Hiding items from SYS_MENU Hiding items from SYS_MENU
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Hiding items from SYS_MENU

Started by biellebrunner, July 11, 2016, 08:37:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

biellebrunner

I've been trying to hide some items from {SYS_MENU} (my gallery, contact, upload file,... Basically leaving only home, register, login/logout), but I can't get it to work.
I followed what was on this thread, copied all the files from sample/theme.php into my theme's theme.php, and so on. Then I commented out the items I don't need (I tried both /* ... */ and //). It seems to work fine when I'm logged it. The items I don't want there aren't showing, and all is well - until I log out. Then the gallery crashes and I get messages like, Template error - Failed to find block 'my_gallery' (#<!-- BEGIN my_gallery -->(.*?)<!-- END my_gallery -->#s) in : (...). To get the gallery running again, I need to remove the comments from those items - which obviously cause them to show up again when the user is logged in - so what I was trying to accomplish to begin with is a complete fail.
How can I remove those items from the gallery for the logged in user in a way it won't affect those that are logged out?
Thanks.

Αndré

Please attach your current theme.php file to your next reply.

biellebrunner

Sorry, here it is.

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2015 Coppermine Dev Team
  v1.0 originally written by Gregory Demar

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.

  ********************************************
  Coppermine version: 1.5.40
  $HeadURL: https://svn.code.sf.net/p/coppermine/code/trunk/cpg1.5.x/themes/sample/theme.php $
  $Revision: 8830 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //




/******************************************************************************
** Section <<<assemble_template_buttons>>> - START
******************************************************************************/
// Creates buttons from a template using an array of tokens
// this function is used in this file it needs to be declared before being called.
function assemble_template_buttons($template_buttons,$buttons)
{
    
$counter=0;
    
$output='';

    foreach (
$buttons as $button)  {
        if (isset(
$button[4])) {
            
$spacer=$button[4];
        } else {
            
$spacer='';
        }

        
$params = array(
            
'{SPACER}'     => $spacer,
            
'{BLOCK_ID}'   => $button[3],
            
'{HREF_TGT}'   => $button[2],
            
'{HREF_TITLE}' => $button[1],
            
'{HREF_LNK}'   => $button[0],
            
'{HREF_ATTRIBUTES}'   => $button[5]
            );
        
$output.=template_eval($template_buttons$params);
    }
    return 
$output;
}
/******************************************************************************
** Section <<<assemble_template_buttons>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<addbutton>>> - START
******************************************************************************/
// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer,$href_attrib='')
{
    
$menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer,$href_attrib);
}
/******************************************************************************
** Section <<<addbutton>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_sys_menu>>> - START
******************************************************************************/
// HTML template for sys_menu
$template_sys_menu = <<<EOT
          {BUTTONS}
EOT;
/******************************************************************************
** Section <<<$template_sys_menu>>> - END
******************************************************************************/



/******************************************************************************
** Section <<<$template_sub_menu>>> - START
******************************************************************************/
// HTML template for sub_menu
$template_sub_menu $template_sys_menu;
/******************************************************************************
** Section <<<$template_sub_menu>>> - END
******************************************************************************/


/******************************************************************************
** Section <<<THEME_HAS_NO_SYS_MENU_BUTTONS>>> - START
******************************************************************************/
if (!defined('THEME_HAS_NO_SYS_MENU_BUTTONS')) {

  
// HTML template for template sys_menu spacer

  
$template_sys_menu_spacer '';

  
// HTML template for template sys_menu buttons

  
$template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}" {HREF_ATTRIBUTES}>{HREF_LNK}</a>
  <!-- END {BLOCK_ID} -->
EOT;

  
// HTML template for template sys_menu buttons

    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{HREF_ATTRIBUTES}
    
addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    
// addbutton($sys_menu_buttons,'{CONTACT_LNK}','{CONTACT_TITLE}','{CONTACT_TGT}','contact',$template_sys_menu_spacer);
    // addbutton($sys_menu_buttons,'{MY_GAL_LNK}','{MY_GAL_TITLE}','{MY_GAL_TGT}','my_gallery',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    if (
array_key_exists('allowed_albums'$USER_DATA) && is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
      
addbutton($sys_menu_buttons,'{UPL_APP_LNK}','{UPL_APP_TITLE}','{UPL_APP_TGT}','upload_approval',$template_sys_menu_spacer);
    }
    
addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{SIDEBAR_LNK}','{SIDEBAR_TITLE}','{SIDEBAR_TGT}','sidebar',$template_sys_menu_spacer);
    
// addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}','upload_pic',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    
addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    
// Login and Logout don't have a spacer as only one is shown, and either would be the last option.



  
$sys_menu_buttons CPGPluginAPI::filter('sys_menu',$sys_menu_buttons);
  
$params = array('{BUTTONS}' => assemble_template_buttons($template_sys_menu_button,$sys_menu_buttons));
  
$template_sys_menu template_eval($template_sys_menu,$params);
}
/******************************************************************************
** Section <<<THEME_HAS_NO_SYS_MENU_BUTTONS>>> - END
******************************************************************************/





/******************************************************************************
** Section <<<$template_user_admin_menu>>> - START
******************************************************************************/
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

      <a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a>

EOT;
/******************************************************************************
** Section <<<$template_user_admin_menu>>> - END
******************************************************************************/



