diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php
index 8976271af..7133f7782 100644
--- a/e107_plugins/forum/forum_admin.php
+++ b/e107_plugins/forum/forum_admin.php
@@ -2,7 +2,7 @@
/*
* e107 website system
*
- * Copyright (C) 2008-2009 e107 Inc (e107.org)
+ * Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
@@ -26,7 +26,7 @@ $e_sub_cat = 'forum';
require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER.'form_handler.php');
-require_once(e_HANDLER.'ren_help.php');
+require_once(e_HANDLER.'ren_help.php'); // FIXME
require_once(e_PLUGIN.'forum/forum_class.php');
require_once(e_PLUGIN.'forum/forum_admin_class.php');
//$emessage = eMessage::getInstance();
@@ -191,14 +191,18 @@ if(isset($_POST['submit_parent']))
$tmp['forum_threadclass'] = (int)$_POST['forum_threadclass'];
if($sql->db_Insert('forum',$tmp))
{
- $forum->show_message(FORLAN_22.' - '.LAN_CREATED);
+ //$forum->show_message(FORLAN_22.' - '.LAN_CREATED);
+ $mes->addSuccess(LAN_CREATED);
}
else
{
- $forum->show_message(FORLAN_22.' - '.LAN_CREATED_FAILED);
+ //$forum->show_message(FORLAN_22.' - '.LAN_CREATED_FAILED);
+ $mes->addError(LAN_CREATED_FAILED);
}
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if(isset($_POST['update_parent']))
{
$tmp = $_POST;
@@ -214,10 +218,13 @@ if(isset($_POST['update_parent']))
$tmp['data']['forum_postclass'] = $_POST['forum_postclass'];
$tmp['data']['forum_threadclass'] = $_POST['forum_threadclass'];
$sql->db_Update('forum', $tmp);
- $forum->show_message(FORLAN_14);
+ //$forum->show_message(FORLAN_14);
+ $mes->addSucces(LAN_UPDATED);
$action = 'main';
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if(isset($_POST['submit_forum']))
{
$tmp = array();
@@ -229,16 +236,20 @@ if(isset($_POST['submit_forum']))
$tmp['forum_postclass'] = (int)$_POST['forum_postclass'];
$tmp['forum_threadclass'] = (int)$_POST['forum_threadclass'];
$tmp['forum_parent'] = (int)$_POST['forum_parent'];
- if($sql->db_Insert('forum',$tmp))
+ if($sql->db_Insert('forum', $tmp))
{
- $forum->show_message(FORLAN_36.' - '.LAN_CREATED);
+ //$forum->show_message(FORLAN_36.' - '.LAN_CREATED);
+ $mes->addSuccess(LAN_CREATED);
}
else
{
- $forum->show_message(FORLAN_36.' - '.LAN_CREATED_FAILED);
+ //$forum->show_message(FORLAN_36.' - '.LAN_CREATED_FAILED);
+ $mes->addError(LAN_CREATED_FAILED);
}
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if(isset($_POST['update_forum']))
{
unset($_POST['update_forum']);
@@ -254,10 +265,13 @@ if(isset($_POST['update_forum']))
$sql->db_Update('forum', $tmp);
$sql->db_Update('forum', $tmp2);
- $forum->show_message(FORLAN_12);
+ //$forum->show_message(FORLAN_12);
+ $mes->addSucces(LAN_UPDATED);
$action = 'main';
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if (isset($_POST['update_order']))
{
while (list($key, $id) = each($_POST['forum_order']))
@@ -299,13 +313,18 @@ if (isset($_POST['updateoptions']))
// $forum->show_message(FORLAN_10);
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if (isset($_POST['do_prune']))
{
$msg = $for->forumPrune($_POST['prune_type'], $_POST['prune_days'], $_POST['pruneForum']);
- $forum->show_message($msg);
+ //$forum->show_message($msg);
+ $mes->addSucces($msg);
$action = 'main';
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if (isset($_POST['frsubmit']))
{
$guestrules = $e107->tp->toDB($_POST['guestrules']);
@@ -325,13 +344,21 @@ if (isset($_POST['frsubmit']))
}
}
+$ns->tablerender($caption, $mes->render() . $text);
if (vartrue($delete) == 'main') {
if ($sql->db_Delete('forum', "forum_id='$del_id' ")) {
- $forum->show_message(FORLAN_96);
+ //$forum->show_message(FORLAN_96);
+ $mes->addSucces(LAN_DELETED);
+ }
+ else
+ {
+ $mes->addError(LAN_DELETED_FAILED);
}
}
+$ns->tablerender($caption, $mes->render() . $text);
+
if (vartrue($action) == 'create')
{
if ($sql->db_Select('forum', '*', "forum_parent='0' "))
@@ -350,11 +377,17 @@ if ($delete == 'cat')
if ($sql->db_Delete('forum', "forum_id='$del_id' "))
{
$sql->db_Delete('forum', "forum_parent='$del_id' ");
- $forum->show_message(FORLAN_97);
+ $mes->addSucces(LAN_DELETED);
$action = 'main';
}
+ else
+ {
+ $mes->addError(LAN_DELETED_FAILED);
+ }
}
+$ns->tablerender($caption, $mes->render() . $text);
+
switch($action)
{
case 'delete':
@@ -402,7 +435,8 @@ switch($action)
if ($delete == 'reported')
{
$sql->db_Delete("generic", "gen_id='$del_id' ");
- $forum->show_message(FORLAN_118);
+ //$forum->show_message(FORLAN_118);
+ $mes->addSucces(LAN_DELETED);
}
diff --git a/e107_plugins/forum/forum_admin_class.php b/e107_plugins/forum/forum_admin_class.php
index 69eaf7e3d..f3e64bbfd 100755
--- a/e107_plugins/forum/forum_admin_class.php
+++ b/e107_plugins/forum/forum_admin_class.php
@@ -2,7 +2,7 @@
/*
* e107 website system
*
-* Copyright (C) 2008-2009 e107 Inc (e107.org)
+* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
@@ -90,7 +90,10 @@ class forumAdmin
function delete_parent($id, $confirm = false)
{
$sql = e107::getDb();
- $ret = '';
+ $mes = e107::getMessage();
+ $ns = e107::getRender();
+
+ //$ret = '';
if($sql->db_Select('forum', 'forum_id', "forum_parent = {$id} AND forum_sub = 0"))
{
$fList = $sql->db_getList();
@@ -103,18 +106,21 @@ class forumAdmin
{
if($sql->db_Delete('forum', "forum_id = {$id}"))
{
- $ret .= 'Forum parent successfully deleted'; // TODO LAN
+ //$ret .= 'Forum parent successfully deleted';
+ $mes->addSuccess("Forum parent successfully deleted"); // TODO LAN
}
else
{
- $ret .= 'Forum parent could not be deleted'; // TODO LAN
+ //$ret .= 'Forum parent could not be deleted'; // TODO LAN
+ $mes->addError("Forum parent could not be deleted"); // TODO LAN
}
return $ret;
}
- return 'The forum parent has the following info:
'.$ret; // TODO LAN
+ //return 'The forum parent has the following info:
'.$ret; // TODO LAN
}
+
function deleteForum($forumId)
{
$sql = e107::getDb();
@@ -133,7 +139,7 @@ class forumAdmin
$f = new e107Forum;
if($sql->db_Select('forum_thread', 'thread_id','thread_forum_id='.$forumId))
{
- $list = $e107->sql->db_getList();
+ $list = $sql->db_getList();
foreach($list as $t)
{
$f->threadDelete($t['thread_id'], false);
@@ -146,7 +152,10 @@ class forumAdmin
{
$sql = e107::getDb();
$tp = e107::getParser();
- $ret = '';
+ $ns = e107::getRender();
+ $mes = e107::getMessage();
+
+ //$ret = '';
if($sql->db_Select('forum', 'forum_id', 'forum_sub = '.$id))
{
$fList = $sql->db_getList();
@@ -159,18 +168,22 @@ class forumAdmin
{
if($this->deleteForum($id))
{
- $ret .= "Forum {$id} successfully deleted"; // TODO LAN
+ //$ret .= "Forum {$id} successfully deleted"; // TODO LAN
+ $mes->addSuccess(LAN_DELETED);
}
else
{
- $ret .= "Forum {$id} could not be deleted"; // TODO LAN
- }
- return $ret;
+ //$ret .= "Forum {$id} could not be deleted"; // TODO LAN
+ $mes->addError(LAN_DELETED_FAILED);
+ }
}
$sql->db_Select('forum', 'forum_name, forum_threads, forum_replies', 'forum_id = '.$id);
$row = $sql->db_Fetch();
- return "Forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
".$ret;
+ //return "Forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
".$ret;
+ $mes->addInfo("Forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads and {$row['forum_replies']} replies."); //FIXME combine multiple info's into one message
+
+ $ns->tablerender($caption, $mes->render() . $text);
}
function delete_sub($id, $confirm = FALSE)
@@ -290,6 +303,8 @@ class forumAdmin
$frm = e107::getForm();
$sql = e107::getDb();
$tp = e107::getParser();
+ $mes = e107::getMessage();
+ $ns = e107::getRender();
$subList = $for->forumGetSubs();
@@ -301,19 +316,20 @@ class forumAdmin
{
$text = "
- ".FORLAN_171.": - | -- #".$row['gen_intdata']." + | ".FORLAN_171.": | +#".$row['gen_intdata']." | +
".FORLAN_173.": | +".$row['gen_ip']." | +||
".FORLAN_174.": | +".$user['user_name']." | ||
- ".FORLAN_173.": - | -- ".$row['gen_ip']." - | +".FORLAN_175.": | +".$con -> convert_date($row['gen_datestamp'], "long")." |
- ".FORLAN_174.": - | -- ".$user['user_name']." - | +".FORLAN_176.": | +".$row['gen_chardata']." |
- ".FORLAN_175.": - | -- ".$con -> convert_date($row['gen_datestamp'], "long")." + | + ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." + ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." + ".$rs->form_close()." | |
- ".FORLAN_176.": - | -- ".$row['gen_chardata']." - | -||
- ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." - ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." - ".$rs->form_close()." - | -
".FORLAN_170." | -".FORLAN_80." | -
".FORLAN_171." #".$row['gen_intdata']." | -- ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." - ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." - ".$rs->form_close()." - | -
".FORLAN_170." | +".LAN_OPTIONS." | +
".FORLAN_171." #".$row['gen_intdata']." | ++ ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." + ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." + ".$rs->form_close()." + | +
".WMGLAN_1.": - ".WMGLAN_6.":"; - if (vartrue($guest_rules['gen_intdata'])) - { - $text .= ""; - } - else - { - $text .= ""; - } - $text .= " |
-
-
- - - - ".display_help('helpb', 1, 'addtext1', 'help1')." - |
+ ||
".WMGLAN_1.": + ".WMGLAN_6.":"; + if (vartrue($guest_rules['gen_intdata'])) + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= " |
+
+
+
+ + + + ".display_help('helpb', 1, 'addtext1', 'help1')." + |
||
".WMGLAN_2.": - ".WMGLAN_6.":"; - if (vartrue($member_rules['gen_intdata'])) - { - $text .= ""; - } - else - { - $text .= ""; - } - $text .= " |
-
-
- - - - ".display_help('helpb', 1, 'addtext2', 'help2')." - |
+ ".WMGLAN_2.": + ".WMGLAN_6.":"; + if (vartrue($member_rules['gen_intdata'])) + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= " |
+
+
+
+ + + + ".display_help('helpb', 1, 'addtext2', 'help2')." + |
".WMGLAN_3.": - ".WMGLAN_6.": "; + | ".WMGLAN_3.": + ".WMGLAN_6.": "; - if (vartrue($admin_rules['gen_intdata'])) - { - $text .= ""; - } - else - { - $text .= ""; - } + if (vartrue($admin_rules['gen_intdata'])) + { + $text .= ""; + } + else + { + $text .= ""; + } - $text .= " |
-
-
- - - - ".display_help('helpb', 1, 'addtext3', 'help3')." - |
- |
- | - ".$frm->admin_button('frsubmit', WMGLAN_4, 'submit')." - | + $text .= " +
+
+ + + + ".display_help('helpb', 1, 'addtext3', 'help3')." + |