forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: kingspice on September 03, 2012, 08:00:10 pm

Title: Changing output of dynamic page title
Post by: kingspice on September 03, 2012, 08:00:10 pm
Example URL:
http://www.parishiltonzone.com/pictures/displayimage-555-9718.html#top_display_media

The title of this page is:
"Lindsay Lohan partying with Paris hilton - Paris-Hilton-Lindsay-Lohan12"
which equates to coppermine default dynamic title, for this page, of:
Album name - FileName

I'd like to change the title output so it is:
"Lindsay Lohan partying with Paris hilton - 4 / 12"
ie Album name - Picture number / Number of pictures in gallery

What function would help me achieve this?

Thanks
Gareth
Title: Re: Changing output of dynamic page title
Post by: Αndré on September 04, 2012, 12:17:59 pm
Open displayimage.php, find
Code: [Select]
pageheader($album_name . ' - ' . $picture_title, $meta_keywords, false);and replace with
Code: [Select]
pageheader($album_name . ' - ' . preg_replace('/.*width="100%">FILE (.*)<\/td>.*/Usi', '\\1', $nav_menu), $meta_keywords, false);
Title: Re: Changing output of dynamic page title
Post by: kingspice on September 05, 2012, 06:30:18 pm
Thanks for pointing out the relevant file/function.

This preg_replace approach effected some other parts of the pages layout unfortunately (can't keep up to show you example, as corrupted the sites layout).

Is there a simple variable approach I could use, in the output, instead?
Title: Re: Changing output of dynamic page title
Post by: Αndré on September 05, 2012, 07:33:46 pm
Try
Code: [Select]
pageheader($album_name . ' - ' . ($pos + 1) . ' / ' . $pic_count, $meta_keywords, false);