68 Classifieds Forums

Hide Categories without Ads

This is a discussion on Hide Categories without Ads within the v4 Modules / Modifications forums, part of the Help & Support category; Hello, Is there any way to hide categories that have no ads on the category page? When a listing is ...


Go Back   68 Classifieds Forums > Help & Support > v4 Modules / Modifications

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-22-2008, 07:12 PM
Member
 
Join Date: Mar 2008
Posts: 42
Rep Power: 4
markstanden is on a distinguished road
Default Hide Categories without Ads

Hello,

Is there any way to hide categories that have no ads on the category page? When a listing is added the category would then show. This would be a great feature.

thanks for any help

Mark
Developer 4.08

Reply With Quote
  #2  
Old 09-22-2008, 09:01 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,305
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

You should be able to do that at the template level.

Open home.tpl and find:
{if $data[td]<>""}

Replace with:
{if $data[td]<>"" && $data[td].total > 0}
__________________
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
  #3  
Old 09-23-2008, 04:36 AM
Member
 
Join Date: Mar 2008
Posts: 42
Rep Power: 4
markstanden is on a distinguished road
Default

Thanks Eric,

That sort of worked.. but it leaves gaps in the table where the categories with ads should have been, ill have a play with the code to see if i can get it working. Thanks

Mark
Developer 4.08
Reply With Quote
  #4  
Old 09-23-2008, 09:20 AM
Lhotch's Avatar
Moderator
 
Join Date: Mar 2006
Posts: 3,653
Rep Power: 90
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by markstanden View Post
Thanks Eric,

That sort of worked.. but it leaves gaps in the table where the categories with ads should have been, ill have a play with the code to see if i can get it working. Thanks

Mark
Developer 4.08
Thats because the table data tag is above the evaluation. You really want to evaluate if there are ads before you create the table data tag.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #5  
Old 09-23-2008, 08:43 PM
Member
 
Join Date: Mar 2008
Posts: 42
Rep Power: 4
markstanden is on a distinguished road
Default

Thanks Larry,

Yeah, i see that from the code, trying to find a work around, if i crack it ill post the code here..

Mark
Reply With Quote
  #6  
Old 10-10-2008, 02:39 PM
Junior Member
 
Join Date: Oct 2008
Posts: 4
Rep Power: 0
retrocartrader is on a distinguished road
Default

Quote:
Originally Posted by markstanden View Post
Thanks Larry,

Yeah, i see that from the code, trying to find a work around, if i crack it ill post the code here..

Mark
Have you had any luck with this?
Reply With Quote
  #7  
Old 10-18-2008, 03:15 AM
Member
 
Join Date: Dec 2006
Posts: 95
Rep Power: 10
darek is on a distinguished road
Default

v4 is really better than v3, a lot of things are possible now, I do have to change a lot of php files, however I first try to change tpl files before editing php files,

here is the solution you are asking

PHP Code:
<table width="100%">
            {
section name=tr loop=$data step=$cols}
            {if 
$data[tr]<>"" && $data[tr].total 0}
                <
tr>
                    {
section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+$cols}
                    {if 
$data[td]<>"" && $data[td].total 0}
                    <
td valign="top">
                        {
$data[td].start_link}<strong>{$data[td].name}</strong></a>
                        {if 
$data[td].total <> ''}
                        ({
$data[td].total})
                        {/if}
                    &
nbsp;
                    </
td>
                    <
td>
                    {/if}
                    {/
section}
                </
tr>
                {/if}
            {/
section}
            </
table

Last edited by darek; 10-18-2008 at 03:22 AM. Reason: edited
Reply With Quote
  #8  
Old 10-18-2008, 01:28 PM
Member
 
Join Date: Mar 2008
Posts: 42
Rep Power: 4
markstanden is on a distinguished road
Default

Thanks Darek, i didn't get around to having a go at it myself..

Mark
Reply With Quote
  #9  
Old 10-19-2008, 09:14 AM
michael's Avatar
Senior Member
 
Join Date: Jan 2007
Posts: 260
Rep Power: 14
michael is on a distinguished road
Default

So where is dareks code used? category.php?
__________________
v4.09 Developer
MKClassifieds


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
Reply With Quote
  #10  
Old 10-19-2008, 04:55 PM
Chaslie's Avatar
Moderator
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 697
Rep Power: 25
Chaslie is on a distinguished road
Default

Quote:
So where is dareks code used? category.php?
Try home.tpl
__________________
Chaslie
V3.1.10 dev
mods.auscity.com
AUSCITY

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals

HTML Help
W3 Schools
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
hide categories if no product paulsra v3.1 Questions & Support 1 10-22-2007 10:00 AM
Hide Categories based on User Login ID Unregistered Pre Sales Questions 1 06-15-2007 02:57 PM
How to Hide Categories tipud v3.1 Questions & Support 2 05-19-2007 11:41 AM
Hide top categories on add listing calaf6 v3.1 Modules & Modifications 3 06-25-2006 03:22 AM
Prevent Browse Categories Table for hidden categories free2take v3.0 Questions & Support 3 05-12-2006 11:14 AM


All times are GMT -4. The time now is 01:34 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