1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +02:00

Update forum_t to forum_thread in SQL

This commit is contained in:
Moc
2013-04-15 12:44:56 +02:00
parent 384cb63c07
commit 96e7f8e777
10 changed files with 31 additions and 48 deletions

View File

@@ -2,14 +2,12 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (C) 2008-2012 e107 Inc (e107.org) * Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* mySQL Handler * MySQL Handler
* *
* $URL$
* $Id$
*/ */
@@ -18,7 +16,6 @@
* *
* @package e107 * @package e107
* @subpackage e107_handlers * @subpackage e107_handlers
* @version $Id$;
* @todo separate cache for db type tables * @todo separate cache for db type tables
* *
* WARNING!!! System config should be DIRECTLY called inside db handler like this: * WARNING!!! System config should be DIRECTLY called inside db handler like this:
@@ -965,7 +962,7 @@ class e_db_mysql
* @desc Count the number of rows in a select<br /> * @desc Count the number of rows in a select<br />
* <br /> * <br />
* Example:<br /> * Example:<br />
* <code>$topics = e107::getDb()->count("forum_t", "(*)", "thread_forum_id='".$forum_id."' AND thread_parent='0'");</code> * <code>$topics = e107::getDb()->count("forum_thread", "(*)", "thread_forum_id='".$forum_id."' AND thread_parent='0'");</code>
* *
* @access public * @access public
*/ */

View File

@@ -154,7 +154,7 @@ if(isset($_POST['update_subs']))
if ($sql->delete("forum", "forum_id='$id' ")) if ($sql->delete("forum", "forum_id='$id' "))
{ {
$msg .= FORLAN_150." ". LAN_ID.":"." ".$id." ".LAN_DELETED."<br />"; $msg .= FORLAN_150." ". LAN_ID.":"." ".$id." ".LAN_DELETED."<br />";
$cnt = $sql->delete("forum_t", "thread_forum_id = {$id}"); $cnt = $sql->delete("forum_thread", "thread_forum_id = {$id}");
$msg .= $cnt." ".FORLAN_152." ".LAN_DELETED."<br />"; $msg .= $cnt." ".FORLAN_152." ".LAN_DELETED."<br />";
} }
} }

View File

