>> - START ***********************************/ // actual code here /*********************************** ** Section <<>> - END ***********************************/ // ----------------------------------------------------------------------------- // if (!defined('IN_COPPERMINE')) die('Not in Coppermine...'); //{THEMES}// if (!function_exists('assemble_template_buttons')) { //{THEMES} /****************************************************************************** ** Section <<>> - 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 <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('addbutton')) { //{THEMES} /****************************************************************************** ** Section <<>> - 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 <<>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_sys_menu)) { //{THEMES} /****************************************************************************** ** Section <<<$template_sys_menu>>> - START ******************************************************************************/ // HTML template for sys_menu $template_sys_menu = <<>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_sub_menu)) { //{THEMES} /****************************************************************************** ** Section <<<$template_sub_menu>>> - START ******************************************************************************/ // HTML template for sub_menu $template_sub_menu = $template_sys_menu; } //{THEMES} if (!defined('THEME_HAS_NO_SYS_MENU_BUTTONS')) { // HTML template for template sys_menu spacer if (!isset($template_sys_menu_spacer)) //{THEMES} $template_sys_menu_spacer ="::"; // HTML template for template sys_menu buttons if (!isset($template_sys_menu_button)) //{THEMES} $template_sys_menu_button = << {HREF_LNK} {SPACER} EOT; // HTML template for template sys_menu buttons if (!isset($sys_menu_buttons)) { //{THEMES} // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}{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. } //{THEMES} $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 <<<$template_sub_menu>>> - END ******************************************************************************/ /****************************************************************************** ** Section <<>> - START ******************************************************************************/ if (!defined('THEME_HAS_NO_SUB_MENU_BUTTONS')) { // HTML template for template sub_menu spacer if (!isset($template_sub_menu_spacer)) //{THEMES} $template_sub_menu_spacer = $template_sys_menu_spacer; // HTML template for template sub_menu buttons if (!isset($template_sub_menu_button)) //{THEMES} $template_sub_menu_button = $template_sys_menu_button; // HTML template for template sub_menu buttons if (!isset($sub_menu_buttons)) { //{THEMES} // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}{HREF_ATTRIBUTES} addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer); addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer); addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer,'rel="nofollow"'); addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer,'rel="nofollow"'); addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer,'rel="nofollow"'); addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer,'rel="nofollow"'); addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer,'rel="nofollow"'); if ($CONFIG['browse_by_date'] != 0) { addbutton($sub_menu_buttons, '{BROWSEBYDATE_LNK}', '{BROWSEBYDATE_TITLE}', '{BROWSEBYDATE_TGT}', 'browse_by_date', $template_sub_menu_spacer, 'rel="nofollow" class="greybox"'); } addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search',''); } //{THEMES} $sub_menu_buttons = CPGPluginAPI::filter('sub_menu',$sub_menu_buttons); $params = array('{BUTTONS}' => assemble_template_buttons($template_sub_menu_button,$sub_menu_buttons)); $template_sub_menu = template_eval($template_sub_menu,$params); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ if (!isset($template_gallery_admin_menu)) { //{THEMES} /****************************************************************************** ** Section <<<$template_gallery_admin_menu>>> - START ******************************************************************************/ // HTML template for gallery admin menu $template_gallery_admin_menu = <<
EOT; /****************************************************************************** ** Section <<<$template_gallery_admin_menu>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_user_admin_menu)) { //{THEMES} /****************************************************************************** ** Section <<<$template_user_admin_menu>>> - START ******************************************************************************/ // HTML template for user admin menu $template_user_admin_menu = <<
{ALBUMS_ICO}{ALBMGR_LNK} {MODIFYALB_ICO}{MODIFYALB_LNK} {MY_PROF_ICO}{MY_PROF_LNK} {PICTURES_ICO}{PICTURES_LNK}
EOT; /****************************************************************************** ** Section <<<$template_user_admin_menu>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_cat_list)) { //{THEMES} /****************************************************************************** ** Section <<<$template_cat_list>>> - START ******************************************************************************/ // HTML template for the category list $template_cat_list = << {CATEGORY} {ALBUMS} {PICTURES}
{CAT_THUMB}{CAT_TITLE}{CAT_DESC}
{CAT_THUMB}{CAT_TITLE}{CAT_DESC}
{ALB_COUNT} {PIC_COUNT} {CAT_ALBUMS} {STATISTICS}
EOT; /****************************************************************************** ** Section <<<$template_cat_list>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_breadcrumb)) { //{THEMES} /****************************************************************************** ** Section <<<$template_breadcrumb>>> - START ******************************************************************************/ // HTML template for the breadcrumb $template_breadcrumb = << {BREADCRUMB}
{BREADCRUMB} {STATISTICS}
EOT; /****************************************************************************** ** Section <<<$template_breadcrumb>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_album_list)) { //{THEMES} /****************************************************************************** ** Section <<<$template_album_list>>> - START ******************************************************************************/ // HTML template for the album list $template_album_list = << {STATISTICS}
{ALBUM_TITLE}


{ALB_LINK_PIC}
{ADMIN_MENU}

{ALB_DESC}

{ALB_INFOS}
{ALB_HITS}

 

{TABS}

EOT; /****************************************************************************** ** Section <<<$template_album_list>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_film_strip)) { //{THEMES} /****************************************************************************** ** Section <<<$template_film_strip>>> - START ******************************************************************************/ // HTML template for filmstrip display $template_film_strip = <<
{THUMB_STRIP}
{THUMB}   EOT; /****************************************************************************** ** Section <<<$template_film_strip>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_album_list_cat)) { //{THEMES} /****************************************************************************** ** Section <<<$template_album_list_cat>>> - START ******************************************************************************/ // HTML template for the album list $template_album_list_cat = << {STATISTICS}
{ALBUM_TITLE}


{ALB_LINK_PIC}
{ADMIN_MENU}

{ALB_DESC}

{ALB_INFOS}
{ALB_HITS}

 

{TABS}

EOT; /****************************************************************************** ** Section <<<$template_album_list_cat>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_album_admin_menu)) { //{THEMES} /****************************************************************************** ** Section <<<$template_album_admin_menu>>> - START ******************************************************************************/ // HTML template for the ALBUM admin menu displayed in the album list $template_album_admin_menu = <<
EOT; /****************************************************************************** ** Section <<<$template_album_admin_menu>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_thumb_view_title_row)) { //{THEMES} /****************************************************************************** ** Section <<<$template_thumb_view_title_row>>> - START ******************************************************************************/ // HTML template for title row of the thumbnail view (album title + sort options) $template_thumb_view_title_row = <<

{ALBUM_NAME}

EOT; /****************************************************************************** ** Section <<<$template_thumb_view_title_row>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_fav_thumb_view_title_row)) { //{THEMES} /****************************************************************************** ** Section <<<$template_fav_thumb_view_title_row>>> - START ******************************************************************************/ // HTML template for title row of the fav thumbnail view (album title + download) $template_fav_thumb_view_title_row = <<

{ALBUM_NAME}

{DOWNLOAD_ZIP}
EOT; /****************************************************************************** ** Section <<<$template_fav_thumb_view_title_row>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_thumbnail_view)) { //{THEMES} /****************************************************************************** ** Section <<<$template_thumbnail_view>>> - START ******************************************************************************/ // HTML template for thumbnails display $template_thumbnail_view = <<
{THUMB}
{CAPTION} {ADMIN_MENU}
  {TABS}

EOT; /****************************************************************************** ** Section <<<$template_thumbnail_view>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_no_img_to_display)) { //{THEMES} /****************************************************************************** ** Section <<<$template_no_img_to_display>>> - START ******************************************************************************/ // HTML template for the thumbnail view when there is no picture to show $template_no_img_to_display = << {TEXT}
EOT; /****************************************************************************** ** Section <<<$template_no_img_to_display>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_user_list_info_box)) { //{THEMES} /****************************************************************************** ** Section <<<$template_user_list_info_box>>> - START ******************************************************************************/ // HTML template for the USER info box in the user list view $template_user_list_info_box = << {USER_NAME} {ALBUMS} {PICTURES} EOT; /****************************************************************************** ** Section <<<$template_user_list_info_box>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_img_navbar)) { //{THEMES} /****************************************************************************** ** Section <<<$template_img_navbar>>> - START ******************************************************************************/ // HTML template for the image navigation bar $template_img_navbar = << {THUMB_TITLE} {PIC_POS} {REPORT_TITLE} {ECARD_TITLE} {START_TITLE} {PREV_TITLE} {NEXT_TITLE} {END_TITLE} EOT; /****************************************************************************** ** Section <<<$template_img_navbar>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_display_media)) { //{THEMES} /****************************************************************************** ** Section <<<$template_display_media>>> - START ******************************************************************************/ // HTML template for intermediate image display $template_display_media = <<
{IMAGE}
{ADMIN_MENU}

