mirror of
https://github.com/e107inc/e107.git
synced 2025-04-13 17:12:07 +02:00
Update forum_t to forum_thread in SQL
This commit is contained in:
parent
384cb63c07
commit
96e7f8e777
@ -2,14 +2,12 @@
|
||||
/*
|
||||
* 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
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* mySQL Handler
|
||||
* MySQL Handler
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@ -18,7 +16,6 @@
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id$;
|
||||
* @todo separate cache for db type tables
|
||||
*
|
||||
* 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 />
|
||||
* <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
|
||||
*/
|
||||
|
@ -154,7 +154,7 @@ if(isset($_POST['update_subs']))
|
||||
if ($sql->delete("forum", "forum_id='$id' "))
|
||||
{
|
||||
$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 />";
|
||||
}
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ class e107forum
|
||||
$lp_user = 'NULL';
|
||||
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))
|
||||
{
|
||||
@ -1409,8 +1409,8 @@ class e107forum
|
||||
|
||||
$qry = "
|
||||
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
|
||||
LEFT JOIN #forum_t as fp ON fp.thread_id = ft.thread_parent
|
||||
FROM #forum_thread AS ft
|
||||
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 #forum as f ON f.forum_id = ft.thread_forum_id
|
||||
WHERE ft.thread_datestamp > ".USERLV. "
|
||||
|
@ -36,7 +36,7 @@ $id = (int)$_GET['id'];
|
||||
$action = $_GET['f'];
|
||||
|
||||
$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 fp ON fp.forum_id = f.forum_parent
|
||||
WHERE t.thread_id = {$thread_id}
|
||||
@ -60,11 +60,11 @@ require_once(HEADERF);
|
||||
if (isset($_POST['deletepollconfirm']))
|
||||
{
|
||||
$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();
|
||||
extract($row);
|
||||
$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;
|
||||
$url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id;
|
||||
}
|
||||
|
@ -2,14 +2,10 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
require_once('../../class2.php');
|
||||
|
@ -2,14 +2,10 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
@ -57,7 +53,7 @@ if($msg)
|
||||
$fi = new e_file;
|
||||
$mask = ".*_".USERID."_FT.*";
|
||||
$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();
|
||||
}
|
||||
|
@ -2,16 +2,10 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/search/search_parser.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
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;
|
||||
$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 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);
|
||||
$text .= $ps['text'];
|
||||
|
@ -67,7 +67,7 @@ elseif(!isset($NEWFORUMPOSTSTYLE_HEADER))
|
||||
|
||||
$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
|
||||
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 lp ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lp.user_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='' />";
|
||||
}
|
||||
*/
|
||||
$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
|
||||
$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
|
||||
$sql->db_Select_gen("SELECT sum(thread_views) FROM ".MPREFIX."forum_t");
|
||||
$TOTAL_TOPICS = $sql->db_Count("forum_thread", "(*)", " WHERE thread_parent='0' ");
|
||||
$TOTAL_REPLIES = $sql->db_Count("forum_thread", "(*)", " WHERE thread_parent!='0' ");
|
||||
$sql->db_Select_gen("SELECT sum(thread_views) FROM #forum_thread");
|
||||
$tmp = $sql->db_Fetch();
|
||||
$TOTAL_VIEWS = $tmp[0];
|
||||
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
|
||||
|
10
online.php
10
online.php
@ -234,7 +234,7 @@ Think these are no longer used
|
||||
$t_page = 1;
|
||||
}
|
||||
$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
|
||||
WHERE t.thread_id = ".intval($tmp[0])
|
||||
;
|
||||
@ -256,11 +256,11 @@ Think these are no longer used
|
||||
$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
|
||||
}
|
||||
} 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");
|
||||
$forum_t = $sql->db_Fetch();
|
||||
$sql->db_Select("forum", "forum_name", "forum_id=".$forum_t['thread_forum_id']);
|
||||
$sql->db_Select("forum_thread", "thread_name, thread_forum_id", "thread_forum_id=".intval($tmp[0])." AND thread_parent=0");
|
||||
$forum_thread = $sql->db_Fetch();
|
||||
$sql->db_Select("forum", "forum_name", "forum_id=".$forum_thread['thread_forum_id']);
|
||||
$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]";
|
||||
}
|
||||
}
|
||||
|
12
top.php
12
top.php
@ -122,9 +122,9 @@ if ($action == 'active')
|
||||
|
||||
$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;
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
$ns->tablerender(LAN_7, $text, 'nfp');
|
||||
/*
|
||||
require_once (e_HANDLER.'np_class.php');
|
||||
@ -195,7 +195,7 @@ if ($action == 'top')
|
||||
{
|
||||
$ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0');
|
||||
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].top.forum.'.$view;
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
}
|
||||
$ns->tablerender(TOP_LAN_0, $text);
|
||||
/*
|
||||
@ -255,8 +255,8 @@ if ($action == 'top')
|
||||
$text .= "</table>\n</div>";
|
||||
$ns->tablerender(TOP_LAN_3, $text);
|
||||
}
|
||||
|
||||
if ($subaction == 'chat' || $subaction == 'all')
|
||||
|
||||
if ($subaction == 'chat' || $subaction == 'all')
|
||||
{
|
||||
$top_forum_posters = $sql->db_Select("user", "*", "`user_chats` > 0 ORDER BY user_chats DESC LIMIT 0, 10");
|
||||
$text = "
|
||||
@ -305,5 +305,5 @@ if ($action == 'top')
|
||||
$ns->tablerender(TOP_LAN_5, $text);
|
||||
}
|
||||
}
|
||||
require_once(FOOTERF);
|
||||
require_once(FOOTERF);
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user