68 Classifieds Forums

Showing the number of ads in subcategories on main page

This is a discussion on Showing the number of ads in subcategories on main page within the v3.1 Modules & Modifications forums, part of the v3.1 Legacy Help & Support category; Hi How do I show the number of ads in subcategories on the main page? On the main page I ...


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

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-13-2006, 04:57 PM
pat01's Avatar
Member
 
Join Date: Jun 2006
Location: Switzerland
Posts: 86
Rep Power: 12
pat01 is on a distinguished road
Default Showing the number of ads in subcategories on main page

Hi

How do I show the number of ads in subcategories on the main page?

On the main page I display the categories test1 and test2. Behind it 68C shows me the total numer of ads from all subcategories.
Underneath the main categories the subcategories are displayed. And there I want to display the number of ads in each subcategory as well.

Is there a way to do it?

Thank's a lot!

__________________
_________
v3.1.7 dev
Reply With Quote
  #2  
Old 07-13-2006, 06:24 PM
juven14's Avatar
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,132
Rep Power: 57
juven14 is a jewel in the rough
Send a message via Skype™ to juven14
Default

index.php or category.php?
__________________
Regards,

John


“By perseverance, study, and eternal desire, any man can become great.” George S. Patton
Reply With Quote
  #3  
Old 07-14-2006, 01:18 AM
pat01's Avatar
Member
 
Join Date: Jun 2006
Location: Switzerland
Posts: 86
Rep Power: 12
pat01 is on a distinguished road
Default

Both...!

(Sorry, I did forget to mention that).

EDIT: No, on index.php only. The category.php does show the number of ads if the subcategories are displayed. If the category.php shows the maincategories, the subcategories are not displayed anyway...
__________________
_________
v3.1.7 dev

Last edited by pat01; 07-14-2006 at 12:21 PM.
Reply With Quote
  #4  
Old 07-19-2006, 12:16 PM
pat01's Avatar
Member
 
Join Date: Jun 2006
Location: Switzerland
Posts: 86
Rep Power: 12
pat01 is on a distinguished road
Default

I guess this is more complicated...?

I did try it myself for a few hours to adapt it for index.php, but no luck. :-(
Since this function does exist for categories.php it should be possible, or not?
__________________
_________
v3.1.7 dev
Reply With Quote
  #5  
Old 07-19-2006, 12:33 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,307
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

If I am understanding correctly you can try this.

Open the index.php file and locate this else statement:
PHP Code:
else
            {
                
$add_cats.='<a href="category.php?type='.$rs['id'].'&sec='.$arow['id'].'">'.$arow['name'].'</a>&nbsp;';
            } 
Replace it with this:
PHP Code:
else
            {
$arr_childs = array($arow['id']);
get_ids($arr_childs);
$total=get_count($arr_childs);
 
$add_cats.='<a href="category.php?type='.$rs['id'].'&sec='.$arow['id'].'">'.$arow['name'].' ('.$total.')</a>&nbsp;';
$total='';
            } 
__________________
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 | Twitter
Reply With Quote
  #6  
Old 07-19-2006, 05:22 PM
pat01's Avatar
Member
 
Join Date: Jun 2006
Location: Switzerland
Posts: 86
Rep Power: 12
pat01 is on a distinguished road
Default

Eric, you're the best!

This works perfectely! Now the visitors can see right away how many ads are placed in a subcategory.

Thank you very much!
__________________
_________
v3.1.7 dev
Reply With Quote
  #7  
Old 07-19-2006, 05:24 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,307
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

Glad to help.
__________________
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 | Twitter
Reply With Quote
Reply

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
Viewing ads from subcategories in Main Categories browse view SilverMicro v3.1 Questions & Support 11 05-26-2007 05:39 PM
Showing total on last page pat01 v3.1 Modules & Modifications 3 08-06-2006 03:56 AM
Removing browse category table from main page. gabs v3.0 Questions & Support 1 06-24-2006 01:37 PM
Categories on main page. gabs v3.0 Questions & Support 2 04-25-2006 03:55 PM
Listings on main site home page LukeOut v3.0 Questions & Support 14 04-07-2006 12:54 PM


All times are GMT -4. The time now is 05:53 PM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22