Новости"; closetable(); echo "
"; automated_news(); if (isset($cookie[3]) AND $user_news == 1) { $storynum = $cookie[3]; } else { $storynum = $storyhome; } if ($new_topic == 0) { $qdb = "WHERE (ihome='0' OR catid='0')"; $home_msg = ""; } else { $qdb = "WHERE topic='$new_topic'"; $res = sql_query("select topictext from ".$prefix."_topics where topicid='$new_topic'", $dbi); list($topic_title) = sql_fetch_row($res, $dbi); OpenTable(); if (sql_num_rows($res, $dbi) == 0) { echo "
$sitename

"._NOINFO4TOPIC."

[ "._GOTONEWSINDEX." | "._SELECTNEWTOPIC." ]
"; } else { echo "
$sitename: $topic_title

" ."
" ."" .""._SEARCHONTOPIC.":   " ."" ."
" ."[ "._GOTOHOME." | "._SELECTNEWTOPIC." ]
"; } closetable(); echo "
"; } if ($pagenum == "") { $pagenum = 1 ; } $offset = ($pagenum-1) * $storynum ; $result = sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings, bnd FROM ".$prefix."_stories $qdb $querylang ORDER BY bnd DESC, sid DESC limit $offset, $storynum", $dbi); while (list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes, $acomm, $score, $ratings, $bnd) = sql_fetch_row($result, $dbi)) { if ($catid > 0) { list($cattitle) = sql_fetch_row(sql_query("select title from ".$prefix."_stories_cat where catid='$catid'", $dbi), $dbi); } getTopics($s_sid); formatTimestamp($time); $subject = stripslashes($subject); $hometext = stripslashes($hometext); $notes = stripslashes($notes); $subject = bkuser_replace($subject); $hometext = bkuser_replace($hometext); $bodytext = bkuser_replace($bodytext); $notes = bkuser_replace($notes); // $hometext = nl2br($hometext); // $bodytext = nl2br($bodytext); // $notes = nl2br($notes); $bnd = intval($bnd); $introcount = strlen($hometext); $fullcount = strlen($bodytext); $totalcount = $introcount + $fullcount; $c_count = $comments; $r_options = ""; if (isset($cookie[4])) { $r_options .= "&mode=$cookie[4]"; } if (isset($cookie[5])) { $r_options .= "&order=$cookie[5]"; } if (isset($cookie[6])) { $r_options .= "&thold=$cookie[6]"; } if (is_user($user)) { $the_icons = " | \""._PRINTER."\"  \""._FRIEND."\""; } else { $the_icons = ""; } $story_link = ""; $morelink = ""; if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) { $morelink .= "$story_link"._READMORE." [$c_count] "; } else { $morelink .= ""; } if ($fullcount > 0) { $morelink .= " "; } if ($articlecomm == 1 AND $acomm == 0) { if ($c_count == 0) { $morelink .= " "; } elseif ($c_count == 1) { $morelink .= " "; } elseif ($c_count > 1) { $morelink .= " "; } } $morelink .= " "; $sid = $s_sid; if ($catid != 0) { $resultm = sql_query("select title from ".$prefix."_stories_cat where catid='$catid'", $dbi); list($title1) = sql_fetch_row($resultm, $dbi); $title = "$title1: $title"; $morelink .= " "; } if ($score != 0) { $rated = substr($score / $ratings, 0, 4); } else { $rated = 0; } $morelink .= " "; $morelink .= " "; $morelink = str_replace(" ", " ", $morelink); $sqlcc = "SELECT COUNT(*) FROM ".$prefix."_comments WHERE sid='$sid'"; $rescc = sql_query($sqlcc, $dbi); list($comcount) = sql_fetch_row($rescc, $dbi); if ($bnd) $title = "Прикреплена     ".$title; themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext, $bnd, $comcount); } $res = sql_query("select * from ".$prefix."_stories where ihome=0", $dbi); $numstories = sql_num_rows($res, $dbi); $numpages = ceil($numstories / $storynum); if ($numpages > 1) { echo "
Всего $numstories статьи
" ; echo "[ " ; for ($i=1; $i < $numpages+1; $i++) { if ($i > $pagenum - 5 && $i < $pagenum+5){ if ($i == $pagenum) { echo "$i"; } else { echo "$i"; } if ($i < $numpages) { echo " | "; } else { echo " ]
"; } } elseif ($i+5 == $pagenum){ $brb = ($i-20 < 1) ? 1 : $i-9;