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: Still Breadcrumb  (Read 4277 times)

0 Members and 1 Guest are viewing this topic.

jdbaranger

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 169
    • Accro-Photo
Still Breadcrumb
« on: November 30, 2003, 08:20:26 pm »

Hi,

I've got a problem with breadcrumbs.
I've activated the breadcrumb in admin panel, But :

Breadcrumb is OK Here :
http://www.accro-photo.com/galeries/displayimage.php?album=41&pos=0
But not Here :
http://www.accro-photo.com/galeries/displayimage.php?album=90&pos=0

The difference :
album 41 is under a user gallery
album 90 is a root album

Any idea ?

Thanks for your Help

Jean-Denis
Logged
Jean-Denis

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Still Breadcrumb
« Reply #1 on: November 30, 2003, 08:56:50 pm »

I visited your site, and got the following warning on the page where there was no breadcrumb;
Quote
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\web\www.accro-photo.com\mystats\hit.php on line 405


Don't know how to cure it though, sorry.  Hopefully one of the guru's can help with this.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

jdbaranger

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 169
    • Accro-Photo
Still Breadcrumb
« Reply #2 on: November 30, 2003, 09:07:52 pm »

This message is not important, it appears when the mystats statistics cookie is not on your computer.

Thanks for having tried

Jean-Denis
Logged
Jean-Denis

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Still Breadcrumb
« Reply #3 on: December 02, 2003, 10:49:31 pm »

What would you like it to be?
To me the breadcrumb seems normal :roll:
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Still Breadcrumb
« Reply #4 on: December 02, 2003, 10:56:44 pm »

yes, it's ok now, but wasn't when I visited first time.  JD must have found and fixed the problem.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Still Breadcrumb
« Reply #5 on: December 03, 2003, 12:04:56 am »

@Jean-Denis: if you fixed the problem by yourself, please post how.

GauGau
Logged

jdbaranger

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 169
    • Accro-Photo
Still Breadcrumb
« Reply #6 on: December 03, 2003, 07:52:46 am »

Quote from: "gaugau"
@Jean-Denis: if you fixed the problem by yourself, please post how.

GauGau


Yes, i founf the solution yesterday night, based on CVS :wink:

***************************
BREADCRUMBS FOR ROOT ALBUMS
***************************

In functions.inc.php

search for :

Code: [Select]

        //Add Link for album if $album is set
                if (is_numeric($album)){
                        $link = "<a href=thumbnails.php?album=$album>".$CURRENT_ALBUM_DATA['title']."</a>";
                        $breadcrumb .= ' > ' . $link;
                        $BREADCRUMB_TEXT .= ' > ' . $CURRENT_ALBUM_DATA['title'];
                }
        }
}


Replace with :

Code: [Select]

        }else{ //Dont bother just add the Home link  to breadcrumb
                $breadcrumb = '<a href=index.php>'.$lang_list_categories['home'].'</a>';
                $BREADCRUMB_TEXT = $lang_list_categories['home'];
        }
        //Add Link for album if aid is set
        if (isset($CURRENT_ALBUM_DATA['aid'])){
                $link = "<a href=thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid'].">".$CURRENT_ALBUM_DATA['title']."</a>";
                $breadcrumb .= ' > ' . $link;
                $BREADCRUMB_TEXT .= ' > ' . $CURRENT_ALBUM_DATA['title'];
        }
}


In DisplayImage.php

Search for :

Code: [Select]

    if (is_numeric($album)) {
        $cat = - $album;
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $cat = - $album;
    } else {
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
    }
}


Replace with :

Code: [Select]

if (is_numeric($album)) {
    $result = db_query("SELECT category, title, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='$album'");
    if (mysql_num_rows($result) > 0) {
        $CURRENT_ALBUM_DATA_SAV = $CURRENT_ALBUM_DATA;
        $CURRENT_ALBUM_DATA = mysql_fetch_array($result);
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $cat = - $album;
          $CURRENT_ALBUM_DATA = $CURRENT_ALBUM_DATA_SAV;
    }
} elseif (isset($cat) && $cat) { // Meta albums, we need to restrict the albums to the current category
    if ($cat < 0) {
        $result = db_query("SELECT category, title, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='" . (- $cat) . "'");
        if (mysql_num_rows($result) > 0) {
            $CURRENT_ALBUM_DATA = mysql_fetch_array($result);
            $actual_cat = $CURRENT_ALBUM_DATA['category'];
        }
        $ALBUM_SET .= 'AND aid IN (' . (- $cat) . ') ';
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $CURRENT_CAT_NAME = $CURRENT_ALBUM_DATA['title'];
    } else {
        $album_set_array = array();
        if ($cat == USER_GAL_CAT)
            $where = 'category > ' . FIRST_USER_CAT;
        else
            $where = "category = '$cat'";

        $result = db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE $where");
        while ($row = mysql_fetch_array($result)) {
            $album_set_array[] = $row['aid'];
        } // while
        if ($cat >= FIRST_USER_CAT) {
            $user_name = get_username($cat - FIRST_USER_CAT);
            $CURRENT_CAT_NAME = sprintf($lang_list_categories['xx_s_gallery'], $user_name);
        } else {
            $result = db_query("SELECT name FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = '$cat'");
            if (mysql_num_rows($result) == 0) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_cat'], __FILE__, __LINE__);
            $row = mysql_fetch_array($result);
            $CURRENT_CAT_NAME = $row['name'];
        }
        get_subcat_data($cat, $album_set_array, $CONFIG['subcat_level']);
        // Treat the album set
        if (count($album_set_array)) {
            $set = '';
            foreach ($album_set_array as $album_id) $set .= ($set == '') ? $album_id : ',' . $album_id;
            $ALBUM_SET .= "AND aid IN ($set) ";
        }

        breadcrumb($cat, $breadcrumb, $breadcrumb_text);
    }
  }
}


***************************
MAKE INVIBLE BREADCRUMB IN INDEX.PHP
***************************

Dans Index.php

Search for :

Code: [Select]

if ($breadcrumb != '' || count($cat_data) > 0) theme_display_breadcrumb($breadcrumb, $cat_data);


Replace with :
 
Code: [Select]

if (($breadcrumb != '' || count($cat_data) > 0) && ($breadcrumb != '<a href=index.php>'.$lang_list_categories['home'].'</a>')) theme_display_breadcrumb($breadcrumb, $cat_data);


Jean-Denis
Logged
Jean-Denis
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.