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
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.
This message is not important, it appears when the mystats statistics cookie is not on your computer.
Thanks for having tried
Jean-Denis
What would you like it to be?
To me the breadcrumb seems normal :roll:
yes, it's ok now, but wasn't when I visited first time. JD must have found and fixed the problem.
@Jean-Denis: if you fixed the problem by yourself, please post how.
GauGau
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.phpsearch 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.phpSearch 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.phpSearch 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