Файл: forum/inc/set_them_form.php
Строк: 60
<?
if (isset($_GET['act']) && $_GET['act']=='mesto' && (user_access('forum_them_edit') || $ank2['id']==$user['id']))
{
echo "<form method='post' action='/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto&ok'>";
echo "<b>Раздел:</b><br />";
echo "<select name='razdel'>";
if (user_access('forum_them_edit'))
{
$q = mysql_query("SELECT * FROM `forum_f` ORDER BY `pos` ASC");
while ($forums = mysql_fetch_assoc($q))
{
echo "<optgroup label='".$forums['name']."'>";
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forums[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2))
{
echo "<option".($razdel['id']==$razdels['id']?' selected="selected"':null)." value="$razdels[id]">$razdels[name]</option>";
}
echo "</optgroup>";
}
}else{
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2))
{
echo "<option".($razdel['id']==$razdels['id']?' selected="selected"':null)." value='$razdels[id]'>$razdels[name]</option>n";
}
}
echo "</select><br />";
echo "<input value='Переместить' type='submit' /><br />";
echo "<img src='/s-klub/img/left.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>Отмена</a><br />";
echo "</form>";
}
if (isset($_GET['act']) && $_GET['act']=='set' && ((user_access('forum_them_edit') && $ank2['level']<$user['level']) || $ank2['id']==$user['id']))
{
echo "<form method='post' action='/forum/$forum[id]/$razdel[id]/$them[id]/?act=set&ok'>";
echo "<b>Название темы:</b><br />";
echo "<input name='name' type='text' maxlength='32' value='$them[name]' /><br />";
if ($user['set_translit']==1)
{
echo "<label><input type='checkbox' name='translit1' value='1' /> Транслит</label><br />";
}
if ($user['level']>0)
{
if ($them['up']==1)
{
$check=' checked="checked"';
}else{
$check=NULL;
}
echo "<label><input type='checkbox'$check name='up' value='1' /> Всегда наверху</label><br />";
}
if ($them['close']==1)
{
$check=' checked="checked"';
}else{
$check=NULL;
}
echo "<label><input type='checkbox'$check name='close' value='1' /> Закрыть</label><br />";
if ($ank2['id']!=$user['id'])
{
echo "<label><input type='checkbox' name='autor' value='1' /> Забрать у автора права</label><br />";
}
echo "<input value='Изменить' type='submit' /><br />";
echo "<img src='/s-klub/img/left.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>Отмена</a><br />";
echo "</form>";
}
if (isset($_GET['act']) && $_GET['act']=='del' && user_access('forum_them_del') && ($ank2['level']<$user['level'] || $ank2['id']==$user['id']))
{
echo "<div class='err'>";
echo "<b>Подтвердите удаление темы</b><br />";
echo "<img src='/s-klub/img/yes.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=delete&ok'>Да</a> | <img src='/s-klub/img/no.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>Нет</a><br />";
echo "</div>n";
}
if (isset($_GET['act']) && $_GET['act']=='post_delete' && (user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']))
{
echo "<input value='Удалить выбранные посты' type='submit' /><br />";
echo "<img src='/s-klub/img/left.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>Отмена</a><br />";
echo "</form>";
}
if (((!isset($_GET['act']) || $_GET['act']!='post_delete') && (user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']))
|| ((user_access('forum_them_edit') && $ank2['level']<$user['level']) || $ank2['id']==$user['id'])
|| (user_access('forum_them_del') && ($ank2['level']<$user['level'] || $ank2['id']==$user['id'])))
{
echo "<div class='foot'>";
if ((!isset($_GET['act']) || $_GET['act']!='post_delete') && (user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']))
{
echo "<img src='/s-klub/img/post-del.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=post_delete'>Удаление постов</a><br />";
}
if ((user_access('forum_them_edit') && $ank2['level']<$user['level']) || $ank2['id']==$user['id'])
{
echo "<img src='/s-klub/img/tema-go.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto'>Переместить тему</a><br />";
echo "<img src='/s-klub/img/tema-edit.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=set'>Параметры темы</a><br />";
}
if (user_access('forum_them_del') && ($ank2['level']<$user['level'] || $ank2['id']==$user['id']))
{
echo "<img src='/s-klub/img/them_01.png'> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=del'>Удалить тему</a><br />";
}
echo "</div>";
}
?>