Add To Lightbox On Image Navigation Bar Add To Lightbox On Image Navigation Bar
 

News:

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

Main Menu

Add To Lightbox On Image Navigation Bar

Started by pressurecooker, May 05, 2008, 05:18:49 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

pressurecooker

Hi,

I am trying to add the "Lightbox" button to the Image navigation bar (near the Thumbnails icon).
The problem is that Lightbox button is defined in Themes.php while the Img navigation bar is in the Themes.Inc.php. My Lightbox is separate from the File information, I made a new template variable called {FAVES}. First I tried to add {FAVES} to the part of Themes.inc which deals with navigation bar. It doesn't work. Then I tried to remove Navigation Bar part from Themes.inc and add it to Themes.php. That didn't work either.

I would be grateful for any suggestions.

Url is: www.nanotoxic.com/cpg.html
The idea what I want to achieve is attached
Join the green campaign - Environmental Articles

Joachim Müller

Quote from: pressurecooker on May 05, 2008, 05:18:49 PM
The problem is that Lightbox button is defined in Themes.php while the Img navigation bar is in the Themes.Inc.php.
No, that is wrong. include/themes.inc.php is just the core default file that never should be changed or edited. You can override anything you want to see overridden in themes/yourtheme/theme.php.
Undo your changes in include/themes.inc.php and apply your changes to themes/yourtheme/theme.php. If you can find the section you want to modify in your custom theme, copy the "missing" section from themes/sample/theme.php

pressurecooker

Ok, so you mean that if I add $template_img_navbar plus all its $params to Theme.php the same part of Theme.Inc.php will be just ignored?  :o
That's interesting. I will try, thanks.
Join the green campaign - Environmental Articles

pressurecooker

 ;D Great! Thank you GauGau, you're a genius!

Now, here's what I did:

1. Copy $template_img_navbar from sample template.php to my own template.php

2. Copy the whole function theme_html_img_nav_menu() from sample template.php to my template.php

3. The first lines of theme_html_img_nav_menu() was:
function theme_html_img_nav_menu()
{
    global $CONFIG, $CURRENT_PIC_DATA, $meta_nav, $THEME_DIR ; //$PHP_SELF,
    global $album, $cat, $pos, $pic_count, $lang_img_nav_bar, $lang_text_dir, $template_img_navbar;

Changed to:
function theme_html_img_nav_menu()
{
    global $CONFIG, $CURRENT_PIC_DATA, $FAVPICS, $meta_nav, $THEME_DIR ; //$PHP_SELF,
    global $album, $cat, $pos, $pic_count, $lang_display_image_php, $lang_picinfo, $lang_img_nav_bar, $lang_text_dir, $template_img_navbar;


4. Anywhere in the same function but before $params, entered this stuff:
if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $myFave2[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid'] . $ref . "\" >" . $lang_picinfo['addFav'] . '</a>';
    } else {
        $myFave2[$lang_picinfo['addFavPhrase']] = "<a href=\"addfav.php?pid=" . $CURRENT_PIC_DATA['pid']  . $ref . "\" >" . $lang_picinfo['remFav'] . '</a>';
    }


5. In the $params list added this:
'{FAVES2}' => $myFave2[$lang_picinfo['addFavPhrase']],

6. In the template variable $template_img_navbar mix {FAVES2} within the html code where I want it to appear.

Eeh, it's gorgeous. I'm starting to love this...
Join the green campaign - Environmental Articles

Joachim Müller

Quote from: pressurecooker on May 06, 2008, 10:26:04 AM
Ok, so you mean that if I add $template_img_navbar plus all its $params to Theme.php the same part of Theme.Inc.php will be just ignored?  :o
Exactly: stuff in theme.php overrides stuff in themes.inc.php

Quote from: pressurecooker on May 06, 2008, 11:06:51 AM
1. Copy $template_img_navbar from sample template.php to my own template.php
It's actually theme.php, not template.php - just posting this as a clarification for others.