database_query($artquery); $art_array = Array(); $art_count=0; while($artdata = $database->database_fetch_assoc($artlist)) { if ($artdata[keywords]>'') { $keywords=$artdata[keywords]; } else { $keywords='диеты,быстрые диеты,мода,модные прически,фитнесс,таблица калорий,как похудеть,похудение,целлюлит,здоровье,питание'; } if ($artdata[description]>'') { $description=$artdata[description]; } else { $description=substr($artdata[short], 0, 180); } $art_array[$art_count] = Array('ddate' => $artdata[ddate], 'artname' => $artdata[artname], 'img' => $artdata[img], 'view' => $artdata[view], 'short' => $artdata[short], 'cat' => $artdata[cat], 'id' => $artdata[id], 'art' => gzuncompress($artdata[art]) ); $pagename=$artdata[artname]; $art_count++; } // ЩОЧЕГ ПРОСМОТРОВ ПЛЮСАДИН $database->database_query("UPDATE se_art SET view=view+1 WHERE id=$id"); // ПЯТЬ СТАТЬИШЕК ИЗ ЭТОЙ ТЕМЫ $query= "Select * from se_art where cat=".$art_array[0][cat]." ORDER BY ddate DESC LIMIT 3"; $qresult = $database->database_query($query); $short_array = Array(); $short_count=0; while($shortdata = $database->database_fetch_assoc($qresult)) { if ($shortdata[id]<846) {$arturl='article.php?id='.$shortdata[id];} else {$arturl=$shortdata[id].'-'.$shortdata[url];} $short_array[$short_count] = Array('ddate' => $shortdata[ddate], 'id' => $shortdata[id], 'img' => $shortdata[img], 'arturl' => $arturl, 'artname' => $shortdata[artname]); $short_count++; } // ПЯТЬ СТАТЬИШЕК ИЗ ЭТОЙ ТЕМЫ $query= "Select * from se_art where cat=".$art_array[0][cat]." ORDER BY ddate DESC LIMIT 3,3"; $qresult = $database->database_query($query); $short_array2 = Array(); $short_count2=0; while($shortdata2 = $database->database_fetch_assoc($qresult)) { $short_array2[$short_count2] = Array('img' => $shortdata2[img]); $short_count2++; } // ПОПУЛЯРНЫЕ СТАТЬИ $query= "Select * from se_art ORDER BY view DESC LIMIT 15"; $qresult = $database->database_query($query); $pop_array = Array(); $pop_count=0; while($popdata = $database->database_fetch_assoc($qresult)) { if ($popdata[id]<846) {$arturl='article.php?id='.$popdata[id];} else {$arturl=$popdata[id].'-'.$popdata[url];} $pop_array[$pop_count] = Array('ddate' => $popdata[ddate], 'id' => $popdata[id], 'img' => $popdata[img], 'arturl' => $arturl, 'artname' => $popdata[artname]); $pop_count++; } shuffle($pop_array); array_splice($pop_array, 3); $smarty->assign('popdata', $pop_array); // IF A COMMENT IS BEING POSTED if($task == "dopost") { $comment_date = time(); $comment_body = $_POST['comment_body']; // RETRIEVE AND CHECK SECURITY CODE IF NECESSARY if($setting[setting_comment_code] != 0 || $user->user_info[user_username] == '') { session_start(); $code = $_SESSION['code']; if($code == "") { $code = randomcode(); } $comment_secure = $_POST['comment_secure']; if($comment_secure != $code) { $is_error = 1; } } // MAKE SURE COMMENT BODY IS NOT EMPTY $comment_body = censor(str_replace("\r\n", "
", $comment_body)); $comment_body = preg_replace('/(
){3,}/is', '

