ZenphotoCMS Forum
effervescence+ remove random function of heading image - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Themes (https://forum.zenphoto.org/forum-5.html)
+--- Thread: effervescence+ remove random function of heading image (/thread-6981.html)



effervescence+ remove random function of heading image - djoel - 2010-04-30

Hi,

What do I have to modify in the following code to get rid of the random function and to specify one image to be displayed as heading image?

[quote]
function printHeadingImage($randomImage) {
global $_zp_themeroot;
$id = getAlbumId();
echo '';
if (is_null($randomImage)) {
echo '';
} else {
$randomAlbum = $randomImage->getAlbum();
$randomAlt1 = $randomAlbum->getTitle();
if ($randomAlbum->getAlbumId() $id) {
$randomAlbum = $randomAlbum->getParent();
while (!is_null($randomAlbum) && ($randomAlbum->getAlbumId() $id)) {
$randomAlt1 = $randomAlbum->getTitle().":\n".$randomAlt1;
$randomAlbum = $randomAlbum->getParent();
}
}
$randomImageURL = htmlspecialchars(getURL($randomImage));
if (getOption('allow_upscale')) {
$wide = 620;
$high = 180;
} else {
$wide = min(620, $randomImage->getWidth());
$high = min(180, $randomImage->getHeight());
}
echo "




effervescence+ remove random function of heading image - Blue Dragonfly - 2010-04-30

Modify the file /themes/effervesence_plus/functions.php, line 152.

I haven't played with this theme, so I don't know what issues there may be with breaking the layout if you use a differently sized image, but regardless, that's where the line is that prints the image heading for each of the theme pages.




effervescence+ remove random function of heading image - Blue Dragonfly - 2010-04-30

Actually, I'll post the block of code also, in case you've already modified the file and it's not line 152 anymore:

function printLogo() { global $_zp_themeroot; if ($img = getOption('Graphic_logo')) { echo '[img]'.$_zp_themeroot.'/images/'.$img.'.png[/img]'; } else { $name = getOption('Theme_logo'); if (empty($name)) { $name = sanitize($_SERVER['HTTP_HOST']); } echo "$name"; } }
It would be the line that reads: echo '




effervescence+ remove random function of heading image - Blue Dragonfly - 2010-04-30

Well, now I've looked more closely at the theme, and I see which image you're talking about. So, now I think I can answer the question you asked, not the one I thought you meant :-)

Perhaps the easiest way is to modify the function you posted in your original post. Add the following line above the one beginning with 'global $_zp_theme_root;':

$randomImage = NULL

That will force it to use the hard-coded image a few lines down. Now, modify that line to point to the image you want to use - again, noting that a differently sized image may adversely affect the theme layout. The line to modify is:

echo '[img]'.$_zp_themeroot.'/images/zen-logo.jpg[/img]';
In the above line, if you put the image in the theme's images folder, just replace 'zen-logo.jpg' with the filename you use.

Hope that helps!




effervescence+ remove random function of heading image - djoel - 2010-04-30

Thank you for your help. I don't have time to check it now. As soon as I checked I'll post the results.

Thank you again




effervescence+ remove random function of heading image - djoel - 2010-05-03

Ok I've checked it and the code works perfectly. Just have to cut the image to make it fit...

Thank you very much Blue Dragonfly!!!