Example #1
0
if (acl_has_album_permissions($album)) {
    $token = acl_token_get($album);
    $token = $token['token'];
    ?>
            <div class="right-arrow"></div>
            <a  href="javascript:show_album_assets('<?php 
    echo $album;
    ?>
', '<?php 
    echo $token;
    ?>
');" title="®Back_to_album®">(<?php 
    echo suffix_remove($album);
    ?>
) <?php 
    echo get_album_title($album);
    ?>
</a>   
        <?php 
}
?>
        <div class="right-arrow"></div><?php 
print_info($asset_meta['title']);
?>
    </div>

    <div id="video_player">
        <!-- #main_video : HTML5 video player.
            There is no selected source by default.
            Video src is loaded when the user clicks on a link in the side pane.
            The video player is only displayed when an asset is selected. 
Example #2
0
/**
 * Displays the list of all assets from the selected album
 * @refresh_center determines if we need to refresh the whole page / the center 
 * of the page or another part of the page (mainly the right side)
 * @global type $input
 * @global type $repository_path
 * @global type $ezplayer_url
 * @global type $assets_list
 * @global string $panel_display
 */
function view_album_assets($refresh_center = true)
{
    global $input;
    global $repository_path;
    global $ezplayer_url;
    // used in a popup window
    global $user_files_path;
    global $assets_list;
    global $album;
    global $album_bookmarks;
    global $toc_bookmarks;
    global $error_path;
    // used to display an error on the main page
    global $login_error;
    // used to display error when anonymous user login
    global $default_bookmarks_order;
    global $default_toc_order;
    global $cache_limit;
    // if reloaded is set, the whole page has to be refreshed
    if ($_SESSION['reloaded']) {
        unset($input['click']);
        unset($_SESSION['reloaded']);
        $refresh_center = true;
    }
    $error_path = '';
    if (isset($input['album'])) {
        $album = $input['album'];
    } else {
        $album = $_SESSION['album'];
    }
    if (isset($input['token'])) {
        $token = $input['token'];
    } else {
        $token = $_SESSION['token'];
    }
    ezmam_repository_path($repository_path);
    user_prefs_repository_path($user_files_path);
    // 0) Sanity checks
    if (!ezmam_album_exists($album)) {
        if ($input['click']) {
            // refresh a part of the page
            include_once template_getpath('error_album_not_found.php');
        } else {
            // refresh the whole page
            $error_path = template_getpath('error_album_not_found.php');
            include_once template_getpath('main.php');
        }
        log_append('warning', 'view_album_assets: tried to access non-existant album ' . $input['album']);
        exit;
    }
    // Authorization check
    if (!ezmam_album_token_check($album, $token)) {
        if ($input['click']) {
            include_once template_getpath('error_permission_denied.php');
        } else {
            $error_path = template_getpath('error_permission_denied.php');
            include_once template_getpath('main.php');
        }
        log_append('warning', 'view_album_assets: tried to access album ' . $input['album'] . ' with invalid token ' . $input['token']);
        die;
    }
    // 1) Retrieving all assets' metadata
    $assets_list = ezmam_asset_list_metadata($album);
    $count = count($assets_list);
    // add the asset token to the metadata
    for ($index = 0; $index < $count; $index++) {
        $assets_list[$index]['token'] = ezmam_asset_token_get($album, $assets_list[$index]['name']);
    }
    // 2) Save current album
    log_append('view_album_assets: ' . $album);
    $_SESSION['ezplayer_mode'] = 'view_album_assets';
    // used in 'div_assets_center.php'
    $_SESSION['album'] = $album;
    // used in search
    $_SESSION['asset'] = '';
    $_SESSION['token'] = $token;
    // 3) Add current album to the album list
    //    and load album bookmarks
    //
    $album_name = get_album_title($album);
    $album_token = array('title' => $album_name, 'album' => $album, 'token' => $token);
    if (!token_array_contains($_SESSION['acl_album_tokens'], $album_token)) {
        if (acl_user_is_logged()) {
            // logged user : consulted albums are stored in file
            user_prefs_token_add($_SESSION['user_login'], $album, $album_name, $token);
            log_append('view_album_assets: album token added - ' . $album);
            trace_append(array('2', 'album_token_add', $album));
            // lvl, action, album
        } else {
            // anonymous user : consulted albums are stored in session var
            $_SESSION['acl_album_tokens'][] = $album_token;
        }
        acl_update_permissions_list();
    }
    if (acl_user_is_logged()) {
        // bookmarks to display in 'div_side_assets.php'
        $album_bookmarks = user_prefs_album_bookmarks_list_get($_SESSION['user_login'], $album);
        // sorts the bookmarks following user's prefs
        $order = acl_value_get("bookmarks_order");
        if (isset($order) && $order != '' && $order != $default_bookmarks_order) {
            $album_bookmarks = array_reverse($album_bookmarks);
        }
    }
    // 4) table of contents to display in 'div_side_assets.php'
    $toc_bookmarks = toc_album_bookmarks_list_get($album);
    // sorts the bookmarks following user's prefs
    $order = acl_value_get("toc_order");
    if (isset($order) && $order != '' && $order != $default_toc_order) {
        $toc_bookmarks = array_reverse($toc_bookmarks);
    }
    if ($refresh_center) {
        if (acl_display_threads()) {
            $threads = threads_select_by_album($album, $cache_limit);
            foreach ($threads as &$thread) {
                if (!thread_is_archive($thread['albumName'], $thread['assetName'])) {
                    $threads_list[] = $thread;
                }
            }
        }
        if ($input['click']) {
            // called by a local link
            // lvl, action, album, origin
            trace_append(array('2', 'view_album_assets', $album, 'from_ezplayer'));
            include_once template_getpath('div_assets_center.php');
        } else {
            // accessed by the UV or shared link
            // lvl, action, album, origin
            trace_append(array('2', 'view_album_assets', $album, 'from_external'));
            include_once template_getpath('main.php');
        }
    } else {
        // refresh only the side panel (after import / export / deletion / ...)
        include_once template_getpath('div_side_assets.php');
    }
}
Example #3
0
<b class="blue-title" style="font-size: 14px" onclick="$('#bookmarks_result').toggle();">®Personal® </b>
<div id ="bookmarks_result">
<ul class="search_result">
    <?php 
