Support Forums

Code for listing total for dtree nav

This is a discussion on Code for listing total for dtree nav within the v3.1 Modules & Modifications forums, part of the Legacy Help & Support category; First off, let me say that 68C ROCKS! I've looked everywhere for a for a similar thread, but no luck. ...


Go Back   68 Classifieds Forums > Archives > Legacy Help & Support > v3.1 Modules & Modifications

 
 
Thread Tools Display Modes
Old 07-05-2007, 07:51 PM   #1
Junior Member
 
Join Date: May 2007
Posts: 22
Rep Power: 11
midoplaz is on a distinguished road
Default Code for listing total for dtree nav

First off, let me say that 68C ROCKS!

I've looked everywhere for a for a similar thread, but no luck.

I am looking for a code to display the number of listings for the dtree nav found in the blue layout. (using V3.1.7)
http://midoplaza.com/classifieds68

I create the following file with the following code written by Eric:
But How do you call it within the javascript?
Code:
<?php
/**
* smarty_function_categories_ul
*
* This function is useful for using your categories in the navigation.
*
* All source code & content (c) Copyright 2006, 68 Classifieds
* unless specifically noted otherwise.
*
* @package 68classifieds
* @author**Eric Barnes
* @copyright 68 Classifieds
* @link http://www.68classifieds.com
* @$Revision: 1.1 $
* @Updated: $Date: 2007/01/08 19:12:22 $
*/
function smarty_function_categories_ul($params, &$smarty)
{
    global $db;
    global $arr_childs;
    $show_total = 'N';
    foreach ($params as $_key=>$_value)
    {
        switch ($_key)
        {
        case 'depth':
        $$_key = (int)$_value;
        break;
        case 'show_total':
        $$_key = (string)$_value;
        break;
        }
    }
    $sSQL="SELECT id,name,parent_id,cOrder,cLink FROM ".PREFIX."categories WHERE parent_id=0 AND display<>'N' ORDER BY cORDER DESC, name ASC";
    $result=$db->query($sSQL);
    $output="<tr>\n";
    while($row = $result->fetch())
    {
    $id=$row['id'];
    $parent=$row['parent_id'];
        if($row['cLink']<>'')
        {
        $link=$row['cLink'];
        }
        else
        {
        $link='category.php?type='.$id;
        }
        $output.= "<td class=\"navlist\"><a href=\"".$link."\">".$row['name']."</a>";
        if($show_total='N') {
        // $output.="(". getTotal($id) .")</td>\n";
        $arr_childs = array($id);
        get_ids($arr_childs);
        $output .= "(".get_count($arr_childs).")";
        }
        $output.="</td></tr>\n";
    }
    return $output;
}
?>

Thanks everybody!
Mitch
midoplaz is offline  
Old 07-17-2007, 04:46 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,123
Rep Power: 120
Eric Barnes is a jewel in the rough
Default

Sorry for the delay. Your post some how got moderated and wasn't showing.

Anyway I believe you will want to look at the file includes/classes/smarty/plugins/function.categories_js.php

and then mix and match code from above into that file to get the total number of listings.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline  
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display category total listings? dankellaway v3.1 Questions & Support 2 03-13-2007 02:25 PM
Postal Code Search Mod GSP v3.1 Questions & Support 0 05-15-2006 04:52 PM
Rotating Ads code placement GSP Templates, HTML, CSS, and Design Help 2 04-23-2006 12:13 PM


All times are GMT -4. The time now is 12:20 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0