{TITLE}

{CAPTION}

EOT; /****************************************************************************** ** Section <<<$template_display_media>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_image_rating)) { //{THEMES} /****************************************************************************** ** Section <<<$template_image_rating>>> - START ******************************************************************************/ // HTML template for the image rating box $template_image_rating = << {TITLE} {VOTES} EOT; /****************************************************************************** ** Section <<<$template_image_rating>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_image_rating_oldstyle)) { //{THEMES} /****************************************************************************** ** Section <<<$template_image_rating_oldstyle>>> - START ******************************************************************************/ // HTML template for the image rating box (old-style) $template_image_rating_oldstyle = << {TITLE} {VOTES} {RATING_IMAGES}
EOT; /****************************************************************************** ** Section <<<$template_image_rating_oldstyle>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_image_comments)) { //{THEMES} /****************************************************************************** ** Section <<<$template_image_comments>>> - START ******************************************************************************/ // HTML template for the display of comments $template_image_comments = <<
{MSG_AUTHOR_LNK}   ({IP}) {REPORT_COMMENT_ICON} {PENDING_APPROVAL} {DELETE_ICON} [{MSG_DATE}]
{MSG_BODY}
EOT; /****************************************************************************** ** Section <<<$template_image_comments>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_add_your_comment)) { //{THEMES} /****************************************************************************** ** Section <<<$template_add_your_comment>>> - START ******************************************************************************/ $template_add_your_comment = <<
{ADD_YOUR_COMMENT}{HELP_ICON}
{NAME} {COMMENT} {COMMENT}
{CONFIRM}
{SMILIES}
{LOGIN_TO_COMMENT}
EOT; /****************************************************************************** ** Section <<<$template_add_your_comment>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_cpg_die)) { //{THEMES} /****************************************************************************** ** Section <<<$template_cpg_die>>> - START ******************************************************************************/ // HTML template used by the cpg_die function $template_cpg_die = <<

{HEADER_TXT}

{MESSAGE}

{FILE_TXT}{FILE} - {LINE_TXT}{LINE}

{OUTPUT_BUFFER}


EOT; /****************************************************************************** ** Section <<<$template_cpg_die>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_msg_box)) { //{THEMES} /****************************************************************************** ** Section <<<$template_msg_box>>> - START ******************************************************************************/ // HTML template used by the msg_box function $template_msg_box = << {MESSAGE}
 
{TEXT} EOT; /****************************************************************************** ** Section <<<$template_msg_box>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_ecard)) { //{THEMES} /****************************************************************************** ** Section <<<$template_ecard>>> - START ******************************************************************************/ // HTML template for e-cards $template_ecard = << {TITLE}

{VIEW_ECARD_LNK}

{PIC_MARKUP}

{PIC_TITLE}


{GREETINGS}

{MESSAGE}

{SENDER_NAME} ({SENDER_EMAIL})
{PIC_CAPTION}

{VIEW_MORE_LNK}

EOT; /****************************************************************************** ** Section <<<$template_ecard>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_ecard_plaintext)) { //{THEMES} /****************************************************************************** ** Section <<<$template_ecard_plaintext>>> - START ******************************************************************************/ // plain-text template for e-cards (as fallback for clients that can't display html-formatted mails) $template_ecard_plaintext = <<>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_report)) { //{THEMES} /****************************************************************************** ** Section <<<$template_report>>> - START ******************************************************************************/ // HTML template for report $template_report = << {TITLE}

{VIEW_REPORT_LNK}


{SUBJECT}

{REASON}

{MESSAGE}

{SENDER_NAME} ({SENDER_EMAIL})

{VIEW_MORE_LNK}

EOT; /****************************************************************************** ** Section <<<$template_report>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_report_plaintext)) { //{THEMES} /****************************************************************************** ** Section <<<$template_report_plaintext>>> - START ******************************************************************************/ // plain-text template for reports (as fallback for clients that can't display html-formatted mails) $template_report_plaintext = <<>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_report_comment)) { //{THEMES} /****************************************************************************** ** Section <<<$template_report_comment>>> - START ******************************************************************************/ // HTML template for displaying a reported comment $template_report_comment = << {TITLE}

{VIEW_REPORT_LNK}

{COMMENT}

{COMMENT_LNK}

{SUBJECT}
{REASON}
{MESSAGE}
{SENDER_NAME} ({SENDER_EMAIL})

{VIEW_MORE_LNK}

EOT; /****************************************************************************** ** Section <<<$template_report_comment>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_report_comment_email)) { //{THEMES} /****************************************************************************** ** Section <<<$template_report_comment_email>>> - START ******************************************************************************/ // plain-text template for reports (as fallback for clients that can't display html-formatted mails) $template_report_comment_email = << {TITLE}

{VIEW_COMMENT_LNK}

{SUBJECT}
{REASON}
{MESSAGE}
{SENDER_NAME} ({SENDER_EMAIL})

{VIEW_MORE_LNK}

