Classified Advertising
|
// |
?>
$mysql = mysql_connect("localhost","402441_admin","NuvvMJ..");
mysql_select_db( "402441_motorbikenews" );
$lastmake = "zzzz";
$makecnt = 0;
$linecnt = 0;
$query = "SELECT * FROM newclass_ads order by make";
$result = mysql_query($query) or die('Error!!!!!!, query failed 1');
?>
| | | |
while ( $DOC = mysql_fetch_object( $result ) )
{
if ($DOC->make <> $lastmake and $lastmake <> "zzzz")
{
?>
 |
echo $lastmake;?> ( echo $makecnt;?>) |
$linecnt = $linecnt + 1;
if ($linecnt == 4){ echo " "; $linecnt = 0; }
$makecnt = 0;
}
$lastmake = $DOC->make;
$makecnt = $makecnt + 1;
}
if ($makecnt > 1) {?>
 |
echo $lastmake;?> ( echo $makecnt;?>) |
}
?>
| | | |
/*
*/ ?>
$query = "SELECT * FROM newclass_ads where adtype = 10 order by primkey";
$result = mysql_query($query) or die('Error!!!!!!, query failed 1');
while ( $DOC = mysql_fetch_object( $result ) )
{ ?>
$adclass = "bronze" ;
$adclass2 = "bronzehead" ;
$adclass3 = "bronzebody" ;
$detbut = "viewadb.gif" ;
if ($DOC->adtype == 10 ){
$adclass = "gold" ;$adclass2 = "goldhead" ;$adclass3 = "goldbody" ;$detbut = "viewadg.gif" ;}
if ($DOC->adtype == 5 ){
$adclass = "silver" ; $adclass2 = "silverhead" ;$adclass3 = "bronzebody" ;$detbut = "viewads.gif" ;}
echo '';
?>
echo ' ';
$pricey = $DOC->price;
if ( is_null ($DOC->price) ) { $pricey = "N/A" ; }
echo ' £'.$pricey.' | '.$DOC->make.' ' .$DOC->model.' | ';
echo '';
$texty = substr ($DOC->comments,0,250);
echo $texty;
?>
|
|
echo ' '; ?>
|
$tp = "";
if ( $DOC->tp == "T" ) {$tp = "(T)rader";}
if ( $DOC->tp == "P" ) {$tp = "(P)rivate";}
?>
|
|
if ($DOC->weblink == "" )
{ echo ' | '; }
else {
echo ' | '; }
?>
|
|
}
?>
$query = "SELECT * FROM newclass_ads where adtype < 10 and logoimg <> 'http://motorcyclesupermarket.com/images/dealerLogos/images/' and image<>'' order by price desc limit 10";
$result = mysql_query($query) or die('Error!!!!!!, query failed 1');
while ( $DOC = mysql_fetch_object( $result ) )
{ ?>
$adclass = "bronze" ;
$adclass2 = "bronzehead" ;
$adclass3 = "bronzebody" ;
$detbut = "viewadb.gif" ;
if ($DOC->adtype == 10 ){
$adclass = "gold" ;$adclass2 = "goldhead" ;$adclass3 = "goldbody" ;$detbut = "viewadg.gif" ;}
if ($DOC->adtype == 5 ){
$adclass = "silver" ; $adclass2 = "silverhead" ;$adclass3 = "bronzebody" ;$detbut = "viewads.gif" ;}
echo '';
?>
echo ' ';
$pricey = $DOC->price;
if ( is_null ($DOC->price) ) { $pricey = "N/A" ; }
echo ' £'.$pricey.' | '.$DOC->make.' ' .$DOC->model.' | ';
echo '';
$texty = substr ($DOC->comments,0,250);
echo $texty;
?>
|
|
echo ' '; ?>
|
$tp = "";
if ( $DOC->tp == "T" ) {$tp = "(T)rader";}
if ( $DOC->tp == "P" ) {$tp = "(P)rivate";}
?>
|
|
if ($DOC->weblink == "" )
{ echo ' | '; }
else {
echo ' | '; }
?>
|
|
}
?>
| |