Name; $main_id = $rij4->CategoryID; $res3 = mysql_query("SELECT * FROM Categories WHERE DirName = '".mysql_real_escape_string($_GET['subcat'])."' AND Type = 'SubCat' AND CategoryLink = '$main_id'"); $rij3 = mysql_fetch_object($res3); $subcat_name = $rij3->Name; $link_id = $rij3->CategoryID; $title = "$subcat_name"; $titlelinks = "$main_name"; if($subcat_name == "" && $_GET['main'] != "") { header("Location: http://www.attractionsindex.com/attractions/".$_GET['main']); exit; } if($id == "") { $id = 1; } $start = ($id - 1) * 10; $res5 = mysql_query("SELECT * FROM Objects WHERE CategoryLink = '$link_id' ORDER BY AVRrate DESC LIMIT $start, 10"); $ant5 = mysql_num_rows($res5); $res2 = mysql_query("SELECT * FROM Objects WHERE CategoryLink = '$link_id' ORDER BY AVRrate DESC"); $ant2 = mysql_num_rows($res2); $content = ""; if($ant5 == 0) { $content = "No attractions available yet."; } else { if($ant5 == 10) { $end = $start + 10; } else { $end = $start + $ant5; } $start = $start + 1; $thispage = ($id + 1) - 1; $firstpage = 1; $lastpage = ceil($ant2 / 10); $prevpage = $thispage - 1; $nextpage = $thispage + 1; if($lastpage == 1) { $content = $ant2 . " attraction(s) found, showing results " . $start . " - " . $end . "
 "; } else { if($prevpage > 0) { $toev1 = "$prevpage  "; } else { $toev1 = ""; } if($nextpage < $lastpage OR $nextpage == $lastpage) { $toev2 = "$nextpage  "; } else { $toev2 = ""; } if($thispage == $firstpage) { $pag = "$thispage  $toev2"; } if($thispage == $lastpage) { $pag = "  $toev1$thispage"; } if($thispage != $firstpage && $thispage != $lastpage) { $pag = "  $toev1$thispage  $toev2"; } $content = $ant2 . " attraction(s) found, showing results " . $start . " - " . $end . "

" . $pag . "

 "; } $tlr5 = 0; $number = ($start - 1); $content = $content . ""; while($tlr5 < $ant5) { $tlr5++; $number++; $rij5 = mysql_fetch_object($res5); $htitle = $rij5->Title; $description = $rij5->Description; $label = $rij5->FileName; $image = $rij5->Image; $description = stripslashes($description); $content = $content . ""; } $content = $content . "

$number. $htitle

$description
 

"; $content = $content . "

" . $pag . "

"; } require("./template_header.php"); require("./template_content.php"); require("./template_footer.php"); exit; ?>