diff --git a/e107_handlers/e107Url.php b/e107_handlers/e107Url.php
index 41732d945..d43f39f3d 100755
--- a/e107_handlers/e107Url.php
+++ b/e107_handlers/e107Url.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/e107Url.php,v $
-| $Revision: 1.3 $
-| $Date: 2008-11-25 17:02:02 $
+| $Revision: 1.4 $
+| $Date: 2008-11-26 03:24:51 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -37,7 +37,7 @@ class eURL
$urlItems = array($urlItems => 1);
}
- $handlerId = $section . '/' . $urlType;
+ $handlerId = $section . '/' . $urlType; if (!isset($this->_link_handlers[$handlerId]))
if (!isset($this->_link_handlers[$handlerId]))
{
$this->_link_handlers[$handlerId] = $this->_initHandler($section, $urlType);
diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php
index 7cea8fd00..3bdac243a 100644
--- a/e107_plugins/forum/forum_admin.php
+++ b/e107_plugins/forum/forum_admin.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin.php,v $
-| $Revision: 1.3 $
-| $Date: 2008-01-06 21:16:37 $
-| $Author: e107steved $
+| $Revision: 1.4 $
+| $Date: 2008-11-26 03:24:51 $
+| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
$eplug_admin = true;
@@ -28,14 +28,15 @@ if (!getperms("P"))
}
$e_sub_cat = 'forum';
-$forum = new 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_PLUGIN."forum/forum_class.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_PLUGIN.'forum/forum_class.php');
+require_once(e_PLUGIN.'forum/forum_admin_class.php');
$rs = new form;
$for = new e107forum;
+$forum = new forumAdmin;
define("IMAGE_new", "
");
define("IMAGE_sub", "
");
define("IMAGE_nosub", "
");
@@ -108,20 +109,27 @@ if(isset($_POST['tools']))
if(isset($_POST['create_sub']))
{
- $fid = intval($sub_action);
- $_name = $tp->toDB($_POST['subname_new']);
- $_desc = $tp->toDB($_POST['subdesc_new']);
- $_order = intval($_POST['suborder_new']);
- if($_name != "" && $sql->db_Select('forum', '*', "forum_id = {$fid}"))
+ $fid = (int)($sub_action);
+ $tmp = array();
+ $tmp['forum_name'] = $tp->toDB($_POST['subname_new']);
+ $tmp['forum_description'] = $tp->toDB($_POST['subdesc_new']);
+ $tmp['forum_order'] = (int)$_POST['suborder_new'];
+
+ if($tmp['forum_name'] != '' && $sql->db_Select('forum', '*', "forum_id = {$fid}"))
{
$row = $sql->db_Fetch();
- if($sql->db_Insert("forum", "0, '{$_name}', '{$_desc}', '{$row['forum_parent']}', '{$fid}', '".time()."', '{$row['forum_moderators']}', 0, 0, '', '', '{$row['forum_class']}', '{$_order}', '{$row['forum_postclass']}'"))
+ $tmp['forum_parent'] = $row['forum_parent'];
+ $tmp['forum_moderators'] = $row['forum_moderators'];
+ $tmp['forum_class'] = $row['forum_class'];
+ $tmp['forum_postclass'] = $row['forum_postclass'];
+ $tmp['forum_sub'] = $fid;
+ if($sql->db_Insert('forum', $tmp))
{
- $forum->show_message(LAN_CREATED);
+ $forum->show_message(FORLAN_150.' - '.LAN_CREATED);
}
else
{
- $forum->show_message(LAN_CREATED_FAILED);
+ $forum->show_message(FORLAN_150.' - '.LAN_CREATED_FAILED);
}
}
}
@@ -159,9 +167,19 @@ if(isset($_POST['update_subs']))
if(isset($_POST['submit_parent']))
{
- $_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
- $sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '', '0', '0', '".time()."', '', '0', '0', '', '', '".$_POST['forum_class']."', '0', '{$_POST['forum_postclass']}'");
- $forum->show_message(FORLAN_13);
+ $tmp = array();
+ $tmp['forum_name'] = $tp->toDB($_POST['forum_name']);
+ $tmp['forum_datestamp'] = time();
+ $tmp['forum_class'] = (int)$_POST['forum_class'];
+ $tmp['forum_postclass'] = (int)$_POST['forum_postclass'];
+ if($e107->sql->db_Insert('forum',$tmp))
+ {
+ $forum->show_message(FORLAN_22.' - '.LAN_CREATED);
+ }
+ else
+ {
+ $forum->show_message(FORLAN_22.' - '.LAN_CREATED_FAILED);
+ }
}
if(isset($_POST['update_parent']))
@@ -174,11 +192,22 @@ if(isset($_POST['update_parent']))
if(isset($_POST['submit_forum']))
{
- $mods = $_POST['forum_moderators'];
- $_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
- $_POST['forum_description'] = $tp->toDB($_POST['forum_description']);
- $sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$_POST['forum_parent']."', '0', '".time()."', '".$mods."', 0, 0, '', '', '".$_POST['forum_class']."', 0, '{$_POST['forum_postclass']}'");
- $forum->show_message(FORLAN_11);
+ $tmp = array();
+ $tmp['forum_moderators'] = (int)$_POST['forum_moderators'];
+ $tmp['forum_name'] = $tp->toDB($_POST['forum_name']);
+ $tmp['forum_description'] = $tp->toDB($_POST['forum_description']);
+ $tmp['forum_datestamp'] = time();
+ $tmp['forum_class'] = (int)$_POST['forum_class'];
+ $tmp['forum_postclass'] = (int)$_POST['forum_postclass'];
+ $tmp['forum_parent'] = (int)$_POST['forum_parent'];
+ if($e107->sql->db_Insert('forum',$tmp))
+ {
+ $forum->show_message(FORLAN_36.' - '.LAN_CREATED);
+ }
+ else
+ {
+ $forum->show_message(FORLAN_36.' - '.LAN_CREATED_FAILED);
+ }
}
if(isset($_POST['update_forum']))
@@ -391,1128 +420,6 @@ function headerjs()
return $headerjs;
}
-class forum
-{
-
- function show_options($action)
- {
- global $sql;
- if ($action == "")
- {
- $action = "main";
- }
- // ##### Display options ---------------------------------------------------------------------------------------------------------
- $var['main']['text'] = FORLAN_76;
- $var['main']['link'] = e_SELF;
- $var['cat']['text'] = FORLAN_83;
- $var['cat']['link'] = e_SELF."?cat";
- if ($sql->db_Select("forum", "*", "forum_parent='0' "))
- {
- $var['create']['text'] = FORLAN_77;
- $var['create']['link'] = e_SELF."?create";
- }
- $var['order']['text'] = FORLAN_78;
- $var['order']['link'] = e_SELF."?order";
- $var['opt']['text'] = FORLAN_79;
- $var['opt']['link'] = e_SELF."?opt";
- $var['prune']['text'] = FORLAN_59;
- $var['prune']['link'] = e_SELF."?prune";
- $var['rank']['text'] = FORLAN_63;
- $var['rank']['link'] = e_SELF."?rank";
- $var['rules']['text'] = FORLAN_123;
- $var['rules']['link'] = e_SELF."?rules";
- $var['sr']['text'] = FORLAN_116;
- $var['sr']['link'] = e_SELF."?sr";
- $var['mods']['text'] = FORLAN_33;
- $var['mods']['link'] = e_SELF."?mods";
- $var['tools']['text'] = FORLAN_153;
- $var['tools']['link'] = e_SELF."?tools";
-
- show_admin_menu(FORLAN_7, $action, $var);
- }
-
- function delete_item($id)
- {
- global $sql;
- $id = intval($id);
- $confirm = isset($_POST['confirm']) ? TRUE : FALSE;
-
- if($sql->db_Select('forum', '*', "forum_id = {$id}"))
- {
- $txt = "";
- $row = $sql->db_Fetch();
- if($row['forum_parent'] == 0)
- {
- $txt .= $this->delete_parent($id, $confirm);
- }
- elseif($row['forum_sub'] > 0)
- {
- $txt .= $this->delete_sub($id, $confirm);
- }
- else
- {
- $txt .= $this->delete_forum($id, $confirm);
- }
- if($confirm)
- {
- $this->show_message($txt);
- }
- else
- {
- $this->delete_show_confirm($txt);
- }
- }
- }
-
- function delete_parent($id, $confirm = FALSE)
- {
- global $sql;
- $ret = "";
- if($sql->db_Select("forum", "forum_id", "forum_parent = {$id} AND forum_sub = 0"))
- {
- $fList = $sql->db_getList();
- foreach($fList as $f)
- {
- $ret .= $this->delete_forum($f['forum_id'], $confirm);
- }
- }
- if($confirm)
- {
- if($sql->db_Delete("forum", "forum_id = {$id}"))
- {
- $ret .= "Forum parent successfully deleted";
- }
- else
- {
- $ret .= "Forum parent could not be deleted";
- }
- return $ret;
- }
- return "The forum parent has the following info:
".$ret;
-
- }
-
- function delete_forum($id, $confirm = FALSE)
- {
- global $sql, $tp;
- $ret = "";
- if($sql->db_Select("forum", "forum_id", "forum_sub = {$id}"))
- {
- $fList = $sql->db_getList();
- foreach($fList as $f)
- {
- $ret .= $this->delete_sub($f['forum_id'], $confirm);
- }
- }
- if($confirm)
- {
- $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
- $ret .= $cnt." forum {$id} thread(s) deleted
";
- if($sql->db_Delete("forum", "forum_id = {$id}"))
- {
- $ret .= "Forum {$id} successfully deleted";
- }
- else
- {
- $ret .= "Forum {$id} could not be deleted";
- }
- return $ret;
- }
-
- $sql->db_Select("forum", "*", "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;
- }
-
- function delete_sub($id, $confirm = FALSE)
- {
- global $sql, $tp;
- if($confirm)
- {
- $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
- $ret .= $cnt." Sub-forum {$id} thread(s) deleted
";
- if($sql->db_Delete("forum", "forum_id = {$id}"))
- {
- $ret .= "Sub-forum {$id} successfully deleted";
- }
- else
- {
- $ret .= "Sub-forum {$id} could not be deleted";
- }
- return $ret;
- }
-
- $sql->db_Select("forum", "*", "forum_id = {$id}");
- $row = $sql->db_Fetch();
- return "Sub-forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
".$ret;
- }
-
- function delete_show_confirm($txt)
- {
- global $ns;
- $this->show_message($txt);
- $txt = "
-
- ";
- $ns->tablerender(FORLAN_181, $txt);
- }
-
- function show_subs($id)
- {
- global $sql, $tp, $ns;
- $txt = "
-
- ";
- $ns->tablerender(FORLAN_149, $txt);
- }
-
- function show_existing_forums($sub_action, $id, $mode = FALSE)
- {
- global $sql, $rs, $ns, $sql2, $sql3, $tp, $for;
-
- $subList = $for->forum_getsubs();
- if (!is_object($sql2))
- {
- $sql2 = new db;
- }
- if (!is_object($sql3))
- {
- $sql3 = new db;
- }
- if (!$mode)
- {
- $text = "";
- } else {
- $text = "
";
- $ns->tablerender(FORLAN_30, $text);
- }
- else
- {
- $text .= "\n\n
\n\n";
- $ns->tablerender(FORLAN_37, $text);
- }
-
- }
-
- function create_parents($sub_action, $id)
- {
- global $sql, $ns;
-
- if ($sub_action == "edit" && !$_POST['update_parent'])
- {
- if ($sql->db_Select("forum", "*", "forum_id=$id"))
- {
- $row = $sql->db_Fetch();
- extract($row);
- }
- }
- $text = "";
-
- $ns->tablerender(FORLAN_75, $text);
- }
-
- function create_forums($sub_action, $id)
- {
- global $sql, $ns;
-
- if ($sub_action == "edit" && !$_POST['update_forum'])
- {
- if ($sql->db_Select("forum", "*", "forum_id=$id"))
- {
- $row = $sql->db_Fetch();
- extract($row);
- }
- }
-
- $text = "";
- $ns->tablerender(FORLAN_28, $text);
- }
-
- function show_message($message)
- {
- global $ns;
- $ns->tablerender("", "".$message."
");
- }
-
- function show_tools()
- {
- global $sql, $ns, $tp;
- $txt = "
-
- ";
- $ns->tablerender(FORLAN_166, $txt);
- }
-
- function show_prefs()
- {
- global $pref, $ns, $sql;
-
- if($sql->db_Count('plugin','(*)', "where plugin_path = 'poll' AND plugin_installflag = 1"))
- {
- $poll_installed = true;
- }
- else
- {
- $poll_installed = false;
- if($pref['forum_poll'] == 1)
- {
- $pref['forum_poll'] = 0;
- save_prefs();
- }
- }
-
- $text = "";
- $ns->tablerender(FORLAN_62, $text);
- }
-
- function show_reported ($sub_action, $id)
- {
- global $sql, $rs, $ns, $tp;
- if ($sub_action) {
- $sql -> db_Select("generic", "*", "gen_id='".$sub_action."'");
- $row = $sql -> db_Fetch();
- $sql -> db_Select("user", "*", "user_id='". $row['gen_user_id']."'");
- $user = $sql -> db_Fetch();
- $con = new convert;
- $text = "
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\n";
- $text .= "
";
- $text .= "
";
- $ns -> tablerender(FORLAN_116, $text);
- } else {
- $text = "";
- if ($reported_total = $sql->db_Select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'"))
- {
- $text .= "
-
- ".FORLAN_170." |
- ".FORLAN_80." |
-
";
- while ($row = $sql->db_Fetch())
- {
- $text .= "
-
-
-
\n";
- }
- $text .= "
";
- }
- else
- {
- $text .= "
".FORLAN_121."
";
- }
- $text .= "
";
- $ns->tablerender(FORLAN_116, $text);
- }
- }
-
- function show_prune()
- {
- global $ns, $sql;
-
- // $sql -> db_Select("forum", "forum_id, forum_name", "forum_parent!=0 ORDER BY forum_order ASC");
- $qry = "
- SELECT f.forum_id, f.forum_name, sp.forum_name AS sub_parent, fp.forum_name AS forum_parent
- FROM #forum AS f
- LEFT JOIN #forum AS sp ON sp.forum_id = f.forum_sub
- LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
- WHERE f.forum_parent != 0
- ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC
- ";
- $sql -> db_Select_gen($qry);
- $forums = $sql -> db_getList();
-
- $text = "";
- $ns->tablerender(FORLAN_59, $text);
- }
-
- function show_levels()
- {
- global $sql, $pref, $ns, $rs;
-
- $rank_names = explode(",", $pref['forum_levels']);
- $rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
- $rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"));
-
- $text = "";
- $ns->tablerender("Ranks", $text);
- }
-
- function show_mods()
- {
- global $sql, $ns, $for, $tp;
- $forumList = $for->forum_getforums('all');
- $parentList = $for->forum_getparents('list');
- $subList = $for->forum_getsubs('bysub');
-
- $txt = "";
- $ns->tablerender(FORLAN_33, $txt);
- }
-
- function show_rules()
- {
- global $sql, $pref, $ns, $tp;
-
- $sql->db_Select("wmessage");
- list($null) = $sql->db_Fetch();
- list($null) = $sql->db_Fetch();
- list($null) = $sql->db_Fetch();
- list($id, $guestrules, $wm_active4) = $sql->db_Fetch();
- list($id, $memberrules, $wm_active5) = $sql->db_Fetch();
- list($id, $adminrules, $wm_active6) = $sql->db_Fetch();
-
- if($sql->db_Select('generic','*',"gen_type='forum_rules_guest'"))
- {
- $guest_rules = $sql->db_Fetch();
- }
- if($sql->db_Select('generic','*',"gen_type='forum_rules_member'"))
- {
- $member_rules = $sql->db_Fetch();
- }
- if($sql->db_Select('generic','*',"gen_type='forum_rules_admin'"))
- {
- $admin_rules = $sql->db_Fetch();
- }
-
- $guesttext = $tp->toFORM($guest_rules['gen_chardata']);
- $membertext = $tp->toFORM($member_rules['gen_chardata']);
- $admintext = $tp->toFORM($admin_rules['gen_chardata']);
-
- $text = "
- ";
-
- $ns->tablerender(WMGLAN_5, $text);
-
- echo "
-
- ";
-
- }
- }
function forum_admin_adminmenu()
{
diff --git a/e107_plugins/forum/forum_admin_class.php b/e107_plugins/forum/forum_admin_class.php
new file mode 100755
index 000000000..97d33c140
--- /dev/null
+++ b/e107_plugins/forum/forum_admin_class.php
@@ -0,0 +1,1117 @@
+db_Select("forum", "*", "forum_parent='0' "))
+ {
+ $var['create']['text'] = FORLAN_77;
+ $var['create']['link'] = e_SELF."?create";
+ }
+ $var['order']['text'] = FORLAN_78;
+ $var['order']['link'] = e_SELF."?order";
+ $var['opt']['text'] = FORLAN_79;
+ $var['opt']['link'] = e_SELF."?opt";
+ $var['prune']['text'] = FORLAN_59;
+ $var['prune']['link'] = e_SELF."?prune";
+ $var['rank']['text'] = FORLAN_63;
+ $var['rank']['link'] = e_SELF."?rank";
+ $var['rules']['text'] = FORLAN_123;
+ $var['rules']['link'] = e_SELF."?rules";
+ $var['sr']['text'] = FORLAN_116;
+ $var['sr']['link'] = e_SELF."?sr";
+ $var['mods']['text'] = FORLAN_33;
+ $var['mods']['link'] = e_SELF."?mods";
+ $var['tools']['text'] = FORLAN_153;
+ $var['tools']['link'] = e_SELF."?tools";
+
+ show_admin_menu(FORLAN_7, $action, $var);
+ }
+
+ function delete_item($id)
+ {
+ global $sql;
+ $id = intval($id);
+ $confirm = isset($_POST['confirm']) ? TRUE : FALSE;
+
+ if($sql->db_Select('forum', '*', "forum_id = {$id}"))
+ {
+ $txt = "";
+ $row = $sql->db_Fetch();
+ if($row['forum_parent'] == 0)
+ {
+ $txt .= $this->delete_parent($id, $confirm);
+ }
+ elseif($row['forum_sub'] > 0)
+ {
+ $txt .= $this->delete_sub($id, $confirm);
+ }
+ else
+ {
+ $txt .= $this->delete_forum($id, $confirm);
+ }
+ if($confirm)
+ {
+ $this->show_message($txt);
+ }
+ else
+ {
+ $this->delete_show_confirm($txt);
+ }
+ }
+ }
+
+ function delete_parent($id, $confirm = FALSE)
+ {
+ global $sql;
+ $ret = "";
+ if($sql->db_Select("forum", "forum_id", "forum_parent = {$id} AND forum_sub = 0"))
+ {
+ $fList = $sql->db_getList();
+ foreach($fList as $f)
+ {
+ $ret .= $this->delete_forum($f['forum_id'], $confirm);
+ }
+ }
+ if($confirm)
+ {
+ if($sql->db_Delete("forum", "forum_id = {$id}"))
+ {
+ $ret .= "Forum parent successfully deleted";
+ }
+ else
+ {
+ $ret .= "Forum parent could not be deleted";
+ }
+ return $ret;
+ }
+ return "The forum parent has the following info:
".$ret;
+
+ }
+
+ function delete_forum($id, $confirm = FALSE)
+ {
+ global $sql, $tp;
+ $ret = "";
+ if($sql->db_Select("forum", "forum_id", "forum_sub = {$id}"))
+ {
+ $fList = $sql->db_getList();
+ foreach($fList as $f)
+ {
+ $ret .= $this->delete_sub($f['forum_id'], $confirm);
+ }
+ }
+ if($confirm)
+ {
+ $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
+ $ret .= $cnt." forum {$id} thread(s) deleted
";
+ if($sql->db_Delete("forum", "forum_id = {$id}"))
+ {
+ $ret .= "Forum {$id} successfully deleted";
+ }
+ else
+ {
+ $ret .= "Forum {$id} could not be deleted";
+ }
+ return $ret;
+ }
+
+ $sql->db_Select("forum", "*", "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;
+ }
+
+ function delete_sub($id, $confirm = FALSE)
+ {
+ global $sql, $tp;
+ if($confirm)
+ {
+ $cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
+ $ret .= $cnt." Sub-forum {$id} thread(s) deleted
";
+ if($sql->db_Delete("forum", "forum_id = {$id}"))
+ {
+ $ret .= "Sub-forum {$id} successfully deleted";
+ }
+ else
+ {
+ $ret .= "Sub-forum {$id} could not be deleted";
+ }
+ return $ret;
+ }
+
+ $sql->db_Select("forum", "*", "forum_id = {$id}");
+ $row = $sql->db_Fetch();
+ return "Sub-forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies.
".$ret;
+ }
+
+ function delete_show_confirm($txt)
+ {
+ global $ns;
+ $this->show_message($txt);
+ $txt = "
+
+ ";
+ $ns->tablerender(FORLAN_181, $txt);
+ }
+
+ function show_subs($id)
+ {
+ global $sql, $tp, $ns;
+ $txt = "
+
+ ";
+ $ns->tablerender(FORLAN_149, $txt);
+ }
+
+ function show_existing_forums($sub_action, $id, $mode = false)
+ {
+ global $e107, $for;
+
+ $subList = $for->forum_getsubs();
+
+ if (!$mode)
+ {
+ $text = "";
+ }
+ else
+ {
+ $text = "
";
+ $e107->ns->tablerender(FORLAN_30, $text);
+ }
+ else
+ {
+ $text .= "\n\n
\n\n";
+ $e107->ns->tablerender(FORLAN_37, $text);
+ }
+
+ }
+
+ function create_parents($sub_action, $id)
+ {
+ global $e107;
+
+ $id = (int)$id;
+ if ($sub_action == 'edit' && !$_POST['update_parent'])
+ {
+ if ($e107->sql->db_Select('forum', '*', "forum_id=$id"))
+ {
+ $row = $e107->sql->db_Fetch(MYSQL_ASSOC);
+ }
+ }
+ $text = "";
+
+ $e107->ns->tablerender(FORLAN_75, $text);
+ }
+
+ function create_forums($sub_action, $id)
+ {
+ global $e107;
+
+ $id = (int)$id;
+ if ($sub_action == 'edit' && !$_POST['update_forum'])
+ {
+ if ($e107->sql->db_Select('forum', '*', "forum_id=$id"))
+ {
+ $fInfo = $e107->sql->db_Fetch();
+ }
+ }
+
+ $text = "";
+ $e107->ns->tablerender(FORLAN_28, $text);
+ }
+
+ function show_message($message)
+ {
+ global $e107;
+ $e107->ns->tablerender('', "".$message."
");
+ }
+
+ function show_tools()
+ {
+ global $sql, $ns, $tp;
+ $txt = "
+
+ ";
+ $ns->tablerender(FORLAN_166, $txt);
+ }
+
+ function show_prefs()
+ {
+ global $pref, $ns, $sql;
+
+ if($sql->db_Count('plugin','(*)', "where plugin_path = 'poll' AND plugin_installflag = 1"))
+ {
+ $poll_installed = true;
+ }
+ else
+ {
+ $poll_installed = false;
+ if($pref['forum_poll'] == 1)
+ {
+ $pref['forum_poll'] = 0;
+ save_prefs();
+ }
+ }
+
+ $text = "";
+ $ns->tablerender(FORLAN_62, $text);
+ }
+
+ function show_reported ($sub_action, $id)
+ {
+ global $sql, $rs, $ns, $tp;
+ if ($sub_action) {
+ $sql -> db_Select("generic", "*", "gen_id='".$sub_action."'");
+ $row = $sql -> db_Fetch();
+ $sql -> db_Select("user", "*", "user_id='". $row['gen_user_id']."'");
+ $user = $sql -> db_Fetch();
+ $con = new convert;
+ $text = "
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\n";
+ $text .= "
";
+ $text .= "
";
+ $ns -> tablerender(FORLAN_116, $text);
+ } else {
+ $text = "";
+ if ($reported_total = $sql->db_Select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'"))
+ {
+ $text .= "
+
+ ".FORLAN_170." |
+ ".FORLAN_80." |
+
";
+ while ($row = $sql->db_Fetch())
+ {
+ $text .= "
+
+
+
\n";
+ }
+ $text .= "
";
+ }
+ else
+ {
+ $text .= "
".FORLAN_121."
";
+ }
+ $text .= "
";
+ $ns->tablerender(FORLAN_116, $text);
+ }
+ }
+
+ function show_prune()
+ {
+ global $ns, $sql;
+
+ // $sql -> db_Select("forum", "forum_id, forum_name", "forum_parent!=0 ORDER BY forum_order ASC");
+ $qry = "
+ SELECT f.forum_id, f.forum_name, sp.forum_name AS sub_parent, fp.forum_name AS forum_parent
+ FROM #forum AS f
+ LEFT JOIN #forum AS sp ON sp.forum_id = f.forum_sub
+ LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
+ WHERE f.forum_parent != 0
+ ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC
+ ";
+ $sql -> db_Select_gen($qry);
+ $forums = $sql -> db_getList();
+
+ $text = "";
+ $ns->tablerender(FORLAN_59, $text);
+ }
+
+ function show_levels()
+ {
+ global $sql, $pref, $ns, $rs;
+
+ $rank_names = explode(",", $pref['forum_levels']);
+ $rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
+ $rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"));
+
+ $text = "";
+ $ns->tablerender("Ranks", $text);
+ }
+
+ function show_mods()
+ {
+ global $sql, $ns, $for, $tp;
+ $forumList = $for->forum_getforums('all');
+ $parentList = $for->forum_getparents('list');
+ $subList = $for->forum_getsubs('bysub');
+
+ $txt = "";
+ $ns->tablerender(FORLAN_33, $txt);
+ }
+
+ function show_rules()
+ {
+ global $sql, $pref, $ns, $tp;
+
+ $sql->db_Select("wmessage");
+ list($null) = $sql->db_Fetch();
+ list($null) = $sql->db_Fetch();
+ list($null) = $sql->db_Fetch();
+ list($id, $guestrules, $wm_active4) = $sql->db_Fetch();
+ list($id, $memberrules, $wm_active5) = $sql->db_Fetch();
+ list($id, $adminrules, $wm_active6) = $sql->db_Fetch();
+
+ if($sql->db_Select('generic','*',"gen_type='forum_rules_guest'"))
+ {
+ $guest_rules = $sql->db_Fetch();
+ }
+ if($sql->db_Select('generic','*',"gen_type='forum_rules_member'"))
+ {
+ $member_rules = $sql->db_Fetch();
+ }
+ if($sql->db_Select('generic','*',"gen_type='forum_rules_admin'"))
+ {
+ $admin_rules = $sql->db_Fetch();
+ }
+
+ $guesttext = $tp->toFORM($guest_rules['gen_chardata']);
+ $membertext = $tp->toFORM($member_rules['gen_chardata']);
+ $admintext = $tp->toFORM($admin_rules['gen_chardata']);
+
+ $text = "
+ ";
+
+ $ns->tablerender(WMGLAN_5, $text);
+
+ echo "
+
+ ";
+
+ }
+ }
diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php
index df07aebdb..db9eb03b4 100644
--- a/e107_plugins/forum/forum_class.php
+++ b/e107_plugins/forum/forum_class.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $
-| $Revision: 1.6 $
-| $Date: 2008-10-03 19:27:56 $
-| $Author: e107steved $
+| $Revision: 1.7 $
+| $Date: 2008-11-26 03:24:51 $
+| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -201,19 +201,19 @@ class e107forum
return FALSE;
}
- function forum_getsubs($forum_id = "")
+ function forum_getsubs($forum_id = '')
{
global $sql;
- $where = ($forum_id != "" && $forum_id != 'bysub' ? "AND forum_sub = ".intval($forum_id) : "");
+ $where = ($forum_id != '' && $forum_id != 'bysub' ? "AND forum_sub = ".(int)$forum_id : '');
$qry = "
SELECT f.*, u.user_name FROM #forum AS f
- LEFT JOIN #user AS u ON SUBSTRING_INDEX(f.forum_lastpost_user,'.',1) = u.user_id
+ LEFT JOIN #user AS u ON f.forum_lastpost_user = u.user_id
WHERE forum_sub != 0 {$where}
ORDER BY f.forum_order ASC
";
if ($sql->db_Select_gen($qry))
{
- while ($row = $sql->db_Fetch())
+ while ($row = $sql->db_Fetch(MYSQL_ASSOC))
{
if($forum_id == "")
{
@@ -230,7 +230,7 @@ class e107forum
}
return $ret;
}
- return FALSE;
+ return false;
}
diff --git a/e107_plugins/forum/forum_sql.php b/e107_plugins/forum/forum_sql.php
index 375213db3..665fd0ef2 100644
--- a/e107_plugins/forum/forum_sql.php
+++ b/e107_plugins/forum/forum_sql.php
@@ -1,39 +1,66 @@
-CREATE TABLE forum (
- forum_id int(10) unsigned NOT NULL auto_increment,
- forum_name varchar(250) NOT NULL default '',
- forum_description text NOT NULL,
- forum_parent int(10) unsigned NOT NULL default '0',
- forum_sub int(10) unsigned NOT NULL default '0',
- forum_datestamp int(10) unsigned NOT NULL default '0',
- forum_moderators text NOT NULL,
- forum_threads int(10) unsigned NOT NULL default '0',
- forum_replies int(10) unsigned NOT NULL default '0',
- forum_lastpost_user varchar(200) NOT NULL default '',
- forum_lastpost_info varchar(40) NOT NULL default '',
- forum_class varchar(100) NOT NULL default '',
- forum_order int(10) unsigned NOT NULL default '0',
- forum_postclass tinyint(3) unsigned NOT NULL default '0',
- PRIMARY KEY (forum_id)
- ) TYPE=MyISAM;
+CREATE TABLE forum (
+ `forum_id` int(10) unsigned NOT NULL auto_increment,
+ `forum_name` varchar(250) NOT NULL default '',
+ `forum_description` text,
+ `forum_parent` int(10) unsigned NOT NULL default '0',
+ `forum_sub` int(10) unsigned NOT NULL default '0',
+ `forum_datestamp` int(10) unsigned NOT NULL default '0',
+ `forum_moderators` text,
+ `forum_threads` int(10) unsigned NOT NULL default '0',
+ `forum_replies` int(10) unsigned NOT NULL default '0',
+ `forum_lastpost_user` int(10) unsigned default NULL,
+ `forum_lastpost_info` varchar(40) default NULL,
+ `forum_class` varchar(100) NOT NULL default '',
+ `forum_order` int(10) unsigned NOT NULL default '0',
+ `forum_postclass` text NOT NULL,
+ `forum_threadclass` text,
+ `forum_options` text,
+ PRIMARY KEY (`forum_id`),
+ KEY `forum_parent` (`forum_parent`),
+ KEY `forum_sub` (`forum_sub`)
+) Type=MyISAM AUTO_INCREMENT=1 ;
-CREATE TABLE forum_t (
- thread_id int(10) unsigned NOT NULL auto_increment,
- thread_name varchar(250) NOT NULL default '',
- thread_thread text NOT NULL,
- thread_forum_id int(10) unsigned NOT NULL default '0',
- thread_datestamp int(10) unsigned NOT NULL default '0',
- thread_parent int(10) unsigned NOT NULL default '0',
- thread_user varchar(250) NOT NULL default '',
- thread_views int(10) unsigned NOT NULL default '0',
- thread_active tinyint(3) unsigned NOT NULL default '0',
- thread_lastpost int(10) unsigned NOT NULL default '0',
- thread_s tinyint(1) unsigned NOT NULL default '0',
- thread_edit_datestamp int(10) unsigned NOT NULL default '0',
- thread_lastuser varchar(30) NOT NULL default '',
- thread_total_replies int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (thread_id),
- KEY thread_parent (thread_parent),
- KEY thread_datestamp (thread_datestamp),
- KEY thread_forum_id (thread_forum_id)
- ) TYPE=MyISAM;
+CREATE TABLE forum_thread (
+ `thread_id` int(10) unsigned NOT NULL auto_increment,
+ `thread_name` varchar(250) NOT NULL default '',
+ `thread_thread` text NOT NULL,
+ `thread_forum_id` int(10) unsigned NOT NULL default '0',
+ `thread_views` int(10) unsigned NOT NULL default '0',
+ `thread_active` tinyint(3) unsigned NOT NULL default '0',
+ `thread_lastpost` int(10) unsigned NOT NULL default '0',
+ `thread_s` tinyint(1) unsigned NOT NULL default '0',
+ `thread_lastuser` int(10) unsigned NOT NULL,
+ `thread_total_replies` int(10) unsigned NOT NULL default '0',
+ `thread_options` text,
+ PRIMARY KEY (`thread_id`),
+ KEY `thread_forum_id` (`thread_forum_id`),
+ KEY `thread_s` (`thread_s`),
+ KEY `thread_lastpost` (`thread_lastpost`)
+) Type=MyISAM AUTO_INCREMENT=1 ;
+
+CREATE TABLE forum_post (
+ `post_id` int(10) unsigned NOT NULL auto_increment,
+ `post_entry` text NOT NULL,
+ `post_thread` int(10) unsigned NOT NULL default '0',
+ `post_datestamp` int(10) unsigned NOT NULL default '0',
+ `post_user` int(10) unsigned NOT NULL,
+ `post_edit_datestamp` int(10) unsigned NOT NULL default '0',
+ `post_edit_user` int(10) unsigned NOT NULL,
+ `post_ip` varchar(45) NOT NULL,
+ `post_attachments` text NOT NULL,
+ `post_options` text,
+ PRIMARY KEY (`post_id`),
+ KEY `post_ip` (`post_ip`),
+ KEY `post_thread` (`post_thread`),
+ KEY `post_datestamp` (`post_datestamp`),
+ KEY `post_user` (`post_user`)
+) Type=MyISAM AUTO_INCREMENT=1 ;
+
+CREATE TABLE forum_track (
+ `track_userid` int(10) unsigned NOT NULL,
+ `track_threadid` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`track_userid`,`track_threadid`),
+ KEY `track_userid` (`track_userid`),
+ KEY `track_threadid` (`track_threadid`)
+) Type=MyISAM;
diff --git a/e107_plugins/forum/plugin.xml b/e107_plugins/forum/plugin.xml
index 73eaba852..9beedcdea 100755
--- a/e107_plugins/forum/plugin.xml
+++ b/e107_plugins/forum/plugin.xml
@@ -1,15 +1,13 @@
Forum
- 1.2
+ 2.0
e107dev
http://e107.org
This plugin is a fully featured Forum system
0.8
true
forum
- forum1
- forum2
forum_admin.php
images/forums_32.png
@@ -18,7 +16,6 @@
Your forum is now installed
-
@@ -30,15 +27,10 @@
-
-
-
-
-
-
-
+
+
diff --git a/e107_plugins/forum/url/forum.php b/e107_plugins/forum/url/forum.php
new file mode 100755
index 000000000..41b4aede6
--- /dev/null
+++ b/e107_plugins/forum/url/forum.php
@@ -0,0 +1,11 @@
+forum_get($forum_id);
+
+if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class']) || !$forum_info['forum_parent'])
+{
+ header("Location:".e_PLUGIN."forum/forum.php");
+ exit;
+}
+
+if (!$FORUM_VIEW_START) {
+ if (file_exists(THEME."forum_viewforum_template.php"))
+ {
+ require_once(THEME."forum_viewforum_template.php");
+ }
+ else if (file_exists(THEME."forum_template.php"))
+ {
+ require_once(THEME."forum_template.php");
+ }
+ else
+ {
+ require_once(e_PLUGIN."forum/templates/forum_viewforum_template.php");
+ }
+}
+
+
+$forum_info['forum_name'] = $tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook, emotes_off');
+$forum_info['forum_description'] = $tp->toHTML($forum_info['forum_description'], TRUE, 'no_hook');
+
+$_forum_name = (substr($forum_info['forum_name'], 0, 1) == "*" ? substr($forum_info['forum_name'], 1) : $forum_info['forum_name']);
+define("e_PAGETITLE", LAN_01." / ".$_forum_name);
+define("MODERATOR", $forum_info['forum_moderators'] != "" && check_class($forum_info['forum_moderators']));
+$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
+$message = "";
+if (MODERATOR)
+{
+ if ($_POST)
+ {
+ require_once(e_PLUGIN."forum/forum_mod.php");
+ $message = forum_thread_moderate($_POST);
+ }
+}
+
+$member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id!='0' ");
+$guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id='0' ");
+$users = $member_users+$guest_users;
+
+require_once(HEADERF);
+$text='';
+if ($message)
+{
+ $ns->tablerender("", $message, array('forum_viewforum', 'msg'));
+}
+
+$topics = $forum->forum_get_topic_count($forum_id);
+
+if ($topics > $view)
+{
+ $pages = ceil($topics/$view);
+}
+else
+{
+ $pages = FALSE;
+}
+
+if ($pages)
+{
+ if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== FALSE || strpos($FORUM_VIEW_END, 'THREADPAGES') !== FALSE)
+ {
+ $parms = "{$topics},{$view},{$thread_from},".e_SELF.'?'.$forum_id.'.[FROM],off';
+ $THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
+ }
+}
+
+if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass']))
+{
+ $NEWTHREADBUTTON = "".IMAGE_newthread."";
+}
+
+if(substr($forum_info['forum_name'], 0, 1) == "*")
+{
+ $forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
+ $container_only = true;
+}
+else
+{
+ $container_only = false;
+}
+
+if(substr($forum_info['sub_parent'], 0, 1) == "*")
+{
+ $forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1);
+}
+
+$forum->set_crumb(); // set $BREADCRUMB (and $BACKLINK)
+
+$FORUMTITLE = $forum_info['forum_name'];
+//$MODERATORS = LAN_404.": ".$forum_info['forum_moderators'];
+$MODERATORS = LAN_404.": ".implode(", ", $modArray);
+$BROWSERS = $users." ".($users == 1 ? LAN_405 : LAN_406)." (".$member_users." ".($member_users == 1 ? LAN_407 : LAN_409).", ".$guest_users." ".($guest_users == 1 ? LAN_408 : LAN_410).")";
+
+$ICONKEY = "
+
+
+ ".IMAGE_new_small." |
+ ".LAN_79." |
+ ".IMAGE_nonew_small." |
+ ".LAN_80." |
+ ".IMAGE_sticky_small." |
+ ".LAN_202." |
+ ".IMAGE_announce_small." |
+ ".LAN_396." |
+
+
+ ".IMAGE_new_popular_small." |
+ ".LAN_79." ".LAN_395." |
+ ".IMAGE_nonew_popular_small." |
+ ".LAN_80." ".LAN_395." |
+ ".IMAGE_stickyclosed_small." |
+ ".LAN_203." |
+ ".IMAGE_closed_small." |
+ ".LAN_81." |
+
+
";
+
+$SEARCH = "
+ ";
+
+if(check_class($forum_info['forum_postclass']))
+{
+ $PERMS = LAN_204." - ".LAN_206." - ".LAN_208;
+}
+else
+{
+ $PERMS = LAN_205." - ".LAN_207." - ".LAN_209;
+}
+
+$sticky_threads = 0;
+$stuck = FALSE;
+$reg_threads = 0;
+$unstuck = FALSE;
+
+$thread_list = $forum->forum_get_topics($forum_id, $thread_from, $view);
+$sub_list = $forum->forum_getsubs($forum_id);
+//print_a($sub_list);
+$gen = new convert;
+
+$SUBFORUMS = "";
+if(is_array($sub_list))
+{
+ $newflag_list = $forum->forum_newflag_list();
+ $sub_info = "";
+ foreach($sub_list as $sub)
+ {
+ $sub_info .= parse_sub($sub);
+ }
+ $SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END;
+}
+
+
+if (count($thread_list) )
+{
+ foreach($thread_list as $thread_info) {
+ $idArray[] = $thread_info['thread_id'];
+ }
+ $inList = '('.implode(',', $idArray).')';
+ foreach($thread_list as $thread_info) {
+ if ($thread_info['thread_s']) {
+ $sticky_threads ++;
+ }
+ if ($sticky_threads > 0 && !$stuck && $pref['forum_hilightsticky'])
+ {
+ if($FORUM_IMPORTANT_ROW)
+ {
+ $forum_view_forum .= $FORUM_IMPORTANT_ROW;
+ }
+ else
+ {
+ $forum_view_forum .= "
";
+ }
+ $stuck = TRUE;
+ }
+ if (!$thread_info['thread_s'])
+ {
+ $reg_threads ++;
+ }
+ if ($reg_threads == "1" && !$unstuck && $stuck)
+ {
+ if($FORUM_NORMAL_ROW)
+ {
+ $forum_view_forum .= $FORUM_NORMAL_ROW;
+ }
+ else
+ {
+ $forum_view_forum .= "
";
+ }
+ $unstuck = TRUE;
+ }
+ $forum_view_forum .= parse_thread($thread_info);
+ }
+}
+else
+{
+ $forum_view_forum .= "
";
+}
+
+$sql->db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
+$FORUMJUMP = forumjump();
+$TOPLINK = "".LAN_02."";
+
+if($container_only)
+{
+ $FORUM_VIEW_START = ($FORUM_VIEW_START_CONTAINER ? $FORUM_VIEW_START_CONTAINER : $FORUM_VIEW_START);
+ $FORUM_VIEW_END = ($FORUM_VIEW_END_CONTAINER ? $FORUM_VIEW_END_CONTAINER : $FORUM_VIEW_END);
+ $forum_view_forum = "";
+}
+
+$forum_view_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_START);
+$forum_view_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_END);
+
+
+if ($pref['forum_enclose'])
+{
+ $ns->tablerender($pref['forum_title'], $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1'));
+}
+else
+{
+ echo $forum_view_start.$forum_view_forum.$forum_view_end;
+}
+
+echo "";
+
+require_once(FOOTERF);
+
+
+function parse_thread($thread_info)
+{
+ global $forum, $tp, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $forum_id, $menu_pref;
+ $text = "";
+ $VIEWS = $thread_info['thread_views'];
+ $REPLIES = $thread_info['thread_total_replies'];
+
+
+ if ($REPLIES)
+ {
+ $lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
+ $tmp = explode(".", $thread_info['thread_lastuser'], 2);
+ if($thread_info['lastpost_username'])
+ {
+ $LASTPOST = "".$thread_info['lastpost_username']."";
+ }
+ else
+ {
+ if($tmp[1])
+ {
+ $LASTPOST = $tp->toHTML($tmp[1]);
+ }
+ else
+ {
+ $LASTPOST = FORLAN_19;
+ }
+ }
+ $LASTPOST .= "
".$lastpost_datestamp;
+ }
+
+ $newflag = FALSE;
+ if (USER)
+ {
+ if ($thread_info['thread_lastpost'] > USERLV && !preg_match("#\b".$thread_info['thread_id']."\b#", USERVIEWED))
+ {
+ $newflag = TRUE;
+ }
+ }
+
+ $THREADDATE = $gen->convert_date($thread_info['thread_datestamp'], 'forum');
+ $ICON = ($newflag ? IMAGE_new : IMAGE_nonew);
+ if ($REPLIES >= $pref['forum_popular'])
+ {
+ $ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular);
+ }
+
+ $THREADTYPE = '';
+ if ($thread_info['thread_s'] == 1)
+ {
+ $ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
+ $THREADTYPE = '['.LAN_202.']
';
+ }
+ elseif($thread_info['thread_s'] == 2)
+ {
+ $ICON = IMAGE_announce;
+ $THREADTYPE = '['.LAN_396.']
';
+ }
+ elseif(!$thread_info['thread_active'])
+ {
+ $ICON = IMAGE_closed;
+ }
+
+ $thread_name = strip_tags($tp->toHTML($thread_info['thread_name'], false, 'no_hook, emotes_off'));
+ if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) {
+ $thread_name = substr($thread_name, strlen($THREADTYPE));
+ }
+ if ($pref['forum_tooltip']) {
+ $thread_thread = strip_tags($tp->toHTML($thread_info['thread_thread'], true, 'no_hook'));
+ $tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400);
+ if (strlen($thread_thread) > $tip_length) {
+ $thread_thread = substr($thread_thread, 0, $tip_length)." ".$menu_pref['newforumposts_postfix'];
+ }
+ $thread_thread = str_replace("'", "'", $thread_thread);
+ $title = "title='".$thread_thread."'";
+ } else {
+ $title = "";
+ }
+ $THREADNAME = "{$thread_name}";
+
+ $pages = ceil(($REPLIES+1)/$pref['forum_postspage']);
+ if ($pages > 1)
+ {
+ if($pages > 6)
+ {
+ for($a = 0; $a <= 2; $a++)
+ {
+ $PAGES .= $PAGES ? " " : "";
+ $PAGES .= "".($a+1)."";
+ }
+ $PAGES .= " ... ";
+ for($a = $pages-3; $a <= $pages-1; $a++)
+ {
+ $PAGES .= $PAGES ? " " : "";
+ $PAGES .= "".($a+1)."";
+ }
+ }
+ else
+ {
+ for($a = 0; $a <= ($pages-1); $a++)
+ {
+ $PAGES .= $PAGES ? " " : "";
+ $PAGES .= "".($a+1)."";
+ }
+ }
+ $PAGES = LAN_316." [ ".$PAGES." ]";
+ }
+ else
+ {
+ $PAGES = "";
+ }
+
+ if (MODERATOR)
+ {
+ $thread_id = $thread_info['thread_id'];
+ $ADMIN_ICONS = "
+
+ ";
+ }
+
+ $text .= "
+