/******************************************************************************
** Section <<<$template_gallery_admin_menu>>> - START
******************************************************************************/
// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

        <div class="admin_menu_wrapper">
            <!-- BEGIN admin_approval -->
                <div class="admin_menu admin_float" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_ICO}{UPL_APP_LNK}</a></div>
            <!-- END admin_approval -->
            <!-- BEGIN config -->
                <div class="admin_menu admin_float"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_ICO}{ADMIN_LNK}</a></div>
            <!-- END config -->
            <!-- BEGIN catmgr -->
                <div class="admin_menu admin_float"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_ICO}{CATEGORIES_LNK}</a></div>
            <!-- END catmgr -->
            <!-- BEGIN albmgr -->
                <div class="admin_menu admin_float"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_ICO}{ALBUMS_LNK}</a></div>
            <!-- END albmgr -->
            <!-- BEGIN picmgr -->
                <div class="admin_menu admin_float"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_ICO}{PICTURES_LNK}</a></div>
            <!-- end picmgr -->
            <!-- BEGIN groupmgr -->
                <div class="admin_menu admin_float"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_ICO}{GROUPS_LNK}</a></div>
            <!-- END groupmgr -->
            <!-- BEGIN usermgr -->
                <div class="admin_menu admin_float"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_ICO}{USERS_LNK}</a></div>
            <!-- END usermgr -->
            <!-- BEGIN banmgr -->
                <div class="admin_menu admin_float"><a href="banning.php" title="{BAN_TITLE}">{BAN_ICO}{BAN_LNK}</a></div>
            <!-- END banmgr -->
            <!-- BEGIN admin_profile -->
                <div class="admin_menu admin_float"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_ICO}{MY_PROF_LNK}</a></div>
            <!-- END admin_profile -->
            <!-- BEGIN review_comments -->
                <div class="admin_menu admin_float"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_ICO}{COMMENTS_LNK}</a></div>
            <!-- END review_comments -->
            <!-- BEGIN log_ecards -->
                <div class="admin_menu admin_float"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_ICO}{DB_ECARD_LNK}</a></div>
            <!-- END log_ecards -->
            <!-- BEGIN batch_add -->
                <div class="admin_menu admin_float"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_ICO}{SEARCHNEW_LNK}</a></div>
            <!-- END batch_add -->
            <!-- BEGIN admin_tools -->
                <div class="admin_menu admin_float"><a href="util.php?t={TIME_STAMP}#admin_tools" title="{UTIL_TITLE}">{UTIL_ICO}{UTIL_LNK}</a></div>
            <!-- END admin_tools -->
            <!-- BEGIN keyword_manager -->
                <div class="admin_menu admin_float"><a href="keywordmgr.php" title="{KEYWORDMGR_TITLE}">{KEYWORDMGR_ICO}{KEYWORDMGR_LNK}</a></div>
            <!-- END keyword_manager -->
            <!-- BEGIN exif_manager -->
                <div class="admin_menu admin_float"><a href="exifmgr.php" title="{EXIFMGR_TITLE}">{EXIFMGR_ICO}{EXIFMGR_LNK}</a></div>
            <!-- END exif_manager -->
            <!-- BEGIN plugin_manager -->
                <div class="admin_menu admin_float"><a href="pluginmgr.php" title="{PLUGINMGR_TITLE}">{PLUGINMGR_ICO}{PLUGINMGR_LNK}</a></div>
            <!-- END plugin_manager -->
            <!-- BEGIN bridge_manager -->
                <div class="admin_menu admin_float"><a href="bridgemgr.php" title="{BRIDGEMGR_TITLE}">{BRIDGEMGR_ICO}{BRIDGEMGR_LNK}</a></div>
            <!-- END bridge_manager -->
            <!-- BEGIN view_log_files -->
                <div class="admin_menu admin_float"><a href="viewlog.php" title="{VIEW_LOG_FILES_TITLE}">{VIEW_LOG_FILES_ICO}{VIEW_LOG_FILES_LNK}</a></div>
            <!-- END view_log_files -->
            <!-- BEGIN overall_stats -->
                <div class="admin_menu admin_float"><a href="stat_details.php?type=hits&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;search_phrase=0&amp;referer=0&amp;browser=1&amp;os=1&amp;mode=fullscreen&amp;page=1&amp;amount=50" title="{OVERALL_STATS_TITLE}">{OVERALL_STATS_ICO}{OVERALL_STATS_LNK}</a></div>
            <!-- END overall_stats -->
            <!-- BEGIN check_versions -->
                <div class="admin_menu admin_float"><a href="versioncheck.php" title="{CHECK_VERSIONS_TITLE}">{CHECK_VERSIONS_ICO}{CHECK_VERSIONS_LNK}</a></div>
            <!-- END check_versions -->
            <!-- BEGIN update_database -->
                <div class="admin_menu admin_float"><a href="update.php" title="{UPDATE_DATABASE_TITLE}">{UPDATE_DATABASE_ICO}{UPDATE_DATABASE_LNK}</a></div>
            <!-- END update_database -->
            <!-- BEGIN php_info -->
                <div class="admin_menu admin_float"><a href="phpinfo.php" title="{PHPINFO_TITLE}">{PHPINFO_ICO}{PHPINFO_LNK}</a></div>
            <!-- END php_info -->
            <!-- BEGIN show_news -->
                <div class="admin_menu admin_float"><a href="mode.php?what=news&amp;referer=
$REFERER" title="{SHOWNEWS_TITLE}">{SHOWNEWS_ICO}{SHOWNEWS_LNK}</a></div>
            <!-- END show_news -->
            <!-- BEGIN documentation -->
                <div class="admin_menu admin_float"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}">{DOCUMENTATION_ICO}{DOCUMENTATION_LNK}</a></div>
            <!-- END documentation -->
        </div>

EOT;
/******************************************************************************
** Section <<<$template_gallery_admin_menu>>> - END
******************************************************************************/






