Author Topic: [REQ] List links for all Categories and Subcategories in one page.  (Read 78787 times)

0 Members and 1 Guest are viewing this topic.

Offline Albert

  • Newbie
  • *
  • Posts: 45
    • View Profile
A mod to list all categories and subcateries in one page would be great.  Just like the administrator can see on the Control Panel when Edit Category is clicked.

This way member can take at everything on the website in one single page.

Cheers,

Albert Abrantes

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
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #1 on: July 02, 2005, 01:01:26 AM »
a dropdown is not enough?
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 Albert

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #2 on: July 02, 2005, 09:41:35 AM »
Well, let's call it a replacement.. hehe

Cheers,

Albert Abrantes

Offline Albert

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #3 on: July 04, 2005, 01:03:10 AM »
Is this something hard to do?

Offline hien

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #4 on: July 04, 2005, 01:35:04 AM »
i am looking for this as well... use for sitemap

Offline Albert

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #5 on: July 09, 2005, 06:50:17 PM »
yeah... And for images already have it for administrator... so I think it would be fairly simple to do...

Cheers,

Albert Abrantes

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
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #6 on: July 09, 2005, 07:34:19 PM »
ok, guys, here is a "ripoff" from ACP -> Edit categories

1) insert into includes/functions.php:
Code: [Select]
function get_category_html_bits($cat_id = 0, $cid = 0, $depth = 1) {
  global $site_db, $html_cat_cache, $cat_cache, $site_sess;

  if (!isset($html_cat_cache[$cid])) {
    return "";
  }
  $category_list = "";
  foreach ($html_cat_cache[$cid] as $key => $category_id) {
    if (check_permission("auth_viewcat", $category_id)) {
      if ($depth > 1) {
        $category_list .= str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $depth - 1)."<img src=\"".get_gallery_image("folder_path.gif")."\" alt=\"\">\n";
      }
      $category_list .= "<img src=\"".get_gallery_image("folder.gif")."\" alt=\"\"><b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$category_id)."\">".$cat_cache[$category_id]['cat_name']."</a></b><br />";
      $category_list .= get_category_html_bits($cat_id, $category_id, $depth + 1);
    }
  }
  unset($html_cat_cache[$cid]);
  return $category_list;
}

Then insert into index.php or any other files where u want the category list to be displayed, above
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
this block:
Code: [Select]
$html_cat_cache = $cat_parent_cache;
$site_template->register_vars(array(
  "categories_list" => get_category_html_bits()
));

3) Now, in the "main" template (home.html) that is associates with the file u've insert the code (index.php) use this tag: {categories_list}

P.S. almost forgot, copy admin/images/folder_path.gif into templates/<your template>/images/ folder
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 mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #7 on: July 09, 2005, 11:17:35 PM »
ok, V@no ...  :wink:

it is a nice Addon to give the websitevisitor a good overview of the categories ... (I still added images and hits) ...  :D
for navigation visitors can still use the dropdownmenu as quickjump !

thanks mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Legendary

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.idols-unlimited.com
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #8 on: July 19, 2005, 06:17:54 PM »
mawenzi:  How were you able to add the number of images and number of hits to your sitemap?  Would you mind sharing the code?

Thanks

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #9 on: July 19, 2005, 09:19:13 PM »
hi Legendary,

nice folder_path.gif in your sitemap ...  :wink:

... for number of category-images and category-hits after category-name
replace this code-line:
Code: [Select]
$category_list .= "<img src=\"".get_gallery_image("folder.gif")."\" alt=\"\"><b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$category_id)."\">".$cat_cache[$category_id]['cat_name']."</a></b><br />";
with this :
Code: [Select]
$category_list .= "<img src=\"".get_gallery_image("folder.gif")."\" alt=\"\"><b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$category_id)."\">".$cat_cache[$category_id]['cat_name']."</a></b> - ( Images: ".$cat_cache[$category_id]['num_images']." ; Hits: ".$cat_cache[$category_id]['cat_hits']." )<br />";

mawenzi


Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Legendary

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.idols-unlimited.com
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #10 on: July 19, 2005, 09:36:57 PM »
yeah...i saw it try to save it but couldn't.  So I had to draw it, took me a while..lol

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #11 on: July 20, 2005, 11:45:07 PM »
nothing to say - it works!  :lol:

vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #12 on: July 21, 2005, 01:51:34 AM »
nothing to say

Vincent ... mmm ... und wie wäre es mit ... thanks ...  :wink:

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #13 on: July 21, 2005, 09:20:05 AM »
@Mawenzi

Sorry  :oops:  :oops:  :oops:

THANKS A LOT FOR THIS MOD

Vincent  :wink:
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #14 on: July 21, 2005, 12:48:40 PM »
@mawenzi
wäre es möglich hinter dem Kategorie name die Beschreibung einzufügen?

wäre auch cool das dort wo neue Bilder sind die schrift gelb ist oder das New hinten ansteht wie bei den fotos?

gruss
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods