Control Panel
Login to Begin to Talk!





Click Here to Register!
Advertisements



Go Back   Site Sift Forums > Site-Sift > Mods

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-03-2007, 07:55 AM
jojomart jojomart is offline
Clueless
 
Join Date: Oct 2007
Posts: 23
Arrow Show subcategories and # of links in directory

Thought I should probably put this in the Mods forum as well!

This will allow you to show the number of subcategories in a category, as well as the number of links.

Ex: Web Directories (4) (20)

First is the number of subs and second is the number of links.

In subcat.php

Locate:

Code:
while($subcategory = mysql_fetch_assoc($subcat)){ //fetch children $sql = "select * from pages where active = 'Yes' and catID = '" . $subcategory['id'] . "'"; //echo $sql; $R = mysql_query($sql,$myconn) or die(mysql_error()); //print children links and total subcategories of children $sql = "select * from settings where id = '1'"; $S = mysql_query($sql,$myconn); $settings = mysql_fetch_assoc($S); if($settings['stats'] == '1') $stats = ' ('.mysql_num_rows($R).')';


and replace the code with this:

Code:
while($subcategory = mysql_fetch_assoc($subcat)){ //fetch children $sql = "select * from pages where active = 'Yes' and catID = '" . $subcategory['id'] . "'"; //echo $sql; $R = mysql_query($sql,$myconn) or die(mysql_error()); //print children links and total subcategories of children $sql = "select * from settings where id = '1'"; $S = mysql_query($sql,$myconn); $settings = mysql_fetch_assoc($S); if($settings['stats'] == '1') $sql = "select * from categories where fatherID = '" . $subcategory['id'] . "'"; $Results = mysql_query($sql,$myconn) or die(mysql_error()); $subcats = mysql_query($sql,$myconn); $stats = ' ('.mysql_num_rows($subcats).') ('.mysql_num_rows($R).')';


This will show the subcategories of the subcategory, as well as the links under the subcategory.

I'm sure someone will be able to use this mod.

Joanne
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -7. The time now is 02:58 AM.


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Site Sift Media, Inc.