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

0 Members and 1 Guest are viewing this topic.

Offline FrankUSA

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #60 on: September 11, 2008, 06:25:25 PM »
Sorry if my question is confusing you.

Question: I use your fixed code but when I click on New Image page, I do receive an error for some reason.

Question 2: How do you insert the class style which is same color as the center categories (main categories in center) ?

Let me know if my question is not clear enough thanks bro. Check the error below

Quote
Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

Notice: Undefined index: num_images in /home/content/xxx/html/coupons/includes/functions.php on line 40

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 #61 on: September 12, 2008, 12:57:45 AM »
1) unless you did "other" modifications out of this topic I see no reason for these errors based on the code on first page. Please be more specific which code you are referring to. Also, its a good idea whenever you see error messages, quote the exact error message (as you did) AND provide part of code from the file where error occur 10 lines above and 10 lines below the error.
2) when it comes to styles it is very hard to envision what one is talking about without seeing it on a screenshot or even better on the site.
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 satine88

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
Re: [REQ] List links for all Categories and Subcategories in one page.
« Reply #62 on: September 23, 2008, 06:49:40 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

Hello :)

How do (edit files) if I put this code in a new
files?

Comment faire (quel fichier éditer) si j'ai placé ce code dans un nouveaux fichiers ?



---------------------->>> in page_header.php :)
« Last Edit: September 24, 2008, 09:02:34 PM by satine88 »