/******************************************************************************
** Section <<<theme_page_title>>> - START
******************************************************************************/
// Creates the title tag for each page
// For the sake of search engine friendliness, the dynamic part $section should come first
function theme_page_title($section)
{
    global 
$CONFIG;
    global 
$CPG_PHP_SELF;
    
$section str_replace(array(' - '' > '), array(' &raquo; '' - '), $section);
    switch (
$CPG_PHP_SELF) {
        case 
'index.php':
            
$return $CONFIG['gallery_name'];
            break;
        case 
'thumbnails.php':
        case 
'displayimage.php':
            
$return $CONFIG['gallery_name'] . ' &raquo; ' strip_tags(bb_decode($section));
            break;
        default:
            
$return $CONFIG['gallery_name'] . ' &raquo; ' strip_tags(bb_decode($section));
            break;
    }
    return 
$return;
}
/******************************************************************************
** Section <<<theme_page_title>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_album_list>>> - START
******************************************************************************/
// HTML template for the album list
$template_album_list = <<<EOT

<!-- BEGIN stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END stat_row -->
<!-- BEGIN header -->
        <tr class="tableb tableb_alternate">
<!-- END header -->
<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="middle" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}">{ALBUM_TITLE}</a></span>
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbs">
                        <div class="thumbbg"><a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}</a></div>
                </td>
                <td width="100%" valign="middle" align="left" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->
<!-- BEGIN empty_cell -->
        <td width="{COL_WIDTH}%" valign="middle">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td height="1" valign="middle" class="tableh2">
                        &nbsp;
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="middle" class="tableb tableb_alternate">
                    <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="1" 
border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="tableb tableb_alternate">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_album_list>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_thumbnail_view>>> - START
******************************************************************************/

// HTML template for thumbnails display
$template_thumbnail_view = <<<EOT

<!-- BEGIN header -->
        <tr class="miniaturas">
<!-- END header -->
<!-- BEGIN thumb_cell -->
        <td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
                <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td align="center">
                                        <a href="{LINK_TGT}"><div class="thumbbg">{THUMB}</div></a>
                                        <a href="{LINK_TGT}">{CAPTION}</a>
                                        {ADMIN_MENU}
                                </td>
                        </tr>
                </table>
        </td>
<!-- END thumb_cell -->
<!-- BEGIN empty_cell -->
                <td valign="middle" class="thumbnails" align="center">&nbsp;</td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="miniaturas">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{THUMB_COLS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_thumbnail_view>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<theme_display_thumbnails>>> - START
******************************************************************************/
function theme_display_thumbnails(&$thumb_list$nbThumb$album_name$aid$cat$page$total_pages$sort_options$display_tabs$mode 'thumb'$date='')
{
    global 
$CONFIG$CURRENT_ALBUM_DATA;
    global 
$template_thumb_view_title_row,$template_fav_thumb_view_title_row$lang_thumb_view$lang_common$template_tab_display$template_thumbnail_view$lang_album_list$lang_errors;

    
$superCage Inspekt::makeSuperCage();

    static 
$header '';
    static 
$thumb_cell '';
    static 
$empty_cell '';
    static 
$row_separator '';
    static 
$footer '';
    static 
$tabs '';
    static 
$spacer '';

    if (
$header == '') {
        
$thumb_cell template_extract_block($template_thumbnail_view'thumb_cell');
        
$tabs template_extract_block($template_thumbnail_view'tabs');
        
$header template_extract_block($template_thumbnail_view'header');
        
$empty_cell template_extract_block($template_thumbnail_view'empty_cell');
        
$row_separator template_extract_block($template_thumbnail_view'row_separator');
        
$footer template_extract_block($template_thumbnail_view'footer');
        
$spacer template_extract_block($template_thumbnail_view'spacer');
    }

    
$cat_link is_numeric($aid) ? '' '&amp;cat=' $cat;
    
$date_link $date=='' '' '&amp;date=' $date;
    if (
$superCage->get->getInt('uid')) {
      
$uid_link '&amp;uid=' $superCage->get->getInt('uid');
    } else {
      
$uid_link '';
    }

    
$album_types = array(
        
'albums' => array('lastalb')
    );
    
$album_types CPGPluginAPI::filter('theme_thumbnails_album_types'$album_types);

    
$theme_thumb_tab_tmpl $template_tab_display;

    if (
$mode == 'thumb') {
        
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => in_array($aid$album_types['albums']) ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
        
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' $aid $cat_link $date_link $uid_link '&amp;page=%d'));
    } else {
        
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' $cat '&amp;page=%d'));
    }

    
$thumbcols $CONFIG['thumbcols'];
    
$cell_width ceil(100 $CONFIG['thumbcols']) . '%';

    
$tabs_html $display_tabs create_tabs($nbThumb$page$total_pages$theme_thumb_tab_tmpl) : '';

    if (!
GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row'admin_buttons') !== false) {
        
template_extract_block($template_thumb_view_title_row'admin_buttons');
    }
    
// The sort order options are not available for meta albums
    
if ($sort_options) {
        if (
GALLERY_ADMIN_MODE) {
            
$param = array(
                
'{ALBUM_ID}'   => $aid,
                
'{CAT_ID}'     => ($cat $cat $CURRENT_ALBUM_DATA['category']),
                
'{MODIFY_LNK}'     => $lang_common['album_properties'],
                
'{MODIFY_ICO}'     => cpg_fetch_icon('modifyalb'1),
                
'{PARENT_CAT_LNK}' => $lang_common['parent_category'],
                
'{PARENT_CAT_ICO}' => cpg_fetch_icon('category'1),
                
'{EDIT_PICS_LNK}'  => $lang_common['edit_files'],
                
'{EDIT_PICS_ICO}'  => cpg_fetch_icon('edit'1),
                
'{ALBUM_MGR_LNK}'  => $lang_common['album_manager'],
                
'{ALBUM_MGR_ICO}'  => cpg_fetch_icon('alb_mgr'1),
            );
        } else {
            
$param = array();
        }
        
$param['{ALBUM_NAME}'] = $album_name;
        
// Plugin Filter: allow plugin to modify or add tags to process
        
$param CPGPluginAPI::filter('theme_thumbnails_title'$param);
        
$title template_eval($template_thumb_view_title_row$param);
    } elseif (
$aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) { //Lots of stuff can be added here later
        
$param = array(
            
'{ALBUM_ID}'   => $aid,
            
'{ALBUM_NAME}' => $album_name,
            
'{DOWNLOAD_ZIP}' => cpg_fetch_icon ('zip'2) . $lang_thumb_view['download_zip'],
        );
        
// Plugin Filter: allow plugin to modify or add tags to process
        
$param CPGPluginAPI::filter('theme_thumbnails_title'$param);
        
$title template_eval($template_fav_thumb_view_title_row$param);
    } else {
        
$title $album_name;
    }

    
CPGPluginAPI::action('theme_thumbnails_wrapper_start'null);

    if (!
is_numeric($aid)) {
        global 
$CPG_PHP_SELF;
        echo 
'<div class="'.($CPG_PHP_SELF == 'thumbnails.php' 'meta'.$aid $aid).'">';
    }

    if (
$mode == 'thumb') {
        
starttable('100%'$title$thumbcols);
    } else {
        
starttable('100%');
    }

    
$header CPGPluginAPI::filter('theme_thumbnails_header'$header);
    echo 
$header;

    
$i 0;
    global 
$thumb;  // make $thumb accessible to plugins
    
foreach($thumb_list as $thumb) {
        
$i++;
        if (
$mode == 'thumb') {
            if (
in_array($aid$album_types['albums'])) {
                
$params = array(
                    
'{CELL_WIDTH}' => $cell_width,
                    
'{LINK_TGT}'   => "thumbnails.php?album={$thumb['aid']}",
                    
'{THUMB}'      => $thumb['image'],
                    
'{CAPTION}'    => $thumb['caption'],
                    
'{ADMIN_MENU}' => $thumb['admin_menu'],
                );
            } else {
                
// determine if thumbnail link targets should open in a pop-up
                
if ($CONFIG['thumbnail_to_fullsize'] == 1) { // code for full-size pop-up
                    
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                       
$target 'javascript:;" onclick="alert(\''.sprintf($lang_errors['login_needed'],'','','','').'\');';
                    } elseif (
USER_ID && USER_ACCESS_LEVEL <= 2) {
                        
$target 'javascript:;" onclick="alert(\''.sprintf($lang_errors['access_intermediate_only'],'','','','').'\');';
                    } else {
                       
$target 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' $thumb['pid'] . '&fullsize=1\',\'' uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int)$thumb['pwidth']+(int)$CONFIG['fullsize_padding_x']) .  ',height=' .   ((int)$thumb['pheight']+(int)$CONFIG['fullsize_padding_y']). '\');';
                    }
                } elseif (
$aid == 'random') {
                    
$target "displayimage.php?pid={$thumb['pid']}$uid_link#top_display_media";
                } elseif (
$aid == 'lastcom' || $aid == 'lastcomby') {
                    
$page cpg_get_comment_page_number($thumb['msg_id']);
                    
$page = (is_numeric($page)) ? "&amp;page=$page'';
                    
$target "displayimage.php?album=$aid$cat_link$date_link&amp;pid={$thumb['pid']}$uid_link&amp;msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
                } else {
                    
$target "displayimage.php?album=$aid$cat_link$date_link&amp;pid={$thumb['pid']}$uid_link#top_display_media";
                }
                
$params = array(
                    
'{CELL_WIDTH}' => $cell_width,
                    
'{LINK_TGT}'   => $target,
                    
'{THUMB}'      => $thumb['image'],
                    
'{CAPTION}'    => $thumb['caption'],
                    
'{ADMIN_MENU}' => $thumb['admin_menu'],
                );
            }

        } else {  
// mode != 'thumb'

            // Used for mode = 'user' from list_users() in index.php
            
$params = array(
                
'{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}'   => "index.php?cat={$thumb['cat']}",
                
'{THUMB}'      => $thumb['image'],
                
'{CAPTION}'    => $thumb['caption'],
                
'{ADMIN_MENU}' => '',
            );

        }

        
// Plugin Filter: allow plugin to modify or add tags to process
        
$params CPGPluginAPI::filter('theme_display_thumbnails_params'$params);
        echo 
template_eval($thumb_cell$params);

        if (((
$i $thumbcols) == 0) && ($i count($thumb_list))) {
            echo 
$row_separator;
        }
    } 
// foreach $thumb

    
unset($thumb);  // unset $thumb to avoid conflicting with global

    
for (;($i $thumbcols); $i++) {
        echo 
$empty_cell;
    }
    
$footer CPGPluginAPI::filter('theme_thumbnails_footer'$footer);
    echo 
$footer;

    if (
$display_tabs) {
        
$params = array(
            
'{THUMB_COLS}' => $thumbcols,
            
'{TABS}'       => $tabs_html,
        );
        echo 
template_eval($tabs$params);
    }

    
endtable();

    if (!
is_numeric($aid)) {
        echo 
'</div>';
    }

    
CPGPluginAPI::action('theme_thumbnails_wrapper_end'null);
    echo 
$spacer;
}
/******************************************************************************
** Section <<<theme_display_thumbnails>>> - END
******************************************************************************/




define('THEME_IS_XHTML10_TRANSITIONAL',1);

?>


Αndré

