captcha_check($comment)) { // $comment['comment'] .= "
".$comment['code']; $id_comment = $blog->save_comment($comment); redirect("?p=".$comment['id_post']."*#c".$id_comment.""); } else { redirect("?p=".$comment['id_post']."*&msg=CODE_NOK#add_comment"); } } elseif(VIEW_RSS) { if($debug) echo "VIEW_RSS
"; $posts = $blog->get_last_posts($blog->config['posts_for_rss']); } elseif(VIEW_POST) { if($debug) echo "VIEW_POST
"; $posts = $blog->get_post($_GET['p']); $title = $posts[0]['title']; } elseif(VIEW_POST_WITH_COMMENTS) { if($debug) echo "VIEW_POST_WITH_COMMENTS
"; if(isset($_GET['msg']) && $_GET['msg'] == "CODE_NOK") $blog->comment_msg = $blog->lang['CODE_NOK']; $posts = $blog->get_post(substr( $_GET['p'],0,strlen( $_GET['p'] )-1 )); $title = $posts[0]['title']; $with_comments = true; } elseif(VIEW_POSTS_BY_MONTH) { if($debug) echo "VIEW_POST_BY_MONTH
"; $tmp = explode("-",$_GET['p']); $posts = $blog->get_posts_by_month($tmp[0],$tmp[1]); } elseif(VIEW_POSTS_BY_CATEGORY) { if($debug) echo "VIEW_POSTS_BY_CATEGORY
"; $posts = $blog->get_posts_by_category($_GET['c']); $category = $blog->get_category($_GET['c']); $title = $category['name']; } elseif(VIEW_POSTS_BY_SEARCH) { if($debug) echo "VIEW_POSTS_BY_SEARCH
"; $posts = $blog->get_posts_by_search($_GET['k']); } elseif(VIEW_NEXT_POSTS_FROM_POST) { if($debug) echo "VIEW_NEXT_POSTS_FROM_POST
"; $posts = $blog->get_next_posts($_GET['p']); } elseif(VIEW_PREVIOUS_POSTS_FROM_POST) { if($debug) echo "VIEW_PREVIOUS_POSTS_FROM_POST
"; $posts = $blog->get_previous_posts($_GET['p']); } else { if($debug) echo "VIEW_LAST_POSTS"; $posts = $blog->get_last_posts(); $header_menu_except = "Blog"; } if(VIEW_RSS) { header("Content-Type: application/xml;"); $blog->load_rss($posts); } elseif(VIEW_CAMSHOTS) { $blog->load_header($title); $blog->load_header_menu($header_menu_except); $blog->load_menu(); $blog->load_camshots(); $blog->load_tail(); } else { $blog->load_header($title); $blog->load_header_menu($header_menu_except); $categories = $blog->get_categories(1); $blog->load_categories($categories,100); $blog->load_posts($posts,$with_comments,false,false,$with_categories,false); $blog->load_menu(); $blog->load_tail(); } $blog->display(); ?>