EOT; /****************************************************************************** ** Section <<<$template_report_comment_email>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_zipfile_plaintext)) { //{THEMES} /****************************************************************************** ** Section <<<$template_zipfile_plaintext>>> - START ******************************************************************************/ // plain-text template for readme file that is being added to zipdownload $template_zipfile_plaintext = <<>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_tab_display)) { //{THEMES} /****************************************************************************** ** Section <<<$template_tab_display>>> - START ******************************************************************************/ // Template used for tabbed display $template_tab_display = array( 'left_text' => '{LEFT_TEXT}' . $LINEBREAK, 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => '%d', 'inactive_tab' => '%d' . $LINEBREAK, 'nav_tab' => '%s' . $LINEBREAK, 'nav_tab_nolink' => '%s' . $LINEBREAK, 'allpages_dropdown' => '%s' . $LINEBREAK, 'page_gap' => '-' . $LINEBREAK, 'tab_spacer' => '' . $LINEBREAK, 'page_link' => '{LINK}', ); /****************************************************************************** ** Section <<<$template_tab_display>>> - END ******************************************************************************/ } //{THEMES} if (!isset($template_vanity)) { //{THEMES} /****************************************************************************** ** Section <<<$template_vanity>>> - START ******************************************************************************/ // Template used for Vanity Footer $template_vanity = << EOT; /****************************************************************************** ** Section <<<$template_vanity>>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('pageheader')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function pageheader($section, $meta = '') { global $CONFIG, $THEME_DIR, $CPG_PHP_SELF; global $template_header, $lang_charset, $lang_text_dir; $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']); $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset']; header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"'); header("Content-Type: text/html; charset=$charset"); user_save_profile(); $template_vars = array( '{LANG_DIR}' => $lang_text_dir, '{TITLE}' => theme_page_title($section), '{CHARSET}' => $charset, '{META}' => $meta, '{GAL_NAME}' => $CONFIG['gallery_name'], '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'], '{SYS_MENU}' => theme_main_menu('sys_menu'), '{SUB_MENU}' => theme_main_menu('sub_menu'), '{ADMIN_MENU}' => theme_admin_mode_menu(), '{CUSTOM_HEADER}' => $custom_header, '{JAVASCRIPT}' => theme_javascript_head(), '{MESSAGE_BLOCK}' => theme_display_message_block(), ); if (defined('THEME_WANTS_BODY_CLASS')) { $template_vars['{BODY_CLASS}'] = 'BC-'.basename($CPG_PHP_SELF,'.php'); } $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars); echo template_eval($template_header, $template_vars); // Show various admin messages adminmessages(); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('pageheader_mini')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function pageheader_mini($section, $javascript=false) { global $CONFIG; global $lang_charset, $lang_text_dir; $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']); $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset']; header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"'); header("Content-Type: text/html; charset=$charset"); user_save_profile(); if ($javascript) { $js = theme_javascript_head(); } else { $js = ''; } echo <<< EOT $section $js EOT; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('pagefooter')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for writing a pagefooter function pagefooter() { //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS; global $USER, $USER_DATA, $CONFIG, $time_start, $query_stats, $queries; global $template_footer; $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']); if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) { cpg_debug_output(); } $template_vars = array( '{GAL_NAME}' => $CONFIG['gallery_name'], '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'], '{SYS_MENU}' => theme_main_menu('sys_menu'), '{SUB_MENU}' => theme_main_menu('sub_menu'), '{ADMIN_MENU}' => theme_admin_mode_menu(), // '{CUSTOM_HEADER}' => $custom_header, // '{JAVASCRIPT}' => theme_javascript_head(), '{CUSTOM_FOOTER}' => $custom_footer, '{VANITY}' => theme_vanity(), '{CREDITS}' => theme_credits(), ); echo template_eval($template_footer, $template_vars); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('pagefooter_mini')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function pagefooter_mini() { echo <<< EOT EOT; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_javascript_head')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for the JavaScript inside the -section function theme_javascript_head() { global $JS, $LINEBREAK; $return = ''; // Check if we have any variables being set using set_js_vars function if (!empty($JS['vars'])) { // Convert the $JS['vars'] array to json object string $json_vars = json_encode($JS['vars']); // Output the json object $return = <<< EOT EOT; } // Check if we have any js includes if (!empty($JS['includes'])) { // Bring the jquery core library to the very top of the list if (in_array(CPG_JQUERY_VERSION, $JS['includes']) == TRUE) { $key = array_search(CPG_JQUERY_VERSION, $JS['includes']); unset($JS['includes'][$key]); array_unshift($JS['includes'], CPG_JQUERY_VERSION); } $JS['includes'] = CPGPluginAPI::filter('javascript_includes',$JS['includes']); // Include all the files which were set using js_include() function foreach ($JS['includes'] as $js_file) { $return .= js_include($js_file, true) . $LINEBREAK; } } return $return; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_cpg_die')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for showing error messages function theme_cpg_die($msg_code, $msg_text, $msg_string, $css_class = 'cpg_message_info', $error_file, $error_line, $output_buffer, $ob) { global $CONFIG, $lang_cpg_die, $template_cpg_die; $params = array( '{MESSAGE}' => $msg_text, '{FILE_TXT}' => $lang_cpg_die['file'], '{FILE}' => $error_file, '{LINE_TXT}' => $lang_cpg_die['line'], '{LINE}' => $error_line, '{OUTPUT_BUFFER}' => $ob, '{HEADER_TXT}' => $msg_string, '{CSS_CLASS}' => $css_class, ); if (!($CONFIG['debug_mode'] == 1 || ($CONFIG['debug_mode'] == 2 && GALLERY_ADMIN_MODE))) { template_extract_block($template_cpg_die, 'file_line'); } template_extract_block($template_cpg_die, 'output_buffer'); pageheader($msg_string); echo ""; echo template_eval($template_cpg_die, $params); pagefooter(); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_breadcrumb')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for building the breadcrumb // Inputs: $breadcrumb_links, $BREADCRUMB_TEXTS // Outputs: $breadcrumb, $BREADCRUMB_TEXT function theme_breadcrumb($breadcrumb_links, $BREADCRUMB_TEXTS, &$breadcrumb, &$BREADCRUMB_TEXT) { $breadcrumb = ''; $BREADCRUMB_TEXT = ''; foreach ($breadcrumb_links as $breadcrumb_link) { $breadcrumb .= ' > ' . $breadcrumb_link; } foreach ($BREADCRUMB_TEXTS as $BREADCRUMB_TEXT_elt) { $BREADCRUMB_TEXT .= ' > ' . $BREADCRUMB_TEXT_elt; } // We remove the first ' > ' $breadcrumb = substr_replace($breadcrumb,'', 0, 3); $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, 3); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_msg_box')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for displaying a message-box-like table function theme_msg_box($title, $msg_text, $css_class = 'cpg_message_info', $button_text, $button_link) { global $template_msg_box; if (!$button_text && stripos($template_msg_box, 'button') != false) { template_extract_block($template_msg_box, 'button'); } $params = array( '{MESSAGE}' => $msg_text, '{LINK}' => $button_link, '{TEXT}' => $button_text, '{CLASS}' => $css_class ); echo template_eval($template_msg_box, $params); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_create_tabs')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function for creating tabs showing multiple pages function theme_create_tabs($items, $curr_page, $total_pages, $template) { // Tabs do not take into account $lang_text_dir for RTL languages global $CONFIG, $lang_create_tabs; // Gallery Configuration setting for maximum number of tabs to display $maxTab = $CONFIG['max_tabs']; if ($total_pages == '') { $total_pages = $curr_page; } if (array_key_exists('page_link',$template)) { // Pass through links to tabs with links $template['nav_tab'] = strtr($template['nav_tab'], array('{LINK}' => $template['page_link'])); $template['inactive_tab'] = strtr($template['inactive_tab'], array('{LINK}' => $template['page_link'])); } // Left text, usually shows statistics $tabs = sprintf($template['left_text'], $items, $total_pages); if (($total_pages == 1)) { return $tabs; } // Header for tabs $tabs .= $template['tab_header']; if ($CONFIG['tabs_dropdown']) { // Dropdown list for all pages preg_match('/cat=([\d]+)/', $template['page_link'], $matches); $catn = isset($matches[1]) ? $matches[1] : ''; $tabs_dropdown_js = <<< EOT EOT; $tabs .= sprintf($template['allpages_dropdown'], $tabs_dropdown_js); } // Calculate which pages to show on tabs, limited by the maximum number of tabs (set on Gallery Configuration panel) if ($total_pages > $maxTab) { $start = max(2, $curr_page - floor(($maxTab - 2) / 2)); $start = min($start, $total_pages - $maxTab + 2); $end = $start + $maxTab - 3; } else { $start = 2; $end = $total_pages - 1; } // Previous page tab if ($curr_page != ($start - 1)) { $tabs .= sprintf($template['nav_tab'], $curr_page-1, cpg_fetch_icon('tab_left',0,$lang_create_tabs['previous'])); } else { // A previous tab with link is not needed. // If you want to show a disabled previous tab, // create an image 'left_inactive.png', put it into themes/YOUR_THEME/images/icons/, // then uncomment the line below. // $tabs .= sprintf($template['nav_tab_nolink'], cpg_fetch_icon('left_inactive',0,$lang_create_tabs['previous'])); } // Page 1 tab if ($curr_page == 1) { $tabs .= sprintf($template['active_tab'], 1); } else { $tabs .= sprintf($template['inactive_tab'], 1, 1); } // Gap between page 1 and middle block of tabs if ($start > 2) { $tabs .= $template['page_gap']; } $page_gap = ($template['page_gap'] != ''); // Middle block of tabs for ($page = $start ; $page <= $end; $page++) { if (!$page_gap || ($page_gap && ($page != $start))) { $tabs .= $template['tab_spacer']; } if ($page == $curr_page) { $tabs .= sprintf($template['active_tab'], $page); } else { $tabs .= sprintf($template['inactive_tab'], $page, $page); } } // Gap between middle block of tabs and last page if ($end < $total_pages - 1) { $tabs .= $template['page_gap']; } // Last page tab if (!$page_gap) { $tabs .= $template['tab_spacer']; } if ($total_pages > 1) { if ($curr_page == $total_pages) { $tabs .= sprintf($template['active_tab'], $total_pages); } else { $tabs .= sprintf($template['inactive_tab'], $total_pages, $total_pages); } } // Next page tab if ($curr_page != $total_pages) { $tabs .= sprintf($template['nav_tab'], $curr_page + 1, cpg_fetch_icon('tab_right',0,$lang_create_tabs['next'])); } else { // A next tab with link is not needed. // If you want to show a disabled next tab, // create an image 'right_inactive.png', put it into themes/YOUR_THEME/images/icons/, // then uncomment the line below. // $tabs .= sprintf($template['nav_tab_nolink'], cpg_fetch_icon('right_inactive',0,$lang_create_tabs['next'])); } // Trailer for tabs $tabs .= $template['tab_trailer']; return $tabs; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_credits')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ /****************************************************************************** // Function for the credits-section In previous versions of Coppermine the "Powered by Coppermine" used to be obfuscated to make it hard for non-coders to remove the tag. The reason behind this was an additional license add-on that disallowed users to change the line. The dev team has reviewed this policy for cpg1.5.x and decided that end users ARE allowed to change or remove the line in legal terms. HOWEVER: We have a forum policy for the support board instead: support will only be given for galleries that show the "Powered by Coppermine" tag unobfuscated. Before removing the credits, please consider this as well: Coppermine is free software, the dev team ASKS you to keep the footer intact. We're convinced that you should give credit where credit is due. So please think twice before you decide to remove the tag. ******************************************************************************/ function theme_credits() { $return = <<< EOT EOT; return $return; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('starttable')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function to start a 'standard' table function starttable($width = '-1', $title = '', $title_colspan = '1', $zebra_class = '', $return = false) { global $CONFIG; if ($width == '-1') $width = $CONFIG['picture_table_width']; if ($width == '100%') $width = $CONFIG['main_table_width']; $text = << EOT; if ($title) { $text .= << EOT; } if (!$return) { echo $text; } else { return $text; } } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('endtable')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function endtable($return = false) { $text = << EOT; if (!$return) { echo $text; } else { return $text; } } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_main_menu')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_main_menu($which) { global $AUTHORIZED, $CONFIG, $album, $actual_cat, $cat, $REFERER, $CPG_PHP_SELF; global $lang_main_menu, $template_sys_menu, $template_sub_menu, $lang_gallery_admin_menu; static $sys_menu = '', $sub_menu = ''; if ($$which != '') { return $$which; } //Check whether user has permission to upload file to the current album if any $upload_allowed = false; if (isset($album) && is_numeric($album)) { if (GALLERY_ADMIN_MODE) { $upload_allowed = true; } else { if (USER_ID) { $query = "SELECT null FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' AND aid = '$album'"; $user_albums = cpg_db_query($query); if ($user_albums->numRows()) { $upload_allowed = true; } else { $upload_allowed = false; } } if (!$upload_allowed) { $query = "SELECT null FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' AND (visibility = '0' OR visibility IN ".USER_GROUP_SET.") AND aid = '$album'"; $public_albums = cpg_db_query($query); if ($public_albums->numRows()) { $upload_allowed = true; } else { $upload_allowed = false; } } } } $album_l = isset($album) ? "?album=$album" : ''; $album_12 = ($upload_allowed) ? "?album=$album" : ''; $cat_l = (isset($actual_cat))? "?cat=$actual_cat" : (isset($cat) ? "?cat=$cat" : '?cat=0'); $cat_l2 = isset($cat) ? "&cat=$cat" : ''; $my_gallery_id = FIRST_USER_CAT + USER_ID; if ($which == 'sys_menu' ) { if (USER_ID) { // visitor is logged in template_extract_block($template_sys_menu, 'login'); if ($CONFIG['contact_form_registered_enable'] == 0) { template_extract_block($template_sys_menu, 'contact'); } if ($CONFIG['display_sidebar_user'] != 2) { template_extract_block($template_sys_menu, 'sidebar'); } list($timestamp, $form_token) = getFormToken(); } else { // visitor is not logged in if ($CONFIG['contact_form_guest_enable'] == 0) { template_extract_block($template_sys_menu, 'contact'); } if ($CONFIG['display_sidebar_guest'] != 2) { template_extract_block($template_sys_menu, 'sidebar'); } template_extract_block($template_sys_menu, 'logout'); template_extract_block($template_sys_menu, 'my_profile'); $timestamp = $form_token = ''; } if (!USER_IS_ADMIN) { template_extract_block($template_sys_menu, 'enter_admin_mode'); template_extract_block($template_sys_menu, 'leave_admin_mode'); } else { if (GALLERY_ADMIN_MODE) { template_extract_block($template_sys_menu, 'enter_admin_mode'); } else { template_extract_block($template_sys_menu, 'leave_admin_mode'); } } if (!USER_CAN_CREATE_ALBUMS || !USER_ID) { template_extract_block($template_sys_menu, 'my_gallery'); } if (USER_CAN_CREATE_ALBUMS && USER_ID) { // block 'my_profile' has already been removed for guests template_extract_block($template_sys_menu, 'my_profile'); } if (!USER_CAN_UPLOAD_PICTURES && (!USER_CAN_CREATE_ALBUMS || !USER_ID)) { template_extract_block($template_sys_menu, 'upload_pic'); } if (USER_ID || !$CONFIG['allow_user_registration']) { template_extract_block($template_sys_menu, 'register'); } if (!USER_ID || !$CONFIG['allow_memberlist']) { template_extract_block($template_sys_menu, 'allow_memberlist'); } $param = array( '{HOME_TGT}' => $CONFIG['home_target'], '{HOME_ICO}' => cpg_fetch_icon('home', 1), '{HOME_TITLE}' => $lang_main_menu['home_title'], '{HOME_LNK}' => $lang_main_menu['home_lnk'], '{CONTACT_TGT}' => "contact.php", '{CONTACT_ICO}' => cpg_fetch_icon('contact', 1), '{CONTACT_TITLE}' => sprintf($lang_main_menu['contact_title'], $CONFIG['gallery_name']), '{CONTACT_LNK}' => $lang_main_menu['contact_lnk'], '{MY_GAL_TGT}' => "index.php?cat=$my_gallery_id", '{MY_GAL_ICO}' => cpg_fetch_icon('my_gallery', 1), '{MY_GAL_TITLE}' => $lang_main_menu['my_gal_title'], '{MY_GAL_LNK}' => $lang_main_menu['my_gal_lnk'], '{MEMBERLIST_TGT}' => "usermgr.php", '{MEMBERLIST_ICO}' => cpg_fetch_icon('memberlist', 1), '{MEMBERLIST_TITLE}' => $lang_main_menu['memberlist_title'], '{MEMBERLIST_LNK}' => $lang_main_menu['memberlist_lnk'], '{MY_PROF_TGT}' => "profile.php?op=edit_profile", '{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1), '{MY_PROF_TITLE}' => $lang_main_menu['my_prof_title'], '{MY_PROF_LNK}' => $lang_main_menu['my_prof_lnk'], '{ADM_MODE_TGT}' => "mode.php?admin_mode=1&referer=$REFERER", '{ADM_MODE_ICO}' => cpg_fetch_icon('admin_mode_on', 1), '{ADM_MODE_TITLE}' => $lang_main_menu['adm_mode_title'], '{ADM_MODE_LNK}' => $lang_main_menu['adm_mode_lnk'], '{USR_MODE_TGT}' => "mode.php?admin_mode=0&referer=$REFERER", '{USR_MODE_ICO}' => cpg_fetch_icon('admin_mode_off', 1), '{USR_MODE_TITLE}' => $lang_main_menu['usr_mode_title'], '{USR_MODE_LNK}' => $lang_main_menu['usr_mode_lnk'], '{SIDEBAR_TGT}' => "sidebar.php?action=install", '{SIDEBAR_TITLE}' => $lang_main_menu['sidebar_title'], '{SIDEBAR_LNK}' => $lang_main_menu['sidebar_lnk'], '{SIDEBAR_ICO}' => cpg_fetch_icon('sidebar', 1), '{UPL_PIC_TGT}' => "upload.php$album_12", '{UPL_PIC_TITLE}' => $lang_main_menu['upload_pic_title'], '{UPL_PIC_LNK}' => $lang_main_menu['upload_pic_lnk'], '{UPL_PIC_ICO}' => cpg_fetch_icon('upload', 1), '{REGISTER_TGT}' => "register.php", '{REGISTER_TITLE}' => $lang_main_menu['register_title'], '{REGISTER_LNK}' => $lang_main_menu['register_lnk'], '{REGISTER_ICO}' => cpg_fetch_icon('add_user', 1), '{LOGIN_TGT}' => "login.php", '{LOGIN_TITLE}' => $lang_main_menu['login_title'], '{LOGIN_LNK}' => $lang_main_menu['login_lnk'], '{LOGIN_ICO}' => cpg_fetch_icon('login', 1), '{LOGOUT_TGT}' => "logout.php?form_token=$form_token&timestamp=$timestamp&referer=$REFERER", '{LOGOUT_TITLE}' => $lang_main_menu['logout_title'], '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . stripslashes(USER_NAME) . "]", '{LOGOUT_ICO}' => cpg_fetch_icon('logout', 1), '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_TGT}' => "editpics.php?mode=upload_approval", '{UPL_APP_TITLE}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_ICO}' => cpg_fetch_icon('file_approval', 1), ); if ($CPG_PHP_SELF != 'login.php' && strpos($REFERER, 'login.php') === FALSE) { $param['{LOGIN_TGT}'] .= "?referer=$REFERER"; } if ($CPG_PHP_SELF != 'contact.php' && strpos($REFERER, 'contact.php') === FALSE) { $param['{CONTACT_TGT}'] .= "?referer=$REFERER"; } $sys_menu = template_eval($template_sys_menu, $param); } else { if (!$CONFIG['custom_lnk_url']) { template_extract_block($template_sub_menu, 'custom_link'); } $param = array( '{ALB_LIST_TGT}' => "index.php$cat_l", '{ALB_LIST_TITLE}' => $lang_main_menu['alb_list_title'], '{ALB_LIST_LNK}' => $lang_main_menu['alb_list_lnk'], '{ALB_LIST_ICO}' => cpg_fetch_icon('alb_mgr', 1), '{CUSTOM_LNK_TGT}' => $CONFIG['custom_lnk_url'], '{CUSTOM_LNK_TITLE}' => $CONFIG['custom_lnk_name'], '{CUSTOM_LNK_LNK}' => $CONFIG['custom_lnk_name'], '{CUSTOM_LNK_ICO}' => cpg_fetch_icon('online', 1), '{LASTUP_TGT}' => "thumbnails.php?album=lastup$cat_l2", '{LASTUP_TITLE}' => $lang_main_menu['lastup_title'], '{LASTUP_LNK}' => $lang_main_menu['lastup_lnk'], '{LASTUP_ICO}' => cpg_fetch_icon('last_uploads', 1), '{LASTCOM_TGT}' => "thumbnails.php?album=lastcom$cat_l2", '{LASTCOM_TITLE}' => $lang_main_menu['lastcom_title'], '{LASTCOM_LNK}' => $lang_main_menu['lastcom_lnk'], '{LASTCOM_ICO}' => cpg_fetch_icon('comment', 1), '{TOPN_TGT}' => "thumbnails.php?album=topn$cat_l2", '{TOPN_TITLE}' => $lang_main_menu['topn_title'], '{TOPN_LNK}' => $lang_main_menu['topn_lnk'], '{TOPN_ICO}' => cpg_fetch_icon('most_viewed', 1), '{TOPRATED_TGT}' => "thumbnails.php?album=toprated$cat_l2", '{TOPRATED_TITLE}' => $lang_main_menu['toprated_title'], '{TOPRATED_LNK}' => $lang_main_menu['toprated_lnk'], '{TOPRATED_ICO}' => cpg_fetch_icon('top_rated', 1), '{FAV_TGT}' => "thumbnails.php?album=favpics", '{FAV_TITLE}' => $lang_main_menu['fav_title'], '{FAV_LNK}' => $lang_main_menu['fav_lnk'], '{FAV_ICO}' => cpg_fetch_icon('favorites', 1), '{BROWSEBYDATE_TGT}' => 'calendar.php', '{BROWSEBYDATE_LNK}' => $lang_main_menu['browse_by_date_lnk'], '{BROWSEBYDATE_TITLE}' => $lang_main_menu['browse_by_date_title'], '{BROWSEBYDATE_ICO}' => cpg_fetch_icon('calendar', 1), '{SEARCH_TGT}' => "search.php", '{SEARCH_TITLE}' => $lang_main_menu['search_title'], '{SEARCH_LNK}' => $lang_main_menu['search_lnk'], '{SEARCH_ICO}' => cpg_fetch_icon('search', 1), '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_TGT}' => "editpics.php?mode=upload_approval", '{UPL_APP_TITLE}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_ICO}' => cpg_fetch_icon('file_approval', 1), ); $sub_menu = template_eval($template_sub_menu, $param); } return $$which; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_admin_mode_menu')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_admin_mode_menu() { global $cat; global $lang_gallery_admin_menu, $lang_user_admin_menu, $lang_cat_list, $lang_common; global $template_gallery_admin_menu, $template_user_admin_menu; global $CONFIG; global $THEME_DIR; $cat_l = isset($cat) ? "?cat=$cat" : ''; static $admin_menu = ''; // Populate the admin menu only if empty to avoid template errors if ($admin_menu == '') { $admin_menu = ''; // set in case an error occurs here; otherwise, theme_cpg_die will call this function and crash if (GALLERY_ADMIN_MODE) { if ($CONFIG['log_ecards'] == 0) { template_extract_block($template_gallery_admin_menu, 'log_ecards'); } if (cpg_get_pending_approvals() == 0) { template_extract_block($template_gallery_admin_menu, 'admin_approval'); } // Query the languages table $help_lang = ''; $results = cpg_db_query("SELECT lang_id, abbr FROM {$CONFIG['TABLE_LANGUAGE']} WHERE available='YES' AND enabled='YES'"); while ($row = $results->fetchArray()) { if ($CONFIG['lang'] == $row['lang_id']) { $help_lang = $row['abbr']; } } // while $results->free(); unset($row); if ($help_lang == '') { $help_lang = 'en'; } // do the docs exist on the webserver? if ((file_exists('docs/README.md') == true) && (file_exists('docs/'.$help_lang.'/index.htm') == true)) { $documentation_href = 'docs/'.$help_lang.'/index.htm'; } else { $documentation_href = 'http://coppermine-gallery.net/docs'; } if (!$CONFIG['enable_plugins']) { template_extract_block($template_gallery_admin_menu, 'plugin_manager'); } if (!$CONFIG['log_mode']) { template_extract_block($template_gallery_admin_menu, 'view_log_files'); } if (!$CONFIG['hit_details']) { template_extract_block($template_gallery_admin_menu, 'overall_stats'); } if (!$CONFIG['clickable_keyword_search']) { template_extract_block($template_gallery_admin_menu, 'keyword_manager'); } if (!$CONFIG['read_exif_data']) { template_extract_block($template_gallery_admin_menu, 'exif_manager'); } if ($CONFIG['display_coppermine_news'] != 0) { template_extract_block($template_gallery_admin_menu, 'show_news'); } if ($CONFIG['bridge_enable'] != 0) { template_extract_block($template_gallery_admin_menu, 'banmgr'); template_extract_block($template_gallery_admin_menu, 'admin_profile'); } $param = array('{CATL}' => $cat_l, '{UPL_APP_TITLE}' => $lang_gallery_admin_menu['upl_app_title'], '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_ICO}' => cpg_fetch_icon('file_approval', 1), '{ADMIN_TITLE}' => $lang_gallery_admin_menu['admin_title'], '{ADMIN_LNK}' => $lang_gallery_admin_menu['admin_lnk'], '{ADMIN_ICO}' => cpg_fetch_icon('config', 1), '{ALBUMS_TITLE}' => $lang_gallery_admin_menu['albums_title'], '{ALBUMS_LNK}' => $lang_gallery_admin_menu['albums_lnk'], '{ALBUMS_ICO}' => cpg_fetch_icon('alb_mgr', 1), '{CATEGORIES_TITLE}' => $lang_gallery_admin_menu['categories_title'], '{CATEGORIES_LNK}' => $lang_gallery_admin_menu['categories_lnk'], '{CATEGORIES_ICO}' => cpg_fetch_icon('cat_mgr', 1), '{USERS_TITLE}' => $lang_gallery_admin_menu['users_title'], '{USERS_LNK}' => $lang_gallery_admin_menu['users_lnk'], '{USERS_ICO}' => cpg_fetch_icon('user_mgr', 1), '{GROUPS_TITLE}' => $lang_gallery_admin_menu['groups_title'], '{GROUPS_LNK}' => $lang_gallery_admin_menu['groups_lnk'], '{GROUPS_ICO}' => cpg_fetch_icon('groups_mgr', 1), '{COMMENTS_TITLE}' => $lang_gallery_admin_menu['comments_title'], '{COMMENTS_LNK}' => $lang_gallery_admin_menu['comments_lnk'], '{COMMENTS_ICO}' => cpg_fetch_icon('comment_approval', 1), '{SEARCHNEW_TITLE}' => $lang_gallery_admin_menu['searchnew_title'], '{SEARCHNEW_LNK}' => $lang_gallery_admin_menu['searchnew_lnk'], '{SEARCHNEW_ICO}' => cpg_fetch_icon('searchnew', 1), '{FILES_TITLE}' => $lang_cat_list['pictures'], '{FILES_LNK}' => $lang_cat_list['pictures'], '{FILES_ICO}' => cpg_fetch_icon('searchnew', 1), '{INFO_TITLE}' => $lang_common['information'], '{INFO_LNK}' => $lang_common['information'], '{INFO_ICO}' => cpg_fetch_icon('info', 1), '{MY_PROF_TITLE}' => $lang_user_admin_menu['my_prof_title'], '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk'], '{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1), '{UTIL_TITLE}' => $lang_gallery_admin_menu['util_title'], '{UTIL_LNK}' => $lang_gallery_admin_menu['util_lnk'], '{UTIL_ICO}' => cpg_fetch_icon('util', 1), '{BAN_TITLE}' => $lang_gallery_admin_menu['ban_title'], '{BAN_LNK}' => $lang_gallery_admin_menu['ban_lnk'], '{BAN_ICO}' => cpg_fetch_icon('ban_user', 1), '{DB_ECARD_TITLE}' => $lang_gallery_admin_menu['db_ecard_title'], '{DB_ECARD_LNK}' => $lang_gallery_admin_menu['db_ecard_lnk'], '{DB_ECARD_ICO}' => cpg_fetch_icon('ecard_review', 1), '{PICTURES_TITLE}' => $lang_gallery_admin_menu['pictures_title'], '{PICTURES_LNK}' => $lang_gallery_admin_menu['pictures_lnk'], '{PICTURES_ICO}' => cpg_fetch_icon('picture_sort', 1), '{DOCUMENTATION_HREF}' => $documentation_href, '{DOCUMENTATION_TITLE}' => $lang_gallery_admin_menu['documentation_title'], '{DOCUMENTATION_LNK}' => $lang_gallery_admin_menu['documentation_lnk'], '{DOCUMENTATION_ICO}' => cpg_fetch_icon('documentation', 1), '{PLUGINMGR_TITLE}' => $lang_gallery_admin_menu['pluginmgr_title'], '{PLUGINMGR_LNK}' => $lang_gallery_admin_menu['pluginmgr_lnk'], '{PLUGINMGR_ICO}' => cpg_fetch_icon('plugin_mgr', 1), '{BRIDGEMGR_TITLE}' => $lang_gallery_admin_menu['bridgemgr_title'], '{BRIDGEMGR_LNK}' => $lang_gallery_admin_menu['bridgemgr_lnk'], '{BRIDGEMGR_ICO}' => cpg_fetch_icon('bridge_mgr', 1), '{PHPINFO_TITLE}' => $lang_gallery_admin_menu['phpinfo_title'], '{PHPINFO_LNK}' => $lang_gallery_admin_menu['phpinfo_lnk'], '{PHPINFO_ICO}' => cpg_fetch_icon('phpinfo', 1), '{UPDATE_DATABASE_TITLE}' => $lang_gallery_admin_menu['update_database_title'], '{UPDATE_DATABASE_LNK}' => $lang_gallery_admin_menu['update_database_lnk'], '{UPDATE_DATABASE_ICO}' => cpg_fetch_icon('update_database', 1), '{VIEW_LOG_FILES_TITLE}' => $lang_gallery_admin_menu['view_log_files_title'], '{VIEW_LOG_FILES_LNK}' => $lang_gallery_admin_menu['view_log_files_lnk'], '{VIEW_LOG_FILES_ICO}' => cpg_fetch_icon('view_logs', 1), '{CHECK_VERSIONS_TITLE}' => $lang_gallery_admin_menu['check_versions_title'], '{CHECK_VERSIONS_LNK}' => $lang_gallery_admin_menu['check_versions_lnk'], '{CHECK_VERSIONS_ICO}' => cpg_fetch_icon('check_versions', 1), '{OVERALL_STATS_TITLE}' => $lang_gallery_admin_menu['overall_stats_title'], '{OVERALL_STATS_LNK}' => $lang_gallery_admin_menu['overall_stats_lnk'], '{OVERALL_STATS_ICO}' => cpg_fetch_icon('stats', 1), '{KEYWORDMGR_TITLE}' => $lang_gallery_admin_menu['keywordmgr_title'], '{KEYWORDMGR_LNK}' => $lang_gallery_admin_menu['keywordmgr_lnk'], '{KEYWORDMGR_ICO}' => cpg_fetch_icon('keyword_mgr', 1), '{EXIFMGR_TITLE}' => $lang_gallery_admin_menu['exifmgr_title'], '{EXIFMGR_LNK}' => $lang_gallery_admin_menu['exifmgr_lnk'], '{EXIFMGR_ICO}' => cpg_fetch_icon('exif_mgr', 1), '{SHOWNEWS_TITLE}' => $lang_gallery_admin_menu['shownews_title'], '{SHOWNEWS_LNK}' => $lang_gallery_admin_menu['shownews_lnk'], '{SHOWNEWS_ICO}' => cpg_fetch_icon('news_show', 1), '{TIME_STAMP}' => date('His').trim(floor(rand(0, 1000))), ); $html = template_eval($template_gallery_admin_menu, $param); // $html.= cpg_alert_dev_version(); } elseif (USER_ADMIN_MODE) { $param = array('{ALBMGR_TITLE}' => $lang_user_admin_menu['albmgr_title'], '{ALBMGR_LNK}' => $lang_user_admin_menu['albmgr_lnk'], '{ALBUMS_ICO}' => cpg_fetch_icon('alb_mgr', 1), '{MODIFYALB_TITLE}' => $lang_user_admin_menu['modifyalb_title'], '{MODIFYALB_LNK}' => $lang_user_admin_menu['modifyalb_lnk'], '{MODIFYALB_ICO}' => cpg_fetch_icon('modifyalb', 1), '{MY_PROF_TITLE}' => $lang_user_admin_menu['my_prof_title'], '{MY_PROF_LNK}' => $lang_user_admin_menu['my_prof_lnk'], '{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1), '{PICTURES_TITLE}' => $lang_gallery_admin_menu['pictures_title'], '{PICTURES_LNK}' => $lang_gallery_admin_menu['pictures_lnk'], '{PICTURES_ICO}' => cpg_fetch_icon('picture_sort', 1), ); $html = template_eval($template_user_admin_menu, $param); } else { $html = ''; } $admin_menu = CPGPluginAPI::filter('admin_menu',$html); } return $admin_menu; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_message_block')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ /****************************************************************************** // Function for the theme_display_message_block The message block (not to be confused with the admin menu) will display message carried over from one page to the other. It's advisable not to change it unless you really know what you're doing. This function composes the individual sections of the block. ******************************************************************************/ function theme_display_message_block() { global $lang_gallery_admin_menu, $lang_common, $CONFIG, $message_id; $superCage = Inspekt::makeSuperCage(); $return = ''; $message_id = ''; $message_icon = ''; $message_style = ''; if ($superCage->get->keyExists('message_id')) { $message_id = $superCage->get->getEscaped('message_id'); } if ($superCage->get->keyExists('message_icon')) { $message_icon = $superCage->get->getAlpha('message_icon'); } if ($message_icon == 'error') { $message_style = 'cpg_message_error'; } elseif ($message_icon == 'warning') { $message_style = 'cpg_message_warning'; } elseif ($message_icon == 'validation') { $message_style = 'cpg_message_validation'; } elseif ($message_icon == 'success') { $message_style = 'cpg_message_success'; } else { $message_style = 'cpg_message_info'; } if ($message_id != '') { $tempMessage = cpgFetchTempMessage($message_id); if ($tempMessage != '') { $return .= ''; $return .= <<< EOT
{$tempMessage}
EOT; } } if (GALLERY_ADMIN_MODE) { $return .= cpg_alert_dev_version(); // $return .= cpg_display_rss(); //add RSS feed from coppermine-gallery.net later } else { // not in admin mode //$return = ''; } return $return; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_cat_list')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_display_cat_list($breadcrumb, &$cat_data, $statistics) { global $template_cat_list, $lang_cat_list; if (count($cat_data) > 0) { starttable('100%'); $template = template_extract_block($template_cat_list, 'header'); $params = array( '{CATEGORY}' => $lang_cat_list['category'], '{ALBUMS}' => $lang_cat_list['albums'], '{PICTURES}' => $lang_cat_list['pictures'], ); echo template_eval($template, $params); } $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb'); $template = template_extract_block($template_cat_list, 'catrow'); foreach($cat_data as $category) { if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; } if (count($category) == 3) { $params = array( '{CAT_TITLE}' => $category[0], '{CAT_THUMB}' => $category['cat_thumb'], '{CAT_DESC}' => $category[1], ); echo template_eval($template_noalb, $params); } elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) { $params = array( '{CAT_TITLE}' => $category[0], '{CAT_THUMB}' => $category['cat_thumb'], '{CAT_DESC}' => $category[1], '{CAT_ALBUMS}' => $category['cat_albums'], '{ALB_COUNT}' => cpg_float2decimal($category[2]), '{PIC_COUNT}' => cpg_float2decimal($category[3]), ); echo template_eval($template, $params); } else { $params = array( '{CAT_TITLE}' => $category[0], '{CAT_THUMB}' => $category['cat_thumb'], '{CAT_DESC}' => $category[1], '{CAT_ALBUMS}' => '', '{ALB_COUNT}' => cpg_float2decimal($category[2]), '{PIC_COUNT}' => cpg_float2decimal($category[3]), ); echo template_eval($template, $params); } } if ($statistics && count($cat_data) > 0) { $template = template_extract_block($template_cat_list, 'footer'); $params = array('{STATISTICS}' => $statistics); echo template_eval($template, $params); } if (count($cat_data) > 0) endtable(); echo template_extract_block($template_cat_list, 'spacer'); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_breadcrumb')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_display_breadcrumb($breadcrumb, &$cat_data) { /** * ** added breadcrumb as a seperate element */ global $template_breadcrumb, $lang_breadcrumb; starttable('100%'); if ($breadcrumb) { $template = template_extract_block($template_breadcrumb, 'breadcrumb'); $params = array( '{BREADCRUMB}' => $breadcrumb, ); echo template_eval($template, $params); } endtable(); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_album_list')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages) { global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list, $lang_album_list; $theme_alb_list_tab_tmpl = $template_tab_display; $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page'])); $theme_alb_list_tab_tmpl['page_link'] = strtr($theme_alb_list_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d')); $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl); $album_cell = template_extract_block($template_album_list, 'album_cell'); $empty_cell = template_extract_block($template_album_list, 'empty_cell'); $tabs_row = template_extract_block($template_album_list, 'tabs'); $stat_row = template_extract_block($template_album_list, 'stat_row'); $spacer = template_extract_block($template_album_list, 'spacer'); $header = template_extract_block($template_album_list, 'header'); $footer = template_extract_block($template_album_list, 'footer'); $rows_separator = template_extract_block($template_album_list, 'row_separator'); $count = 0; $columns = $CONFIG['album_list_cols']; $column_width = ceil(100 / $columns); $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2; starttable('100%'); if ($STATS_IN_ALB_LIST) { $params = array('{STATISTICS}' => $statistics, '{COLUMNS}' => $columns, ); echo template_eval($stat_row, $params); } echo $header; if (is_array($alb_list)) { foreach($alb_list as $album) { $count ++; $params = array('{COL_WIDTH}' => $column_width, '{ALBUM_TITLE}' => $album['album_title'], '{THUMB_CELL_WIDTH}' => $thumb_cell_width, '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}", '{ALB_LINK_PIC}' => $album['thumb_pic'], '{ADMIN_MENU}' => $album['album_adm_menu'], '{ALB_DESC}' => $album['album_desc'], '{ALB_INFOS}' => $album['album_info'], '{ALB_HITS}' => $album['alb_hits'], ); $params = CPGPluginAPI::filter('theme_album_params', $params); echo template_eval($album_cell, $params); if ($count % $columns == 0 && $count < count($alb_list)) { echo $rows_separator; } } } $params = array('{COL_WIDTH}' => $column_width, '{SPACER}' => $thumb_cell_width ); $empty_cell = template_eval($empty_cell, $params); while ($count++ % $columns != 0) { echo $empty_cell; } echo $footer; // Tab display $params = array('{COLUMNS}' => $columns, '{TABS}' => $tabs, ); echo template_eval($tabs_row, $params); endtable(); echo $spacer; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_album_list_cat')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function to display first level Albums of a category function theme_display_album_list_cat(&$alb_list, $nbAlb, $cat, $page, $total_pages) { global $CONFIG, $STATS_IN_ALB_LIST, $statistics, $template_tab_display, $template_album_list_cat, $lang_album_list; if (!$CONFIG['first_level']) { return; } $theme_alb_list_tab_tmpl = $template_tab_display; $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['album_on_page'])); $theme_alb_list_tab_tmpl['page_link'] = strtr($theme_alb_list_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d')); $tabs = create_tabs($nbAlb, $page, $total_pages, $theme_alb_list_tab_tmpl); // echo $template_album_list_cat; $template_album_list_cat1 = $template_album_list_cat; $album_cell = template_extract_block($template_album_list_cat1, 'c_album_cell'); $empty_cell = template_extract_block($template_album_list_cat1, 'c_empty_cell'); $tabs_row = template_extract_block($template_album_list_cat1, 'c_tabs'); $stat_row = template_extract_block($template_album_list_cat1, 'c_stat_row'); $spacer = template_extract_block($template_album_list_cat1, 'c_spacer'); $header = template_extract_block($template_album_list_cat1, 'c_header'); $footer = template_extract_block($template_album_list_cat1, 'c_footer'); $rows_separator = template_extract_block($template_album_list_cat1, 'c_row_separator'); $count = 0; $columns = $CONFIG['album_list_cols']; $column_width = ceil(100 / $columns); $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2; starttable('99%'); // '100%' destroys the layout if $CONFIG['main_table_width'] is a pixel value if ($STATS_IN_ALB_LIST) { $params = array('{STATISTICS}' => $statistics, '{COLUMNS}' => $columns, ); echo template_eval($stat_row, $params); } echo $header; if (is_array($alb_list)) { foreach($alb_list as $album) { $count ++; $params = array('{COL_WIDTH}' => $column_width, '{ALBUM_TITLE}' => $album['album_title'], '{THUMB_CELL_WIDTH}' => $thumb_cell_width, '{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}", '{ALB_LINK_PIC}' => $album['thumb_pic'], '{ADMIN_MENU}' => $album['album_adm_menu'], '{ALB_DESC}' => $album['album_desc'], '{ALB_INFOS}' => $album['album_info'], '{ALB_HITS}' => $album['alb_hits'], ); echo template_eval($album_cell, $params); if ($count % $columns == 0 && $count < count($alb_list)) { echo $rows_separator; } } } $params = array('{COL_WIDTH}' => $column_width, '{SPACER}' => $thumb_cell_width ); $empty_cell = template_eval($empty_cell, $params); while ($count++ % $columns != 0) { echo $empty_cell; } echo $footer; // Tab display $params = array('{COLUMNS}' => $columns, '{TABS}' => $tabs, ); echo template_eval($tabs_row, $params); endtable(); echo $spacer; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_thumbnails')) { //{THEMES} /****************************************************************************** ** Section <<>> - 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) ? '' : '&cat=' . $cat; $date_link = $date=='' ? '' : '&date=' . $date; if ($superCage->get->getInt('uid')) { $uid_link = '&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 . '&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 . '&page=%d')); } $thumbcols = $CONFIG['thumbcols']; $cell_width = floor((100 / $CONFIG['thumbcols']) * 100) / 100 . '%'; $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 > 0 ? $cat : $CURRENT_ALBUM_DATA['category']), '{MODIFY_LNK}' => $lang_common['album_properties'], '{MODIFY_ICO}' => cpg_fetch_icon('modifyalb', 0), '{PARENT_CAT_LNK}' => $lang_common['parent_category'], '{PARENT_CAT_ICO}' => cpg_fetch_icon('category', 0), '{EDIT_PICS_LNK}' => $lang_common['edit_files'], '{EDIT_PICS_ICO}' => cpg_fetch_icon('edit', 0), '{ALBUM_MGR_LNK}' => $lang_common['album_manager'], '{ALBUM_MGR_ICO}' => cpg_fetch_icon('alb_mgr', 0), ); } 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 ($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)) ? "&page=$page" : ''; $target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}"; } else { $target = "displayimage.php?album=$aid$cat_link$date_link&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(); CPGPluginAPI::action('theme_thumbnails_wrapper_end', null); echo $spacer; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_film_strip')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Function to display the film strip function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb', $date='', $filmstrip_prev_pos, $filmstrip_next_pos,$max_block_items,$thumb_width) { global $CONFIG, $THEME_DIR; global $template_film_strip, $lang_film_strip, $lang_common, $pic_count,$mar_pic; $superCage = Inspekt::makeSuperCage(); static $template = ''; static $thumb_cell = ''; static $empty_cell = ''; static $spacer = ''; if ((!$template)) { $template = $template_film_strip; $thumb_cell = str_replace('get->getInt('uid'); } else { $uid_link = ''; } $i = 0; $thumb_strip = ''; foreach($thumb_list as $thumb) { $i++; if ($mode == 'thumb') { if ($thumb['pos'] == $pos && !$superCage->get->keyExists('film_strip')) { $thumb['image'] = str_replace('class="strip_image"', 'class="strip_image middlethumb"', $thumb['image']); } // 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 == 'lastcom' || $aid == 'lastcomby') { $page = cpg_get_comment_page_number($thumb['msg_id']); $page = (is_numeric($page)) ? "&page=$page" : ''; $target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}"; } else { $target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link#top_display_media"; } $params = array( '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:".$thumb_width."px; float: left" , ); } else { $params = array( '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{ONE_WIDTH}' => "width:".$thumb_width."px; float: left" , ); } $thumb_strip .= template_eval($thumb_cell, $params); } if (defined('THEME_HAS_FILM_STRIP_GRAPHICS')) { $tile1 = $THEME_DIR . 'images/tile1.gif'; $tile2 = $THEME_DIR . 'images/tile2.gif'; } elseif (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) { $tile1=$tile2=$THEME_DIR . 'images/tile.gif'; } else { $tile1=$tile2= 'images/tile.gif'; } if (defined('THEME_HAS_NAVBAR_GRAPHICS')) { $location = $THEME_DIR; } else { $location= ''; } $max_itme_width_ul = $max_block_items; if(($max_block_items%2)==0){ $max_itme_width_ul = $max_block_items +1; } $set_width_to_film = "width:".($max_block_items*($thumb_width+4))."px; position:relative;"; $params = array('{THUMB_STRIP}' => $thumb_strip, '{COLS}' => $i, '{TILE1}' => $tile1, '{TILE2}' => $tile2, '{SET_WIDTH}' => $set_width_to_film, ); ob_start(); echo '
'; starttable($CONFIG['picture_table_width']); echo template_eval($template, $params); endtable(); echo '
'; $film_strip = ob_get_contents(); ob_end_clean(); return $film_strip; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_no_img_to_display')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_no_img_to_display($album_name) { global $lang_errors, $template_no_img_to_display; static $template = ''; static $spacer; if ((!$template)) { $template = $template_no_img_to_display; $spacer = template_extract_block($template, 'spacer'); } $params = array('{TEXT}' => $lang_errors['no_img_to_display']); starttable('100%', $album_name); echo template_eval($template, $params); endtable(); } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_display_image')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip) { global $CONFIG, $LINEBREAK; $superCage = Inspekt::makeSuperCage(); $width = $CONFIG['picture_table_width']; echo ''; // set the navbar-anchor starttable(); echo $nav_menu; endtable(); starttable(); echo $picture; endtable(); if ($CONFIG['display_film_strip'] == 1) { echo $film_strip; } echo $votes; $picinfo = $superCage->cookie->keyExists('picinfo') ? $superCage->cookie->getAlpha('picinfo') : ($CONFIG['display_pic_info'] ? 'block' : 'none'); echo $LINEBREAK . '
' . $LINEBREAK; starttable(); echo $pic_info; endtable(); echo '
' . $LINEBREAK; echo ''; echo '
' . $LINEBREAK; echo $comments; echo '
' . $LINEBREAK; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_html_picinfo')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ function theme_html_picinfo(&$info) { global $lang_picinfo, $CONFIG, $CURRENT_PIC_DATA, $LINEBREAK; if ($CONFIG['picinfo_movie_download_link']) { $path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename']; $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']); if ($mime_content['content']=='movie') { $info[$lang_picinfo['download_URL']] = ''. $lang_picinfo['movie_player'] .''; } } $html = ''; $html .= '
' . $LINEBREAK; $template = ' ' . $LINEBREAK; foreach ($info as $key => $value) { $html .= sprintf($template, $key, $value); } return $html; } /****************************************************************************** ** Section <<>> - END ******************************************************************************/ } //{THEMES} if (!function_exists('theme_html_picture')) { //{THEMES} /****************************************************************************** ** Section <<>> - START ******************************************************************************/ // Displays a picture function theme_html_picture() { global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER, $LINEBREAK; global $album, $lang_date, $template_display_media; global $lang_display_image_php, $lang_picinfo, $lang_common, $lang_errors; $superCage = Inspekt::makeSuperCage(); $pid = $CURRENT_PIC_DATA['pid']; $pic_title = ''; if (!isset($USER['liv']) || !is_array($USER['liv'])) { $USER['liv'] = array(); } // Add 1 to hit counter if ((!USER_IS_ADMIN && $CONFIG['count_admin_hits'] == 0 || $CONFIG['count_admin_hits'] == 1) && !in_array($pid, $USER['liv']) && $superCage->cookie->keyExists($CONFIG['cookie_name'] . '_data')) { add_hit($pid); if (count($USER['liv']) > 4) array_shift($USER['liv']); array_push($USER['liv'], $pid); } if ($CURRENT_PIC_DATA['title'] != '') { $pic_title .= $CURRENT_PIC_DATA['title'] . $LINEBREAK; } if ($CURRENT_PIC_DATA['caption'] != '') { $pic_title .= $CURRENT_PIC_DATA['caption'] . $LINEBREAK; } if ($CURRENT_PIC_DATA['keywords'] != '') { $pic_title .= $lang_common['keywords'] . ": " . $CURRENT_PIC_DATA['keywords']; } if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) { template_extract_block($template_display_media, 'img_desc'); } else { if (!$CURRENT_PIC_DATA['title']) { template_extract_block($template_display_media, 'title'); } if (!$CURRENT_PIC_DATA['caption']) { template_extract_block($template_display_media, 'caption'); } } $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : ''; $image_size = array(); if ($CONFIG['make_intermediate'] && cpg_picture_dimension_exceeds_intermediate_limit($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'])) { $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal'); } else { $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize'); } if (!$pic_title) { $pic_title = $CURRENT_PIC_DATA['filename']; } $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']); if ($mime_content['content']=='movie' || $mime_content['content']=='audio') { if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) { $resize_method = $CONFIG['picture_use'] == "thumb" ? ($CONFIG['thumb_use'] == "ex" ? "any" : $CONFIG['thumb_use']) : $CONFIG['picture_use']; if ($resize_method == 'ht') { $pwidth = $CONFIG['picture_width']*4/3; $pheight = $CONFIG['picture_width']; } else { $pwidth = $CONFIG['picture_width']; $pheight = $CONFIG['picture_width']*3/4; } $CURRENT_PIC_DATA['pwidth'] = $pwidth; // Default width // Set default height; if file is a movie if ($mime_content['content']=='movie') { $CURRENT_PIC_DATA['pheight'] = $pheight; // Default height } } $ctrl_offset['mov']=15; $ctrl_offset['wmv']=45; $ctrl_offset['swf']=0; $ctrl_offset['rm']=0; $ctrl_offset_default=45; $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default; $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"'; } if ($mime_content['content']=='image') { list($image_size['width'], $image_size['height'], , $image_size['geom']) = cpg_getimagesize($picture_url); if ($CURRENT_PIC_DATA['mode'] != 'fullsize') { $winsizeX = $CURRENT_PIC_DATA['pwidth'] + $CONFIG['fullsize_padding_x']; //the +'s are the mysterious FF and IE paddings $winsizeY = $CURRENT_PIC_DATA['pheight'] + $CONFIG['fullsize_padding_y']; //the +'s are the mysterious FF and IE paddings if ($CONFIG['transparent_overlay'] == 1) { $pic_html = "
$title
'.$lang_picinfo['title'].'
%s:%s
"; $pic_html_href_close = '' . $LINEBREAK; if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) { if ($CONFIG['allow_user_registration'] == 0) { $pic_html_href_close = ''; } else { $pic_html .= ''; } } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) { $pic_html .= ''; } else { $pic_html .= ""; } $pic_title_fs = $lang_display_image_php['view_fs'] . $LINEBREAK . '==============' . $LINEBREAK . $pic_title; $pic_html .= "\"{$pic_title}\"
"; $pic_html .= $pic_html_href_close . '
'; //PLUGIN FILTER $pic_html = CPGPluginAPI::filter('html_image_reduced_overlay', $pic_html); } else { $pic_html_href_close = '' . $LINEBREAK; if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) { if ($CONFIG['allow_user_registration'] == 0) { $pic_html = $pic_html_href_close = ''; } else { $pic_html = ''; } } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) { $pic_html = ''; } else { $pic_html = ""; } $pic_title_fs = $lang_display_image_php['view_fs'] . $LINEBREAK . '==============' . $LINEBREAK . $pic_title; $pic_html .= "\"{$pic_title}\"
"; $pic_html .= $pic_html_href_close; //PLUGIN FILTER $pic_html = CPGPluginAPI::filter('html_image_reduced', $pic_html); } } else { if ($CONFIG['transparent_overlay'] == 1) { $pic_html = "
"; $pic_html .= "\"{$pic_title}\"
" . $LINEBREAK; $pic_html .= "
"; //PLUGIN FILTER $pic_html = CPGPluginAPI::filter('html_image_overlay', $pic_html); } else { $pic_html = "\"{$pic_title}\"
" . $LINEBREAK; //PLUGIN FILTER $pic_html = CPGPluginAPI::filter('html_image', $pic_html); } } } elseif ($mime_content['content']=='document') { $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb'); $pic_html = "

" . $LINEBREAK; //PLUGIN FILTER $pic_html = CPGPluginAPI::filter('html_document', $pic_html); } else { $autostart = ($CONFIG['media_autostart']) ? ('true'):('false'); $autoplay = '" autostart="'.$autostart.'" autoplay="'.$autostart.'" '; if ($mime_content['player'] == 'HTMLA') { $pic_html = '