sibtracker/system/inc/forum/form.php
2019-05-18 13:46:03 +08:00

367 lines
10 KiB
PHP

<?php
/*
=====================================================
DLE Forum - by DLE Files Group
-----------------------------------------------------
http://dle-files.ru/
-----------------------------------------------------
File: form.php
=====================================================
Copyright (c) 2008,2010 DLE Files Group
=====================================================
*/
function echo_category($type, $name = false, $sid = false){
global $f_lg;
if ($type == "new")
{
$act = "category_add";
$button = $f_lg['button_add'];
}
if ($type == "edit")
{
$act = "category_save&sid={$sid}";
$button = $f_lg['button_edit'];
}
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"260\">{$f_lg['cat_name']}</td>
<td><input class=\"edit\" type=\"text\" name=\"name\" value=\"$name\" size=\"27\"></td></tr>
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
<tr>
<td width=\"260\">&nbsp;</td>
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
</table></form>";
}
function echo_forum($type, $id = false, $sub_id = false){
global $db, $f_lg, $user_group, $category_list, $forum_list, $sub_id;
if ($type == "new")
{
$act = "forum_add";
$button = $f_lg['button_add'];
category_list($id);
forum_list($sub_id);
$access_forum = access_forum($user_group, '0');
$f_form['postcount'] = 1;
}
if ($type == "edit")
{
include(SYSTEM_DIR.'/classes/parse.class.php');
$parse = new ParseFilter();
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$id'");
while ($row = $db->get_row($result))
{
$f_form['name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array("&quot;", "&#039;"),$row['name']));
$f_form['description'] = stripslashes(preg_replace(array("'\"'", "'\''"), array("&quot;", "&#039;"),$row['description']));
$f_form['password'] = stripslashes(preg_replace(array("'\"'", "'\''"), array("&quot;", "&#039;"),$row['password']));
$f_form['rules_name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array("&quot;", "&#039;"),$row['rules_title']));
$f_form['rules'] = $parse->decodeBBCodes($row['rules'], false);
$f_form['icon'] = stripslashes(preg_replace(array("'\"'", "'\''"), array("&quot;", "&#039;"),$row['icon']));
$sel_id = $row['main_id'];
$forum_id = $row['id'];
$parentid = $row['parentid'];
$f_form['postcount'] = $row['postcount'];
$f_form['fixpost'] = $row['fixpost'];
$f_form['banner'] = stripslashes($row['banner']);
$f_form['q_reply'] = intval($row['q_reply']);
$f_form['i_edit'] = intval($row['i_edit']);
}
$act = "forum_save&id=$forum_id";
$button = $f_lg['button_edit'];
category_list($sel_id);
forum_list($parentid);
$access_forum = access_forum($user_group, $forum_id);
}
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_mset']}</strong></legend><br />
<table border=\"0\" width=\"100%\">
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_name']}</b></td>
<td><input class=\"edit\" type=\"text\" name=\"name\" value=\"{$f_form['name']}\" size=\"27\"></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_descr']}</b></td>
<td><TEXTAREA name=\"description\" rows=4 cols=60>{$f_form['description']}</TEXTAREA></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_icon']}</b></td>
<td><input class=\"edit\" type=\"text\" name=\"icon\" value=\"{$f_form['icon']}\" size=\"27\"><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$f_lg[forum_icon_hint]}', this, event, '250px')\">[?]</a></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['password']}</b></td>
<td><input class=\"edit\" type=\"text\" name=\"password\" value=\"{$f_form['password']}\" size=\"27\"></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_cat']}</b></td>
<td><SELECT name=\"main_id\">{$category_list}</SELECT></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_for']}</b></td>
<td><SELECT name=\"parentid\">{$forum_list}</SELECT></td>
</tr>
<tr><td colspan=\"2\"></td></tr></table></fieldset><br />
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_posts_conf']}</strong></legend><br />
<table border=\"0\" width=\"100%\">
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_postcount']}</b></td>
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "postcount", $f_form['postcount'])."</td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_fixpost']}</b></td>
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "fixpost", $f_form['fixpost'])."</td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_q_reply']}</b></td>
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "q_reply", $f_form['q_reply'])."</td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_i_edit']}</b></td>
<td>".makeDropDown(array("1"=>$f_lg['yes'],"0"=>$f_lg['no']), "i_edit", $f_form['i_edit'])."</td>
</tr>
<tr><td colspan=\"2\"></td></tr></table>
</fieldset><br />
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_rules']}</strong></legend><br />
<table border=\"0\" width=\"100%\">
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_rules1']}</b></td>
<td><input class=\"edit\" type=\"text\" name=\"rules_name\" value=\"{$f_form['rules_name']}\" size=\"27\"></td>
</tr>
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_rules2']}</b></td>
<td><TEXTAREA name=\"rules\" rows=10 cols=60>{$f_form['rules']}</TEXTAREA></td>
</tr>
<tr><td colspan=\"2\"></td></tr></table>
</fieldset><br />
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_banner']}</strong></legend><br />
<table border=\"0\" width=\"100%\">
<tr>
<td style=\"padding:4px\" class=\"option\" width=\"260\" height=\"25\"><b>{$f_lg['forum_banner2']}</b></td>
<td><TEXTAREA name=\"banner\" rows=10 cols=60>{$f_form['banner']}</TEXTAREA></td>
</tr>
<tr><td colspan=\"2\"></td></tr></table>
</fieldset><br />
<fieldset><legend class=\"quick\"><strong>{$f_lg['forum_access']}</strong></legend><br />{$access_forum}</fieldset>
<table border=\"0\" width=\"100%\">
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
<tr>
<td width=\"260\">&nbsp;</td>
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
</table></form>";
}
function echo_rank($type, $id = false){
global $db, $f_lg;
if ($type == "new")
{
$act = "rank_add";
$button = $f_lg['button_add'];
}
if ($type == "edit")
{
$act = "rank_save&id=$id";
$button = $f_lg['button_edit'];
$result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_titles WHERE id = '$id'");
$t_name = $result['title'];
$t_posts = $result['posts'];
$t_pips = $result['pips'];
}
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=$act\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"260\">{$f_lg['titles_nname']}</td>
<td><input class=\"edit\" type=\"text\" name=\"t_name\" value=\"$t_name\" size=\"27\"></td></tr>
<tr>
<td width=\"260\">{$f_lg['titles_npost']}</td>
<td><input class=\"edit\" type=\"text\" name=\"t_posts\" value=\"$t_posts\" size=\"27\"></td></tr>
<tr>
<td width=\"260\">{$f_lg['titles_npips']}</td>
<td><input class=\"edit\" type=\"text\" name=\"t_pips\" value=\"$t_pips\" size=\"27\"></td></tr>
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
<tr>
<td width=\"260\">&nbsp;</td>
<td><input type=\"submit\" class=\"buttons\" value=\"{$button}\"></td></tr>
</table></form>";
}
if(!defined('DLE_FORUM')){ exit; }
function echo_mail($name, $text, $description)
{
echo "<table width=\"100%\">
<tr>
<td style=\"padding:2px;\">{$description}</td>
</tr>
<tr>
<td style=\"padding:2px;\"><textarea rows=\"15\" style=\"width:650px;\" name=\"{$name}\">{$text}</textarea></td>
</tr>
</table>";
}
function echo_rank_style ()
{
global $config;
$style = <<<HTML
<style type="text/css" media="all">
.rank {
width: 85px;
height: 16px;
}
.unit-rank {
list-style: none;
margin: 0px;
padding: 0px;
width: 85px;
height: 16px;
position: relative;
background-image: url('{THEME}/forum/images/rating.gif');
background-position: top left;
background-repeat: repeat-x;
}
.unit-rank li {
text-indent: -90000px;
padding: 0px;
margin: 0px;
float: left;
}
.unit-rank li a {
display: block;
width: 17px;
height: 16px;
text-decoration: none;
text-indent: -9000px;
z-index: 17;
position: absolute;
padding: 0px;
}
.unit-rank li a:hover {
background-image: url('{THEME}/forum/images/rating.gif');
background-position: left center;
z-index: 2;
left: 0px;
}
.unit-rank a.r1-unit { left: 0px; }
.unit-rank a.r1-unit:hover { width: 17px; }
.unit-rank a.r2-unit { left: 17px; }
.unit-rank a.r2-unit:hover { width: 34px; }
.unit-rank a.r3-unit { left: 34px; }
.unit-rank a.r3-unit:hover { width: 51px; }
.unit-rank a.r4-unit { left: 51px; }
.unit-rank a.r4-unit:hover { width: 68px; }
.unit-rank a.r5-unit { left: 68px; }
.unit-rank a.r5-unit:hover { width: 85px; }
.unit-rank li.current-rank {
background-image: url('{THEME}/forum/images/rating.gif');
background-position: left bottom;
position: absolute;
height: 16px;
display: block;
text-indent: -9000px;
z-index: 1;
}
</style>
HTML;
echo str_replace('{THEME}', $config['http_home_url'].'templates/'.$config['skin'], $style);
}
?>