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: Improved page titles - thumbnails.php and displayimage.php  (Read 5565 times)

0 Members and 1 Guest are viewing this topic.

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Improved page titles - thumbnails.php and displayimage.php
« on: February 24, 2008, 01:01:15 pm »

Both pages named above have very horrible page titles. You can correct these titles to be a little more SEO friendly:

Could a mod please move this to Modifications / Searching?

For displayimage.php, we are going to change pictures titles to display better. By default, they appear as Album Name/Picture Title - Your Gallery. This will make the title: Picture Title / Album Name - Your Gallery

Find in displayimage.php
Code: [Select]
pageheader($album_name . '/' . $picture_title, $meta_keywords, false);
Replace with:
Code: [Select]
pageheader($picture_title . ' / ' . $album_name, $meta_keywords, false);

I have no idea why I have gone so long without noticing this, but on thumbnails.php the title appears as: Album Name - Your Gallery... Regardless of what page you are viewing. The code change below will change the title ONLY on pages beyond the first page.. For example, on page 10, your title would appear as Album Name - Page 10 - Your Gallery... The first page is left unaffected

Open thumbnails.php and find:
Code: [Select]
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
Replace With:
Code: [Select]
if ($page != '1') {
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] . ' - Page ' . $page: $lang_meta_album_names[$album]);
} else {
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
}

I tried searching and couldn't find this being discussed. I promised with previous projects that I would post all of my modifications I made a long the way but never did.. So I'm trying to make up for that with coppermine :-P
« Last Edit: February 24, 2008, 10:05:58 pm by copperminepro »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Improved page titles - thumbnails.php and displayimage.php
« Reply #1 on: February 24, 2008, 08:37:04 pm »

Find in displayimage.php
Code: [Select]
pageheader($picture_title . ' / ' . $album_name, $meta_keywords, false);
Replace with:
Code: [Select]
pageheader($picture_title . ' / ' . $album_name, $meta_keywords, false);
In which aspect do those lines differ?
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Improved page titles - thumbnails.php and displayimage.php
« Reply #2 on: February 24, 2008, 09:39:51 pm »

 :o :o

fixed
« Last Edit: February 24, 2008, 10:06:54 pm by copperminepro »
Logged

Nibbler

  • Guest
Re: Improved page titles - thumbnails.php and displayimage.php
« Reply #3 on: February 24, 2008, 09:41:51 pm »

Try again. :)
Logged

copperminepro

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 48
Re: Improved page titles - thumbnails.php and displayimage.php
« Reply #4 on: February 24, 2008, 10:04:12 pm »

fixed

 :o :o :o

lol im going to start posting only in the middle of the day, not when i wake up or am going to bed
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.