include("inc/settings.php");
include("inc/functions.php");
global $post;
/*function doGenComments()
{
global $message;
if( isset( $_GET['post']))
$id = intval($_GET['post']);
$vars = explode("/",$_SERVER['REQUEST_URI']);
if( isset( $vars[2] ) ) {
$page = intval($vars[2]);
if( $page < 0 || $page > 10000 )
$page = 0;
}
$querycomm = "SELECT * FROM comments WHERE post_id = $id";
$result = execute_query($querycomm);
if( mysql_num_rows($result) > 0 )
{
while( $line = mysql_fetch_row($result) )
{
$message.="";
}
}
else
{
$message.=""; //No comments on this post.
}
}*/
function getpost() {
$postnum = 0;
$vars = explode("/",$_SERVER['REQUEST_URI']);
if(isset($_GET['post'])) {
$postnum=$_GET['post'];
} else if ( isset($vars[2]) ) {
$postnum = intval($vars[2]);
if( $postnum < 0 || $postnum > 10000 )
$postnum = 0;
} else {
echo( '
Error
You\'ve reached this page incorrectly. Please return Home and follow a different link.
\n\t
');
exit(0);
}
$query="SELECT * FROM posts WHERE id=$postnum";
$result=execute_query($query);
if( mysql_num_rows($result) >0 )
{
$line = mysql_fetch_row($result);
$article = nl2br($line['3']);
$post="
$line[4]
\n\t
\n\n\n";
//$post.=doGenComments();
}
else{exit(0);}
echo( $post );
}
?>
Fatal error: Call to undefined function getpost() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs1\inc\post.inc on line 84