Support Forums

Old 12-14-2006, 11:51 AM   #1
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default Removing number of listings in home.tpl.php

On my Calgary Real Estate section in the categories table under the last category (rentals) I want to remove number of listings. I need to do it because I just want to use the link to other section. But in this case the number of listings all the time will be zero.

The problem is, that I want to remove number of listings only under this category, and leave them under any other category. I am guessing that it could be done with {if} {else} statements, however I can not figure out how to do this.

Is it possible?

Any help appreciated.
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.

Last edited by SkGold; 07-12-2007 at 12:38 AM.
SkGold is offline   Reply With Quote
Old 12-14-2006, 01:12 PM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,780
Rep Power: 110
Eric Barnes is a jewel in the rough
Default

The best way that I can think of is by modifying the home template file and locate the {html_table_adv section. Then replace it with this:
Code:
{section name=tr loop=$data step=$cols}
                <tr>
                    {section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+$cols}
                    <td valign="top">
                    {if $data[td]<>""}
                        {$data[td].start_link}<img src="{$data[td].image}" border="0" alt="{$data[td].name}" /></a> 
                        {$data[td].start_link}<strong>{$data[td].name}</strong></a>    {if $data['td'].name!="Looking for Rental Property? Click here."} ({$data[td].total}) {/if}
                    {/if}
                     
                    </td>
                    <td>
                    {/section}
                </tr>
            {/section}
__________________
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   Reply With Quote
Old 12-15-2006, 02:07 AM   #3
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default

Thanks Eric,
However when I did the change I got error:
Quote:
Fatal error: Smarty error: [in home.tpl.php line 17]: syntax error: unidentified token '['td'].name!="Looking' (Smarty_Compiler.class.php, line 1396) in /home/.../public_html/realestate/includes/classes/smarty/Smarty.class.php on line 1095
Just to make sure I changed this:
PHP Code:
{html_table_adv loop=$data cols=$cols table_attr='width="100%"'}
    [[
start_link]]<img src='[[image]]' border='0' alt='[[name]]' /></a>&nbsp;[[start_link]]<strong>[[name]]</strong></a>
    ([[
total]])
    <
br />
[[
subcats]]
{/
html_table_adv
To this:
PHP Code:
{section name=tr loop=$data step=$cols}
                <
tr>
                    {
section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+$cols}
                    <
td valign="top">
                    {if 
$data[td]<>""}
                        {
$data[td].start_link}<img src="{$data[td].image}" border="0" alt="{$data[td].name}" /></a>&nbsp;
                        {
$data[td].start_link}<strong>{$data[td].name}</strong></a>    {if $data['td'].name!="Looking for Rental Property? Click here."} ({$data[td].total}) {/if}
                    {/if}
                    &
nbsp;
                    </
td>
                    <
td>
                    {/
section}
                </
tr>
            {/
section
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.
SkGold is offline   Reply With Quote
Old 12-15-2006, 07:38 AM   #4
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,780
Rep Power: 110
Eric Barnes is a jewel in the rough
Default

I was kind of afraid of that when I posted it.

However can you get the category id and replace the if statement with this:
Code:
{if $data['td'].id!=6} ({$data[td].total}) {/if}
Where 6 is the id of the category.
__________________
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   Reply With Quote
Old 12-16-2006, 02:49 AM   #5
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default

Thanks Eric, however still getting error:
Quote:
Fatal error: Smarty error: [in home.tpl.php line 17]: syntax error: unidentified token '['td'].id!=246' (Smarty_Compiler.class.php, line 1396) in /home/....../public_html/realestate/includes/classes/smarty/Smarty.class.php on line 1095
I was looking for ID by using {debug} and got this:
Quote:
5 => Array (8)
id => 246
name => Looking for Rental Property?<br>Click...
image => templates/realestate/images/folder.gif
description => empty
cLink => http://rent.allaboutcalgary.com
subcats => <div class="small">...</div>
start_link => <a href="http://rent.allaboutcalgary....
total => 0
Then in home.tpl.php I put this code:
Quote:
{section name=tr loop=$data step=$cols}
<tr>
{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+$cols}
<td valign="top">
{if $data[td]<>""}
{$data[td].start_link}<img src="{$data[td].image}" border="0" alt="{$data[td].name}" /></a> 
{$data[td].start_link}<strong>{$data[td].name}</strong></a> {if $data['td'].id!=246} ({$data[td].total}) {/if}
{/if}
 
</td>
<td>
{/section}
</tr>
{/section}
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.
SkGold is offline   Reply With Quote
Old 12-18-2006, 10:22 AM   #6
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default

I tried it again still same error. Eric do you have any other thoughts?
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.
SkGold is offline   Reply With Quote
Old 12-18-2006, 04:04 PM   #7
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,780
Rep Power: 110
Eric Barnes is a jewel in the rough
Default

Here some other things to try.

Code:
 {if $data['td'].id != 246}
Code:
 {if $data['td'].id != "246"}
Code:
{if $data['td'].id neq 246}
I think it may need the extra spaces I added.
__________________
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   Reply With Quote
Old 12-19-2006, 02:24 PM   #8
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default

I tried everything suggested plus some other variations with spaces and no spaces. No luck, still the same error.
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.
SkGold is offline   Reply With Quote
Old 12-20-2006, 10:04 PM   #9
Senior Member
 
SkGold's Avatar
 
Join Date: Mar 2006
Location: Best city in the World � Calgary, Canada
Posts: 468
Rep Power: 23
SkGold has a spectacular aura about
Default

Eric fixed it. If somebody interested here is the right code for this. It is also don�t need apostrophes around [td].
Thanks a lot Eric.
Quote:
{if $data[td].id != "246"}
__________________
Thanks,
Sergey

Bargain Finder in Calgary, Alberta, Canada.
Calgary Business Directory V3.1.10 Dev - Calgary Classifieds V3.1.10 Dev - Calgary Real Estate V3.1.10 Dev - Calgary Used Cars V3.1.10 Dev - Calgary Rent V3.1.10 Dev - Calgary Dating V3.1.5 Dev

A website without well-done Internet Marketing and Search Engine Optimization is as good as non-existent.
SkGold 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 field that shows the number of times an advert has been viewed sporthorsebreeder v3.1 Questions & Support 2 09-18-2006 07:07 PM
Top Listings sbuell20 v3.1 Questions & Support 0 09-02-2006 12:11 PM
Removing # of Listings CB v3.1 Questions & Support 1 05-14-2006 05:09 PM
Year quickbiz v3.0 Questions & Support 2 04-21-2006 07:20 AM
Display Total Number of Listings Eric Barnes v3.0 Questions & Support 2 03-30-2006 02:29 PM


All times are GMT -4. The time now is 04:50 PM.


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