Jump to content

DogToysMart


Guest kencash

Recommended Posts

  • 2 weeks later...

hi,

I found the following code on this forum, just follow the instruction

below to add the new products section.

However, the code will only display products based on product

code.

open up your index.php file and AFTER line 478 which is;

eb($bg_colour,$colour_1);

add after,

echo"<br>";

//New Products

sb("100%","New Products",$colour_1,$bg_colour);

$query = "select * from ".$prefix."store_inventory order by product desc LIMIT 5";

$result = mysql_query($query);

$count = mysql_num_rows($result);

$columns = 5;

if($count==0)

{

echo"$la_new_product";

}

$no = 0;

echo"<table width='100%' border='0' cellpadding='0' cellspacing='0'>";

for($i = 0; $i < $count; $i++) {

$row = mysql_fetch_array($result); {

$title=$row["title"];

$product=$row["product"];

$image=$row["image"];

$title=stripslashes($title);

$title=substr($title,0,12);

}

if($i % $columns == 0) {

echo"<tr><center>\n";

}

echo"<td>

<table height=\"100%\" width=\"100%\">

<tr>

<td><center><a href=\"view_product.php?product=$product\" target=\"_self\"><img src='images/thumb_$image' border=\"0\"></a></center></td>

</tr>

<tr>

<td><center><a href=\"view_product.php?product=$product\" target=\"_self\">$title</a></center></td>

</tr>

</table>\n";

if(($i % columns) == ($columns - 1) || ($i + 1) == $count) {

echo"</tr></center>\n";

}

}

echo"</table>\n";

eb($bg_colour,$colour_1);

Hope this help.

KenCash

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...