Jump to content

Fixed minor Category bug


Guest Roger Huston

Recommended Posts

Guest Roger Huston

Hello,

There is a minor bug in /includes/boxes/categories.inc.php. Most people will never see it, but if you have CSS code that depends on the proper use of Category ID's, then this will help you.

Near line 67: OLD

$box_content->parse('categories.a.li_start');

$box_content->assign('DATA', $treeData[$i]);

$box_content->parse('categories.a');

if ($treeData[$i]['level']<$treeData[$i+1]['level']) {

$box_content->parse('categories.a.ul_start');

}

Near line 67: NEW - first two lines switched.

$box_content->assign('DATA', $treeData[$i]);

$box_content->parse('categories.a.li_start');

$box_content->parse('categories.a');

if ($treeData[$i]['level']<$treeData[$i+1]['level']) {

$box_content->parse('categories.a.ul_start');

}

The problem I had was that the first time through the loop, DATA was not assigned the CatID so it went through the loop with no value. The second time through the loop, the CAT ID for the second category was that of the first.

In my template, I use custom icons for each top level category. By fixing this, I could use class="iconID{DATA.cat_id}" and have the category ID match up to the Admin value.

I realize this is a minor fix, I post it here as I am not sure how to submit a bug.

- Roger

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...