diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index ff61f5f4f..16c0d73ef 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -3452,8 +3452,28 @@ class e107 $legacyUrl = preg_replace('/&?\$[\d]/i', "", $legacyUrl); // remove any left-over $x (including prefix of '&') + + // Avoid duplicate query keys. eg. URL has ?id=x and $options['query']['id'] exists. + // @see forum/e_url.php - topic/redirect and forum/view_shortcodes.php sc_post_url() + list($legacyUrl,$tmp) = explode("?",$legacyUrl); + + if(!empty($tmp)) + { + parse_str($tmp,$qry); + + foreach($qry as $k=>$v) + { + if(!isset($options['query'][$k])) // $options['query'] overrides any in the original URL. + { + $options['query'][$k] = $v; + } + } + } + // Append the query. - if (is_array($options['query']) && !empty($options['query'])) { + if (is_array($options['query']) && !empty($options['query'])) + { + $legacyUrl .= (strpos($legacyUrl, '?') !== FALSE ? '&' : '?') . self::httpBuildQuery($options['query']); } diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index 3f73064de..19bd445a8 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -81,6 +81,7 @@ if(!class_exists('forum_newforumposts_menu')) default: $qry = " 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, + MAX(p.post_id) AS post_id, f.forum_id, f.forum_name, f.forum_class, f.forum_sef, u.user_name as thread_user_username, u.user_image as thread_user_userimage, @@ -88,12 +89,14 @@ if(!class_exists('forum_newforumposts_menu')) fp.forum_class, fp.forum_sef as forum_parent_sef, lp.user_name AS thread_lastuser_username FROM #forum_thread AS t + LEFT JOIN #forum_post AS p ON t.thread_id = p.post_thread LEFT JOIN #user AS u ON t.thread_user = u.user_id LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_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 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.") + GROUP BY t.thread_id ORDER BY t.thread_lastpost DESC LIMIT 0, ".vartrue($this->menuPref['display'],10); } diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index d4c01d525..a832dc869 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -97,6 +97,11 @@ class news_front { $parms = array('layout'=>'main', 'display'=>$this->pref['nfp_amount']); + if(!empty($this->pref['nfp_layer']) && !empty($this->pref['nfp_layer_height'])) + { + $parms['scroll'] = $this->pref['nfp_layer_height']; + } + $this->text .= e107::getMenu()->renderMenu('forum','newforumposts_menu', $parms, true); }