Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Changing output of dynamic page title  (Read 2273 times)

0 Members and 1 Guest are viewing this topic.

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Changing output of dynamic page title
« 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Changing output of dynamic page title
« Reply #1 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);
Logged

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Changing output of dynamic page title
« Reply #2 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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Changing output of dynamic page title
« Reply #3 on: September 05, 2012, 07:33:46 pm »

Try
Code: [Select]
pageheader($album_name . ' - ' . ($pos + 1) . ' / ' . $pic_count, $meta_keywords, false);
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.