Quick & dirty fix:
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2015 Coppermine Dev Team
  v1.0 originally written by Gregory Demar

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.

  ********************************************
  Coppermine version: 1.5.40
  $HeadURL: https://svn.code.sf.net/p/coppermine/code/trunk/cpg1.5.x/themes/sample/theme.php $
  $Revision: 8830 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //




/******************************************************************************
** Section <<<assemble_template_buttons>>> - START
******************************************************************************/
// Creates buttons from a template using an array of tokens
// this function is used in this file it needs to be declared before being called.
function assemble_template_buttons($template_buttons,$buttons)
{
    
$counter=0;
    
$output='';

    foreach (
$buttons as $button)  {
        if (isset(
$button[4])) {
            
$spacer=$button[4];
        } else {
            
$spacer='';
        }

        
$params = array(
            
'{SPACER}'     => $spacer,
            
'{BLOCK_ID}'   => $button[3],
            
'{HREF_TGT}'   => $button[2],
            
'{HREF_TITLE}' => $button[1],
            
'{HREF_LNK}'   => $button[0],
            
'{HREF_ATTRIBUTES}'   => $button[5]
            );
        
$output.=template_eval($template_buttons$params);
    }
    return 
$output;
}
/******************************************************************************
** Section <<<assemble_template_buttons>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<addbutton>>> - START
******************************************************************************/
// Creates an array of tokens to be used with function assemble_template_buttons
// this function is used in this file it needs to be declared before being called.
function addbutton(&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer,$href_attrib='')
{
    
$menu[]=array($href_lnk,$href_title,$href_tgt,$block_id,$spacer,$href_attrib);
}
/******************************************************************************
** Section <<<addbutton>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_sys_menu>>> - START
******************************************************************************/
// HTML template for sys_menu
$template_sys_menu = <<<EOT
          {BUTTONS}
EOT;
/******************************************************************************
** Section <<<$template_sys_menu>>> - END
******************************************************************************/



/******************************************************************************
** Section <<<$template_sub_menu>>> - START
******************************************************************************/
// HTML template for sub_menu
$template_sub_menu $template_sys_menu;
/******************************************************************************
** Section <<<$template_sub_menu>>> - END
******************************************************************************/


/******************************************************************************
** Section <<<THEME_HAS_NO_SYS_MENU_BUTTONS>>> - START
******************************************************************************/
if (!defined('THEME_HAS_NO_SYS_MENU_BUTTONS')) {

  
// HTML template for template sys_menu spacer

  
$template_sys_menu_spacer '';

  
// HTML template for template sys_menu buttons

  
$template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}" {HREF_ATTRIBUTES}>{HREF_LNK}</a>
  <!-- END {BLOCK_ID} -->
EOT;

  
// HTML template for template sys_menu buttons

    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{HREF_ATTRIBUTES}
    
addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'','','','contact',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'','','','my_gallery',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    if (
array_key_exists('allowed_albums'$USER_DATA) && is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
      
addbutton($sys_menu_buttons,'{UPL_APP_LNK}','{UPL_APP_TITLE}','{UPL_APP_TGT}','upload_approval',$template_sys_menu_spacer);
    }
    
addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{SIDEBAR_LNK}','{SIDEBAR_TITLE}','{SIDEBAR_TGT}','sidebar',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'','','','upload_pic',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    
addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    
addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    
// Login and Logout don't have a spacer as only one is shown, and either would be the last option.



  
$sys_menu_buttons CPGPluginAPI::filter('sys_menu',$sys_menu_buttons);
  
$params = array('{BUTTONS}' => assemble_template_buttons($template_sys_menu_button,$sys_menu_buttons));
  
$template_sys_menu template_eval($template_sys_menu,$params);
}
/******************************************************************************
** Section <<<THEME_HAS_NO_SYS_MENU_BUTTONS>>> - END
******************************************************************************/





/******************************************************************************
** Section <<<$template_user_admin_menu>>> - START
******************************************************************************/
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

      <a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a>

EOT;
/******************************************************************************
** Section <<<$template_user_admin_menu>>> - END
******************************************************************************/



