From ebce2b96e85cbd35b26cac492e38f80a8e02fe5c Mon Sep 17 00:00:00 2001 From: e107steved Date: Mon, 23 Jul 2007 21:13:34 +0000 Subject: [PATCH] Carry across some mods from 0.7 --- e107_plugins/forum/forum_admin.php | 39 ++++++++++++---- .../English/lan_newforumposts_menu.php | 8 ++-- e107_plugins/forum/newforumposts_menu.php | 16 ++++--- .../forum/newforumposts_menu_config.php | 46 ++++++++++++------- 4 files changed, 76 insertions(+), 33 deletions(-) diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php index c6f771842..f3d1859ac 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.1.1.1 $ -| $Date: 2006-12-02 04:35:12 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-23 21:13:34 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ $eplug_admin = true; @@ -986,7 +986,22 @@ class forum function show_prefs() { - global $pref, $ns; + 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 = "
\n @@ -1012,8 +1027,16 @@ class forum - - + "; + if($poll_installed) + { + $text .= ""; + } + else + { + $text .= ""; + } + $text .= " @@ -1223,8 +1246,8 @@ class forum diff --git a/e107_plugins/forum/languages/English/lan_newforumposts_menu.php b/e107_plugins/forum/languages/English/lan_newforumposts_menu.php index 75d1d3645..1268bbb19 100755 --- a/e107_plugins/forum/languages/English/lan_newforumposts_menu.php +++ b/e107_plugins/forum/languages/English/lan_newforumposts_menu.php @@ -11,9 +11,9 @@ e107 website system | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_newforumposts_menu.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:35:18 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-23 21:13:34 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -28,5 +28,7 @@ define("NFP_8", "Show original topics in menu?"); define("NFP_9", "Update menu Settings"); define("NFP_10", "New Forum Posts Menu Configuration"); define("NFP_11", "Posted by"); +define("NFP_12", "Maximum age of displayed posts"); +define("NFP_13", "Use zero on a quiet site; setting a value in days will reduce database time on a busy site"); ?> \ No newline at end of file diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index c423ae0d6..cb1ef2deb 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-06-08 19:15:08 $ +| $Revision: 1.4 $ +| $Date: 2007-07-23 21:13:34 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -30,16 +30,20 @@ else include_once(e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php"); } +$max_age = varset($menu_pref['newforumposts_maxage'],0); +$max_age = $max_age == 0 ? '' : "(t.thread_datestamp > '".intval(time()-$max_age*86400)."') AND "; $query2 = " -SELECT tp.thread_name AS parent_name, t.thread_datestamp , t.thread_thread, t.thread_name, t.thread_id, t.thread_user, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class FROM #forum_t AS t +SELECT tp.thread_name AS parent_name, +t.thread_datestamp , t.thread_thread, t.thread_name, t.thread_id, t.thread_user, +f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class FROM #forum_t AS t LEFT JOIN #user AS u ON t.thread_user = u.user_id LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id -LEFT JOIN #forum AS f ON (f.forum_id = t.thread_forum_id -AND f.forum_class IN (".USERCLASS_LIST.")) +LEFT JOIN #forum AS f ON (f.forum_id = t.thread_forum_id AND f.forum_class IN (".USERCLASS_LIST.")) LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id -WHERE fp.forum_class IN (".USERCLASS_LIST.") +WHERE {$max_age} fp.forum_class IN (".USERCLASS_LIST.") ORDER BY t.thread_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display']; + $results = $sql->db_Select_gen($query2); if(!$results) diff --git a/e107_plugins/forum/newforumposts_menu_config.php b/e107_plugins/forum/newforumposts_menu_config.php index 443ae9efb..a8cd29e7e 100755 --- a/e107_plugins/forum/newforumposts_menu_config.php +++ b/e107_plugins/forum/newforumposts_menu_config.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu_config.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:35:15 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2007-07-23 21:13:34 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ $eplug_admin = TRUE; @@ -40,44 +40,58 @@ if (isset($_POST['update_menu'])) { $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); $ns->tablerender("", "
".NFP_3."
"); } - + +$menu_pref['newforumposts_maxage'] = varset($menu_pref['newforumposts_maxage'],0); + $text = "
-
".FORLAN_49."
".FORLAN_50."
".($pref['forum_poll'] ? "" : "")."".FORLAN_49."
".FORLAN_50."
".($pref['forum_poll'] ? "" : "")."".FORLAN_66."
".FORLAN_2."
- ".FORLAN_89."     - ".FORLAN_90." + ".FORLAN_89."     + ".FORLAN_90."
- +
+ + + + - - + - - - - + + + + + + - - - - +
".NFP_4.": + ".NFP_4.":
".NFP_5.": + ".NFP_5.": +
".NFP_6.": + ".NFP_12.": + +
+ ".NFP_13." +
".NFP_6.":
".NFP_7.": + ".NFP_7.": +
".NFP_8.": + ".NFP_8.":