mirror of
https://github.com/e107inc/e107.git
synced 2025-08-27 00:05:46 +02:00
e107::url() legacy query conflict fix. newforumposts_main BC 'scrolling' fix.
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
|
||||
|
@@ -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.")
|
||||
GROUP BY t.thread_id
|
||||
ORDER BY t.thread_lastpost DESC LIMIT 0, ".vartrue($this->menuPref['display'],10);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user