Добро пожаловать, Гость!
Просмотр записи
ToGo создал дневник Последние 5 тем форума (Испр.) в категории Полезные коды 20 Фев 2014
Вот Держыте, последние 5 тем форума исправил ошібку
<?
echo "<div class='menu_razd'>";
echo "Последние темы:";
echo "</div>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`"), 0);
if ($k_post > 0)
{
$q=mysql_query("SELECT * FROM `forum_t` ORDER BY `time_create` DESC LIMIT 5");
while ($them = mysql_fetch_assoc($q))
{
/*-----------зебра-----------*/
if ($num==0)
{echo " <div class='nav1'>";
$num=1;
}elseif ($num==1)
{echo " <div class='nav2'>";
$num=0;}
/*---------------------------*/
$forum=mysql_fetch_assoc(mysql_query("SELECT id FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT id FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
if ($post)
{
$ank2=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if ($ank2['id']!=0)$ann = " | $ank2[nick]"; else $ann = " | [Система]";
}else{
$ann = null;
}
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$pageEnd'>
(".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0).")</a> $ann<br />";
echo '</div>';
}
}
?>
Вот Держыте, последние 5 тем форума исправил ошібку
<?
echo "<div class='menu_razd'>";
echo "Последние темы:";
echo "</div>";
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`"), 0);
if ($k_post > 0)
{
$q=mysql_query("SELECT * FROM `forum_t` ORDER BY `time_create` DESC LIMIT 5");
while ($them = mysql_fetch_assoc($q))
{
/*-----------зебра-----------*/
if ($num==0)
{echo " <div class='nav1'>";
$num=1;
}elseif ($num==1)
{echo " <div class='nav2'>";
$num=0;}
/*---------------------------*/
$forum=mysql_fetch_assoc(mysql_query("SELECT id FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT id FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
if ($post)
{
$ank2=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if ($ank2['id']!=0)$ann = " | $ank2[nick]"; else $ann = " | [Система]";
}else{
$ann = null;
}
echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />";
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$pageEnd'>
(".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0).")</a> $ann<br />";
echo '</div>';
}
}
?>
DCMS-Social.ru - движок социальной сети, вап и веб мастерская, файло-обменник и форум.
Статистика DCMS-Social.ru: Пользователей - 14967, тем на форуме - 30292, сообщений - 298885