', $comment_body); $comment_body = ChopText($comment_body); if(str_replace(" ", "", $comment_body) == "") { $is_error = 1; $comment_body = ""; } // ADD COMMENT IF NO ERROR if($is_error == 0) { $database->database_query("INSERT INTO se_artcomments (artcomment_artentry_id, artcomment_authoruser_id, artcomment_date, artcomment_body) VALUES ('$art_id', '".$user->user_info[user_id]."', '$comment_date', '$comment_body')"); // INSERT ACTION IF USER EXISTS if($user->user_exists != 0) { $commenter = $user->user_info[user_username]; $comment_body_encoded = $comment_body; if(strlen($comment_body_encoded) > 250) { $comment_body_encoded = substr($comment_body_encoded, 0, 240); $comment_body_encoded .= "..."; } $comment_body_encoded = htmlspecialchars(str_replace("
", " ", $comment_body_encoded)); $actions->actions_add($user, "blogcomment", Array('[username1]', '[username2]', '[id]', '[comment]'), Array($commenter, $owner->user_info[user_username], $blogentry_id, $comment_body_encoded)); } else { $commenter = $blog_entry[11]; } // SEND COMMENT NOTIFICATION IF NECESSARY $owner->user_settings(); if($owner->usersetting_info[usersetting_notify_blogcomment] == 1 & $owner->user_info[user_id] != $user->user_info[user_id]) { send_generic($owner->user_info[user_email], "$setting[setting_email_fromname] <$setting[setting_email_fromemail]>", $setting[setting_email_blogcomment_subject], $setting[setting_email_blogcomment_message], Array('[username]', '[commenter]', '[link]'), Array($owner->user_info[user_username], $commenter, "url_create("blog_entry", $owner->user_info[user_username], $blogentry_info[blogentry_id])."\">".$url->url_create("blog_entry", $owner->user_info[user_username], $blogentry_info[blogentry_id])."")); } } echo ""; exit(); } // MAKE SURE TITLE IS NOT EMPTY if($blogentry_info[blogentry_title] == "") { $blogentry_info[blogentry_title] = $blog_entry[5]; } // CONVERT HTML CHARACTERS BACK $blogentry_info[blogentry_body] = str_replace("\r\n", "", html_entity_decode($blogentry_info[blogentry_body])); // GET BLOG COMMENTS $comment = new se_comment('art', 'artentry_id', $id); $total_comments = $comment->comment_total(); $comments = $comment->comment_list(0, $total_comments); // Get online users $online_array = online_users(); $smarty->assign_by_ref('online_users', $online_array); // FORUM POSTS // $q= "Select * from se_forum_posts where parent_id is NULL order by created DESC limit 0,5"; $forumlist = $database->database_query($q); $forum_array = Array(); $forum_count=0; while($forumdata = $database->database_fetch_assoc($forumlist)) { $forum_array[$forum_count] = Array('cid' => $forumdata[category_id], 'tid' => $forumdata[id], 'title' => $forumdata[title] ); $forum_count++; } $smarty->assign('foumdata', $forum_array); //Games $gamequery= "Select * from se_games,se_users where game_user_id=user_id"; $gamelist = $database->database_query($gamequery); $game_array = Array(); $game_count=0; while($gamedata = $database->database_fetch_assoc($gamelist)) { $game_array[$game_count] = Array('id' => $gamedata[game_id], 'user' => $gamedata[user_username], 'pic' => $gamedata[game_photo] ); $game_count++; } $featured_games = featured_games(4); $smarty->assign_by_ref('featured_games', $featured_games); $smarty->assign('questions', $question_array); // ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER $smarty->assign('artdata', $art_array); $smarty->assign('shortdata', $short_array); $smarty->assign('shortdata2', $short_array2); $smarty->assign('comments', $comments); $smarty->assign('total_comments', $total_comments); $smarty->assign('blogentry_info', $blogentry_info); $smarty->assign('allowed_to_comment', $allowed_to_comment); $smarty->assign('pagename', $pagename); $smarty->assign('keywords', $keywords); $smarty->assign('description', $description); // START USER RATING ADDON VARIABLE $smarty->assign('user_rating', $art_id); // END USER RATING ADDON VARIABLE $smarty->assign('arating', rating_bar($id,5)); switch ($art_array[0][cat]) { case 1: $categ='Мода и стиль'; $categurl='\Мода_и_стиль'; break; case 2: $categ='Здоровье'; $categurl='\Здоровье'; break; case 3: $categ='Фитнес'; $categurl='\Фитнес'; break; case 4: $categ='Питание и Диеты'; $categurl='\Питание_и_диеты'; break; case 5: $categ='Красота'; $categurl='\Красота'; break; case 6: $categ='Карьера'; $categurl='\Карьера'; break; case 7: $categ='Наши будни'; $categurl='\Наши_будни'; break; } $smarty->assign('bread', 'Клеопа.ru » '.$categ.' » '.$art_array[0][artname]); // fuck google $porn = array(442); if (in_array($id,$porn)) $smarty->assign('bad_art', true); else $smarty->assign('bad_art', false); include "footer.php"; ?>