4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: tSlater on December 19, 2002, 04:44:51 AM
-
I have a lot of categories which are organised like this:
Ah! My Goddess
+Images
+Wallpapers
+Avatars
+Video
+Audio
Spirited Away
+Images
+Wallpapers
+Avatars
+Video
etc..
When an image appears in a search or is shown as the random image, it shows the thumbnail, Image name, category it is in, etc.. Well, it is kind of a pain to see that an image is from a category called "Images" when I have over 50 ategories by that same name. =P So.. is there any way I can get a category's parent category too? =]
Thanks in advance
-
Try this:
Open includes/functions.php.
1. Search this part:
else {
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
and add this below:
$cat_parent_id = 0;
$cat_parent_name = "";
$cat_parent_url = "";
if ($cat_cache[$image_row['cat_id']]['cat_parent_id'] != 0) {
$cat_parent_id = $cat_cache[$image_row['cat_id']]['cat_parent_id'];
$cat_parent_name = $cat_cache[$cat_parent_id]['cat_name'];
$cat_parent_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_parent_id);
}
2. Search this line:
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
and add this below:
"cat_parent_name" => $cat_parent_name,
"cat_parent_url" => $cat_parent_url,
Then open the template thumbnail_bit.html and replace this
<a href="{cat_url}">{cat_name}</a>
with
{if cat_parent_name}<a href="{cat_parent_url}">{cat_parent_name}</a> / {endif cat_parent_name}<a href="{cat_url}">{cat_name}</a>
Do the same for random_image.html and random_cat_image.html.
Good luck,
Jan