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: Modernization breadcrumbs  (Read 3927 times)

0 Members and 1 Guest are viewing this topic.

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Modernization breadcrumbs
« on: June 05, 2012, 03:12:11 pm »

At this point breadcrumbs in the CPG are not fully functional:
home>cat>album

I want them to appear here so:
home>cat>album>title image

For this, I in the file functions.inc.php made changes:
Code: [Select]
global $CONFIG,$CURRENT_ALBUM_DATA, $CURRENT_CAT_NAME;changed
Code: [Select]
global $CONFIG,$CURRENT_ALBUM_DATA, $CURRENT_PIC_DATA, $CURRENT_CAT_NAME;
He added

Code: [Select]
//Add Link for album if aid is set
    if (isset($CURRENT_ALBUM_DATA['aid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_ALBUM_DATA['title'];
    }

Code: [Select]
//Add Link for album if aid is set
    if (isset($CURRENT_ALBUM_DATA['aid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_ALBUM_DATA['title'];
    }

//Add Link for picture if pid is set
    if (isset($CURRENT_PIC_DATA['pid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"displayimage.php?pid=".$CURRENT_PIC_DATA['pid']."\">".$CURRENT_PIC_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_PIC_DATA['title'];
    }
But breadcrumbs are displayed as:
home>cat>title image
Help tweaking before the end of the crumbs. Thank you
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Modernization breadcrumbs
« Reply #1 on: June 05, 2012, 03:46:24 pm »

In your newly added code block, find
Code: [Select]
] =and replace with
Code: [Select]
] .=(twice).
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Modernization breadcrumbs
« Reply #2 on: June 05, 2012, 04:09:11 pm »

Oh thank you, it turns out it was all so simple :)
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Modernization breadcrumbs
« Reply #3 on: June 05, 2012, 04:10:33 pm »

Only now there was small problem, album and title image connected one line.
http://s003.radikal.ru/i203/1206/e7/2b99a69f609c.jpg

At what point should put a sign ">" ?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Modernization breadcrumbs
« Reply #4 on: June 05, 2012, 04:22:20 pm »

Try this code:
Code: [Select]
    //Add Link for album if aid is set
    if (isset($CURRENT_ALBUM_DATA['aid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_ALBUM_DATA['title'];
        $cat_order++;
    }
   
    //Add Link for picture if title is set
    if (isset($CURRENT_PIC_DATA['title'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"displayimage.php?pid=".$CURRENT_PIC_DATA['pid']."\">".$CURRENT_PIC_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_PIC_DATA['title'];
        $cat_order++;
    }
(not tested).
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Modernization breadcrumbs
« Reply #5 on: June 05, 2012, 04:25:00 pm »

It works, thanks. By the way it seems to me that the new version of the CPG is better to implement this kind of breadcrumbs, it is better for SEO  ;)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Modernization breadcrumbs
« Reply #6 on: June 05, 2012, 04:26:46 pm »

Please post that suggestion in the feature requests board. Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.145 seconds with 19 queries.