coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Fed on November 15, 2006, 01:43:29 PM

Title: theme.php is already loaded?
Post by: Fed 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
Title: Re: theme.php is already loaded?
Post by: Stramm 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
Title: Re: theme.php is already loaded?
Post by: Fed on November 16, 2006, 12:25:43 PM
Quote from: Stramm 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
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
Title: Re: theme.php is already loaded?
Post by: Stramm 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
Title: Re: theme.php is already loaded?
Post by: Fed on November 16, 2006, 02:14:00 PM
Quote from: Stramm 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
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
$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