$crumbs_main_text :: $cat_name";
}
if ($cat_parent > 0) {
$parent_cat = mysql_query("SELECT * FROM stlinks_cat WHERE cat_id='$cat_parent'") or die("Error: ".mysql_error()." in query: ".$parent_cat);
$result_pc = mysql_fetch_array($parent_cat);
$pc_parent = $result_pc[cat_parent];
$pc_name = $result_pc[cat_name];
$pc_id = $result_pc[cat_id];
$crumbs = "» $crumbs_main_text :: » $pc_name :: $cat_name";
}
?>
// Get and print list of sub-categories if any exist
$sc_query = mysql_query("SELECT * FROM stlinks_cat WHERE cat_parent='$id' ORDER BY cat_order") or die("Error: ".mysql_error()." in query: ".$sc_query);
$sc_result = mysql_num_rows($sc_query);
if ($sc_result > 0) {
?>
}
// Get links in the main category if there are any - duh
if ($count == "") {
$count = "0";
}
$result = mysql_query("SELECT * FROM stlinks_links WHERE link_catid='$id' ORDER BY link_hits DESC LIMIT $count,$link_limit");
$links_here_query = mysql_query("SELECT * FROM stlinks_links WHERE link_catid='$id'") or die("Error: ".mysql_error()." in query: ".$links_here_query);
$links_here = mysql_num_rows($links_here_query);
if ($links_here == "0"){
$links_here = "1";
}
if ($count == "") {
$count = "0";
}
$page = ($count/$link_limit + 1);
while ($link = mysql_fetch_array($result)) {
$link_id = $link[link_id];
$link_name = $link[link_name];
$link_desc = $link[link_desc];
$link_logo = $link[link_logo];
$link_hits = $link[link_hits];
$link_date = $link[link_date];
$link_added = date("F j, Y", $link_date);
if ($id =="1"){
$links .= " | $link_name $link_desc | Date Added: " . $link_added . " Total Hits: " . $link_hits . " |
";
} else if ($id != "1") {
$links .= "» $link_name $link_desc | Date Added: " . $link_added . " Total Hits: " . $link_hits . " |
";
}
}
$total_pages = ceil($links_here / $link_limit);
if ($count + $link_limit < $links_here) {
$new_count = $count + $link_limit;
$nextpage_link = "Next Page »";
}
if ($count - $link_limit >= 0) {
$new_count = $count - $link_limit;
$prevpage_link = "« Previous Page";
}
if (!empty($links)) {
?>
| echo "$prevpage_link"; ?> |
Page echo "$page"; ?> of echo "$total_pages"; ?> |
echo "$nextpage_link"; ?> |
|
| echo "$prevpage_link"; ?> |
Page echo "$page"; ?> of echo "$total_pages"; ?> |
echo "$nextpage_link"; ?> |
|
} else if (empty($links) && $sc_result == 0){
?>
}
?>