forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on December 16, 2013, 02:28:47 pm
-
Is it possible to have a header image for category 1 and another header image for category 2?
same for albums thumbnails page.header image for album 1 diffrent for header image for album 2.
ex: thsis link http://www.allvip.us/cpg/test/thumbnails.php?album=1 to have a header image with a car and this link http://www.allvip.us/cpg/test/thumbnails.php?album=2 to have header image with a city.
is for my own gallery not for a theme so I am ok to edit coppermine files.
-
at least header image for all categories to be diffrent form header image for all albums.
-
Replace your current header image with a new token in your theme's template.html file and replace that token accordingly in theme.php.
I already did that for a gallery, unfortunately I currently have no access to its theme folder.
-
not like this: http://forum.coppermine-gallery.net/index.php/topic,76584.msg369543.html#msg369543 (http://forum.coppermine-gallery.net/index.php/topic,76584.msg369543.html#msg369543)
I want every album and every category to have another header image.
-
I understood your question, that's not the mod I meant. It's not publicly available, that's why I've currently no access.
-
I think I know how to solve: diffrent header image for all categories and all albums.Maybe a token in function cat list and another in function thumbnails.
I still have to find out how to have diffrent header image for every album and every category.
I will post how if I will find the solution.
-
a token in function cat list and another in function thumbnails.
That doesn't make sense. I already told you what to do. If you can wait some days I'll try to get access to the mod.
-
Thanks a lot.
Is no rush at all.I will wait.
-
Unfortunately our recent conversion is lost due to the site outage (http://forum.coppermine-gallery.net/index.php/topic,77004.0.html). If I remember correctly I posted a solution which adjusts the header image according to the category, for all following pages (thumbnail and intermediate-sized view).
Your preferred solution was to adjust the header image for the category and thumbnail pages separately and drop it for the intermediate-sized pages, correct? If so, I'll create the mod accordingly.
-
solution by ANDRE for different header images and logo images for each category only (not even for each thumbnails pages):
add this code to function pageheader before $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);(copy it from themes/sample/theme.php if is not in your theme.php)
ADD in your images foder header_1.jpg for cat=1,header_2.jpg for cat=2 etc and logo_1.png for cat=1,logo_2.png for cat=2 etc and header_default.jpg for index.php.
// header mod - start
global $cat;
$superCage = Inspekt::makeSuperCage();
if ($superCage->get->getRaw('file') == 'minicms/cms') {
$current_id = $superCage->get->getInt('id');
} elseif (!$cat) {
$current_id = 0;
} elseif ($cat < 0) {
$aid = -$cat;
$current_id = mysql_result(cpg_db_query("SELECT category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '$aid' LIMIT 1"), 0);
} else {
$current_id = $cat;
}
$logo_file = 'themes/your_theme_name/your_images_folder/logo_'.$current_id.'.png';
$header_file = 'themes/your_theme_name/your_images_folder/header_'.$current_id.'.jpg';
$logo_link = file_exists($logo_file) ? '<a href="./index.php" title="Index" id="logo"><img src="'.$logo_file.'" alt="Index" /></a>' : '';
$header_file = file_exists($header_file) ? $header_file : 'themes/your_theme_name/your_images_folder/header_default.jpg';
$headerbar = <<<EOT
<div class="headerbar" style="background:url('{$header_file}');">
<div class="inner">
<span class="corners-top"><span></span></span>
<div id="site-description">
{$logo_link}
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
EOT;
$template_vars['{HEADERBAR}'] = $headerbar;
// header mod - end
[Edit by André: Don't forget to add the token {HEADERBAR} to your theme's template.html file]
-
YES
-
Updated code to use different header images for each category and album and don't use any header for intermediate-sized pages:
// header mod - start
global $cat, $CPG_PHP_SELF;
if ($cat < 0) {
$what = 'alb_';
$current_id = -$cat;
} else {
$what = 'cat_';
$current_id = $cat;
}
$logo_file = 'themes/your_theme_name/your_images_folder/logo_'.$what.$current_id.'.png';
$header_file = 'themes/your_theme_name/your_images_folder/header_'.$what.$current_id.'.jpg';
$logo_link = file_exists($logo_file) ? '<a href="./index.php" title="Index" id="logo"><img src="'.$logo_file.'" alt="Index" /></a>' : '';
$header_file = file_exists($header_file) ? $header_file : 'themes/your_theme_name/your_images_folder/header_'.$what.'default.jpg';
$headerbar = <<<EOT
<div class="headerbar" style="background:url('{$header_file}');">
<div class="inner">
<span class="corners-top"><span></span></span>
<div id="site-description">
{$logo_link}
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
EOT;
$template_vars['{HEADERBAR}'] = ($CPG_PHP_SELF == 'displayimage.php') ? '' : $headerbar;
// header mod - end
As you can see I've added $what to the file name, this means you need corresponding files in your images folder, e.g.
- header_cat_0.jpg
- header_cat_1.jpg
- header_cat_2.jpg
- header_cat_3.jpg
- header_cat_default.jpg
- logo_cat_0.jpg
- logo_cat_1.jpg
- logo_cat_2.jpg
- logo_cat_3.jpg
- header_alb_1.jpg
- header_alb_2.jpg
- header_alb_3.jpg
- header_alb_default.jpg
- logo_alb_1.jpg
- logo_alb_2.jpg
- logo_alb_3.jpg
-
thanks a lot