Sidebar Categories Enhancement AddOn

Register an Account
Reply
 
Thread Tools Display Modes
  #41 (permalink)  
Old 11-06-2007, 11:00 AM
AnAlienHolakres3's Avatar
Pligg Donor/Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 116
Send a message via ICQ to AnAlienHolakres3
If you do not want to be "discarded" links displayed in counts, open your dbtree.php in libs fodler,find sidebarextracats function and replace original code:
PHP Code:
//get num of links in root category (and its subcats) (ALL-ALWAYS)
              
foreach ($roots as $roots_id){                
                     
$root_count_array_total[$roots_id->category_id]= 
                     
$db->get_var("SELECT count(link_id) FROM ".table_links." WHERE link_category=".$roots_id->category_id.
                     
" OR link_category IN (SELECT distinct subcat.category_id FROM ".table_categories.
                                            
" JOIN ".table_categories." subcat ON subcat.category_parent=".table_categories.
                                            
".category_id WHERE ".table_categories.".category_id=".$roots_id->category_id.
                                            
" UNION SELECT distinct subcat2.category_id FROM ".table_categories.
                                            
" JOIN ".table_categories." subcat ON subcat.category_parent=".table_categories.".category_id".
                                            
" JOIN ".table_categories." subcat2 ON subcat2.category_parent=subcat.category_id".
                                            
" WHERE ".table_categories.".category_id=".$roots_id->category_id.")"); 
with
PHP Code:
//get num of links in root category (and its subcats) (ALL-ALWAYS)
              
foreach ($roots as $roots_id){                
                     
$root_count_array_total[$roots_id->category_id]= 
                     
$db->get_var("SELECT count(link_id) FROM ".table_links." WHERE link_status NOT LIKE 'discard' AND (link_category=".$roots_id->category_id.
                     
" OR link_category IN (SELECT distinct subcat.category_id FROM ".table_categories.
                                            
" JOIN ".table_categories." subcat ON subcat.category_parent=".table_categories.
                                            
".category_id WHERE ".table_categories.".category_id=".$roots_id->category_id.
                                            
" UNION SELECT distinct subcat2.category_id FROM ".table_categories.
                                            
" JOIN ".table_categories." subcat ON subcat.category_parent=".table_categories.".category_id".
                                            
" JOIN ".table_categories." subcat2 ON subcat2.category_parent=subcat.category_id".
                                            
" WHERE ".table_categories.".category_id=".$roots_id->category_id."))"); 
Hope it helps
Reply With Quote
  #42 (permalink)  
Old 11-09-2007, 09:57 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
The latest updates to SVN broke your code. The problem appears to be with dbtree.php
Reply With Quote
  #43 (permalink)  
Old 11-10-2007, 06:18 PM
AnAlienHolakres3's Avatar
Pligg Donor/Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 116
Send a message via ICQ to AnAlienHolakres3
Please could you be more specific?
Reply With Quote
  #44 (permalink)  
Old 11-12-2007, 08:49 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Well, I did the upgrade and the subcategories all disappeared. The problem appears to be caused in dbtree.php from the following:

OLD VERSION

Code:
$sql = 'SELECT * FROM `'.$table.'` WHERE lft BETWEEN '.$row->lft.' AND '.$row->rgt.' and category_enabled <> 0 ORDER BY lft ASC;';
$result = $db->get_results($sql);

NEW VERSION

Code:
$result = get_cached_between($row->lft, $row->rgt);
Reply With Quote
  #45 (permalink)  
Old 11-14-2007, 10:36 AM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Just noticed that the categories in the Pligg demo are gone also. Assuming that the Pligg demo uses the latest SVN, it appears that there's a bug in the latest SVN and not your mod.
Reply With Quote
  #46 (permalink)  
Old 11-15-2007, 01:18 PM
New Pligger
Pligg Version: 9.8
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 3
Does anyone have any quick thoughts as to why this display problem might be happening? I think I followed the instructions for v0.3 correctly but who knows.






Image show up now?

Last edited by vivevtvivas; 11-15-2007 at 02:48 PM. Reason: Image gone
Reply With Quote
  #47 (permalink)  
Old 11-15-2007, 08:30 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Okay, the newest SVN is out for dbtree and it's still not working with your script. This time the main categories show up in an unaesthetic fashion and the subcategories don't show up at all.
Reply With Quote
  #48 (permalink)  
Old 11-16-2007, 11:28 AM
New Pligger
 
Join Date: Oct 2007
Posts: 12
Quote:
Originally Posted by vivevtvivas View Post
Does anyone have any quick thoughts as to why this display problem might be happening? I think I followed the instructions for v0.3 correctly but who knows.






Image show up now?
I'm actually looking at this same problem right now. From what I can see, I don't think <ul> and <li> tags are being closed properly (v9.8). I will post what I find if someone doesn't beat me to it.


Edit: It does have to do with properly closing the tags. When the last category has a sub category, it doesn't close the tags. If your last category does not have a sub cat, then it works properly. I'm trying to find a solution but I don't use Smarty, so it's a pain to figure out.


Edit: My solution
There may be a better way to solve this, and I don't know if it works for 3 levels deep because I'm not using them, but here is what I did.

v9.8
categories.tpl

Find:
Code:
          {assign var=lastspacer value=$cat_array[thecat].spacercount}
{/section}
Below it place
Code:
{if $cat_array[thecat].spacercount eq "" and $lastspacer ne "1"}</li></ul></div>{/if}

Last edited by cameron65; 11-17-2007 at 05:35 PM.
Reply With Quote
  #49 (permalink)  
Old 11-29-2007, 11:47 AM
Pligg Donor
 
Join Date: Jan 2007
Posts: 86
It have some issues with ie6.0 about layout.
You can find it at site Pligg Beta 9

Please see attached image.
Attached Thumbnails
Sidebar Categories Enhancement AddOn-rrrrrrrrrrrrrrrrr.png  
Reply With Quote
  #50 (permalink)  
Old 11-29-2007, 06:56 PM
Casual Pligger
Pligg Version: coquito
Pligg Template: plw
 
Join Date: Oct 2007
Posts: 48
I have this categories.tpl, but i don't know how to do it:.
(digitalnature template)

PHP Code:
<li>
  <
div class="box" id="categorybox">
    <
h1><span class="expand"><a id="expcat" class="expand-up"></a></span><class="htitle">{#PLIGG_Visual_Category_Title#}</a></h1>
    
<ul id="categorynav">
      {
section name=thecat loop=$cat_array start=1}
      {if 
$lastspacer eq ""}
      {
assign var=lastspacer value=$cat_array[thecat].spacercount}
      {/if}
      <
li> {if $cat_array[thecat].spacercount lt $lastspacer}{$cat_array[thecat].spacerdiff|repeat_count:'</li>
    </ul>
    '
}{/if}
    {if 
$cat_array[thecat].spacercount gt $lastspacer}
    <
ul style="padding-right:12px">
      <
li>{/if} {if $pagename eq "upcoming"} <a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:0">{$cat_array[thecat].name}</a>
          {else} <
a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:0;">{$cat_array[thecat].name}</a> {/if}        
        {
assign var=lastspacer value=$cat_array[thecat].spacercount}
        {/
section}</li>
    </
ul>
  </
div>
</
li

Last edited by Naranja; 11-29-2007 at 07:13 PM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wistie Move Categories to Sidebar w/RSS MissDanni Questions and Comments 0 07-31-2009 10:33 AM
Beta 9.9.5- Bug in Categories & Latest comments sidebar modules kallu Questions and Comments 3 08-07-2008 08:28 AM
How to start with sidebar categories closed? longcountdown Questions and Comments 0 02-15-2008 01:16 PM
Alphabetize Sidebar Categories shackbase Questions and Comments 2 11-16-2007 07:56 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development