Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #41 (permalink)  
Old 11-06-2007, 10:00 AM
AnAlienHolakres3's Avatar
Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 118
Thanks: 7
Thanked 112 Times in 40 Posts
Send a message via ICQ to AnAlienHolakres3
Small Update for discarded links

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
__________________
=Everything that has a beginnig has an end=
=Nevere stop fighting=

Site: http://www.vselink.cz
Reply With Quote
  #42 (permalink)  
Old 11-09-2007, 08:57 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 117
Thanks: 8
Thanked 35 Times in 8 Posts
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, 05:18 PM
AnAlienHolakres3's Avatar
Coder
 
Join Date: Jul 2007
Location: Prague
Posts: 118
Thanks: 7
Thanked 112 Times in 40 Posts
Send a message via ICQ to AnAlienHolakres3
Latest SVN

Please could you be more specific?
__________________
=Everything that has a beginnig has an end=
=Nevere stop fighting=

Site: http://www.vselink.cz
Reply With Quote
  #44 (permalink)  
Old 11-12-2007, 07:49 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 117
Thanks: 8
Thanked 35 Times in 8 Posts
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, 09:36 AM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 117
Thanks: 8
Thanked 35 Times in 8 Posts
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, 12:18 PM
New Pligger
Pligg Version: 9.8
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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 01:48 PM.. Reason: Image gone
Reply With Quote
  #47 (permalink)  
Old 11-15-2007, 07:30 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 117
Thanks: 8
Thanked 35 Times in 8 Posts
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, 10:28 AM
New Pligger
 
Join Date: Oct 2007
Posts: 13
Thanks: 0
Thanked 2 Times in 2 Posts
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 04:35 PM..
Reply With Quote
The Following User Says Thank You to cameron65 For This Useful Post:
  #49 (permalink)  
Old 11-29-2007, 10:47 AM
Pligg Donor
 
Join Date: Jan 2007
Posts: 86
Thanks: 6
Thanked 2 Times in 2 Posts
some issues with ie 6.0

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, 05:56 PM
Casual Pligger
Pligg Version: coquito
Pligg Template: plw
 
Join Date: Oct 2007
Posts: 52
Thanks: 6
Thanked 3 Times in 2 Posts
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 06:13 PM..
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta 9.9.5- Bug in Categories & Latest comments sidebar modules kallu Bug Report 3 08-07-2008 07:28 AM
categories disappear in the sidebar mushmoosh General Help 5 05-07-2008 12:31 AM
How to start with sidebar categories closed? longcountdown General Help 0 02-15-2008 12:16 PM
how to move categories from sidebar to header cute2008 "yget" 12 12-17-2007 04:03 PM
Alphabetize Sidebar Categories shackbase General Help 2 11-16-2007 06:56 AM


Search Engine Friendly URLs by vBSEO 3.2.0