cycle php and featured products
hello,
i have a website that had an admin login panel that i can select which cars are featured by ticking a check box in the admin panel.
at present, the featured cars are static, and if i have four cars featured, it looks untidy. cue the cycle plugin!! (if i new how to use it!!)
heres my code :
<?php
session_start();
include_once "./admin/global.php";
if ( $sort ) {
$ses_sort = $sort;
}
if ( empty($sort) && empty($ses_sort)) {
$ses_sort = $site."_motor.title";
}
?><?
{
$sql = "select distinct ".$site."_motor.id,".$site."_motor.title,".$site."_motor.price,
".$site."_make.name,".$site."_motor.model
from ".$site."_motor,".$site."_category,".$site."_make ";
$sql .= " where ";
$sql .= " ".$site."_motor.price > 0 and ".$site."_make.id = ".$site."_motor.make and ".$site."_category.id = ".$site."_motor.cat and ".$site."_motor.id != '0' and active = 'y' and ".$site."_motor.offer = 'y' ";
$sql .= " group by ".$site."_motor.id ";
$result = mysql_query ( $sql);
$counter = mysql_num_rows( $result);
if ( $counter != 0 ) {
<table border="0" cellspacing="0" cellpadding="0" width="900">
<tr>
<td class="bodyfont" style="border-right: solid 4px #222222;border-left: solid 4px #222222;border-bottom: solid 4px #222222;padding-top:10px;padding-left:10px;"><h2><? echo $frontend_labels["FEATURED_CARS"]; ?></h2>
<?
// start table layouts
$thecount =0;
$firstcount =0;
?>
<table border="0" cellspacing="15" cellpadding="0" align="center">
<tr>
<?
if ( $ses_sort) {
$sql .= " order by $ses_sort ";
}
$result = mysql_query ( $sql);
while ( $row = mysql_fetch_row( $result)) {
$toclear_title = $row[4];
$row[4] = substr($row[4],0,20);
if ($thecount % 4 == 0 && $firstcount != 0) {
echo "</tr><tr>";
}
?>
<td class="featurefront" align="center" width="205" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="140" align="center" valign="top">
<?
if(file_exists("./admin/uploaded_photos/".$row[0]."_3")) {
echo "<a href=\"car_". str_replace (" ", "-", $row[3])."-".str_replace (" ", "-", $row[4]) ."_".$row[0]."_".$start."_index.php\" >
<img src='./admin/uploaded_photos/".$row[0]."_3' alt=\"View $row[1]\" border='0' style=\"border:thin;border-color:#CCCCCC;border-style:solid;\"></a>\n";
} else {
echo ("<table width=\"100\" height=\"74\" bgcolor=\"#f4f4f4\"><tr><td align=\"center\" class=\"bodyfont\" valign=\"middle\">".$frontend_labels["NO_IMAGE"]."</td></tr></table>");
}
?>
</tr>
<tr>
<td style="padding:5px"> <a href=<? echo "\"car_". str_replace (" ", "-", $row[3])."-".str_replace (" ", "-", $row[4]) ."_".$row[0]."_".$start."_index.php\" "; ?> class="creamlink" title="<? echo "$toclear_title $default_currency$row[2]"; ?>"><? echo "$row[1].."; ?></a></td>
</tr>
</table>
</td>
<?
$thecount++;
$firstcount++;
}
?>
</tr>
</table></td></tr></table>
<?
}
}
?>
where in this code would i implement the plugin?
hope someone can help
james