Advanced search  

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]

Pages: [1]   Go Down

Author Topic: theme.php is already loaded?  (Read 2839 times)

0 Members and 1 Guest are viewing this topic.

Fed

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
    • Imagetemple.com
theme.php is already loaded?
« on: November 15, 2006, 01:43:29 pm »

hello guys
I have put some scripting in theme php where I define {NUMPHOTOS} counting the number of rows in the table cpgXXX_pictures then I use it to display this number at the top of the page, anyway I just realized it was already done and displayed at the bottom of the gallery
I don't understand why this number doesn't show on displayimage.php?album=xx&pos=xxx (x are just placeholders)

isn't theme.php always loaded?

is there a simpler way of accessing/displaying this number?

I have seen in the language file it's stored in [pictures] but I don't how I should use this

thanks for the help
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: theme.php is already loaded?
« Reply #1 on: November 16, 2006, 10:31:45 am »

Can you rephrase your question? I don't really understand what you want to do and where in theme.php

Fed

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
    • Imagetemple.com
Re: theme.php is already loaded?
« Reply #2 on: November 16, 2006, 12:25:43 pm »

Can you rephrase your question? I don't really understand what you want to do and where in theme.php
the topic title is wrong but I couldn't find an "edit" button....it should be "is theme.php always loaded?"

anyway I mean:

I have pasted the pageheader method in theme.php and I added some stuff, in particular I added {NUMPHOTOS} (number of photos in the gallery, counted with a query) to the $template_vars array so that I can use it in the template.
I use it to display the number of pictures at the top of the page, it works fine in index.php, thumbnails.php, upload.php, ecard.php but doesn't work in displayimage.php (the image preview) and I don't understand why.

moreover I noticed that the total number of photos is displayed at the bottom of the gallery index, and I was asking where it is stored to use it without having tu run an additional query.

thanks for the help
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: theme.php is already loaded?
« Reply #3 on: November 16, 2006, 12:42:13 pm »

the number of pics in an album displayed in the intermediate view is calculated in the function theme_html_img_nav_menu() ... it passes the value to the $template_img_navbar , {PIC_POS} contains the actual pos and the total
$pic_count holds the number of images... you'll need to pass it to the template.

That's only for the navbar... if you want to display the number anywhere else, you'll have to modify another function, template

Fed

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 50
    • Imagetemple.com
Re: theme.php is already loaded?
« Reply #4 on: November 16, 2006, 02:14:00 pm »

the number of pics in an album displayed in the intermediate view is calculated in the function theme_html_img_nav_menu() ... it passes the value to the $template_img_navbar , {PIC_POS} contains the actual pos and the total
$pic_count holds the number of images... you'll need to pass it to the template.

That's only for the navbar... if you want to display the number anywhere else, you'll have to modify another function, template
I tried to use $pic_count but it contains the number of photos in the actual category, I need to display the total number of images in the gallery

I was told that coppermine checks which methods can find in themes.php and later looks for the missing ones in themes.inc.php

I can't understand why this number isn't shown in displayimage.php, considering that the {NUMPHOTOS} placeholder is in the HTML template and the pageheader function is run at every pageload (I suppose...)

consider that all the other placeholders I added are working fine, just one fails.
This is my $template_vars array
Code: [Select]
$template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($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,
        '{USERSONLINE}' => $i_t_user,
        '{UNDERMENUADS}' => $phpAds_raw_UnderMenu['html'],
        '{HEADERADS}' => $phpAds_rawHeader['html'],
        '{NUMPHOTOS}' => $i_t_numphotos,
        );

only {NUMPHOTOS} doesn't show, and only in displayimage.php, everything works perfectly in all the other pages

thanks for your help and for spending a couple of minutes on this stuff guys
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.