Support Forums

Old 12-17-2006, 07:17 AM   #1
Senior Member
 
Join Date: Dec 2006
Posts: 107
Rep Power: 13
darek is on a distinguished road
Default Need help on all categories in layout.tpl.php

I am trying to get categories like the photo:



most link directories work like that, but it changes when I go to categories



is there any way to keep it still?
darek is offline   Reply With Quote
Old 12-17-2006, 10:15 AM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,084
Rep Power: 117
Eric Barnes is a jewel in the rough
Default

So you are wanting just the parent categories in the side navigation?
__________________
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 online now   Reply With Quote
Old 12-17-2006, 05:27 PM   #3
Senior Member
 
Join Date: Dec 2006
Posts: 107
Rep Power: 13
darek is on a distinguished road
Default

As you see on the first picture. Yes. The smart is a pain for me. OK it is fast but I am just not able to do anything with it. Before I could devide the php code to parts and include it, now, I am just not able to do anything with it. Yes, I would like to chave categories on the side, all of main categories all the time with number next to them. The java one doesn't show the numbers and for my purpose it looks a bit silly.

The other thing if you could help me is how to load an external php file. If I were able to load a search.php into the layout.tpl.php, I would have all features of the search no matter were I would be. OK, I can load it into index.php and other files - but this would mean that I would have to load it into every php file instead of one layout.tpl.php. I will post this question in a separate thread.

Thanks for help.

Last edited by darek; 12-17-2006 at 06:18 PM.
darek is offline   Reply With Quote
Old 12-17-2006, 09:23 PM   #4
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,216
Rep Power: 61
juven14 is a jewel in the rough
Default

I've provided the code to display the number of listings for the dtree nav found in the blue layout, as well as a smarty plugin to have the search in the layout file where it can be used across all pages. I know both of these are in the forums, when I have some more time, I'll try and dig up some links.

I think this is a link for the search plugin:

quick search mod
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 12-19-2006, 02:58 AM   #5
Senior Member
 
Join Date: Dec 2006
Posts: 107
Rep Power: 13
darek is on a distinguished road
Default

Thanks a lot John, I will give it a try. I wrote to Chaslie to auscity.com, I would like to buy the online module, however I would like to include in it total members and total adds, and also, if it were possible to ge the total $ of all ads - this actually will not be $ but I want to use it for different purpose. Can you think of it?
darek is offline   Reply With Quote
Old 12-19-2006, 09:07 AM   #6
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,216
Rep Power: 61
juven14 is a jewel in the rough
Default

You can purchase the useronline module here: http://www.mods.auscity.com/clients/...2&product_id=6

Being that it is only $6.35 the custom modifications you want can be provided in the forum if you are able to manage a little code. Otherwise I'd have need to create it as a separate module.

The additional code wouldn't be much work, and I'll bet you could find it in the forums or user manual.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 03-05-2007, 07:40 AM   #7
Senior Member
 
calaf6's Avatar
 
Join Date: Mar 2006
Location: UK
Posts: 339
Rep Power: 20
calaf6 is on a distinguished road
Default

I have been searching for the code John mentioned to show the number of ads in the dtree on the bluejs template, as I would like to change the stableads site to that layout. Its not coming up on a search, and I wondered if anyone could point me to the thread that its in please.

Seperate question, is the users online mod likely to work the same on v.4 when it comes out please.
calaf6 is offline   Reply With Quote
Old 03-05-2007, 08:31 AM   #8
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,609
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default Top level categories with totals in nav

Hi,

With the help of others in here, I have done (I believe) exactly what you are wanting to do on my site. Use the following code (Provided by our favorite suzkaw) and save the file to your site here:
includes/classes/smarty/plugins/function.categories_ul.php

PHP 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;
}

?>
Next, in your appropriate layout file (layout.tpl.php) put this call to the smarty file that you just created where you want the category list to be:
PHP Code:
{categories_ul show_total='Y'
If you are using the bluejs template (Which I'm not) you would probably want to use the above call in place of the javascript.

If you would like to see how it works before doing the above, you can see how it works on my site here:
IndianaPC.org
Click on the Classifieds link on the left to go into the classifieds area.

Hope this helps!

Cheers,
-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.3)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 03-05-2007 at 08:36 AM.
Mike-N-Tosh is offline   Reply With Quote
Old 03-05-2007, 10:08 AM   #9
Senior Member
 
calaf6's Avatar
 
Join Date: Mar 2006
Location: UK
Posts: 339
Rep Power: 20
calaf6 is on a distinguished road
Default

Thats exactly what I need, I will try it on the test site tonight.

I like your site by the way
calaf6 is offline   Reply With Quote
Old 03-05-2007, 05:44 PM   #10
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,609
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

Quote:
Originally Posted by calaf6 View Post
I like your site by the way
Thanks calaf6. I don't like it yet, but I'm working on it!

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.3)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote

Bookmarks

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
removing the price field on some categories manilaboy v3.1 Questions & Support 2 11-26-2006 06:09 PM
Categories to be listed in a list menu rather that in a text marketingsolutions v3.1 Modules & Modifications 21 10-15-2006 08:41 AM
Replicate Categories e1m2j v3.1 Questions & Support 3 07-25-2006 04:57 AM
Prevent Browse Categories Table for hidden categories free2take v3.0 Questions & Support 3 05-12-2006 10:14 AM
Browse Categories - disable sub-category dawyatt v3.0 Questions & Support 3 03-31-2006 02:32 PM


All times are GMT -4. The time now is 10:41 PM.


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