$cat = slash2($cat);
if(!$cat){
$cat = slash2($_GET['category']);
}else{
$cat = slash2($cat);
}
$pages .= "<a href=\"?page=$d\">$d</a> ";
$pages .= "<a href=\"?page=$d&category=$cat\">$d</a> ";
$h = str_replace("{news}",$allnews,$h);
$h = str_replace("{pagintation}",$allnewspagintation,$h);
echo $h;
}else{
#echo $h;
$sql = "SELECT nppage,newsorder FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$all = mysql_fetch_array($query);
$nppage = $all['nppage'];
$newsorder = $all['newsorder'];
$sql = "SELECT * FROM $newstable ORDER BY timestamp $newsorder LIMIT 0, $nppage";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
echo "<a href=\"?id=".$row[id]."\">" . $row['title']. "</a><br />";
}
$h = str_replace("{news}",$allnews,$h);
$h = str_replace("{pagintation}",$allnewspagintation,$h);
echo $h;
$sql = "SELECT nppage,newsorder FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$all = mysql_fetch_array($query);
$nppage = $all['nppage'];
$newsorder = $all['newsorder'];
$sql = "SELECT * FROM $newstable ORDER BY timestamp $newsorder LIMIT 0, $nppage";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
echo "<a href=\"?id=".$row[id]."\">" . $row['title']. "</a><br />";
}
}else{