Gallery Albums Functionality

2 replies [Last post]
Joined: 02/06/2010
Points: 1

I see you can create playlists on the backend, somewhat akin to an album. But the files are not organised into albums and sub albums themselves.

Is there currently anyway to do this? If not, this would be my number 1 wish.

Secondly, it would be great if All in one Video supported other files aswell e.g. excel, word, pdf etc. Basically I'm looking for a decent replacement to the Wordpress Media Library.

So, is there a way to create albums, and sub albums to organise the files. I haven't tried the Community Edition yet, but wondering, since I am hosting myself if it is possible to do it that way. And if so, how

Thanks

James

Joined: 03/29/2009
Points: 764

Hi,

These functionalities are not part of the plugin - thanks for posting it!

Joined: 05/13/2009
Points: 164

I've hacked on the media gallery sample a bit, but I'm not having real success:

I just roughly copied the example lib, js, and css folders into a new folder called kgallery, then I updated the file paths and removed the header and footer.

That worked a bit, at least it quit throwing errors...

But I'm obviously missing some config things because I perpetually get the "no media" notice.

perhaps it's the

// I was getting some errors about KaturaSessionType not existing so I changed this from
// $ks = $client->session->start(ADMIN_SECRET, "USERID", KalturaSessionType::ADMIN);

code that I changed.

here's the code I'm using (wp-content/themes/twentyten/media_gallery.php)

<?php
/*
   Template Name: Kaltura Media Gallery
   */
get_header(); ?>

<div id="content" class="narrowcolumn">

<?php
//require_once("../../bootstrap.php");
//require_once("kgallery/settings.php");
//require_once("kgallery/settings.php");

$page = @$_GET["page"];
if (!$page)
        $page = 1;
$pageSize = 12;

$config = new KalturaConfiguration(34112);
$config->serviceUrl = SERVER_URL;
$client = new KalturaClient($config);

$error = "";
try
{
    $ks = $client->session->start(secret_key, "34112");
// I was getting some errors about KaturaSessionType not existing so I changed this from
// $ks = $client->session->start(ADMIN_SECRET, "USERID", KalturaSessionType::ADMIN);
catch (Exception $ex)
{
    $error = $ex->getMessage();
}

if (!$error)
{
    $client->setKs($ks);
   
    $pager = new KalturaFilterPager();
    $pager->pageSize = $pageSize;
    $pager->pageIndex = $page;
    $filter = new KalturaMediaEntryFilter();
        $filter->orderBy = "-createdAt";
    try
    {
        $response = $client->media->listAction($filter, $pager);
    }
    catch (Exception $ex)
    {
        $error = $ex->getMessage();
    }
    $count = $response->totalCount;
}
?>
        <script type="text/javascript" src="kgallery/js/jquery-1.2.6.min.js"></script>
        <script type="text/javascript" src="kgallery/js/swfobject.js"></script>
        <div id="wrap">
                <div id="contWrap" class="innerpage galleryPage">
                        <div class="ipleftSide"></div>
                        <div class="ipleftSide iprightSide"></div>
                        <div id="row1" class="clearfix">
                                <?php if ($error): ?>
                                        <p>
                                        An error occured while trying to list media entries. <br />
                                        Error message:
                                        </p>
                                        <pre><?php echo $error; ?></pre>
                                <?php else: ?>
                                <?php if (!count($response->objects)): ?>
                                <p>
                                        No media entries found. <a href="kgallery/add_media.php">Click here</a> to add your first media.
                                        </p>
                                <?php else: ?>
                                <ul id="entries" class="clearfix">
                                <?php foreach($response->objects as $mediaEntry): ?>
                                        <li>
                                                <div class="name">
                                                <?php if ($mediaEntry->status === KalturaEntryStatus::IMPORT || $mediaEntry->status === KalturaEntryStatus::PRECONVERT): ?>
                                                        (Converting) <?php echo $mediaEntry->name; ?><br />
                                                <?php elseif ($mediaEntry->status === KalturaEntryStatus::ERROR_CONVERTING): ?>
                                                        (Error Converting) <?php echo $mediaEntry->name; ?><br />
                                                        <?php else: ?>
                                                                <?php echo $mediaEntry->name; ?><br />
                                                <?php endif; ?>
                                                </div>
                                                <div class="thumb">
                                                        <?php
                                                                // this will make fixed size image filled with black color
                                                                if ($mediaEntry->thumbnailUrl)
                                                                        $thumbUrl = $mediaEntry->thumbnailUrl . "/width/120/height/90/type/0/bgcolor/000000";
                                                                else
                                                                        $thumbUrl = "";
                                                        ?>
                                                        <?php if ($mediaEntry->mediaType == KalturaMediaType::IMAGE && $mediaEntry->status == KalturaEntryStatus::READY): ?>
                                                        <!-- entry ready and image, linking to image.php -->
                                                        <a href="kgallery/image.php?entryId=<?php echo $mediaEntry->id; ?>&from=media"><img src="<?php echo $thumbUrl; ?>" /></a>
                                                        <?php elseif($mediaEntry->status == KalturaEntryStatus::READY): ?>
                                                        <!-- entry ready and not image, linking to player -->
                                                        <a href="kgallery/player.php?entryId=<?php echo $mediaEntry->id; ?>&from=media"><img src="<?php echo $thumbUrl; ?>" /></a>
                                                        <?php else: ?>
                                                        <!-- entry not ready, no use of linking anywhere -->
                                                        <img src="<?php echo $thumbUrl; ?>" />
                                                        <?php endif; ?>
                                                </div>
                                        </li>
                                <?php endforeach; ?>
                                </ul>
                               
                                <div id="pager">
                                <?php
                                        $total = ceil($count / $pageSize);
                                        $current = $page;
                                        $endSize = 1;
                                        $midSize = 2;
                                        $dots = false;
   
                                        if ($total > 1):
                                                for ($i = 1; $i <= $total; $i++ ):
                                                        if ($i == $current) :
                                                                echo "<span class='pages current'>$i</span>";
                                                                $dots = true;
                                                        else :
                                                                if ($i <= $endSize || ($current && $i >= $current - $midSize && $i <= $current + $midSize) || $i > $total - $endSize):
                                                                        echo '<span class="pages"><a href="media_gallery.php?page='.$i.'">'.$i.'</a></span>';
                                                                        $dots = true;
                                                                elseif ($dots) :
                                                                        echo '<span class="pages dots">...</span>';
                                                                        $dots = false;
                                                                endif;
                                                        endif;
                                                endfor;
                                        endif;
                                ?>
                                </div>
                                <?php endif; ?>
                                <?php endif; ?>
                        </div><!-- end #row1 -->
                </div><!-- end #contWrap -->
                <div id="bottomCorners"><div></div></div>
        </div>
</div>

  <?php get_sidebar(); ?>

  <?php get_footer(); ?>
</body>