- Timestamp:
- Dec 28, 2013, 6:08:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/header_manager/include/header_manager.inc.php
r20169 r26298 1 1 <?php 2 if (!defined('HEADER_MANAGER_PATH'))die('Hacking attempt!');2 defined('HEADER_MANAGER_PATH') or die('Hacking attempt!'); 3 3 4 4 /** … … 9 9 global $conf, $user, $template, $page; 10 10 11 if ( script_basename() == 'picture' and !$conf['header_manager']['banner_on_picture'])11 if (script_basename() == 'picture' and !$conf['header_manager']['banner_on_picture']) 12 12 { 13 return null; 13 return ''; 14 } 15 16 // no support for Kardon (not enough space) 17 if ($user['theme'] == 'kardon') 18 { 19 return $page_banner; 14 20 } 15 21 … … 48 54 if (!isset($banner)) 49 55 { 50 if ( 56 if (empty($conf['header_manager']['image']) or $conf['header_manager']['image'] == 'random') 51 57 { 52 58 $banners = array_values(list_banners()); 53 if (!count($banners)) return $page_banner; 59 if (!count($banners)) 60 { 61 return $page_banner; 62 } 54 63 $banner = $banners[ mt_rand(0, count($banners)-1) ]; 55 64 } … … 57 66 { 58 67 $banner = get_banner($conf['header_manager']['image']); 59 if ($banner === false) return $page_banner; 68 if ($banner === false) 69 { 70 return $page_banner; 71 } 60 72 } 61 73 } 62 74 63 75 // for MontBlancXL and BlancMontXL the banner is displayed as background of the header 64 if ( in_array($user['theme'], array('blancmontxl','montblancxl')))76 if (in_array($user['theme'], array('blancmontxl','montblancxl'))) 65 77 { 66 $template->append('head_elements', 67 '<style type="text/css"> 68 #theHeader { background: transparent url('.$banner['PATH'].') center bottom no-repeat; } 69 </style>' 78 $template->block_html_style(null, 79 '#theHeader { background: transparent url('.$banner['PATH'].') center bottom no-repeat; }' 70 80 ); 71 81 72 82 if ($conf['header_manager']['display'] == 'image_only') 73 83 { 74 $page_banner = null;84 $page_banner = ''; 75 85 } 76 86 else 77 87 { 78 $page_banner = str_replace('%header_manager%', null, $page_banner);88 $page_banner = str_replace('%header_manager%', '', $page_banner); 79 89 } 80 90 } 81 // no support for Kardon (not enough space) 82 else if ($user['theme'] != 'kardon') 91 else 83 92 { 84 $template->append('head_elements', 85 '<style type="text/css"> 86 #theHeader div.banner { background:transparent url(\''.$banner['PATH'].'\') center center no-repeat;height:'.$banner['SIZE'][1].'px;line-height:'.($banner['SIZE'][1]-12).'px;font-size:2.5em;color:#fff;text-shadow:0 0 5px #000;text-align:center; } 87 </style>' 93 $template->block_html_style(null, 94 '#theHeader div.banner { background:transparent url(\''.$banner['PATH'].'\') center center no-repeat; height:'. ($banner['SIZE'][1]) .'px; line-height:'. ($banner['SIZE'][1]-12) .'px; font-size:2.5em; color:#fff; text-shadow:0 0 5px #000; text-align:center; }' 88 95 ); 89 96 90 $banner_img = '<div class="banner">'. ($conf['header_manager']['display']=='with_title' ? $conf['gallery_title'] : ' ').'</div>';97 $banner_img = '<div class="banner">'. ($conf['header_manager']['display']=='with_title' ? $conf['gallery_title'] : ' ') .'</div>'; 91 98 92 99 if ($conf['header_manager']['display'] == 'with_text') … … 96 103 else 97 104 { 98 $page_banner = '<a href="'. get_gallery_home_url().'">'.$banner_img.'</a>';105 $page_banner = '<a href="'. get_gallery_home_url() .'">'. $banner_img .'</a>'; 99 106 } 100 107 } … … 109 116 return array_search($a['category_id'], $ids) < array_search($b['category_id'], $ids); 110 117 } 111 112 ?>
Note: See TracChangeset
for help on using the changeset viewer.