0) { $linkrow = mysql_fetch_array($result); $cms[title] = $linkrow[name]; $cms[description] = str_replace('%name%', $linkrow[name], stripslashes($cms[description])); $cms[description] = str_replace('%description%', substr($linkrow[description],0,100), stripslashes($cms[description])); $cms[description] = str_replace('%link%', $linkrow[url], $cms[description]); } else { header( "Location: /" ); } } if ($section == 'category') { if ($_GET[subname]) { $query = "SELECT * FROM category WHERE url='".$_GET[subname]."'"; } else { $query = "SELECT * FROM category WHERE url='".$_GET[mainname]."'"; } $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $catexist = mysql_num_rows($result); if ($catexist > 0) { $catrow = mysql_fetch_array($result); $sql = mysql_query("SELECT id FROM links WHERE category=".$catrow[id]." AND status='approved' AND site=".$site[id]) or die(mysql_error()); $linkcount = mysql_num_rows($sql); $cms[description] = str_replace('%category%', strtolower($catrow[name]), stripslashes($cms[description])); $cms[description] = $cms[description]; $cms[title] = $catrow[name].' '.($cms[title] != "" ? "- " : "").stripslashes($cms[title]); } else { header( "Location: /" ); } } if ($section == 'tags') { $query = "SELECT * FROM tags WHERE tag='".nodashes($_GET[word])."'"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $tagsexist = mysql_num_rows($result); if ($tagsexist > 0) { $tagrow = mysql_fetch_array($result); $cms[title] = str_replace('%tag%', $tagrow[tag], stripslashes($cms[title])); $cms[description] = str_replace('%tag%', $tagrow[tag], stripslashes($cms[description])); } else { header( "Location: /" ); } } if ($section == 'pages') { $query = "SELECT * FROM pages WHERE siteurl='".$_GET[title]."' AND status='published'"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $pageexist = mysql_num_rows($result); if ($pageexist > 0) { $pagerow = mysql_fetch_array($result); $cms[title] = stripslashes($pagerow[title]); $cms[description] = stripslashes($pagerow[description]); } else { header( "Location: /p" ); } } ?> <? echo ucfirst(stripslashes($cms[title])).' » '.$site[domain]; ?>