|
|
$arc=intval($_GET['arc']);
if($arc>0)
echo "Все новости за ".CMonth(intval($arc%100))." ".substr($arc,0,4);
else
echo "Н О В О С Т И";
?>
|
 |
|
 |
| |
//
// Новости
//
$FORUM=7;
$r=my_mysql_query("SELECT t.topic_id AS topic_id, t.topic_title AS topic_title, t.topic_time AS topic_time, t.topic_poster AS topic_poster, t.topic_replies AS topic_replies, t.topic_first_post_id AS topic_first_post_id, p.post_text AS post_text, p.post_id AS post_id, p.bbcode_uid AS bbcode_uid FROM phpbb_topics AS t, phpbb_posts_text AS p WHERE t.forum_id=$FORUM AND p.post_id=t.topic_first_post_id ".($arc>0?"AND YEAR(FROM_UNIXTIME(t.topic_time))=".intval($arc/100)." AND MONTH(FROM_UNIXTIME(t.topic_time))=".intval($arc%100):"")." ORDER BY t.topic_time DESC".($arc>0?"":" LIMIT 10"));
while($fetch=mysql_fetch_array($r))
{
$r_post=my_mysql_query("SELECT post_username FROM phpbb_posts WHERE post_id=$fetch[topic_first_post_id]");
$fetch_post=mysql_fetch_array($r_post);
if($fetch[topic_poster]>0)
{
$r2=my_mysql_query("SELECT username FROM phpbb_users WHERE user_id=$fetch[topic_poster]");
$fetch2=mysql_fetch_array($r2);
$author=$fetch2[username];
}
else // определяем автора из поста
{
$author=$fetch_post[post_username];
}
$message = $fetch[post_text];
if( $fetch_post[enable_bbcode] == 1 )
$message = bbencode_second_pass($message,$fetch[bbcode_uid]);
$message = make_clickable($message);
if( $fetch_post[enable_smilies] == 1)
$message = smilies_pass($message);
$message = str_replace("\n", "\n \n", $message);
echo "$fetch[topic_title]".FullDate(date("Y-m-d H:i:s",$fetch[topic_time]))." - $author - ";
if($fetch[topic_replies]>0)
echo "Комментарии ($fetch[topic_replies])";
else
echo "Прокомментировать";
echo " $message
"; // текст сообщения
}
//
// Ссылки на страницы архива новостей
//
echo "Архив новостей:";
$arcfile = '.htcache/arclist.html';
if( file_exists($arcfile) && intval( date('Ym', filemtime($arclist)) ) >= intval(date('Ym')) )
echo file_get_contents($arcfile);
else
{
$str = '';
for($arcy=date('Y');$arcy>=2002;$arcy--)
{
$str .= "$arcy: ";
$lastm = ($arcy==date('Y')?date('n'):12);
for($arcm=($arcy==2002?10:1); $arcm<=$lastm; $arcm++)
$str .= ''.CMonth($arcm).' ';
$str.=' ';
}
file_put_contents($arcfile,$str);
echo $str;
}
/*
$r=my_mysql_query("SELECT YEAR(FROM_UNIXTIME(topic_time)) as year, MONTH(FROM_UNIXTIME(topic_time)) AS month FROM phpbb_topics WHERE forum_id=$FORUM GROUP BY year,month ORDER BY year DESC, month");
$last_y=0;
while($fetch=mysql_fetch_array($r))
{
if($fetch['year']!=$last_y)
{
echo ($last_y==0?"":" ").$fetch['year'].": ";
$last_y = $fetch['year'];
}
echo "".CMonth($fetch[month])." ";
}
*/
echo "
";
?>
|
|
| |
|
|
|
|
//
// Цикл - 2рецензии / 3статьи / 4архив / 5поэзия / 6музыка / 9объвления
//
$headers_forum = array(2,3,4,5,6,9);
foreach($headers_forum as $i)
{
echo "$titles[$i]";
$r=my_mysql_query("SELECT forum_id, topic_id, topic_time, topic_poster, topic_title, topic_first_post_id, topic_replies FROM phpbb_topics WHERE forum_id=$i ORDER BY topic_time DESC LIMIT 5");
while($fetch=mysql_fetch_array($r))
{
$author=GetAuthor($fetch[topic_poster] ,$fetch[topic_first_post_id]);
echo " ".FullDate(date("Y-m-d",$fetch[topic_time])) . ", $author";
echo " $fetch[topic_title]";
if($fetch[topic_replies]>0)
echo " Обсуждение (".$fetch[topic_replies].")";
echo " ";
}
echo " ";
}
//
// Голосовалка
//
$r=my_mysql_query("SELECT MAX(week) AS week FROM neformattop20");
$fetch=mysql_fetch_array($r);
$lastweek=$fetch[week];
echo "Барабанная топь";
$r=my_mysql_query("SELECT id,nomer,last,name,nomer+0 AS nom FROM neformattop20 WHERE week=$lastweek AND nomer+0>0 ORDER BY nom LIMIT 11");
$i=1;
while($fetch=mysql_fetch_array($r))
echo "- $fetch[name]
";
echo " ";
?> |
require_once("page2.php");
?> |