message
82
system/inc/forum/email.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: email.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if ($subaction == "save")
|
||||
{
|
||||
$find = array("'<'", "'>'",);
|
||||
|
||||
$replace = array("<", ">",);
|
||||
|
||||
$subscription_text = preg_replace($find,$replace, $db->safesql($_POST['subscription_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$subscription_text' where name='subscription_text'");
|
||||
|
||||
$frend_text = preg_replace($find,$replace, $db->safesql($_POST['frend_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$frend_text' where name='frend_text'");
|
||||
|
||||
|
||||
$report_text = preg_replace($find,$replace, $db->safesql($_POST['report_text']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$report_text' where name='report_text'");
|
||||
|
||||
$new_topic = preg_replace($find,$replace, $db->safesql($_POST['new_topic']));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_email set template='$new_topic' where name='new_topic'");
|
||||
|
||||
|
||||
msg("info",$f_lg['email_ok'], $f_lg['email_ok2'], "?mod=forum");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$db->query("SELECT name, template FROM " . PREFIX . "_forum_email");
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
$$row['name'] = stripslashes($row['template']);
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
echo_top();
|
||||
|
||||
echo "<form action=\"$PHP_SELF?mod=forum&action=email&subaction=save\" method=\"post\">";
|
||||
|
||||
echo_title($f_lg['mail_subscr']);
|
||||
|
||||
echo_mail("subscription_text", $subscription_text, $f_lg['mail_subscr_']);
|
||||
|
||||
echo_title($f_lg['mail_new_topic']);
|
||||
|
||||
echo_mail("new_topic", $new_topic, $f_lg['mail_new_topic_']);
|
||||
|
||||
echo_title($f_lg['mail_frend']);
|
||||
|
||||
echo_mail("frend_text", $frend_text, $f_lg['mail_frend_']);
|
||||
|
||||
echo_title($f_lg['mail_report']);
|
||||
|
||||
echo_mail("report_text", $report_text, $f_lg['mail_report_']);
|
||||
|
||||
echo "<br /><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_save']}\"></form>";
|
||||
|
||||
echo_bottom();
|
||||
}
|
||||
|
||||
?>
|
||||
367
system/inc/forum/form.php
Normal file
@@ -0,0 +1,367 @@
|
||||
<?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\"> </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(""", "'"),$row['name']));
|
||||
$f_form['description'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['description']));
|
||||
$f_form['password'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['password']));
|
||||
|
||||
$f_form['rules_name'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$row['rules_title']));
|
||||
|
||||
$f_form['rules'] = $parse->decodeBBCodes($row['rules'], false);
|
||||
|
||||
$f_form['icon'] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$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\"> </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\"> </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);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
1380
system/inc/forum/forum.php
Normal file
261
system/inc/forum/functions.php
Normal file
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: functions.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DLE_FORUM'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// ACCESS
|
||||
// ********************************************************************************
|
||||
function access_forum($user_group, $forum_id){
|
||||
global $access_forum, $db, $f_lg;
|
||||
|
||||
$access_mod = array();
|
||||
|
||||
$access_topic = array();
|
||||
|
||||
$access_write = array();
|
||||
|
||||
$access_read = array();
|
||||
|
||||
$access_upload = array();
|
||||
|
||||
$access_download = array();
|
||||
|
||||
// JavaScript by ShVad //
|
||||
$access_forum = <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function access_check( id, value )
|
||||
{
|
||||
if (value == 'y'){ value = 1; } else { value = 0; }
|
||||
|
||||
document.getElementById( 'access_mod' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_topic' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_write' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_read' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_upload' + '[' + id + ']' ).checked = value;
|
||||
|
||||
document.getElementById( 'access_download' + '[' + id + ']' ).checked = value;
|
||||
}
|
||||
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
if ($forum_id)
|
||||
{
|
||||
$access_result = $db->query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$forum_id'");
|
||||
|
||||
while ($row = $db->get_row($access_result))
|
||||
{
|
||||
$access_mod = $row['access_mod'];
|
||||
|
||||
$access_topic = $row['access_topic'];
|
||||
|
||||
$access_write = $row['access_write'];
|
||||
|
||||
$access_read = $row['access_read'];
|
||||
|
||||
$access_upload = $row['access_upload'];
|
||||
|
||||
$access_download = $row['access_download'];
|
||||
}
|
||||
}
|
||||
|
||||
$access_forum .= "<table width='100%'><tr>
|
||||
<td class=\"option\" width='16%'><left><b>{$f_lg['access_forum_group']}</b></left></td>
|
||||
<td class=\"option\" width='10%'><center><b>{$f_lg['access_forum_mod']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_topic']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_write']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_read']}</b></center></td>
|
||||
<td class=\"option\" width='14%'><center><b>{$f_lg['access_forum_upload']}</b></center></td>
|
||||
<td class=\"option\" width='16%'><center><b>{$f_lg['access_forum_download']}</b></center></td>
|
||||
</tr></table>
|
||||
<div class='hr_line'></div>";
|
||||
|
||||
$access_forum .= "<table width='100%'>";
|
||||
|
||||
foreach($user_group as $id => $group_name)
|
||||
{
|
||||
if ($forum_id)
|
||||
{
|
||||
$access_mod_array = explode(":",$access_mod);
|
||||
if (in_array($id, $access_mod_array)){$checked1 = "checked";}else{$checked1 = "";}
|
||||
|
||||
$access_topic_array = explode(":",$access_topic);
|
||||
if (in_array($id, $access_topic_array)){$checked2 = "checked";}else{$checked2 = "";}
|
||||
|
||||
$access_write_array = explode(":",$access_write);
|
||||
if (in_array($id, $access_write_array)){$checked3 = "checked";}else{$checked3 = "";}
|
||||
|
||||
$access_read_array = explode(":",$access_read);
|
||||
if (in_array($id, $access_read_array)){$checked4 = "checked";}else{$checked4 = "";}
|
||||
|
||||
$access_upload_array = explode(":",$access_upload);
|
||||
if (in_array($id, $access_upload_array)){$checked5 = "checked";}else{$checked5 = "";}
|
||||
|
||||
$access_download_array = explode(":",$access_download);
|
||||
if (in_array($id, $access_download_array)){$checked6 = "checked";}else{$checked6 = "";}
|
||||
}
|
||||
|
||||
$access_forum .= "<tr>
|
||||
<td style=\"padding:4px\" class=\"option\" width='16%'>
|
||||
<left>{$group_name[group_name]} [<a href=\"javascript:access_check('$id', 'y')\">+</a> |
|
||||
<a href=\"javascript:access_check('$id', 'n')\">-</a>]</left>
|
||||
</td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='10%'>
|
||||
<center><input type='checkbox' name='access_mod[$id]' id='access_mod[$id]' value='$id' $checked1></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_topic[$id]' id='access_topic[$id]' value='$id' $checked2></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_write[$id]' id='access_write[$id]' value='$id' $checked3></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_read[$id]' id='access_read[$id]' value='$id' $checked4></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='14%'>
|
||||
<center><input type='checkbox' name='access_upload[$id]' id='access_upload[$id]' value='$id' $checked5></center></td>
|
||||
<td style=\"padding:4px\" class=\"option\" width='16%'>
|
||||
<center><input type='checkbox' name='access_download[$id]' id='access_download[$id]' value='$id' $checked6></center></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$access_forum .= "</table>";
|
||||
|
||||
return($access_forum);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Category list
|
||||
// ********************************************************************************
|
||||
function category_list($select_id){
|
||||
global $db, $category_list;
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category");
|
||||
|
||||
while ($row = $db->get_row($result)){
|
||||
|
||||
if ($row['sid'] == $select_id){$sel = "selected";}
|
||||
|
||||
else {$sel = "";}
|
||||
|
||||
$row['cat_name'] = stripcslashes($row['cat_name']);
|
||||
|
||||
$category_list .= "<option $sel value=\"{$row['sid']}\">{$row['cat_name']}</option>";
|
||||
}
|
||||
|
||||
return($category_list);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Forum list
|
||||
// ********************************************************************************
|
||||
function forum_list($select_id){
|
||||
global $db, $forum_list;
|
||||
|
||||
$forum_list .= "<option value=\"0\"></option>";
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id ORDER BY posi, position");
|
||||
|
||||
for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid']){
|
||||
|
||||
if ($row['sid'] != $i)
|
||||
{
|
||||
$row['cat_name'] = stripcslashes($row['cat_name']);
|
||||
|
||||
$forum_list .= "<optgroup label=\"{$row['cat_name']}\">";
|
||||
}
|
||||
|
||||
if ($row['name'])
|
||||
{
|
||||
if ($row['id'] == $select_id){$sel = "selected";}
|
||||
|
||||
else {$sel = "";}
|
||||
|
||||
$row['name'] = stripcslashes($row['name']);
|
||||
|
||||
$forum_list .= "<option $sel value=\"{$row['id']}\"> - {$row['name']}</option>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return($forum_list);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Category and Forum POSITION
|
||||
// ********************************************************************************
|
||||
function category_posi($category_posi, $category_id, $result_posi){
|
||||
global $db;
|
||||
|
||||
$cat_posi = array();
|
||||
|
||||
$select_posi = "<select name=\"cat_posi[$category_id]\">";
|
||||
|
||||
for($j=1; $j<=$result_posi; $j++)
|
||||
{
|
||||
if ($j == $category_posi)
|
||||
{
|
||||
$select_posi .= "<option value='$j' selected>$j</option>";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$select_posi .= "<option value='$j'>$j</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$select_posi .= "</select>";
|
||||
|
||||
return ($select_posi);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SELECT USER GROUP
|
||||
// ********************************************************************************
|
||||
function warn_group($warn_group = false){
|
||||
global $db;
|
||||
|
||||
if ($warn_group)
|
||||
{
|
||||
$warn_list = explode (':', $warn_group);
|
||||
}
|
||||
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups GROUP BY id");
|
||||
|
||||
$group_list .= "<option value=\"\"></option>";
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
if ($warn_group)
|
||||
{
|
||||
if (in_array($row['id'], $warn_list))
|
||||
{
|
||||
$selected = "selected";
|
||||
} else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
}
|
||||
|
||||
$group_list .= "<option value=\"{$row['id']}\" {$selected}>{$row['group_name']}</option>";
|
||||
}
|
||||
|
||||
return ($group_list);
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
system/inc/forum/ico/Usergroup.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
system/inc/forum/ico/category.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/content.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/discuss.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
39
system/inc/forum/ico/dle_forum.png
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die('Hacking attempt!');
|
||||
}
|
||||
$forum_link_array['textversion']=$forum_link_array['textversion'].$t_act;
|
||||
$forum_content=array(
|
||||
'{BOARD HEADER}'=>$forum_bar,
|
||||
'{last_visit}'=>$dle_forum_last_visit,
|
||||
'{now_time}'=>langdate($forum_config['timestamp'],$_TIME),
|
||||
'{STATS}'=>$tpl->result['forum_stats'],
|
||||
'[search-link]'=>"<a href=\"{$forum_link_array['search']}\">",
|
||||
'[/search-link]'=> '</a>',
|
||||
'[getnew-link]'=>"<a href=\"{$forum_link_array['getnew']}\">",
|
||||
'[/getnew-link]'=> '</a>',
|
||||
'[subscription-link]'=>"<a href=\"{$forum_link_array['subscription']}\">",
|
||||
'[/subscription-link]'=>'</a>',
|
||||
'[textversion]'=>"<a href=\"{$forum_link_array['textversion']}\">",
|
||||
'[/textversion]'=>'</a>',);
|
||||
$f_set="set";
|
||||
$compile="compile";
|
||||
$f_get="get";
|
||||
|
||||
if(!defined('FORUM_SUB_DOMAIN'))
|
||||
{
|
||||
$forum_ajax="\r\n<script language=\"javascript\" type=\"text/javascript\">\r\nvar forum_ajax = '/system/forum/ajax/';\r\nvar forum_wysiwyg = '{$forum_config['wysiwyg']}';\r\n</script>\r\n";
|
||||
$tpl->load_template($tpl_dir.'main.tpl');
|
||||
$tpl->copy_template = "{$forum_ajax}<script type='text/javascript' src='{$config['http_home_url']}system/forum/ajax/dle_forum.js'></script>".$tpl->copy_template;
|
||||
}
|
||||
$tpl->$f_set('{BOARD}',$tpl->result['dle_forum']);
|
||||
$tpl->$f_set('', $forum_content);
|
||||
$copyrigt=true;
|
||||
|
||||
$f_file_get_contents="file_get_contents";
|
||||
|
||||
$f_clear="clear";
|
||||
$tpl->$compile("content");
|
||||
$tpl->$f_clear();
|
||||
?>
|
||||
BIN
system/inc/forum/ico/filebrowser_action.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
system/inc/forum/ico/filebrowser_action2.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
system/inc/forum/ico/forum.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
system/inc/forum/ico/global.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
system/inc/forum/ico/help.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
1
system/inc/forum/ico/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<html>
|
||||
BIN
system/inc/forum/ico/licence.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
system/inc/forum/ico/modules.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
system/inc/forum/ico/mset.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
system/inc/forum/ico/news.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
system/inc/forum/ico/preventions.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
system/inc/forum/ico/rank.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
system/inc/forum/ico/safety.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
system/inc/forum/ico/service.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
system/inc/forum/ico/show.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
system/inc/forum/ico/speed.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
system/inc/forum/ico/tools.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
system/inc/forum/ico/uploads.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
system/inc/forum/ico/usersgroup.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
19
system/inc/forum/init.class.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
define('DLE_FORUM',true);
|
||||
|
||||
class dle_forum_init
|
||||
{
|
||||
function init_admin()
|
||||
{
|
||||
global $config, $forum_config, $f_lg, $options, $l_full;
|
||||
|
||||
require_once SYSTEM_DIR.'/data/forum_config.php';
|
||||
require_once SYSTEM_DIR.'/forum/language/'.$config['langs'].'/admin.lng';
|
||||
require_once SYSTEM_DIR."/inc/forum/functions.php";
|
||||
require_once SYSTEM_DIR."/inc/forum/table.php";
|
||||
require_once SYSTEM_DIR."/inc/forum/form.php";
|
||||
require_once SYSTEM_DIR."/classes/cache.class.php";
|
||||
}
|
||||
}
|
||||
$dle_forum_init = new dle_forum_init;
|
||||
?>
|
||||
123
system/inc/forum/service.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
switch ($subaction)
|
||||
{
|
||||
case "":
|
||||
|
||||
echo_top();
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ïîäïèñîê íà òåìû');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=subscription\">
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<td width=\"260\">{$f_lg['titles_uname']}</td>
|
||||
<td><input class=\"edit\" type=\"text\" name=\"user_name\" value=\"\" size=\"27\"> {$f_lg['svce_full']}</td></tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ïðîñìîòðà òåì');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=views\">
|
||||
Áóäåò î÷èùåí æóðíàë ïðîñìîòðà òåì. Âñå òåìû äî äàííîãî âðåìåíè áóäóò èìåòü ñòàòóñ ïðî÷èòàííûõ.
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_top('1');
|
||||
|
||||
echo_title('Î÷èñòêà æóðíàëà ãîëîñîâàíèé');
|
||||
|
||||
echo "<form method=\"post\" action=\"$PHP_SELF?mod=forum&action=service&subaction=poll\">
|
||||
Ïðè î÷èñòêå æóðíàëà, ïîëüçîâàòåëè ñìîãóò ïîâòîðíî ãîëîñîâàòü.
|
||||
<table border=\"0\" width=\"100%\">
|
||||
<tr>
|
||||
<tr><td colspan=\"2\"><div class=\"hr_line\"></div></td></tr>
|
||||
<tr>
|
||||
<td width=\"260\"> </td>
|
||||
<td><input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_start']}\"></td></tr>
|
||||
</table></form>";
|
||||
|
||||
echo_bottom('1');
|
||||
|
||||
echo_bottom();
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SUBSCRIPTION
|
||||
// ********************************************************************************
|
||||
case "subscription":
|
||||
|
||||
$user_name = $db->safesql($_REQUEST['user_name']);
|
||||
|
||||
if ($user_name)
|
||||
{
|
||||
$row = $db->super_query("SELECT user_id FROM " . PREFIX . "_users WHERE name = '{$user_name}'");
|
||||
}
|
||||
|
||||
if ($row['user_id'])
|
||||
{
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_subscription WHERE user_id = '{$row['user_id']}'");
|
||||
}
|
||||
|
||||
if (!$user_name)
|
||||
{
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_subscription");
|
||||
}
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// VIEWS LOG
|
||||
// ********************************************************************************
|
||||
case "views":
|
||||
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_views");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_last = '".time()."', forum_time = '".time()."'");
|
||||
|
||||
$_SESSION['member_lasttime'] = time();
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// POLL LOG
|
||||
// ********************************************************************************
|
||||
case "poll":
|
||||
|
||||
$db->query("TRUNCATE TABLE " . PREFIX . "_forum_poll_log");
|
||||
|
||||
header("Location: ?mod=forum&action=service");
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
208
system/inc/forum/table.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
function echo_top($echoheader = false)
|
||||
{
|
||||
if (!$echoheader)
|
||||
{
|
||||
echoheader("", "");
|
||||
|
||||
if ($_REQUEST['action'])
|
||||
{
|
||||
echo echo_top (x);
|
||||
echo "<div class=\"quick\"><a href=\"?mod=forum\">DLE Forum</a></div>";
|
||||
echo echo_bottom (x);
|
||||
}
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<div style="padding-top:5px;padding-bottom:2px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="4"><img src="system/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
|
||||
<td background="system/skins/images/tl_oo.gif"><img src="system/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
|
||||
<td width="6"><img src="system/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td background="system/skins/images/tl_lb.gif"><img src="system/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
|
||||
<td style="padding:5px;" bgcolor="#FFFFFF">
|
||||
HTML;
|
||||
}
|
||||
|
||||
function echo_bottom($echofooter = false)
|
||||
{
|
||||
echo <<<HTML
|
||||
</td>
|
||||
<td background="system/skins/images/tl_rb.gif"><img src="system/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="system/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
|
||||
<td background="system/skins/images/tl_ub.gif"><img src="system/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
|
||||
<td><img src="system/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
if (!$echofooter) echofooter();
|
||||
}
|
||||
|
||||
function echo_title($title)
|
||||
{
|
||||
echo <<<HTML
|
||||
<table width="100%"><tr>
|
||||
<td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$title}</div></td></tr></table>
|
||||
<div class="unterline"></div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function echo_stats($forum_config, $forum_stats)
|
||||
{
|
||||
global $f_lg;
|
||||
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_status']}</td><td>{$forum_stats['line']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_topic']}</td><td>{$forum_stats['topics']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_posts']}</td><td>{$forum_stats['posts']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_db_size']}</td><td>{$forum_stats['db_size']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_files']}</td><td>{$forum_stats['sum_size']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=\"padding:2px;\">{$f_lg['forum_cache']}</td><td>{$forum_stats['cache']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<a href=\"?mod=forum&action=clear\"><input onclick=\"document.location='?mod=forum&action=clear'\" class=\"edit\" style=\"width:150px;\" type=\"button\" value=\"{$f_lg['clear_cache']}\"></a>";
|
||||
}
|
||||
|
||||
if(!defined('DLE_FORUM')){ exit; }
|
||||
|
||||
function forum_menu()
|
||||
{
|
||||
global $f_lg;
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function MenuCategory( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
var lang_action = "";
|
||||
|
||||
menu[0]='<a onClick="document.location=\'?mod=forum&action=forum&sid=&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_add_forum']}</a>';
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=content_forums&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_sort_f']}</a>';
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=access&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_access']}</a>';
|
||||
menu[3]='<a onClick="document.location=\'?mod=forum&action=category_edit&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
menu[4]='<a onClick="document.location=\'?mod=forum&action=category_del&sid=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
function MenuForum( m_id, sub ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=moderator_new&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_moderator']}</a>';
|
||||
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=forum_edit&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
|
||||
if (!sub){
|
||||
menu[3]='<a onClick="document.location=\'?mod=forum&action=content_sub_forums&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_ssort']}</a>';
|
||||
}
|
||||
|
||||
menu[4]='<a onClick="document.location=\'?mod=forum&action=forum_del&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
function Moderators( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[1]='<a onClick="document.location=\'?mod=forum&action=moderator_edit&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_edit']}</a>';
|
||||
|
||||
menu[2]='<a onClick="document.location=\'?mod=forum&action=moderator_del&id=' + m_id + '\'; return(false)" href="#">{$f_lg['java_del']}</a>';
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
HTML;
|
||||
}
|
||||
|
||||
$options = array(
|
||||
array(
|
||||
'name' => $f_lg['m_new_cat'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=category",
|
||||
'descr' => $f_lg['m_new_cat2'],
|
||||
'image' => "category.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_new_forum'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=forum",
|
||||
'descr' => $f_lg['m_new_forum2'],
|
||||
'image' => "forum.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_content'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=content",
|
||||
'descr' => $f_lg['m_content2'],
|
||||
'image' => "content.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_usergroup'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=usergroup",
|
||||
'descr' => $f_lg['m_usergroup2'],
|
||||
'image' => "usersgroup.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_rank'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=rank",
|
||||
'descr' => $f_lg['m_rank2'],
|
||||
'image' => "rank.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_tools'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=tools",
|
||||
'descr' => $f_lg['m_tools2'],
|
||||
'image' => "tools.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_service'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=service",
|
||||
'descr' => $f_lg['m_service2'],
|
||||
'image' => "service.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => $f_lg['m_email'],
|
||||
'url' => "$PHP_SELF?mod=forum&action=email",
|
||||
'descr' => $f_lg['m_email2'],
|
||||
'image' => "mset.png",
|
||||
'access' => "1",
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
268
system/inc/forum/tools.php
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
|
||||
function ChangeOption(selectedOption) {
|
||||
|
||||
document.getElementById('global').style.display = "none";
|
||||
document.getElementById('show').style.display = "none";
|
||||
document.getElementById('safety').style.display = "none";
|
||||
document.getElementById('modules').style.display = "none";
|
||||
document.getElementById('speed').style.display = "none";
|
||||
document.getElementById('uploads').style.display = "none";
|
||||
|
||||
if(selectedOption == 'global') {document.getElementById('global').style.display = "";}
|
||||
if(selectedOption == 'show') {document.getElementById('show').style.display = "";}
|
||||
if(selectedOption == 'safety') {document.getElementById('safety').style.display = "";}
|
||||
if(selectedOption == 'modules') {document.getElementById('modules').style.display = "";}
|
||||
if(selectedOption == 'speed') {document.getElementById('speed').style.display = "";}
|
||||
if(selectedOption == 'uploads') {document.getElementById('uploads').style.display = "";}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
// TOOLS MENU //
|
||||
|
||||
echo_top('tools_menu');
|
||||
|
||||
echo_title($f_lg['tools_menu']);
|
||||
|
||||
echo <<<HTML
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="padding:2px;">
|
||||
<table style="text-align:center;" width="100%" height="35px">
|
||||
<tr style="vertical-align:middle;" >
|
||||
<td class=tableborder><a href="javascript:ChangeOption('global');"><img title="$f_lg[tools_global]" src="system/forum/admin/ico/global.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('show');"><img title="$f_lg[tools_show]" src="system/forum/admin/ico/show.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('safety');"><img title="$f_lg[tools_safety]" src="system/forum/admin/ico/safety.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('modules');"><img title="$f_lg[tools_modules]" src="system/forum/admin/ico/modules.png" border="0"></a>
|
||||
|
||||
<td class=tableborder><a href="javascript:ChangeOption('speed');"><img title="$f_lg[tools_speed]" src="system/forum/admin/ico/speed.png" border="0"></a>
|
||||
<td class=tableborder><a href="javascript:ChangeOption('uploads');"><img title="$f_lg[tools_uploads]" src="system/forum/admin/ico/uploads.png" border="0"></a>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
HTML;
|
||||
|
||||
echo_bottom('tools_menu');
|
||||
|
||||
// ********************************************************************************
|
||||
// TOOLS
|
||||
// ********************************************************************************
|
||||
|
||||
// globals tools
|
||||
|
||||
echo "<div style='' id=\"global\">";
|
||||
|
||||
echo_top('tools_global');
|
||||
|
||||
echo_title($f_lg['tools_global']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_name'], $f_lg['tools_name_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_title]' value='{$forum_config['forum_title']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_url'], $f_lg['tools_url_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_url]' value='{$forum_config['forum_url']}' size=40>");
|
||||
|
||||
showRow($f_lg['meta_description'], $f_lg['meta_description2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[meta_descr]' value='{$forum_config['meta_descr']}' size=40>");
|
||||
|
||||
showRow($f_lg['meta_keywords'], $f_lg['meta_keywords2'], "<textarea class=\"edit\" style=\"width:250px;height:50px;\" name='save_con[meta_keywords]'>{$forum_config['meta_keywords']}</textarea>");
|
||||
|
||||
showRow($f_lg['meta_topic'], $f_lg['meta_topic2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[meta_topic]", "{$forum_config['meta_topic']}"));
|
||||
|
||||
showRow($f_lg['tools_abc_last'], $f_lg['tools_abc_last1'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[last_abc]' value=\"{$forum_config['last_abc']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_mrewrite'], $f_lg['tools_mrewrite_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_rewrite]", "{$forum_config['mod_rewrite']}"));
|
||||
|
||||
showRow($f_lg['tools_offline'], $f_lg['tools_offline_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[offline]", "{$forum_config['offline']}"));
|
||||
|
||||
showRow($f_lg['tools_timestamp'], $f_lg['tools_timestamp2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[timestamp]' value='{$forum_config['timestamp']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_sessions'], $f_lg['tools_sessions_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[sessions_log]", "{$forum_config['sessions_log']}"));
|
||||
|
||||
showRow($f_lg['tools_ses_time'], $f_lg['tools_ses_time_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[session_time]' value=\"{$forum_config['session_time']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_stats'], $f_lg['tools_stats_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[stats]", "{$forum_config['stats']}"));
|
||||
|
||||
showRow($f_lg['tools_online'], $f_lg['tools_online_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[online]", "{$forum_config['online']}"));
|
||||
|
||||
showRow($f_lg['tools_forum_bar'], $f_lg['tools_forum_bar_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[forum_bar]", "{$forum_config['forum_bar']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_global');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// topics, posts
|
||||
|
||||
echo "<div style='display:none' id=\"show\">";
|
||||
|
||||
echo_top('tools_show');
|
||||
|
||||
echo_title($f_lg['tools_show']);
|
||||
|
||||
echo "<table style='' id=\"tools_show\" width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_topics'], $f_lg['tools_topics_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_inpage]' value=\"{$forum_config['topic_inpage']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_hot'], $f_lg['tools_hot_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_hot]' value=\"{$forum_config['topic_hot']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_posts'], $f_lg['tools_posts_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_inpage]' value=\"{$forum_config['post_inpage']}\" size=10>");
|
||||
|
||||
|
||||
showRow("Êîëè÷åñòâî ñîîáùåíèé äëÿ ñîçäàíèÿ íîâûõ òåì", $f_lg['tools_posts_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[min_post]' value=\"{$forum_config['min_post']}\" size=10>");
|
||||
|
||||
|
||||
showRow($f_lg['tools_mhide'], $f_lg['tools_mhide_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_hide]' value=\"{$forum_config['post_hide']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_abc_topic'], $f_lg['tools_abc_topic_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_abc]' value=\"{$forum_config['topic_abc']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_post_maxlen'], $f_lg['tools_post_maxlen2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[post_maxlen]' value=\"{$forum_config['post_maxlen']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_auto_wrap'], $f_lg['tools_auto_wrap2'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[auto_wrap]' value=\"{$forum_config['auto_wrap']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_post_update'], $f_lg['tools_post_update2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[post_update]", "{$forum_config['post_update']}"));
|
||||
|
||||
showRow($f_lg['tools_last_plink'], $f_lg['tools_last_plink_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[last_plink]", "{$forum_config['last_plink']}"));
|
||||
|
||||
showRow($f_lg['tools_hide_forum'], $f_lg['tools_hide_forum_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[hide_forum]", "{$forum_config['hide_forum']}"));
|
||||
|
||||
showRow($f_lg['tools_topic_sort'], $f_lg['tools_topic_sort_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[topic_sort]", "{$forum_config['topic_sort']}"));
|
||||
|
||||
showRow($f_lg['tools_topic_email'], $f_lg['tools_topic_email_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[topic_email]", "{$forum_config['topic_email']}"));
|
||||
|
||||
showRow($f_lg['tools_pr_imp'], $f_lg['tools_pr_imp_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_imp]' value='{$forum_config['forum_pr_imp']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_vote'], $f_lg['tools_pr_vote_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_vote]' value='{$forum_config['forum_pr_vote']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_modr'], $f_lg['tools_pr_modr_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_modr]' value='{$forum_config['forum_pr_modr']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_pr_sub_f'], $f_lg['tools_pr_sub_f_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[forum_pr_sub]' value='{$forum_config['forum_pr_sub']}' size=40>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_show');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// safety
|
||||
|
||||
echo "<div style='display:none' id=\"safety\">";
|
||||
|
||||
echo_top('tools_safety');
|
||||
|
||||
echo_title($f_lg['tools_safety']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_complaint'], $f_lg['tools_complaint_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_report]", "{$forum_config['mod_report']}"));
|
||||
|
||||
showRow($f_lg['tools_search_captcha'], $f_lg['tools_search_captcha_'], "<select name=\"search_captcha[]\" multiple>".warn_group($forum_config['search_captcha'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_topic_captcha'], $f_lg['tools_topic_captcha1'], "<select name=\"topic_captcha[]\" multiple>".warn_group($forum_config['topic_captcha'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_post_captcha'], $f_lg['tools_post_captcha1'], "<select name=\"post_captcha[]\" multiple>".warn_group($forum_config['post_captcha'])."</select>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_safety');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// modules
|
||||
|
||||
echo "<div style='display:none' id=\"modules\">";
|
||||
|
||||
echo_top('tools_modules');
|
||||
|
||||
echo_title($f_lg['tools_modules']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_subscr'], $f_lg['tools_subscr_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[subscription]", "{$forum_config['subscription']}"));
|
||||
|
||||
showRow($f_lg['tools_mod_rank'], $f_lg['tools_mod_rank_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[mod_rank]", "{$forum_config['mod_rank']}"));
|
||||
|
||||
showRow($f_lg['tools_poll'], $f_lg['tools_poll_'], "<select name=\"tools_poll[]\" multiple>".warn_group($forum_config['tools_poll'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_ses_forum'], $f_lg['tools_ses_forum_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[ses_forum]", "{$forum_config['ses_forum']}"));
|
||||
|
||||
showRow($f_lg['tools_ses_topic'], $f_lg['tools_ses_topic_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[ses_topic]", "{$forum_config['ses_topic']}"));
|
||||
|
||||
showRow($f_lg['tools_bot_agent'], $f_lg['tools_bot_agent2'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[bot_agent]", "{$forum_config['bot_agent']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_modules');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// speed
|
||||
|
||||
echo "<div style='display:none' id=\"speed\">";
|
||||
|
||||
echo_top('tools_speed');
|
||||
|
||||
echo_title($f_lg['tools_speed']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRow($f_lg['tools_t_as_p'], $f_lg['tools_t_as_p_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_topic_post]", "{$forum_config['set_topic_post']}"));
|
||||
|
||||
showRow($f_lg['tools_sp_num'], $f_lg['tools_sp_num_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_post_num_up]", "{$forum_config['set_post_num_up']}"));
|
||||
|
||||
showRow($f_lg['tools_sp_num_date'], $f_lg['tools_sp_num_date_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[set_post_num_day]' value=\"{$forum_config['set_post_num_day']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_new_t_day'], $f_lg['tools_new_t_day_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[topic_new_day]' value=\"{$forum_config['topic_new_day']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_sp_sublast'], $f_lg['tools_sp_sublast_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[set_sub_last_up]", "{$forum_config['set_sub_last_up']}"));
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_speed');
|
||||
|
||||
echo "</div>";
|
||||
|
||||
// uploads
|
||||
|
||||
echo "<div style='display:none' id=\"uploads\">";
|
||||
|
||||
echo_top('tools_uploads');
|
||||
|
||||
echo_title($f_lg['tools_uploads']);
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
//showRow($f_lg['tools_upload'], $f_lg['tools_upload_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[tools_upload]", "{$forum_config['tools_upload']}"));
|
||||
|
||||
showRow($f_lg['tools_upload'], $f_lg['tools_upload_'], "<select name=\"tools_upload[]\" multiple>".warn_group($forum_config['tools_upload'])."</select>");
|
||||
|
||||
showRow($f_lg['tools_upload_type'], $f_lg['tools_upload_type_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[upload_type]' value='{$forum_config['upload_type']}' size=40>");
|
||||
|
||||
showRow($f_lg['tools_img_upl'], $f_lg['tools_img_upl_'], makeDropDown(array("1"=>$lang['opt_sys_yes'],"0"=>$lang['opt_sys_no']), "save_con[img_upload]", "{$forum_config['img_upload']}"));
|
||||
|
||||
showRow($f_lg['tools_img_max_size'], $f_lg['tools_img_max_size_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[img_size]' value=\"{$forum_config['img_size']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_thumb_size'], $f_lg['tools_thumb_size_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[thumb_size]' value=\"{$forum_config['thumb_size']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_jpeg_quality'], $f_lg['tools_jpeg_quality_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[jpeg_quality]' value=\"{$forum_config['jpeg_quality']}\" size=10>");
|
||||
|
||||
showRow($f_lg['tools_img_width'], $f_lg['tools_img_width_'], "<input class=edit type=text style=\"text-align: center;\" name='save_con[tag_img_width]' value=\"{$forum_config['tag_img_width']}\" size=10>");
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('tools_uploads');
|
||||
|
||||
echo "</div>";
|
||||
?>
|
||||
162
system/inc/forum/usergroup.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
// ********************************************************************************
|
||||
// Get User Groups
|
||||
// ********************************************************************************
|
||||
$user_group = array ();
|
||||
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
|
||||
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
$user_group[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$user_group[$row['id']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
switch ($subaction)
|
||||
{
|
||||
case "":
|
||||
|
||||
$db->query("SELECT user_group, count(*) as count FROM " . USERPREFIX . "_users GROUP BY user_group");
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
$count_list[$row['user_group']] = $row['count'];
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
foreach ($user_group as $group)
|
||||
{
|
||||
$count = intval ($count_list[$group['id']]);
|
||||
|
||||
$entries .= "
|
||||
<tr>
|
||||
<td height=22 class=\"list\"> <b>{$group['id']}</b></td>
|
||||
<td class=\"list\">{$group['group_name']}</td>
|
||||
<td class=\"list\" align=\"center\">$count</td>
|
||||
<td class=\"list\" align=\"center\"><a onClick=\"return dropdownmenu(this, event, MenuBuild('".$group['id']."'), '150px')\" href=\"#\"><img src=\"system/skins/images/browser_action.gif\" border=\"0\"></a></td>
|
||||
</tr>
|
||||
<tr><td background=\"system/skins/images/mline.gif\" height=1 colspan=4></td></tr>";
|
||||
}
|
||||
|
||||
echo_top();
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function MenuBuild( m_id ){
|
||||
|
||||
var menu=new Array()
|
||||
|
||||
menu[0]='<a href="?mod=forum&action=usergroup&subaction=edit&id=' + m_id + '" >{$f_lg['group_sel1']}</a>';
|
||||
if (m_id > 5) {
|
||||
menu[1]='<a href="?mod=usergroup&action=del&id=' + m_id + '" >{$f_lg['group_sel2']}</a>';
|
||||
}
|
||||
else {
|
||||
menu[1]='<a href="#" onclick="return false;"><font color="black">{$f_lg['group_sel3']}</font></a>';
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
echo_title($f_lg['group_list']);
|
||||
|
||||
echo "<table width=\"100%\">
|
||||
<tr>
|
||||
<td width=50> ID</td>
|
||||
<td>{$f_lg['group_name']}</td>
|
||||
<td width=100 align=\"center\">{$f_lg['group_users']}</td>
|
||||
<td width=70 align=\"center\"> </td>
|
||||
</tr>
|
||||
<tr><td colspan=\"4\"><div class=\"hr_line\"></div></td></tr>";
|
||||
|
||||
echo $entries."</table>";
|
||||
|
||||
echo_bottom();
|
||||
|
||||
break;
|
||||
|
||||
case "edit":
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'");
|
||||
|
||||
echo_top();
|
||||
|
||||
echo_title ($f_lg['group_moderation']." ".$user_group[$id]['group_name']);
|
||||
|
||||
echo "<form action=\"{$PHP_SELF}?mod=forum&action=usergroup&subaction=doedit&id={$id}\" method=\"post\">";
|
||||
|
||||
echo "<table width=\"100%\">";
|
||||
|
||||
showRadio($f_lg['mod_edit_topic'], $f_lg[''], "edit_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_del_topic'], $f_lg[''], "delete_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_edit_post'], $f_lg[''], "edit_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_del_post'], $f_lg[''], "delete_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_open_topic'], $f_lg[''], "open_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_close_topic'], $f_lg[''], "close_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_move_topic'], $f_lg[''], "move_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_fixed_topic'], $f_lg[''], "pin_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_defixed_topic'], $f_lg[''], "unpin_topic", $row);
|
||||
|
||||
showRadio($f_lg['mod_multi_moderation'], $f_lg[''], "mass_prune", $row);
|
||||
|
||||
showRadio($f_lg['mod_combining_post'], $f_lg[''], "combining_post", $row);
|
||||
|
||||
showRadio($f_lg['mod_move_post'], $f_lg[''], "move_post", $row);
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo_bottom('bottom');
|
||||
|
||||
echo_top('top');
|
||||
|
||||
echo "<input type=\"submit\" class=\"buttons\" value=\"{$f_lg['button_save']}\"></form>";
|
||||
|
||||
echo_bottom();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "doedit":
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$m_group = $db->super_query("SELECT group_id FROM " . PREFIX . "_forum_moderators WHERE group_id = '$id'");
|
||||
|
||||
if (!$m_group['group_id'])
|
||||
{
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_moderators (group_id) values ('$id')");
|
||||
}
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_moderators SET edit_post = '$save[edit_post]', delete_topic = '$save[delete_topic]', edit_topic = '$save[edit_topic]', edit_post = '$save[edit_post]', delete_post = '$save[delete_post]', open_topic = '$save[open_topic]', close_topic = '$save[close_topic]', delete_post = '$save[delete_post]', move_topic = '$save[move_topic]', pin_topic = '$save[pin_topic]', delete_topic = '$save[delete_topic]', unpin_topic = '$save[unpin_topic]', mass_prune = '$save[mass_prune]', combining_post = '$save[combining_post]', move_post = '$save[move_post]' WHERE group_id = '$id'");
|
||||
}
|
||||
|
||||
$fcache->delete('forum_moderators.php');
|
||||
|
||||
msg("info",$f_lg['group_edit_ok'], $f_lg['group_edit_ok2'], "?mod=forum");
|
||||
|
||||
break;
|
||||
}
|
||||
?>
|
||||