68 Classifieds Forums  

Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Questions & Support
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

v3.1 Questions & Support Help and support for 68 Classifieds v3.1.x

 
Thread Tools Display Modes
  #1  
Old Today, 06:54 AM
objelland objelland is offline
Member
 
Join Date: Dec 2006
Posts: 31
Default Toplistings from one category only

Hi

I am trying to show toplistings from only one spesific category.

The variable $listingsection I have tried to assign from the query result in the toplisting.php file:

$listingsection = $srs['section'];

I have tried with the following code in the showlistings.tpl.php page to show toplistings from only one spesific category:


PHP Code:
foreach from=$results item="entry"}
    <
tr>
    {if
$listingsection = '4696'}
         {if
$sDisPhoto == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}" {if $entry.class<>""} class="{$entry.class}"{/if}><a href="{$entry.link}">{if $entry.image != ""}<img src="thumbs/small_{$entry.image|escape:"url"}" border="0" />{else}<img src="images/nophotosmall.gif" border='0' />{/if}</a></td>
         {/if}
          {if
$sDisTitle == "Y"}
          <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.title}</td>
          {/if}
          {if
$sDisPrice == "Y"}
          <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.price}</td>
          {/if}
         {if
$sDisDateAdded == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.dateadded|date_format:$dateformat}</td>
         {/if}
         {if
$sDisExpiration == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}" {if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.expiration|date_format:$dateformat}</td>
         {/if}
         {if
$sDisCity == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.city}</td>
         {/if}
         {if
$sDisState == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.state}</td>
         {/if}
         {if
$sDisCountry == "Y"}
         <
td class="{cycle values="row1,row2" advance=false}"{if $entry.class<>""} class="{$entry.class}"{/if}>{$entry.country}</td>
         {/if}
         <
td class="{cycle values="row1,row2" advance=true}"{if $entry.class<>""} class="{$entry.class}"{/if}>
             <
a href="{$entry.link}">{$smarty.const.LANG_VIEW_LISTING}</a>
         </
td>
    </
tr>
    {/if}
    {
foreachelse}
Any help is greatly appreaciated!

Thank you

Oyvind
__________________
objelland
V3.1.5b Developer
Reply With Quote
  #2  
Old Today, 07:40 AM
objelland objelland is offline
Member
 
Join Date: Dec 2006
Posts: 31
Default Problem resolved

If it is of anyone's interesst, here is the solution I figured out:

Somewhere around line 40 in the showlistings.tpl.php file you will find the following code:

PHP Code:
{foreach from=$results item="entry"}
    <
tr>
         {if
$sDisPhoto == "Y"}
Replace it with:

PHP Code:
{foreach from=$results item="entry"}
    <
tr>
    {if
$entry.section == "your_section_number"}
         {if
$sDisPhoto == "Y"}
Don't forget ad the {/if } before the closing of the foreach loop

Oyvind
__________________
objelland
V3.1.5b Developer
Reply With Quote


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Banner in one Category BABBSELA v3.1 Questions & Support 3 02-10-2007 02:22 PM
Branding each Category BABBSELA v3.1 Modifications 0 02-10-2007 01:17 PM
Adding 'category' to 'new listings' display Chaslie v3.1 Modifications 4 10-28-2006 08:58 PM
Category problem dawyatt v3.1 Questions & Support 2 05-24-2006 03:58 PM
Category fields in view list Lagniappe v3.0 Questions & Support 2 04-19-2006 09:09 AM


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


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.