Support Forums

featured listing

This is a discussion on featured listing within the Technical Support forums, part of the Technical Support Forums category; Hello, I want to place the seller store logo on the featured items page. (my home page.) So i modified ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 09-11-2008, 09:20 AM   #1
Member
 
Join Date: Mar 2008
Posts: 49
Rep Power: 16
wesse249 is on a distinguished road
Default featured listing

Hello,

I want to place the seller store logo on the featured items page. (my home page.)
So i modified the code of function.css_latest_listings_horizontal.php which are red marked. But the seller store logo's don't become visible. Can somebody look at my code what i did wrong?

This codes i have modified:

I inserted an sql query: $storeSQL = 'SELECT s.sID, s.sUserID, s.sTitle, s.sDescription, s.sImage, u.username FROM ' . PREFIX . 'store AS s JOIN ' . PREFIX . 'users AS u ON u.id=s.sUserID WHERE s.sUserID = ' . $owner;

I added under the follow code $tmp = array(
'id' => $row['id'],
'image'=> $image,
'title'=> $row['title'],

This rule: 'sImage'=> $row['sImage'],

And i inserted this rule $output .= '<div class="feat_txt">' .$loop[$ads][sImage]. '</div>';

PHP Code:
<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     random
 * Purpose:  output a latest number between $varIn and $varOut:
 *    {random in=$varIn out=$varOut}
<?php
/**
 * smarty_function_latest_listings_horizontal
 *
 * This function is useful for generating a horizontal table of new listings. 
 *
 * 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:23 $
 */

function smarty_function_css_latest_listings_horizontal($params$smarty)
{
    global 
$db;
     
    
$table_attr 'border="1"';
    
$tr_attr '';
    
$td_attr '';
    
$number=6;
    
$cols=5;
    
$rows=2;
    
$trailpad ' ';
    
$vdir 'down';
    
$hdir 'right';
    
$inner 'cols';
    
$show_price='N';

    foreach (
$params as $_key=>$_value
    {
        switch (
$_key
        {
            case 
'number':
            
//case 'cols':
            //case 'rows':
            //    $$_key = (int)$_value;
            //    break;

            //case 'table_attr':
            //case 'img_break':
            
case 'show_price':
                $
$_key = (string)$_value;
                break;

            
//case 'tr_attr':
            //case 'td_attr':
            //    $$_key = $_value;
            //    break;
        
}
    }
    
$sSQL="SELECT p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration, p.pHighlighted, p.pBold, u.state, u.city, u.country FROM ".PREFIX."listings AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' ORDER BY p.dateadded DESC LIMIT ".$number;

        
$result=$db->query($sSQL);
        
$i=0;
        while(
$row=$result->fetch())
        {
            
$imageSQL "SELECT image FROM ".PREFIX."prodimages WHERE pid=".$row['id']." ORDER BY rank LIMIT 1";
            
$iResult=$db->query($imageSQL);
            
$irs=$iResult->fetch();
            if(
$irs['image']<>"")
            {
                 
$image="thumbs/small_".$irs['image'];
            }
            else
            {
                 
$image="http://www.68classifieds.com/forums/images/nophoto.gif";
            }
            
            [
color="Red"]$storeSQL 'SELECT s.sID, s.sUserID, s.sTitle, s.sDescription, s.sImage, u.username   FROM ' PREFIX 'store AS s JOIN ' PREFIX 'users AS u ON u.id=s.sUserID WHERE s.sUserID = ' $owner;[/color]
            
             
$tmp = array(
                
'id' => $row['id'],
                
'image'=> $image,
                
'title'=> $row['title'],
                [
color="Red"]'sImage'=> $row['sImage'],[/color]
                
'price'=> FormatCurrency($row['price']),
                );
                
$loop[$i++] = $tmp;
        }
        
$loop_count count($loop);
        
$ads 0;

            
    
// create featured ad div container    
    
$output '<div class="feat_width">';

    
// loop through collected ads
        
while ($ads $loop_count) {
            if(
defined('SEO'))
            {
                
$listing_title=$loop[$ads][title];
                
$listing_title=str_replace(' ''_'$listing_title);
                
$listing_title=preg_replace('/\W/e'''$listing_title);
                
$link="aanbieding/".$loop[$ads][id]."/".$listing_title.".html";    
            }
            else
            {
                
$link="viewlisting.php?view="$loop[$ads][id];
            }
                
            
$output .= '<div class="feat">';
            
$output .= '<div class="feat_img"><a href="' $link '" title="'.$loop[$ads][title].'" rel="nofollow"><img src="' $loop[$ads][image] . '" alt="'.$loop[$ads][title].'" border="0" width="100" height="86" /></a></div>';
            
$output .= '<div class="feat_txt">' .$loop[$ads][title]. '</div>';
            [
color="Red"]$output .= '<div class="feat_txt">' .$loop[$ads][sImage]. [/color]'</div>';
            
            if(
$show_price=='Y')
            {
                
//$output.= $loop[$x][price];
                
$output .= '<div class="feat_price">' $loop[$ads][price] . '</div>';            
            }

            
$output .= '</div>';
            
$ads++;
            }  
//end while
            
$output .= '</div>';

    return 
$output;
}


?>

Last edited by wesse249; 09-11-2008 at 09:23 AM.
wesse249 is offline  
Old 09-11-2008, 10:51 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I see a few things.

1. You need to change this: http://www.68classifieds.com/forums/images/nophoto.gif

As that is pointing to use and will not display an image. It should be just images/nophoto.gif

2. The query is wrong and you are not doing anything with the query. It should be:

PHP Code:
$storeSQL 'SELECT s.sID, s.sUserID, s.sTitle, s.sDescription, s.sImage, u.username   FROM ' PREFIX 'store AS s JOIN ' PREFIX 'users AS u ON u.id=s.sUserID WHERE s.sUserID = ' $row['owner'];
$stResult=$db->query($storeSQL);
$srs=$stResult->fetch();

//Then add it to the array
                
$tmp = array(
                
'id' => $row['id'],
                
'image'=> $image,
                
'title'=> $row['title'],
                
'sImage'=> $srs['sImage'],
                
'price'=> FormatCurrency($row['price']),
                );
                
$loop[$i++] = $tmp
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Featured Listing Question 68 Newbie Technical Support 1 08-16-2008 07:18 PM
Newest Listing Featured on front Page? newcastledirectory Technical Support 11 05-12-2008 10:38 PM
How show up 12 featured listing in home page ? Marcelo Templates, HTML, CSS, and Design Help 2 05-01-2007 02:21 AM


All times are GMT -4. The time now is 09:52 AM.


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