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;
}
?>