@@ -926,7 +926,7 @@ class e107forum
$lp_user = 'NULL'; $lp_user = 'NULL';
if($updateThreads == true) if($updateThreads == true)
{ {
if ($sql2->select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0")) if ($sql2->select('forum_thread', 'thread_id', "thread_forum_id = $id AND thread_parent = 0"))
{ {
while ($row = $sql2->fetch(MYSQL_ASSOC)) while ($row = $sql2->fetch(MYSQL_ASSOC))
{ {
@@ -1409,8 +1409,8 @@ class e107forum
$qry = " $qry = "
SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class
FROM #forum_t AS ft FROM #forum_thread AS ft
LEFT JOIN #forum_t as fp ON fp.thread_id = ft.thread_parent LEFT JOIN #forum_thread as fp ON fp.thread_id = ft.thread_parent
LEFT JOIN #user as u ON u.user_id = SUBSTRING_INDEX(ft.thread_user,'.',1) LEFT JOIN #user as u ON u.user_id = SUBSTRING_INDEX(ft.thread_user,'.',1)
LEFT JOIN #forum as f ON f.forum_id = ft.thread_forum_id LEFT JOIN #forum as f ON f.forum_id = ft.thread_forum_id
WHERE ft.thread_datestamp > ".USERLV. " WHERE ft.thread_datestamp > ".USERLV. "

View File

@@ -36,7 +36,7 @@ $id = (int)$_GET['id'];
$action = $_GET['f']; $action = $_GET['f'];
$qry = " $qry = "
SELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_t as t SELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_thread as t
LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id
LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
WHERE t.thread_id = {$thread_id} WHERE t.thread_id = {$thread_id}
@@ -60,11 +60,11 @@ require_once(HEADERF);
if (isset($_POST['deletepollconfirm'])) if (isset($_POST['deletepollconfirm']))
{ {
$sql->delete("poll", "poll_id='".intval($thread_parent)."' "); $sql->delete("poll", "poll_id='".intval($thread_parent)."' ");
$sql->select("forum_t", "*", "thread_id='".$thread_id."' "); $sql->select("forum_thread", "*", "thread_id='".$thread_id."' ");
$row = $sql->fetch(); $row = $sql->fetch();
extract($row); extract($row);
$thread_name = str_replace("[poll] ", "", $thread_name); $thread_name = str_replace("[poll] ", "", $thread_name);
$sql->update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' "); $sql->update("forum_thread", "thread_name='$thread_name' WHERE thread_id='$thread_id' ");
$message = FORCONF_5; $message = FORCONF_5;
$url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id; $url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id;
} }

View File

@@ -2,14 +2,10 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $URL$
* $Id$
*/ */
require_once('../../class2.php'); require_once('../../class2.php');

View File

@@ -2,14 +2,10 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $URL$
* $Id$
*/ */
require_once("../../class2.php"); require_once("../../class2.php");
@@ -57,7 +53,7 @@ if($msg)
$fi = new e_file; $fi = new e_file;
$mask = ".*_".USERID."_FT.*"; $mask = ".*_".USERID."_FT.*";
$fileList = $fi->get_files(e_UPLOAD, $mask); $fileList = $fi->get_files(e_UPLOAD, $mask);
if($sql->db_Select('forum_t','thread_id, thread_thread, thread_parent', "thread_thread REGEXP '.*_".USERID."_FT.*'")) if($sql->db_Select('forum_thread','thread_id, thread_thread, thread_parent', "thread_thread REGEXP '.*_".USERID."_FT.*'"))
{ {
$threadList = $sql->db_getList(); $threadList = $sql->db_getList();
} }

View File

@@ -2,16 +2,10 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/search/search_parser.php,v $
* $Revision$
* $Date$
* $Author$
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
@@ -43,10 +37,10 @@ $no_results = LAN_198;
$where = "f.forum_class REGEXP '".e_CLASS_REGEXP."' AND fp.forum_class REGEXP '".e_CLASS_REGEXP."' AND".$advanced_where; $where = "f.forum_class REGEXP '".e_CLASS_REGEXP."' AND fp.forum_class REGEXP '".e_CLASS_REGEXP."' AND".$advanced_where;
$order = array('thread_datestamp' => DESC); $order = array('thread_datestamp' => DESC);
$table = "forum_t AS t LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id $table = "forum_thread AS t LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id
LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id"; LEFT JOIN #forum_thread AS tp ON t.thread_parent = tp.thread_id";
$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_forum', $no_results, $where, $order); $ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_forum', $no_results, $where, $order);
$text .= $ps['text']; $text .= $ps['text'];

View File

@@ -67,7 +67,7 @@ elseif(!isset($NEWFORUMPOSTSTYLE_HEADER))
$results = $sql->db_Select_gen(" $results = $sql->db_Select_gen("
SELECT t.thread_id, t.thread_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, t.thread_active, t.thread_s, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name SELECT t.thread_id, t.thread_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, t.thread_active, t.thread_s, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name
FROM #forum_t AS t FROM #forum_thread AS t
LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
LEFT JOIN #user AS lp ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lp.user_id LEFT JOIN #user AS lp ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lp.user_id
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
@@ -93,9 +93,9 @@ else
$ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />"; $ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />";
} }
*/ */
$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' "); $TOTAL_TOPICS = $sql->db_Count("forum_thread", "(*)", " WHERE thread_parent='0' ");
$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' "); $TOTAL_REPLIES = $sql->db_Count("forum_thread", "(*)", " WHERE thread_parent!='0' ");
$sql->db_Select_gen("SELECT sum(thread_views) FROM ".MPREFIX."forum_t"); $sql->db_Select_gen("SELECT sum(thread_views) FROM #forum_thread");
$tmp = $sql->db_Fetch(); $tmp = $sql->db_Fetch();
$TOTAL_VIEWS = $tmp[0]; $TOTAL_VIEWS = $tmp[0];
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER); $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);

View File

@@ -234,7 +234,7 @@ Think these are no longer used
$t_page = 1; $t_page = 1;
} }
$qry = " $qry = "
SELECT t.thread_name, f.forum_name, f.forum_class from #forum_t AS t SELECT t.thread_name, f.forum_name, f.forum_class from #forum_thread AS t
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
WHERE t.thread_id = ".intval($tmp[0]) WHERE t.thread_id = ".intval($tmp[0])
; ;
@@ -256,11 +256,11 @@ Think these are no longer used
$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\""; $online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
} }
} elseif(strstr($online_location, "_post")) { } elseif(strstr($online_location, "_post")) {
$sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_forum_id=".intval($tmp[0])." AND thread_parent=0"); $sql->db_Select("forum_thread", "thread_name, thread_forum_id", "thread_forum_id=".intval($tmp[0])." AND thread_parent=0");
$forum_t = $sql->db_Fetch(); $forum_thread = $sql->db_Fetch();
$sql->db_Select("forum", "forum_name", "forum_id=".$forum_t['thread_forum_id']); $sql->db_Select("forum", "forum_name", "forum_id=".$forum_thread['thread_forum_id']);
$forum = $sql->db_Fetch(); $forum = $sql->db_Fetch();
$online_location_page = ONLINE_EL12.": ".ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum_t['thread_name']; $online_location_page = ONLINE_EL12.": ".ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum_thread['thread_name'];
$online_location = e_PLUGIN."forum/forum_viewtopic.php?$tmp[0].$tmp[1]"; $online_location = e_PLUGIN."forum/forum_viewtopic.php?$tmp[0].$tmp[1]";
} }
} }

View File

@@ -122,7 +122,7 @@ if ($action == 'active')
$text .= "</table>\n</div>"; $text .= "</table>\n</div>";
$ftotal = $sql->db_Count('forum_t', '(*)', 'WHERE `thread_parent` = 0'); $ftotal = $sql->db_Count('forum_thread', '(*)', 'WHERE `thread_parent` = 0');
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].active.forum.'.$view; $parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].active.forum.'.$view;
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>'; $text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
$ns->tablerender(LAN_7, $text, 'nfp'); $ns->tablerender(LAN_7, $text, 'nfp');