/******************************************************************************
** Section <<<$template_gallery_admin_menu>>> - START
******************************************************************************/
// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

        <div class="admin_menu_wrapper">
            <!-- BEGIN admin_approval -->
                <div class="admin_menu admin_float" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_ICO}{UPL_APP_LNK}</a></div>
            <!-- END admin_approval -->
            <!-- BEGIN config -->
                <div class="admin_menu admin_float"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_ICO}{ADMIN_LNK}</a></div>
            <!-- END config -->
            <!-- BEGIN catmgr -->
                <div class="admin_menu admin_float"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_ICO}{CATEGORIES_LNK}</a></div>
            <!-- END catmgr -->
            <!-- BEGIN albmgr -->
                <div class="admin_menu admin_float"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_ICO}{ALBUMS_LNK}</a></div>
            <!-- END albmgr -->
            <!-- BEGIN picmgr -->
                <div class="admin_menu admin_float"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_ICO}{PICTURES_LNK}</a></div>
            <!-- end picmgr -->
            <!-- BEGIN groupmgr -->
                <div class="admin_menu admin_float"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_ICO}{GROUPS_LNK}</a></div>
            <!-- END groupmgr -->
            <!-- BEGIN usermgr -->
                <div class="admin_menu admin_float"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_ICO}{USERS_LNK}</a></div>
            <!-- END usermgr -->
            <!-- BEGIN banmgr -->
                <div class="admin_menu admin_float"><a href="banning.php" title="{BAN_TITLE}">{BAN_ICO}{BAN_LNK}</a></div>
            <!-- END banmgr -->
            <!-- BEGIN admin_profile -->
                <div class="admin_menu admin_float"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_ICO}{MY_PROF_LNK}</a></div>
            <!-- END admin_profile -->
            <!-- BEGIN review_comments -->
                <div class="admin_menu admin_float"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_ICO}{COMMENTS_LNK}</a></div>
            <!-- END review_comments -->
            <!-- BEGIN log_ecards -->
                <div class="admin_menu admin_float"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_ICO}{DB_ECARD_LNK}</a></div>
            <!-- END log_ecards -->
            <!-- BEGIN batch_add -->
                <div class="admin_menu admin_float"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_ICO}{SEARCHNEW_LNK}</a></div>
            <!-- END batch_add -->
            <!-- BEGIN admin_tools -->
                <div class="admin_menu admin_float"><a href="util.php?t={TIME_STAMP}#admin_tools" title="{UTIL_TITLE}">{UTIL_ICO}{UTIL_LNK}</a></div>
            <!-- END admin_tools -->
            <!-- BEGIN keyword_manager -->
                <div class="admin_menu admin_float"><a href="keywordmgr.php" title="{KEYWORDMGR_TITLE}">{KEYWORDMGR_ICO}{KEYWORDMGR_LNK}</a></div>
            <!-- END keyword_manager -->
            <!-- BEGIN exif_manager -->
                <div class="admin_menu admin_float"><a href="exifmgr.php" title="{EXIFMGR_TITLE}">{EXIFMGR_ICO}{EXIFMGR_LNK}</a></div>
            <!-- END exif_manager -->
            <!-- BEGIN plugin_manager -->
                <div class="admin_menu admin_float"><a href="pluginmgr.php" title="{PLUGINMGR_TITLE}">{PLUGINMGR_ICO}{PLUGINMGR_LNK}</a></div>
            <!-- END plugin_manager -->
            <!-- BEGIN bridge_manager -->
                <div class="admin_menu admin_float"><a href="bridgemgr.php" title="{BRIDGEMGR_TITLE}">{BRIDGEMGR_ICO}{BRIDGEMGR_LNK}</a></div>
            <!-- END bridge_manager -->
            <!-- BEGIN view_log_files -->
                <div class="admin_menu admin_float"><a href="viewlog.php" title="{VIEW_LOG_FILES_TITLE}">{VIEW_LOG_FILES_ICO}{VIEW_LOG_FILES_LNK}</a></div>
            <!-- END view_log_files -->
            <!-- BEGIN overall_stats -->
                <div class="admin_menu admin_float"><a href="stat_details.php?type=hits&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;search_phrase=0&amp;referer=0&amp;browser=1&amp;os=1&amp;mode=fullscreen&amp;page=1&amp;amount=50" title="{OVERALL_STATS_TITLE}">{OVERALL_STATS_ICO}{OVERALL_STATS_LNK}</a></div>
            <!-- END overall_stats -->
            <!-- BEGIN check_versions -->
                <div class="admin_menu admin_float"><a href="versioncheck.php" title="{CHECK_VERSIONS_TITLE}">{CHECK_VERSIONS_ICO}{CHECK_VERSIONS_LNK}</a></div>
            <!-- END check_versions -->
            <!-- BEGIN update_database -->
                <div class="admin_menu admin_float"><a href="update.php" title="{UPDATE_DATABASE_TITLE}">{UPDATE_DATABASE_ICO}{UPDATE_DATABASE_LNK}</a></div>
            <!-- END update_database -->
            <!-- BEGIN php_info -->
                <div class="admin_menu admin_float"><a href="phpinfo.php" title="{PHPINFO_TITLE}">{PHPINFO_ICO}{PHPINFO_LNK}</a></div>
            <!-- END php_info -->
            <!-- BEGIN show_news -->
                <div class="admin_menu admin_float"><a href="mode.php?what=news&amp;referer=
$REFERER" title="{SHOWNEWS_TITLE}">{SHOWNEWS_ICO}{SHOWNEWS_LNK}</a></div>
            <!-- END show_news -->
            <!-- BEGIN documentation -->
                <div class="admin_menu admin_float"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}">{DOCUMENTATION_ICO}{DOCUMENTATION_LNK}</a></div>
            <!-- END documentation -->
        </div>

EOT;
/******************************************************************************
** Section <<<$template_gallery_admin_menu>>> - END
******************************************************************************/






/******************************************************************************
** Section <<<theme_page_title>>> - START
******************************************************************************/
// Creates the title tag for each page
// For the sake of search engine friendliness, the dynamic part $section should come first
function theme_page_title($section)
{
    global 
$CONFIG;
    global 
$CPG_PHP_SELF;
    
$section str_replace(array(' - '' > '), array(' &raquo; '' - '), $section);
    switch (
$CPG_PHP_SELF) {
        case 
'index.php':
            
$return $CONFIG['gallery_name'];
            break;
        case 
'thumbnails.php':
        case 
'displayimage.php':
            
$return $CONFIG['gallery_name'] . ' &raquo; ' strip_tags(bb_decode($section));
            break;
        default:
            
$return $CONFIG['gallery_name'] . ' &raquo; ' strip_tags(bb_decode($section));
            break;
    }
    return 
$return;
}
/******************************************************************************
** Section <<<theme_page_title>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_album_list>>> - START
******************************************************************************/
// HTML template for the album list
$template_album_list = <<<EOT

<!-- BEGIN stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END stat_row -->
<!-- BEGIN header -->
        <tr class="tableb tableb_alternate">
<!-- END header -->
<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="middle" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}">{ALBUM_TITLE}</a></span>
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbs">
                        <div class="thumbbg"><a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}</a></div>
                </td>
                <td width="100%" valign="middle" align="left" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->
