"; else $firstURL=""; $urls=""; if($_REQUEST['p']<10) $startPage=1; else $startPage=(int)($_REQUEST['p']/10)*10+1; //echo $startPage; if($startPage+10<=$totPages) $endPage=$startPage+10; else $endPage=$lastPage; $prevPage=$startPage-2; if($prevPage>=0) $prevURL=""; else $prevURL=""; //echo $startPage.", ".$endPage; for($i=$startPage-1;$i<$endPage;$i++) { $j=$i+1; if($i==$_REQUEST['p']) { $urls.=""; } else { $urls.=""; } if($j%10==0) break; } $nextPage=$i+1; if($nextPage-1!=$lastPage) $nextURL=""; else { $k=$nextPage-1; if($k==$_REQUEST['p']) $urls.=""; else $urls.=""; $nextURL=""; } if($nextPage-1!=$lastPage) $lastURL=""; else $lastURL=""; $query=$sql." limit $start, $pageSize"; $rs=mysql_query($query); //echo $query; echo "
FirstFirstPreviousPrevious$j$jNext$nextPage$nextPageNextLastLast
"; if($totRecords==0) { echo ""; echo ""; echo ""; } $i=0; while($row=mysql_fetch_array($rs)) { $i++; $rateSql="select avg(points) from rating where article_id=".$row["article_id"]; $rate=ReturnAnyValue($rateSql); if($rate=="") $rate=0; else $rate=round($rate,1); $voteSql="select sum(votes) from vote where article_id=".$row["article_id"]; $votes=ReturnAnyValue($voteSql); if($votes=="") $votes=0; $id=$row["article_id"]; //if($row["image"]=="") //{ echo ""; echo ""; echo ""; echo ""; //} /*else { echo ""; echo ""; echo ""; echo ""; echo ""; }*/ } switch($totPages) { case 2: $width="25%"; break; case 3: $width="30%"; break; case 4: $width="35%"; break; case 5: $width="40%"; break; case 6: $width="45%"; break; case 7: $width="50%"; break; case 8: $width="55%"; break; case 9: $width="55%"; break; default: $width="60%"; break; } if($totPages > 1) { echo ""; echo ""; echo ""; } echo ""; echo ""; //echo ""; echo ""; echo ""; echo "
"; echo "Currently there are no news/articles in this category."; echo "
"; echo ""; echo ""; echo "
$votes
"; //echo "Votes"; echo "Vote"; echo "
"; //echo ""; echo "
".$row["title"]."
"; echo "
Posted by ".$row["user_name"]." on ".formatDate($row["post_date"])." (".trimURL($row["url"]).")
"; echo "
Category : ".$row["cat_name"]." | Tags : ".splitTags($row["tags"])." | Current Rating : $rate/5.0 | Views : ".$row["views"]."
"; if($row["image"]!="") { $photo="admin/photo/".$row["image"]; echo "
"; } echo "
"; if($row["image2"]!="") { $photo="admin/photo/".$row["image2"]; echo "
"; } echo $row["summary"]; echo ""; if($i!=3) include 'inc/middle-adds.php'; else include 'inc/google_referal.php'; echo "
"; echo ""; echo ""; echo "
$votes
"; //echo "Votes"; echo "Vote"; echo "
"; echo ""; echo "
Posted by ".$row["user_name"]." on ".formatDate($row["post_date"])." (".trimURL($row["url"]).")
"; echo "
Category : ".$row["cat_name"]." | Tags : ".splitTags($row["tags"])." | Current Rating : $rate/5.0
"; echo $row["summary"]; echo ""; include 'inc/middle-adds.php'; echo "

(Click to Enlarge)
"; echo ""; echo $firstURL.$prevURL.$urls.$nextURL.$lastURL; echo "
"; echo "
"; include_once 'inc/tags.php'; echo "
"; ?>