";
} else
{
$div = "
";
}
echo "$div";
if ($arr[edit] == 1)
{
echo "
";
} else
{
echo "
";
}
echo "
$arr[text][$colmes1]";
if ($cpg > 1)
{
if (((empty($_SESSION['uid'])) && (!empty($_SESSION['uppost'])) && ($_SESSION['uppost'] == 1)) || ((!empty($_SESSION['uid'])) && $upfp == 1))
{
echo "
[<<]";
} else
{
echo "
[>>]";
}
}
echo "
";
echo "
(" . date("H:i /d.m.y", $arr['time']) . ")[$arr[from]";
if (!empty($nam['from']))
{
echo "
/$nam[from]";
}
echo "
]";
echo "$frm[text]/$razd[text]";
echo "
";
$i++;
}
echo "
";
echo "Всего: $count
";
if ($count > $kmess)
{
if ($offpg != 1)
{
echo "Страницы:
";
} else
{
echo "Страниц: $ba
";
}
if ($start != 0)
{
echo '
<< ';
}
if ($offpg != 1)
{
navigate('index.php?act=new&do=all&vr=' . $vr . '&submit', $count, $kmess, $start, $page);
} else
{
echo "
[$page]";
}
if ($count > $start + $kmess)
{
echo '
>>';
}
echo "
";
}
} else
{
echo "
";
}
echo '
Вернуться';
break;
default:
////////////////////////////////////////////////////////////
// Вывод списка непрочитанных тем форума //
////////////////////////////////////////////////////////////
$knt = forum_new();
$start = $page * $kmess - $kmess;
if ($dostsadm == 1)
{
$req = mysql_query("SELECT *
FROM `forum`
LEFT JOIN `cms_forum_rdm` ON `forum`.`id` = `cms_forum_rdm`.`topic_id` AND `cms_forum_rdm`.`user_id` = '" . $user_id . "'
WHERE `forum`.`type`='t'
AND `moder`='1'
AND (`cms_forum_rdm`.`topic_id` Is Null
OR `forum`.`time` > `cms_forum_rdm`.`time`)
ORDER BY `forum`.`time` DESC
LIMIT " . $start . "," . $kmess . ";");
} else
{
$req = mysql_query("SELECT *
FROM `forum`
LEFT JOIN `cms_forum_rdm` ON `forum`.`id` = `cms_forum_rdm`.`topic_id` AND `cms_forum_rdm`.`user_id` = '" . $user_id . "'
WHERE `forum`.`type`='t'
AND `moder`='1'
AND `close`!='1'
AND (`cms_forum_rdm`.`topic_id` Is Null
OR `forum`.`time` > `cms_forum_rdm`.`time`)
ORDER BY `forum`.`time` DESC
LIMIT " . $start . "," . $kmess . ";");
}
while ($res = mysql_fetch_array($req))
{
$q3 = mysql_query("SELECT `id`, `refid`, `text` FROM `forum` WHERE `type`='r' AND `id`='" . $res['refid'] . "';");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("SELECT `text` FROM `forum` WHERE `type`='f' AND `id`='" . $razd['refid'] . "';");
$frm = mysql_fetch_array($q4);
$colmes = mysql_query("SELECT * FROM `forum` WHERE `refid`='" . $res['id'] . "' AND `type`='m' AND `close`!='1' order by time desc;");
$colmes1 = mysql_num_rows($colmes);
$nick = mysql_fetch_array($colmes);
echo '';
}
echo '';
if ($knt > $kmess)
{
echo '
';
// Постраничная навигация
$pagenav = array('address' => 'index.php?act=new', 'total' => $knt, 'numpr' => $kmess, 'page' => $page);
pagenav($pagenav);
echo '
';
echo '';
}
echo '
Сброс!
';
echo 'Показать за период...
';
echo 'Выбор подфорумов
';
if (empty($_SESSION['uid']))
{
if ((empty($_SESSION['uppost'])) || ($_SESSION['uppost'] == 0))
{
echo "»
Новые вверху";
} else
{
echo "»
Новые внизу";
}
}
break;
}
} else
{
$lp = mysql_query("select * from `forum` where type='t' and moder='1' order by time desc LIMIT 10;");
while ($arr = mysql_fetch_array($lp))
{
$q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "';");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "';");
$frm = mysql_fetch_array($q4);
$colmes = mysql_query("select `id` from `forum` where type='m' and close!='1' and refid='" . $arr['id'] . "' order by time desc;");
$nikuser = mysql_query("SELECT `from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $arr['id'] . "'ORDER BY time DESC LIMIT 1;");
$colmes1 = mysql_num_rows($colmes);
$cpg = ceil($colmes1 / $kmess);
$colmes1 = $colmes1 - 1;
if ($colmes1 < 0)
{
$colmes1 = 0;
}
$nam = mysql_fetch_array($nikuser);
$d = $i / 2;
$d1 = ceil($d);
$d2 = $d1 - $d;
$d3 = ceil($d2);
if ($d3 == 0)
{
$div = "
";
} else
{
$div = "
";
}
echo "$div";
if ($arrt['edit'] == 1)
{
echo "
";
} else
{
echo "
";
}
echo "
$arr[text][$colmes1]";
if ($cpg > 1)
{
if (((empty($_SESSION['uid'])) && (!empty($_SESSION['uppost'])) && ($_SESSION['uppost'] == 1)) || ((!empty($_SESSION['uid'])) && $upfp == 1))
{
echo "
[<<]";
} else
{
echo "
[>>]";
}
}
echo "
";
echo "(" . date("H:i /d.m.y", $arr['time']) . ")
[$arr[from]";
if (!empty($nam['from']))
{
echo "/$nam[from]";
}
echo "]
";
echo "$frm[text]/$razd[text]";
echo "
";
$i++;
}
}
echo '
В форум';
require_once ("../incfiles/end.php");
?>