<!-- BEGIN empty_cell -->
        <td width="{COL_WIDTH}%" valign="middle">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td height="1" valign="middle" class="tableh2">
                        &nbsp;
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="middle" class="tableb tableb_alternate">
                    <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="1" 
border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="tableb tableb_alternate">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_album_list>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<$template_thumbnail_view>>> - START
******************************************************************************/

// HTML template for thumbnails display
$template_thumbnail_view = <<<EOT

<!-- BEGIN header -->
        <tr class="miniaturas">
<!-- END header -->
<!-- BEGIN thumb_cell -->
        <td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
                <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td align="center">
                                        <a href="{LINK_TGT}"><div class="thumbbg">{THUMB}</div></a>
                                        <a href="{LINK_TGT}">{CAPTION}</a>
                                        {ADMIN_MENU}
                                </td>
                        </tr>
                </table>
        </td>
<!-- END thumb_cell -->
<!-- BEGIN empty_cell -->
                <td valign="middle" class="thumbnails" align="center">&nbsp;</td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="miniaturas">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{THUMB_COLS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_thumbnail_view>>> - END
******************************************************************************/




/******************************************************************************
** Section <<<theme_display_thumbnails>>> - START
******************************************************************************/
function theme_display_thumbnails(&$thumb_list$nbThumb$album_name$aid$cat$page$total_pages$sort_options$display_tabs$mode 'thumb'$date='')
{
    global 
$CONFIG$CURRENT_ALBUM_DATA;
    global 
$template_thumb_view_title_row,$template_fav_thumb_view_title_row$lang_thumb_view$lang_common$template_tab_display$template_thumbnail_view$lang_album_list$lang_errors;

    
$superCage Inspekt::makeSuperCage();

    static 
$header '';
    static 
$thumb_cell '';
    static 
$empty_cell '';
    static 
$row_separator '';
    static 
$footer '';
    static 
$tabs '';
    static 
$spacer '';

    if (
$header == '') {
        
$thumb_cell template_extract_block($template_thumbnail_view'thumb_cell');
        
$tabs template_extract_block($template_thumbnail_view'tabs');
        
$header template_extract_block($template_thumbnail_view'header');
        
$empty_cell template_extract_block($template_thumbnail_view'empty_cell');
        
$row_separator template_extract_block($template_thumbnail_view'row_separator');
        
$footer template_extract_block($template_thumbnail_view'footer');
        
$spacer template_extract_block($template_thumbnail_view'spacer');
    }

    
$cat_link is_numeric($aid) ? '' '&amp;cat=' $cat;
    
$date_link $date=='' '' '&amp;date=' $date;
    if (
$superCage->get->getInt('uid')) {
      
$uid_link '&amp;uid=' $superCage->get->getInt('uid');
    } else {
      
$uid_link '';
    }

    
$album_types = array(
        
'albums' => array('lastalb')
    );
    
$album_types CPGPluginAPI::filter('theme_thumbnails_album_types'$album_types);

    
$theme_thumb_tab_tmpl $template_tab_display;

    if (
$mode == 'thumb') {
        
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => in_array($aid$album_types['albums']) ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
        
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' $aid $cat_link $date_link $uid_link '&amp;page=%d'));
    } else {
        
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' $cat '&amp;page=%d'));
    }

    
$thumbcols $CONFIG['thumbcols'];
    
$cell_width ceil(100 $CONFIG['thumbcols']) . '%';

    
$tabs_html $display_tabs create_tabs($nbThumb$page$total_pages$theme_thumb_tab_tmpl) : '';

    if (!
GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row'admin_buttons') !== false) {
        
template_extract_block($template_thumb_view_title_row'admin_buttons');
    }
    
// The sort order options are not available for meta albums
    
if ($sort_options) {
        if (
GALLERY_ADMIN_MODE) {
            
$param = array(
                
'{ALBUM_ID}'   => $aid,
                
'{CAT_ID}'     => ($cat $cat $CURRENT_ALBUM_DATA['category']),
                
'{MODIFY_LNK}'     => $lang_common['album_properties'],
                
'{MODIFY_ICO}'     => cpg_fetch_icon('modifyalb'1),
                
'{PARENT_CAT_LNK}' => $lang_common['parent_category'],
                
'{PARENT_CAT_ICO}' => cpg_fetch_icon('category'1),
                
'{EDIT_PICS_LNK}'  => $lang_common['edit_files'],
                
'{EDIT_PICS_ICO}'  => cpg_fetch_icon('edit'1),
                
'{ALBUM_MGR_LNK}'  => $lang_common['album_manager'],
                
'{ALBUM_MGR_ICO}'  => cpg_fetch_icon('alb_mgr'1),
            );
        } else {
            
$param = array();
        }
        
$param['{ALBUM_NAME}'] = $album_name;
        
// Plugin Filter: allow plugin to modify or add tags to process
        
$param CPGPluginAPI::filter('theme_thumbnails_title'$param);
        
$title template_eval($template_thumb_view_title_row$param);
    } elseif (
$aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) { //Lots of stuff can be added here later
        
$param = array(
            
'{ALBUM_ID}'   => $aid,
            
'{ALBUM_NAME}' => $album_name,
            
'{DOWNLOAD_ZIP}' => cpg_fetch_icon ('zip'2) . $lang_thumb_view['download_zip'],
        );
        
// Plugin Filter: allow plugin to modify or add tags to process
        
$param CPGPluginAPI::filter('theme_thumbnails_title'$param);
        
$title template_eval($template_fav_thumb_view_title_row$param);
    } else {
        
$title $album_name;
    }

    
CPGPluginAPI::action('theme_thumbnails_wrapper_start'null);

    if (!
is_numeric($aid)) {
        global 
$CPG_PHP_SELF;
        echo 
'<div class="'.($CPG_PHP_SELF == 'thumbnails.php' 'meta'.$aid $aid).'">';
    }

    if (
$mode == 'thumb') {
        
starttable('100%'$title$thumbcols);
    } else {
        
starttable('100%');
    }

    
$header CPGPluginAPI::filter('theme_thumbnails_header'$header);
    echo 
$header;

    
$i 0;
    global 
$thumb;  // make $thumb accessible to plugins
    
foreach($thumb_list as $thumb) {
        
$i++;
        if (
$mode == 'thumb') {
            if (
in_array($aid$album_types['albums'])) {
                
$params = array(
                    
'{CELL_WIDTH}' => $cell_width,
                    
'{LINK_TGT}'   => "thumbnails.php?album={$thumb['aid']}",
                    
'{THUMB}'      => $thumb['image'],
                    
'{CAPTION}'    => $thumb['caption'],
                    
'{ADMIN_MENU}' => $thumb['admin_menu'],
                );
            } else {
                
// determine if thumbnail link targets should open in a pop-up
                
if ($CONFIG['thumbnail_to_fullsize'] == 1) { // code for full-size pop-up
                    
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                       
$target 'javascript:;" onclick="alert(\''.sprintf($lang_errors['login_needed'],'','','','').'\');';
                    } elseif (
USER_ID && USER_ACCESS_LEVEL <= 2) {
                        
$target 'javascript:;" onclick="alert(\''.sprintf($lang_errors['access_intermediate_only'],'','','','').'\');';
                    } else {
                       
$target 'javascript:;" onclick="MM_openBrWindow(\'displayimage.php?pid=' $thumb['pid'] . '&fullsize=1\',\'' uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int)$thumb['pwidth']+(int)$CONFIG['fullsize_padding_x']) .  ',height=' .   ((int)$thumb['pheight']+(int)$CONFIG['fullsize_padding_y']). '\');';
                    }
                } elseif (
$aid == 'random') {
                    
$target "displayimage.php?pid={$thumb['pid']}$uid_link#top_display_media";
                } elseif (
$aid == 'lastcom' || $aid == 'lastcomby') {
                    
$page cpg_get_comment_page_number($thumb['msg_id']);
                    
$page = (is_numeric($page)) ? "&amp;page=$page'';
                    
$target "displayimage.php?album=$aid$cat_link$date_link&amp;pid={$thumb['pid']}$uid_link&amp;msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
                } else {
                    
$target "displayimage.php?album=$aid$cat_link$date_link&amp;pid={$thumb['pid']}$uid_link#top_display_media";
                }
                
$params = array(
                    
'{CELL_WIDTH}' => $cell_width,
                    
'{LINK_TGT}'   => $target,
                    
'{THUMB}'      => $thumb['image'],
                    
'{CAPTION}'    => $thumb['caption'],
                    
'{ADMIN_MENU}' => $thumb['admin_menu'],
                );
            }

        } else {  
// mode != 'thumb'

            // Used for mode = 'user' from list_users() in index.php
            
$params = array(
                
'{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}'   => "index.php?cat={$thumb['cat']}",
                
'{THUMB}'      => $thumb['image'],
                
'{CAPTION}'    => $thumb['caption'],
                
'{ADMIN_MENU}' => '',
            );

        }

        
