Still Breadcrumb Still Breadcrumb
 

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

Main Menu

Still Breadcrumb

Started by jdbaranger, November 30, 2003, 08:20:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jdbaranger

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
Jean-Denis

Casper

I visited your site, and got the following warning on the page where there was no breadcrumb;
QuoteWarning: 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.
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

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

Thanks for having tried

Jean-Denis
Jean-Denis

Titooy

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

Casper

yes, it's ok now, but wasn't when I visited first time.  JD must have found and fixed the problem.
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

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

GauGau

jdbaranger

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 :


        //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 :


        }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 :


    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 :


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 :


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


Replace with :
 

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


Jean-Denis
Jean-Denis