Author Topic: Category listing in details.php  (Read 8292 times)

0 Members and 1 Guest are viewing this topic.

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
Category listing in details.php
« on: January 25, 2003, 12:02:55 AM »
Hello,

The function {categories} doesn't work in details.php. I know this is because there are no more categories "left".
But I would like to have a category listing of one level up in details.php.
Can this be done?

Kind regards,

Piet
www.totaaldigitaal.nl

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
Category listing in details.php
« Reply #1 on: January 25, 2003, 12:21:53 AM »
not sure if this gonna work, but try add this code in details.php
Code: [Select]
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$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 pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
Category listing in details.php
« Reply #2 on: January 25, 2003, 12:29:25 AM »
Almost.
It only shows the first "main" categories.
Not the ones one level higher then the category the user is in.

But thanxs. Must be a way to .....

Piet

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
Category listing in details.php
« Reply #3 on: January 25, 2003, 12:53:21 AM »
its shows main categories, because it asked for it... :wink:
Code: [Select]
$categories = get_categories(0);  where (0) is to show main categories.
try this:
Code: [Select]
$categories = get_categories($cat_id);
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 pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
Category listing in details.php
« Reply #4 on: January 26, 2003, 05:21:51 PM »
doesn't work :(

It says no categories found.

I think this is logical because the script is searching for categories in/under the current category.
I want people to be able to see on the left side the links to the categories at the same level as they are in.
This way people can click to the other subcategories of the same game.
And browsing through the pictures is a little bit more idiot proof.

Example:
category A: Game dated 24-1-2003
subcategorie 1: Team 1
subcategorie 2: Team 2
subcategorie 3: Team 3

So if people are in the subcategorie 2 (thumbnails or details) there should be a list of the subcategories 1,2 and 3 in the table on the left.

You can get a look at what I am trying to achieve on http://test.totaaldigitaal.nl/gallery/details.php?image_id=2436 (test-site).

Maybe I should use some coding that is used in the admin panel ?

Hope somebody can help me with this.

kind regards,
Piet

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
Category listing in details.php
« Reply #5 on: January 27, 2003, 09:07:20 PM »
in categories.php in the admin section there is a variable $depth.
Is this usable in the frontend in any way?

Piet

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
Category listing in details.php
« Reply #6 on: February 06, 2003, 04:28:35 PM »