Author Topic: Categories on every page?  (Read 16003 times)

0 Members and 1 Guest are viewing this topic.

Offline EnglishRider

  • Pre-Newbie
  • Posts: 2
    • View Profile
Categories on every page?
« on: March 11, 2003, 09:15:07 PM »
Hello,
I am trying to move the categories listing onto the left hand side of the page. This works fine for the first page, but they do not show up. However when I put the random images statement under it, that feature shows up fine on all pages. Am I missing a setting, or does anyone know how to change the code to allow the categories to be shown on all pages? Example here -> http://www.bridlepathdesigns.com/temp/photos/ ... works on that page, but won't show up on http://www.bridlepathdesigns.com/temp/photos/details.php?image_id=8 (excuse the mess, haven't finished editing all the pages). The category statement is in my header file.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Categories on every page?
« Reply #1 on: March 12, 2003, 12:31:54 AM »
in the main .php files witch u are having problem with (such as details.php, member.php, lightbox.php and so on) at the end find:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

add before:
Code: [Select]
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline EnglishRider

  • Pre-Newbie
  • Posts: 2
    • View Profile
Categories on every page?
« Reply #2 on: March 12, 2003, 03:55:05 PM »
Perfect, thank you!
- Carole

Offline matlex

  • Pre-Newbie
  • Posts: 5
    • View Profile
Categories on every page?
« Reply #3 on: April 04, 2003, 05:05:28 PM »
Quote from: V@no
in the main .php files witch u are having problem with (such as details.php, member.php, lightbox.php and so on) at the end find:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

add before:
Code: [Select]
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);


By reading post
http://4homepages.de/forum/viewtopic.php?t=4582


I have tried and its working great on all pages apart of categories.php
When I put it everything get mixedup... like
{cat_name} will show same name for every category
{cat_description} same as above
Subcategory doesn't show at all instead show up again main categories

Is it any solution can be found?
Please help

Thank you
Matlex

Offline speedway

  • Newbie
  • *
  • Posts: 14
    • View Profile
Categories on every page?
« Reply #4 on: April 29, 2003, 04:36:41 PM »
Quote from: matlex

By reading post
http://4homepages.de/forum/viewtopic.php?t=4582


I have tried and its working great on all pages apart of categories.php
When I put it everything get mixedup... like
{cat_name} will show same name for every category
{cat_description} same as above
Subcategory doesn't show at all instead show up again main categories

Is it any solution can be found?
Please help

Thank you
Matlex


Matlex

I have used this in categories.php:

Code: [Select]

//-----------------------------------------------------
//--- Show Main Categories ----------------------------
//-----------------------------------------------------
$main_categories = get_categories(0);
if (!$main_categories)  {
  $main_categories = $lang['no_categories'];
}
$site_template->register_vars("main_categories", $main_categories);
unset($main_categories);

basically I just "renamed" anything with "categories" to "main_categories" and placed {main_categories} in the template where I wanted it - works great AND still gives you any subcats....

Cheers

Offline eshpro

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • gallery.eshpro.com
Re: Categories on every page?
« Reply #5 on: October 04, 2005, 08:41:25 PM »
What??? nothing needs to be fixed.. i just want to add my category list on every page.. like details.php but it doesn't work .. :/

Offline animal lover

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Categories on every page?
« Reply #6 on: May 25, 2009, 05:21:50 PM »
I know this is an old thread but I have this problem.  I have changed all the .php pages as directed above and they work great, however, there is a problem with the category.php page as explained above.  This below does not work. 
Quote
Matlex

I have used this in categories.php:

 
//-----------------------------------------------------
//--- Show Main Categories ----------------------------
//-----------------------------------------------------
$main_categories = get_categories(0);
if (!$main_categories)  {
  $main_categories = $lang['no_categories'];
}
$site_template->register_vars("main_categories", $main_categories);
unset($main_categories);
 

basically I just "renamed" anything with "categories" to "main_categories" and placed {main_categories} in the template where I wanted it - works great AND still gives you any subcats....

Cheers


Unless I am missing something.  Does anyone know how to change the categories.php page to show the categories and with the category links working correctly.  Thanks

Offline animal lover

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Categories on every page?
« Reply #7 on: May 25, 2009, 05:33:49 PM »
Okay okay.  I found it.  I didnt think I would get a reply on an old thread like this so I refined my search phrase and I found this which works perfectly

http://www.4homepages.de/forum/index.php?topic=23516.0

Just to clarify - you need to change your categories.html (or any other template) to  categories_all 

Thanks very much.

Offline croking

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: Categories on every page?
« Reply #8 on: March 02, 2010, 12:13:27 PM »
hi v@no,

works fine but i have one problem with this mod.

on categories and details the {cat_name} is always just the last category
from my category list.
example: i have three categories:
  • category1
  • category2
  • category3

the {cat_name} shows always category3 on categories and details pages

can you help me?

CroKing