// Plugin Filter: allow plugin to modify or add tags to process
        
$params CPGPluginAPI::filter('theme_display_thumbnails_params'$params);
        echo 
template_eval($thumb_cell$params);

        if (((
$i $thumbcols) == 0) && ($i count($thumb_list))) {
            echo 
$row_separator;
        }
    } 
// foreach $thumb

    
unset($thumb);  // unset $thumb to avoid conflicting with global

    
for (;($i $thumbcols); $i++) {
        echo 
$empty_cell;
    }
    
$footer CPGPluginAPI::filter('theme_thumbnails_footer'$footer);
    echo 
$footer;

    if (
$display_tabs) {
        
$params = array(
            
'{THUMB_COLS}' => $thumbcols,
            
'{TABS}'       => $tabs_html,
        );
        echo 
template_eval($tabs$params);
    }

    
endtable();

    if (!
is_numeric($aid)) {
        echo 
'</div>';
    }

    
CPGPluginAPI::action('theme_thumbnails_wrapper_end'null);
    echo 
$spacer;
}
/******************************************************************************
** Section <<<theme_display_thumbnails>>> - END
******************************************************************************/




define('THEME_IS_XHTML10_TRANSITIONAL',1);

?>


It would be better to set the permissions accordingly, as Coppermine will remove buttons automatically if the user has no permission to use it. I.e. deactivate the contact form and deny logged in users to create albums or upload pictures and those buttons won't appear.

biellebrunner

Thank you, André! It did get my gallery up and running again. Just one question: where the contact link should be, there's now an extra empty space (an empty <a></a>). Any suggestion on how I could fix that?
http://stanakaticbrasil.com/galteste

biellebrunner

Quote from: biellebrunner on July 14, 2016, 09:56:22 AM
Thank you, André! It did get my gallery up and running again. Just one question: where the contact link should be, there's now an extra empty space (an empty <a></a>). Any suggestion on how I could fix that?
http://stanakaticbrasil.com/galteste
Actually, this goes for the other "missing links" as well (my gallery, upload, etc) when logged in.

Αndré

As I already said:
Quote from: Αndré on July 12, 2016, 02:12:06 PM
set the permissions accordingly, as Coppermine will remove buttons automatically if the user has no permission to use it. I.e. deactivate the contact form and deny logged in users to create albums or upload pictures and those buttons won't appear.