$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Date_Added ASC;";
switch ($iSortby){
Case 0:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Date_Added ASC";break;
Case 1:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Date_Added ASC";break;
Case 2:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Date_Added DESC" ;break;
Case 3:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Name ASC" ;break;
Case 4:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Name DESC" ;break;
Case 5:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Rating ASC" ;break;
Case 6:
$sSQL="SELECT * FROM tblLinks WHERE Active = 'Y' and category ='".$iCategoryID."' ORDER BY Featured DESC, Rating DESC";break;
}
$mysql = mysql_connect("localhost","402441_admin","NuvvMJ..");
mysql_select_db( "402441_motorbikenews" );
$rowsPerPage = 15;
$query = "SELECT COUNT(category) AS numrows FROM tblLinks WHERE category =".$iCategoryID." and Active = 'Y'";
$result = mysql_query($query) or die('Error!!!!!!, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$iRecordcount = $row['numrows'];
// how many pages we have when using paging?
$iPagecount = ceil($iRecordcount/$rowsPerPage);
If ($iPage > $iPagecount) { $iPage=$iPagecount ;}
$offset = ($iPage - 1) * $rowsPerPage;
if ($iRecordcount <= 0 ) {
echo ' ';
'';
' <<Home -- <%=sCategoryName%>';
' | There are currently no external links listed. | ';}
Else
{
echo '
';
$sSQL .= " LIMIT $offset, $rowsPerPage ";
$Result = mysql_query($sSQL);
$my_var = 0;
$mystr = 999999;
$sFeatured = "ZZZ";
$j = 0;
while ( $DOC = mysql_fetch_object( $Result )) {
$iLinkID="$DOC->ID";
$sLinkName="$DOC->Name";
$iRating="$DOC->Rating";
$iNumberofRatings = "$DOC->NumberofRatings";
$sLinkDescription="$DOC->Description";
$dDate_Added="$DOC->Date_Added";
$sURL="$DOC->URL";
$sFeatured="$DOC->Featured";
echo '
';
If ($sFeatured=="Y" ){ echo ' ';}
echo ' '.$sLinkName.'
|
';
switch ($iRating) {
Case 1 : echo ' '; break;
Case 2 : echo ' '; break;
Case 3 : echo ' '; break;
Case 4 : echo ' '; break;
default : echo ' '; break;}
echo ' ';
If ($iNumberofRatings > 0 )
{ If ($iNumberofRatings = 1)
{ echo $iNumberofRatings.' rating'; }
Else
{ echo $iNumberofRatings.' ratings'; }
}
echo '
|
';
$j++;
if ($j == $iHl) {
echo ''.$sLinkDescription.'';
}
else {
echo substr($sLinkDescription,0,250);
$mystr= strlen($sLinkDescription);
if ($mystr > 250 )
{echo '.... ';
$self = $_SERVER['PHP_SELF'];
#$next = " more ";
#$next = ' more';
$next = " more ";
echo $next;
};
}
$dayear = substr($dDate_Added,0,4);
$damonth = substr($dDate_Added,5,2);
$daday = substr($dDate_Added,08,2);
$maydatets = mktime(0,0,0,$damonth,$daday,$dayear);
$maydate = date("jS F Y", $maydatets);
echo ' |
Date Added: '. $maydate.' |
';
echo '[rate] ';
echo '[review] ';
echo '[read reviews] ';
echo '[report broken link]';
echo ' |
|
';
}
}
?>
$self = $_SERVER['PHP_SELF'];
// creating 'previous' and 'next' link
// plus 'first page' and 'last page' link
// print 'previous' link only if we're not
// on page one
if ($iPage > 1)
{
$page = $iPage - 1;
$prev = "  ";
#$prev = '  ';
$first = "  ";
#$first = '  ';
}
else
{
$prev = "  "; // we're on page one, don't enable 'previous' link
$first = "  "; // nor 'first page' link
}
// print 'next' link only if we're not
// on the last page
if ($iPage < $iPagecount)
{
$page = $iPage + 1;
$next = "  ";
#$next = '  ';
$last = "  ";
#$last = '  ';
}
else
{
$next = "  "; // we're on the last page, don't enable 'next' link
$last = "  "; // nor 'last page' link
}
// print the page navigation link
echo " | " .
"" .
$first . $prev . " Showing page $iPage of $iPagecount pages " . $next . $last .
" |
";
?>
Site Favorite:  |
| |