mirror of
https://github.com/e107inc/e107.git
synced 2025-06-09 04:28:29 +02:00
Fix for forum query
Still a deprecated plugin - use newforumposts_menu (included with the forum plugin) instead
This commit is contained in:
parent
87b9489976
commit
71ce71bdb1
@ -6,12 +6,6 @@
|
|||||||
* 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/newforumposts_main/newforumposts_main.php,v $
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!defined('e107_INIT')) { exit();}
|
if(!defined('e107_INIT')) { exit();}
|
||||||
@ -65,14 +59,14 @@ elseif(!isset($NEWFORUMPOSTSTYLE_HEADER))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $sql->db_Select_gen("
|
$results = $sql->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, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name
|
||||||
FROM #forum_thread 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
|
||||||
LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
|
LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
|
||||||
WHERE f.forum_id = t.thread_forum_id AND t.thread_parent=0 AND f.forum_class IN (".USERCLASS_LIST.")
|
WHERE f.forum_id = t.thread_forum_id AND f.forum_class IN (".USERCLASS_LIST.")
|
||||||
AND fp.forum_class IN (".USERCLASS_LIST.")
|
AND fp.forum_class IN (".USERCLASS_LIST.")
|
||||||
ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
|
ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
|
||||||
|
|
||||||
@ -93,11 +87,13 @@ 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_thread", "(*)", " WHERE thread_parent='0' ");
|
$TOTAL_TOPICS = $sql->count("forum_thread");
|
||||||
$TOTAL_REPLIES = $sql->db_Count("forum_thread", "(*)", " WHERE thread_parent!='0' ");
|
$TOTAL_REPLIES = $sql->count("forum_post");
|
||||||
$sql->db_Select_gen("SELECT sum(thread_views) FROM #forum_thread");
|
|
||||||
$tmp = $sql->db_Fetch();
|
$sql->gen("SELECT sum(thread_views) FROM #forum_thread");
|
||||||
$TOTAL_VIEWS = $tmp[0];
|
$tmp = $sql->fetch();
|
||||||
|
$TOTAL_VIEWS = $tmp["sum(thread_views)"];
|
||||||
|
|
||||||
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
|
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
|
||||||
|
|
||||||
foreach ($forumArray as $forumInfo)
|
foreach ($forumArray as $forumInfo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user