$album_ref = '';
$asset_ref = '';
foreach ($bookmarks as $index => $bookmark) {
    if ($album_ref != $bookmark['album']) {
        ?>
            <li class="album_result">(<?php 
        echo suffix_remove($bookmark['album']);
        ?>
) <?php 
        echo get_album_title($bookmark['album']);
        ?>
</li>
        <?php 
    }
    ?>
        <?php 
    if ($asset_ref != $bookmark['asset']) {
        ?>
            <li class="asset_result"><div class="right-arrow"></div><?php 
        print_info(substr(get_user_friendly_date($bookmark['asset'], '/', false, get_lang(), false), 0, 10));
        ?>
 <?php 
        echo get_asset_title($bookmark['album'], $bookmark['asset']);
        ?>
</li>
        <?php 
    }
Example #4
0
function slideshowit_mainpage($matches)
{
    global $CONFIG, $lang_plugin_slideshowit, $FORBIDDEN_SET, $slideshowit_set, $lang_meta_album_names, $META_ALBUM_SET;
    if (strtolower($matches[1]) != 'slideshowit') {
        //        if($matches[1] != 'slideshowit' || GALLERY_ADMIN_MODE) {
        return $matches;
    }
    $slideshowit_speed = $slideshowit_set['slideshowit_speed'];
    $slideshowit_usemeta = $slideshowit_set['slideshowit_usemeta'];
    $slideshowit_align = $slideshowit_set['slideshowit_align'];
    $slideshowit_album = $slideshowit_set['slideshowit_album'];
    $slideshowit_albumid = $slideshowit_set['slideshowit_albumid'];
    $slideshowit_limit = $slideshowit_set['slideshowit_numberofpics'];
    // maximum pics to show
    $slideshowit_skipportrait = $slideshowit_set['slideshowit_skipportrait'];
    $slideshowit_control_dir = $slideshowit_set['slideshowit_control_dir'];
    $slideshowit_control_loc = $slideshowit_set['slideshowit_control_loc'];
    $slideshowit_hover_text = $slideshowit_set['slideshowit_hover_text'];
    $slideshowit_User_Selection = $slideshowit_set['slideshowit_User_Selection'];
    $slideshowit_Direct_Link = $slideshowit_set['slideshowit_Direct_Link'];
    $slideshowit_Show_Title = $slideshowit_set['slideshowit_Show_Title'];
    $slideshowit_Filter_Enable = $slideshowit_set['slideshowit_Filter_Enable'];
    $slideshowit_User_List_Loc = $slideshowit_set['slideshowit_User_List_Loc'];
    echo "<!-- Start slideshowit PlugIn Table-->\n";
    //starttable("100%", $lang_meta_album_names[$slideshowit_set['slideshowit_album']]);
    starttable("100%");
    ?>
<tr>
 <td>
  <div id="slideshowit_area">
<?php 
    $slideshowit_FORBIDDEN_SET = "";
    if ($FORBIDDEN_SET != "") {
        $slideshowit_FORBIDDEN_SET = "AND {$FORBIDDEN_SET}";
    }
    if ($slideshowit_usemeta == 1) {
        //Use meta albums
        if ($slideshowit_set['slideshowit_album'] == "toprated") {
            // request string for meta album toprated
            $slideshowit_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' {$slideshowit_FORBIDDEN_SET} AND votes >= '{$CONFIG['min_votes_for_rating']}' {$META_ALBUM_SET} ORDER BY pic_rating DESC, votes DESC, pid DESC LIMIT {$slideshowit_limit}";
        } else {
            if ($slideshowit_set['slideshowit_album'] == "topn") {
                // request string for meta album most viewed
                $slideshowit_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' {$slideshowit_FORBIDDEN_SET} AND hits > 0 {$META_ALBUM_SET} ORDER BY hits DESC, filename LIMIT {$slideshowit_limit}";
            } else {
                if ($slideshowit_set['slideshowit_album'] == "lastup") {
                    // request string for meta album last uploads
                    $slideshowit_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' {$slideshowit_FORBIDDEN_SET} {$META_ALBUM_SET} ORDER BY pid DESC LIMIT {$slideshowit_limit}";
                } else {
                    // request string for meta album random pics
                    $slideshowit_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' {$slideshowit_FORBIDDEN_SET} {$META_ALBUM_SET} ORDER BY RAND() LIMIT {$slideshowit_limit}";
                }
            }
        }
    } else {
        //use real albums with aid
        $slideshowit_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' {$slideshowit_FORBIDDEN_SET}  AND `aid` = {$slideshowit_albumid} ORDER BY position ASC LIMIT {$slideshowit_limit}";
    }
    $result = cpg_db_query($slideshowit_query);
    $i = 0;
    //$slideshowit_control_dir = 1;
    //$slideshowit_control_loc = 1;
    $control = <<<EOT
\t\t\t<td><b id='slideshowitTitle' class="slideshowit_title">title</b></td>
EOT;
    $control_title = <<<EOT
\t\t<tr width="100%" align="center"><td align="
EOT;
    $control_title .= $slideshowit_align;
    $control_title .= <<<EOT
" colspan="3"><b id='slideshowitTitle' class="slideshowit_caption">title</b></td></tr>
EOT;
    $control_caption = <<<EOT
\t<tr><td style="text-align: center; line-height: 20px;" ><b id='slideshowitTitle' class="slideshowit_caption">title</b></td></tr>
EOT;
    $controls_horiz = <<<EOT
<tr align="center">
\t<td>
\t\t<table align="center" style="width:80px; height:16px; line-height:16px;" >
\t\t\t<tr >
\t\t\t\t<td width="15px"><a class="Controls" href="#" onclick="javascript:control('R');"><b title="Play in Reverse direction" \tclass="reverse">&nbsp;</b></a></td>
\t\t\t\t<td width="15px"><a class="Controls" href="#" onclick="javascript:control('B');"><b title="See previous picture" \t\t\tclass="back">&nbsp;</b></a></td>
\t\t\t\t<td width="15px"><a class="Controls" href="#" onclick="javascript:control('T');"><b id='Xplay' title="Pause/Play">&nbsp;</b></a></td>
\t\t\t\t<td width="15px"><a class="Controls" href="#" onclick="javascript:control('N');"><b title="See next picture" \t\tclass="next">&nbsp;</b></a></td>
\t\t\t\t<td width="15px"><a class="Controls" href="#" onclick="javascript:control('F');"><b title="Play in Forward direction" \tclass="forward">&nbsp;</b></a></td>
\t\t\t</tr>
\t\t</table>
\t</td>
</tr>
EOT;
    $controls_vert = <<<EOT
\t\t<td width="50px">
\t\t\t<table  height="auto">
\t\t\t\t<tr><td><a class="Controls" href="#" onclick="javascript:control('R');"><b title="Play in Reverse direction" \tclass="reverse">&nbsp;</b></a></td></tr>
\t\t\t\t<tr><td><a class="Controls" href="#" onclick="javascript:control('B');"><b title="See previous picture" \t\t\tclass="back">&nbsp;</b></a></td></tr>
\t\t\t\t<tr><td><a class="Controls" href="#" onclick="javascript:control('T');"><b id='Xplay' title="Pause/Play">&nbsp;</b></a></td></tr>
\t\t\t\t<tr><td><a class="Controls" href="#" onclick="javascript:control('N');"><b title="See next picture" \t\tclass="next">&nbsp;</b></a></td></tr>
\t\t\t\t<tr><td><a class="Controls" href="#" onclick="javascript:control('F');"><b title="Play in Forward direction" \tclass="forward">&nbsp;</b></a> </td></tr>
\t\t\t</table>
\t\t</td>
EOT;
    $controls_vert_placeholder = <<<EOT
\t\t<td width="50px" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
EOT;
    echo "<table width=\"100%\">\n<!-- Begin Title Row -->";
    if ($slideshowit_Show_Title) {
        echo "<tr>\n<td align=\"{$slideshowit_align}\" colspan=\"3\">";
        echo "<b class=\"slideshowit_title\">" . get_album_title($slideshowit_albumid, $slideshowit_usemeta) . "</b>";
        echo "</td>\n</tr>\n<!-- End Title Row -->";
    }
    if ($slideshowit_User_Selection && !$slideshowit_usemeta && !$slideshowit_User_List_Loc) {
        //create dropdown selection list
        echo '<tr><td align="' . $slideshowit_align . '" colspan="3">' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="slideshowit_settings"><b class="slideshowit_selection">' . $lang_plugin_slideshowit['album'] . "</b>" . '<select name="slideshowit_albumid" id="slideshowit_albumid">';
        create_drop_list($slideshowit_set['slideshowit_albumid']);
        echo '</select>' . "\n" . '<input name="update" type="hidden" id="update" value="1" />' . "\n" . '<input name="Submit" type="submit" value="' . $lang_plugin_slideshowit['submit_button'] . '" />' . "\n" . '</form>' . '</td></tr>';
    }
    if ($slideshowit_control_dir == 0 && $slideshowit_control_loc == 1) {
        //  01 horiz top
        echo $control_caption;
        //Caption below the title
        echo $controls_horiz;
        //controls are a row at top after title
        echo "<!-- Begin Middle row -->\n<tr><td>";
    } else {
        if ($slideshowit_control_dir == 1 && $slideshowit_control_loc == 1) {
            //11 = vertical left
            echo "<!-- Begin Middle row -->\n<tr>";
            echo $controls_vert;
            //controls are a column
            echo '<td width="100%" style="padding-top: 0px">';
            //start picture area
        } else {
            if ($slideshowit_control_dir == 1 && $slideshowit_control_loc == 0) {
                //10 vertical right
                echo "<!-- Begin Middle row -->\n<tr>";
                echo $controls_vert_placeholder;
                //controls are a column
                echo '<td  width="100%" style="padding-top: 0px">';
                //start picture area
            } else {
                if ($slideshowit_control_dir == 0 && $slideshowit_control_loc == 0) {
                    //00 horiz bottom
                    echo "<!-- Begin Middle row -->\n<tr>";
                    echo '<td  style="padding-top: 10px">';
                    //start picture area
                }
            }
        }
    }
    ?>
		
		<div id="slideshowitPosition" style="height:auto" align="<?php 
    echo $slideshowit_align;
    ?>
">
			<a class="slideshowitlink" id="slideshowitA" href="" title="" >
				<img class="slideshowitlink" id="slideshowitPicture" src="" width="" height="" alt="" />
			</a>
		</div>

<?php 
    if ($slideshowit_control_dir == 0 && $slideshowit_control_loc == 1) {
        //  01 horiz top
        echo "</td></tr>\n<!-- End Middle row -->";
    } else {
        if ($slideshowit_control_dir == 1 && $slideshowit_control_loc == 1) {
            //11 = vertical left
            echo "</td>\n";
            echo $controls_vert_placeholder;
            //controls are a column
            echo "</tr><!-- End Middle row -->\n";
            echo $control_title;
        } else {
            if ($slideshowit_control_dir == 1 && $slideshowit_control_loc == 0) {
                //10 vertical right
                echo "</td>" . $controls_vert;
                // end picture area and start new colum for controls
                echo "</tr><!-- End Middle row -->\n";
                echo $control_title;
            } else {
                if ($slideshowit_control_dir == 0 && $slideshowit_control_loc == 0) {
                    //00 horiz bottom
                    echo "</td></tr>\n<!-- End Middle row -->";
                    echo $control_caption;
                    //Caption below the title
                    echo $controls_horiz;
                    //controls are a row at bottom after picture
                }
            }
        }
    }
    if ($slideshowit_User_Selection && !$slideshowit_usemeta && $slideshowit_User_List_Loc) {
        echo '<tr><td align="' . $slideshowit_align . '" colspan="3">' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="slideshowit_settings"><b class="slideshowit_selection">' . $lang_plugin_slideshowit['album'] . "</b>" . '<select name="slideshowit_albumid" id="slideshowit_albumid">';
        create_drop_list($slideshowit_set['slideshowit_albumid']);
        echo '</select>' . "\n" . '<input name="update" type="hidden" id="update" value="1" />' . "\n" . '<input name="Submit" type="submit" value="' . $lang_plugin_slideshowit['submit_button'] . '" />' . "\n" . '</form>' . '</td></tr>';
    }
    ?>
	
	</table>   
   </div> <!-- end slideshowit_area -->
  </td>
 </tr>
<?php 
    endtable();
    echo "\n" . '<script type="text/javascript">';
    $count = mysql_num_rows($result);
    $first = true;
    $i = 0;
    echo "var Picture= new Array();\n var Title= new Array();\n var Width= new Array();\n var Height= new Array();\n var Link= new Array();\n var Caption= new Array();";
    while ($row = mysql_fetch_array($result)) {
        if ($row['pheight'] < $row['pwidth'] || !$slideshowit_skipportrait) {
            // check if portrait image and skipping
            if ($slideshowit_Direct_Link == 1) {
                $link = "displayimage.php?pos=-" . $row['pid'];
            } else {
                $link = "thumbnails.php?album=" . $slideshowit_albumid;
            }
            // OR link of pic thumbnails
            $file = "albums/" . $row['filepath'] . $row['filename'];
            // path of pic
            echo "\nPicture[" . $i . "]  = '" . $file . "';";
            echo "\nTitle[" . $i . "]  = " . '"' . $row['title'] . '"' . ";";
            echo "\nWidth[" . $i . "]  = " . '"' . $row['pwidth'] . '"' . ";";
            echo "\nHeight[" . $i . "]  = " . '"' . $row['pheight'] . '"' . ";";
            echo "\nLink[" . $i . "]  = " . '"' . $link . '"' . ";";
            if ($slideshowit_hover_text == 1) {
                echo "\nCaption[" . $i . "]  = " . '"' . $row['caption'] . '"' . ";";
            } else {
                echo "\nCaption[" . $i . "]  = " . '""' . ";";
            }
            $i = $i + 1;
        }
    }
    $i--;
    echo "var direction = 1;var paused = 0; var pointer = -2; var max = {$i}; var filter_enabled = " . $slideshowit_Filter_Enable . ";\n";
    echo 'RunSlideShowWithLinks("slideshowitPicture","slideshowitA","slideshowitTitle","slideshowitPosition"' . "," . $slideshowit_speed . ",{$i});\n</script>";
    //
    // free memory
    mysql_free_result($result);
    echo "<!-- End slideshowit PlugIn Table-->\n";
}
Example #5
0
} else {
    ?>
            <ul class="search_albums">
                <?php 
    foreach ($search_albums as $selected_album) {
        ?>
                    <li><label><input tabindex='4' type="checkbox" name="albums[]" <?php 
        if ($_SESSION['album'] == '' || $_SESSION['album'] == $selected_album) {
            echo 'checked';
        }
        ?>
  value="<?php 
        echo $selected_album;
        ?>
"/><?php 
        echo get_album_title($selected_album);
        ?>
</label></li>
                <?php 
    }
    ?>
            </ul>
        <?php 
}
?>
        <div class="search_current">
            <?php 
if (isset($_SESSION['album']) && $_SESSION['album'] != '') {
    ?>
                ®Search_album®
                <?php