0){$template = mysql_real_escape_string($_GET['template']);} else {$template=1;} $query = "SELECT body_id, header FROM ck_templates WHERE id = '$template'"; $result = mysql_query($query, $conn) or die(mysql_error()); mysql_select_db($database,$conn); $count_query = "SELECT ck_posts.ID FROM ck_posts WHERE ck_posts.post_parent = 2"; $count_result = mysql_query($count_query, $conn) or die(mysql_error()); $num_rows = mysql_num_rows($count_result); mysql_select_db($database,$conn); $pages = round($num_rows/3)-1; if (mysql_real_escape_string($_GET['page'])>0){$page = mysql_real_escape_string($_GET['page']);$limit = (($page*3)-3);} else {$page=1;$limit= 0;} include("includes/top.php"); include("includes/header.php"); // BEGIN CONTENT echo "
"; echo"

"; echo"
"; if(strlen(mysql_real_escape_string($_GET['category']))>0){$category = mysql_real_escape_string($_GET['category']);} else {$category=2;} $post_query = "SELECT ck_posts.ID, ck_posts.post_author, ck_posts.post_date, ck_posts.post_date_gmt, ck_posts.post_content, ck_posts.post_title, ck_posts.post_excerpt, ck_posts.post_parent, ck_post_images.imageName, ck_post_images.caption FROM ck_posts LEFT JOIN ck_post_images ON ck_post_images.albumID = ck_posts.id WHERE ck_posts.ID ='".mysql_real_escape_string($_GET['id'])."'"; $posts = mysql_query($post_query, $conn) or die(mysql_error()); mysql_select_db($database,$conn); while (list($postID, $post_author, $post_date, $post_date_gmt, $post_content, $post_title, $post_excerpt, $post_parent, $imageName, $caption) = mysql_fetch_row($posts)) { echo"
"; echo"
  • $caption
"; echo"
    "; echo"
  • $post_date
  • "; echo"
    $post_title
    "; echo"
    $post_content
    "; //echo""; echo"
"; echo "
"; echo"
"; } echo"< back to news
"; include("includes/sidebar-home.php"); echo"
"; ?>