From c7b9aaa5fc7e71ccf9118a03199cd3114ee810e5 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Fri, 3 Mar 2017 14:46:40 +0000 Subject: [PATCH 01/19] Update admin_shortcodes.php --- e107_core/shortcodes/batch/admin_shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 65563ea9f..f70ed04b7 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1223,7 +1223,7 @@ class admin_shortcodes $type = empty($val['invert']) ? 'latest' : 'invert'; $class = admin_shortcodes::getBadge($val['total'], $type); $link = "".$val['icon']." ".str_replace(":"," ",$val['title'])." ".$val['total'].""; - $text .= "
  • ".$link."
  • \n"; + $text .= "
  • ".$link."
  • \n"; } } $text .= ""; From 2b315dce3249a531bf3cbe1b846fffa3019c7f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:00:29 +0200 Subject: [PATCH 02/19] Update lan_admin.php --- e107_languages/English/admin/lan_admin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 9e12058ac..d00c5957a 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -466,6 +466,7 @@ define("LAN_UI_BATCH_DEATTACH_SUCCESS", "[x] removed from [y] record(s)."); define("LAN_UI_EDIT_LABEL", "Update record #[x]"); define("LAN_UI_CREATE_LABEL", "Create new record"); define("LAN_UI_PREF_LABEL", "Settings"); +define("LAN_UI_PASSWORD_WARNING", "It is HIGHLY recommended that you [change your password encoding] to the PHP Default. (Password hashes will be automatically upgraded during user login.)"); define("LAN_UI_DELETE_LABEL", "Confirm Delete"); define("LAN_UI_DELETE_WARNING", "You are about to delete [x] records. Please confirm to continue."); define("LAN_UI_BATCH_CREATELINK", "Create Link"); From 1b05023d0360482bfc13e19e3b45b67c2cdc6c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:02:56 +0200 Subject: [PATCH 03/19] Add lang code --- e107_admin/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 0902c064a..56a09ef90 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -535,7 +535,7 @@ TMPO; if($us->passwordAPIExists() === true && $us->getDefaultHashType() !== PASSWORD_E107_PHP && e107::pref('core','password_CHAP')==0) { - $message = "It is HIGHLY recommended that you [change your password encoding] to the PHP Default. (Password hashes will be automatically upgraded during user login.)"; + $message = LAN_UI_PASSWORD_WARNING; $srch = array('[',']'); $repl = array("",""); $mes->addWarning(str_replace($srch,$repl,$message)); From d60db215ef4ed938f4aabd150efb43a85b9d0365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:19:24 +0200 Subject: [PATCH 04/19] Update lan_prefs.php --- e107_languages/English/admin/lan_prefs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index dbb63c8c7..781dcec60 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -294,3 +294,4 @@ define("PRFLAN_272", "Session Lifetime"); define("PRFLAN_273", "Lifetime in seconds. 0 = until the browser is closed. "); define("PRFLAN_274", "Contact form will only be visible to this userclass group."); define("PRFLAN_275", "View this page using https (SSL) to modify this option"); +define("PRFLAN_276", "PHP Default (Preferred)"); From db24e265787be3e2fd74a710d77a36ace7ecc66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:20:39 +0200 Subject: [PATCH 05/19] Update prefs.php --- e107_admin/prefs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 83ac79286..a1e74f8e0 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -1411,7 +1411,7 @@ $text .= " if(function_exists('password_verify')) // ie. php 5.5 or higher { - $pwdEncodeOpts[3] = "PHP Default (Preferred)"; + $pwdEncodeOpts[3] = PRFLAN_276; } From 4c0ac0d9550a46b1e21caf187d54a115e9db9e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:57:29 +0200 Subject: [PATCH 06/19] Update lan_admin.php --- e107_languages/English/admin/lan_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index d00c5957a..f85128f38 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -466,7 +466,7 @@ define("LAN_UI_BATCH_DEATTACH_SUCCESS", "[x] removed from [y] record(s)."); define("LAN_UI_EDIT_LABEL", "Update record #[x]"); define("LAN_UI_CREATE_LABEL", "Create new record"); define("LAN_UI_PREF_LABEL", "Settings"); -define("LAN_UI_PASSWORD_WARNING", "It is HIGHLY recommended that you [change your password encoding] to the PHP Default. (Password hashes will be automatically upgraded during user login.)"); +define("LAN_UI_PASSWORD_WARNING", "It is HIGHLY recommended that you [change your password encoding] to the PHP Default.[br](Password hashes will be automatically upgraded during user login.)"); define("LAN_UI_DELETE_LABEL", "Confirm Delete"); define("LAN_UI_DELETE_WARNING", "You are about to delete [x] records. Please confirm to continue."); define("LAN_UI_BATCH_CREATELINK", "Create Link"); From 52c4719ed58db78e7862bb1598be3f6a4012faed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 30 Apr 2017 15:58:27 +0200 Subject: [PATCH 07/19] Update admin.php --- e107_admin/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 56a09ef90..043500f1a 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -535,7 +535,7 @@ TMPO; if($us->passwordAPIExists() === true && $us->getDefaultHashType() !== PASSWORD_E107_PHP && e107::pref('core','password_CHAP')==0) { - $message = LAN_UI_PASSWORD_WARNING; + $message = e107::getParser()->toHTML(LAN_UI_PASSWORD_WARNING, true); $srch = array('[',']'); $repl = array("",""); $mes->addWarning(str_replace($srch,$repl,$message)); From c9c7a1a8cc0f8580317e16850fab25e01eeb045c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Tue, 2 May 2017 06:45:49 +0200 Subject: [PATCH 08/19] Update admin.php --- e107_admin/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 043500f1a..5aa6f1417 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -535,7 +535,7 @@ TMPO; if($us->passwordAPIExists() === true && $us->getDefaultHashType() !== PASSWORD_E107_PHP && e107::pref('core','password_CHAP')==0) { - $message = e107::getParser()->toHTML(LAN_UI_PASSWORD_WARNING, true); + $message = LAN_PASSWORD_WARNING; $srch = array('[',']'); $repl = array("",""); $mes->addWarning(str_replace($srch,$repl,$message)); From 9fa9d66a6179bf5348b62f5367a71518a98c8918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Tue, 2 May 2017 06:47:57 +0200 Subject: [PATCH 09/19] Update lan_admin.php --- e107_languages/English/admin/lan_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index f85128f38..3179360f0 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -332,6 +332,7 @@ define("LAN_OPTIONAL", "optional"); define("LAN_INACTIVE","Inactive"); define("LAN_ACTIVATE","Activate"); define("LAN_ACCEPT","Accept"); +define("LAN_PASSWORD_WARNING", "It is HIGHLY recommended that you [change your password encoding] to the PHP Default. (Password hashes will be automatically upgraded during user login.)"); define("LAN_PENDING","Pending"); define("LAN_SUBMITTED","Submitted"); define("LAN_POSTED_BY_X","Posted by [x] [y]"); @@ -466,7 +467,6 @@ define("LAN_UI_BATCH_DEATTACH_SUCCESS", "[x] removed from [y] record(s)."); define("LAN_UI_EDIT_LABEL", "Update record #[x]"); define("LAN_UI_CREATE_LABEL", "Create new record"); define("LAN_UI_PREF_LABEL", "Settings"); -define("LAN_UI_PASSWORD_WARNING", "It is HIGHLY recommended that you [change your password encoding] to the PHP Default.[br](Password hashes will be automatically upgraded during user login.)"); define("LAN_UI_DELETE_LABEL", "Confirm Delete"); define("LAN_UI_DELETE_WARNING", "You are about to delete [x] records. Please confirm to continue."); define("LAN_UI_BATCH_CREATELINK", "Create Link"); From aeb4f925d28b9db40ec0210b2a0831342e495503 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 2 May 2017 13:47:18 -0700 Subject: [PATCH 10/19] Issue #2610 Remove legacy SEF URL from forum plugin. --- e107_plugins/forum/forum_stats.php | 4 +- e107_plugins/forum/forum_viewtopic.php | 9 +- .../shortcodes/batch/viewforum_shortcodes.php | 5 +- e107_plugins/forum/url/rewrite_url.php | 172 ----------------- e107_plugins/forum/url/url.php | 174 ------------------ 5 files changed, 13 insertions(+), 351 deletions(-) delete mode 100644 e107_plugins/forum/url/rewrite_url.php delete mode 100644 e107_plugins/forum/url/url.php diff --git a/e107_plugins/forum/forum_stats.php b/e107_plugins/forum/forum_stats.php index 35fac0776..73f194e2b 100644 --- a/e107_plugins/forum/forum_stats.php +++ b/e107_plugins/forum/forum_stats.php @@ -626,8 +626,8 @@ class forumStats $POSTER = $row['thread_user_anon']; } - $LINKTOTHREAD = e107::url('forum/thread/view', array('id' =>$row['thread_id'])); //$e107->url->getUrl('forum', 'thread', "func=view&id={$row['thread_id']}"); - $LINKTOFORUM = e107::url('forum/forum/view', array('id' => $row['thread_forum_id'])); //$e107->url->getUrl('forum', 'forum', "func=view&id={$row['thread_forum_id']}"); + // $LINKTOTHREAD = e107::url('forum/thread/view', array('id' =>$row['thread_id'])); //$e107->url->getUrl('forum', 'thread', "func=view&id={$row['thread_id']}"); + // $LINKTOFORUM = e107::url('forum/forum/view', array('id' => $row['thread_forum_id'])); //$e107->url->getUrl('forum', 'forum', "func=view&id={$row['thread_forum_id']}"); $lastpost_datestamp = $gen->convert_date($row['thread_lastpost'], 'forum'); diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index 4799dc5a6..b7231f332 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -646,9 +646,12 @@ function showmodoptions() $forum_id = $thread->threadInfo['forum_id']; if ($postInfo['thread_start']) { + $type = 'Thread'; // XXX _URL_ thread name? - $ret = "
    $postInfo['post_thread']))."' id='frmMod_{$postInfo['post_forum']}_{$postInfo['post_thread']}'>"; + // $formUrl = $e107->url->create('forum/thread/view', array('id' => $postInfo['post_thread'])); + $formUrl = e_REQUEST_URI; // e107::url('forum', 'topic', + $ret = ""; $delId = $postInfo['post_thread']; } else @@ -674,7 +677,9 @@ function showmodoptions() } else { - $ret .= " $postInfo['post_id']))."'>" . defset('IMAGE_admin_split') . ''; + // $splitUrl = $e107->url->create('forum/thread/split', array('id' => $postInfo['post_id'])); + $splitUrl = e107::url('forum','split', array('thread_id'=>$postInfo['post_thread'], 'post_id'=>$postInfo['post_id'])); + $ret .= "" . defset('IMAGE_admin_split') . ''; } $ret .= " diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index d141435cf..d5f2e4557 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -554,7 +554,10 @@ { // global $gen; $tmp = explode('.', $this->var['forum_lastpost_info']); - $lp_thread = " $tmp[1])) . "'>" . IMAGE_post2 . ''; + // $lp_url = e107::getUrl()->create('forum/thread/last', array('id' => $tmp[1])); + $lp_url = $threadUrl = e107::url('forum','topic',$this->var, array('query'=>array('last'=>1))); + + $lp_thread = "" . IMAGE_post2 . ''; $lp_date = $this->gen->convert_date($tmp[0], 'forum'); /*-- diff --git a/e107_plugins/forum/url/rewrite_url.php b/e107_plugins/forum/url/rewrite_url.php deleted file mode 100644 index 62d6e08e8..000000000 --- a/e107_plugins/forum/url/rewrite_url.php +++ /dev/null @@ -1,172 +0,0 @@ - array( - 'noSingleEntry' => true, // [optional] default false; disallow this module to be shown via single entry point when this config is used - 'legacy' => '{e_PLUGIN}forum/forum.php', // this config won't work in single entry point mod (legacy not used at all), so just set this to default plugin file to notify router it's legacy module - 'format' => 'get', // get|path - notify core for the current URL format, if set to 'get' rules will be ignored - 'selfParse' => false, // [optional] default false; use only this->parse() method, no core routine URL parsing - 'selfCreate' => true, // [optional] default false; use only this->create() method, no core routine URL creating - 'defaultRoute' => 'forum/main', // [optional] default empty; route (no leading module) used when module is found with no additional controller/action information e.g. /news/ - 'legacyQuery' => '' // default legacy query string template, null to disable, empty - use current QUERY_STRING - ), - - // rule set array - 'rules' => array() - ); - } - - /** - * NOTE we have double 'forum' but this is the best way to map new-old forum URLs to the new routing engine - * Additionally, 'forum' controller is descriptive, and leading 'forum' module name could be easiely changed (URL aliases administration page) - */ - public function create($route, $params = array(), $options = array()) - { - $amp = varset($options['encode']) ? '&' : '&'; - if(is_string($route)) $route = explode('/', $route, 2); - if(!varset($route[0]) || 'index' == $route[0]) $route[0] = 'forum'; - if(!varset($route[1])) $route[1] = 'main'; - $base = e107::getInstance()->getFolder('plugins').'forum/'; - //var_dump($options, $route, $params); - if($route[0] == 'forum') - { - if(!isset($params['id']) && isset($params['forum_id'])) $params['id'] = $params['forum_id']; - // if(isset($params['forum_name'])) $params['name'] = $params['forum_name']; - not used in this config - switch($route[1]) - { - case 'view': - $page = (varset($params['page']) ? $amp.'p='.$params['page'] : ''); - return $base."forum_viewforum.php?id={$params['id']}{$page}"; - break; - - case 'track': - return $base.'forum.php?track'; - break; - - case 'index': - case 'main': - return $base.'forum.php'; - break; - - case 'post': - return $base."forum_post.php?f={$params['type']}}id={$params['id']}"; - break; - - case 'rules': - return $base.'forum.php?f=rules'; - break; - - case 'mfar': - return $base.'forum.php?f=mfar'.$amp.'id='.$params['id']; - break; - - } - } - elseif($route[0] == 'thread') - { - if(!isset($params['id']) && isset($params['thread_id'])) $params['id'] = $params['thread_id']; - // if(isset($params['thread_name'])) $params['name'] = $params['thread_name']; - not used in this config - switch($route[1]) - { - case 'new': - return $base."forum_post.php?f=nt{$amp}id={$params['id']}"; - break; - - case 'reply': - return $base."forum_post.php?f=rp{$amp}id={$params['id']}"; - break; - - case 'view': - $page = (varset($params['page']) ? $amp.'p='.$params['page'] : ''); - return $base."forum_viewtopic.php?id={$params['id']}{$page}"; - break; - - case 'last': - return $base."forum_viewtopic.php?id={$params['id']}{$amp}last=1"; - break; - - case 'post': - return $base."forum_viewtopic.php?f=post{$amp}id={$params['id']}"; - break; - - case 'report': - $page = (isset($params['page']) ? (int)$params['page'] : 0 ); - return $base."forum_viewtopic.php?f=report{$amp}id={$params['id']}{$amp}post={$params['post']}{$amp}p={$page}"; - break; - - case 'edit': - return $base."forum_post.php?f=edit{$amp}id={$params['id']}"; - break; - - case 'move': - return $base."forum_conf.php?f=move{$amp}id={$params['id']}"; - break; - - case 'split': - return $base."forum_conf.php?f=split{$amp}id={$params['id']}"; - break; - - case 'quote': - return $base."forum_post.php?f=quote{$amp}id={$params['id']}"; - break; - - case 'next': - return $base."forum_viewtopic.php?f=next{$amp}id={$params['id']}"; - break; - - case 'prev': - return $base."forum_viewtopic.php?f=prev{$amp}id={$params['id']}"; - break; - - case 'track': - return $base."forum_viewtopic.php?f=track{$amp}id={$params['id']}"; - break; - - case 'untrack': - return $base."forum_viewtopic.php?f=untrack{$amp}id={$params['id']}"; - break; - - case 'track_toggle': - return $base."forum_viewtopic.php?f=track_toggle{$amp}id={$params['id']}"; - break; - - } - } - return false; - } - - /** - * Admin callback - * Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page) - */ - public function admin() - { - // static may be used for performance - /* - e107::plugLan('forum', 'lan_forum_url'); - static $admin = array( - 'labels' => array( - 'name' => LAN_PLUGIN_FORUM_NAME, // Module name - 'label' => FORUM_LAN_URL_REWRITE_LABEL, // Current profile name - 'description' => FORUM_LAN_URL_REWRITE_DESCR, // - 'examples' => array("{e_PLUGIN_ABS}forum/forum.php") - ), - 'form' => array(), // Under construction - additional configuration options - 'callbacks' => array(), // Under construction - could be used for e.g. URL generator functionallity - ); - - return $admin;*/ - } -} diff --git a/e107_plugins/forum/url/url.php b/e107_plugins/forum/url/url.php deleted file mode 100644 index 7c7b320ca..000000000 --- a/e107_plugins/forum/url/url.php +++ /dev/null @@ -1,174 +0,0 @@ - array( - 'noSingleEntry' => true, // [optional] default false; disallow this module to be shown via single entry point when this config is used - 'legacy' => '{e_PLUGIN}forum/forum.php', // this config won't work in single entry point mod (legacy not used at all), so just set this to default plugin file to notify router it's legacy module - 'format' => 'get', // get|path - notify core for the current URL format, if set to 'get' rules will be ignored - 'selfParse' => false, // [optional] default false; use only this->parse() method, no core routine URL parsing - 'selfCreate' => true, // [optional] default false; use only this->create() method, no core routine URL creating - 'defaultRoute' => 'forum/main', // [optional] default empty; route (no leading module) used when module is found with no additional controller/action information e.g. /news/ - 'legacyQuery' => '' // default legacy query string template, null to disable, empty - use current QUERY_STRING - ), - - // rule set array - 'rules' => array() - ); - } - - /** - * NOTE we have double 'forum' but this is the best way to map new-old forum URLs to the new routing engine - * Additionally, 'forum' controller is descriptive, and leading 'forum' module name could be easiely changed (URL aliases administration page) - */ - public function create($route, $params = array(), $options = array()) - { - $amp = varset($options['encode']) ? '&' : '&'; - if(is_string($route)) $route = explode('/', $route, 2); - if(!varset($route[0]) || 'index' == $route[0]) $route[0] = 'forum'; - if(!varset($route[1])) $route[1] = 'main'; - $base = e107::getInstance()->getFolder('plugins').'forum/'; - - //var_dump($options, $route, $params); - if($route[0] == 'forum') - { - if(!isset($params['id']) && isset($params['forum_id'])) $params['id'] = $params['forum_id']; - // if(isset($params['forum_name'])) $params['name'] = $params['forum_name']; - not used in this config - switch($route[1]) - { - case 'view': - $page = (varset($params['page']) ? $amp.'p='.$params['page'] : ''); - return $base."forum_viewforum.php?id={$params['id']}{$page}"; - break; - - case 'track': - return $base.'forum.php?track'; - break; - - case 'index': - case 'main': - return $base.'forum.php'; - break; - - case 'post': - return $base."forum_post.php?f={$params['type']}{$amp}id={$params['id']}"; - break; - - case 'rules': - return $base.'forum.php?f=rules'; - break; - - case 'mfar': - return $base.'forum.php?f=mfar'.$amp.'id='.$params['id']; - break; - - } - } - elseif($route[0] == 'thread') - { - if(!isset($params['id']) && isset($params['thread_id'])) $params['id'] = $params['thread_id']; - // if(isset($params['thread_name'])) $params['name'] = $params['thread_name']; - not used in this config - switch($route[1]) - { - case 'new': - return $base."forum_post.php?f=nt{$amp}id={$params['id']}"; - break; - - case 'reply': - return $base."forum_post.php?f=rp{$amp}id={$params['id']}"; - break; - - case 'view': - $page = (varset($params['page']) ? $amp.'p='.$params['page'] : ''); - return $base."forum_viewtopic.php?id={$params['id']}{$page}"; - break; - - case 'last': - return $base."forum_viewtopic.php?id={$params['id']}{$amp}last=1"; - break; - - case 'post': - return $base."forum_viewtopic.php?f=post{$amp}id={$params['id']}"; - break; - - case 'report': - $page = (isset($params['page']) ? (int)$params['page'] : 0 ); - return $base."forum_viewtopic.php?f=report{$amp}id={$params['id']}{$amp}post={$params['post']}{$amp}p={$page}"; - break; - - case 'edit': - return $base."forum_post.php?f=edit{$amp}id={$params['id']}{$amp}post={$params['post']}"; - break; - - case 'move': - return $base."forum_conf.php?f=move{$amp}id={$params['id']}"; - break; - - case 'split': - return $base."forum_conf.php?f=split{$amp}id={$params['id']}"; - break; - - case 'quote': - return $base."forum_post.php?f=quote{$amp}id={$params['id']}{$amp}post={$params['post']}"; - break; - - case 'next': - return $base."forum_viewtopic.php?f=next{$amp}id={$params['id']}"; - break; - - case 'prev': - return $base."forum_viewtopic.php?f=prev{$amp}id={$params['id']}"; - break; - - case 'track': - return $base."forum_viewtopic.php?f=track{$amp}id={$params['id']}"; - break; - - case 'untrack': - return $base."forum_viewtopic.php?f=untrack{$amp}id={$params['id']}"; - break; - - case 'track_toggle': - return $base."forum_viewtopic.php?f=track_toggle{$amp}id={$params['id']}"; - break; - - } - } - return false; - } - - /** - * Admin callback - * Language file not loaded as all language data is inside the lan_eurl.php (loaded by default on administration URL page) - */ - public function admin() - { - return false; // whole file deprecated. - /* - // static may be used for performance - e107::plugLan('forum', 'lan_forum_url'); - static $admin = array( - 'labels' => array( - 'name' => LAN_PLUGIN_FORUM_NAME, // Module name - 'label' => FORUM_LAN_URL_DEFAULT_LABEL, // Current profile name - 'description' => FORUM_LAN_URL_DEFAULT_DESCR, // - 'examples' => array("{e_PLUGIN_ABS}forum/forum_viewtopic.php?id=3&p=2") - ), - 'form' => array(), // Under construction - additional configuration options - 'callbacks' => array(), // Under construction - could be used for e.g. URL generator functionallity - ); - */ - return $admin; - } -} From 51a547ca6a0b19f2d3a586de90722f243b9fe40b Mon Sep 17 00:00:00 2001 From: rica-carv Date: Tue, 2 May 2017 21:48:51 +0100 Subject: [PATCH 11/19] Legacy themes support Legacy themes support --- .../pm/templates/pm_menu_template.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/e107_plugins/pm/templates/pm_menu_template.php b/e107_plugins/pm/templates/pm_menu_template.php index ef8e93465..88c814c66 100644 --- a/e107_plugins/pm/templates/pm_menu_template.php +++ b/e107_plugins/pm/templates/pm_menu_template.php @@ -25,15 +25,22 @@ if (!defined('e107_INIT')) { exit; } -//define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); -define('PM_INBOX_ICON', e107::getParser()->toGlyph('fa-inbox')); -//define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); -// Icon candidate to stacked fontawesome icons... -define('PM_OUTBOX_ICON', e107::getParser()->toGlyph('fa-inbox').e107::getParser()->toGlyph('fa-arrow-up')); +if(deftrue('BOOTSTRAP') && deftrue('FONTAWESOME')) +{ + define('PM_INBOX_ICON', e107::getParser()->toGlyph('fa-inbox')); + // Icon candidate to stacked fontawesome icons... + define('PM_OUTBOX_ICON', e107::getParser()->toGlyph('fa-inbox').e107::getParser()->toGlyph('fa-arrow-up')); + // Icon candidate to animated fontawesome icons... + define('NEWPM_ANIMATION', e107::getParser()->toGlyph('fa-envelope')); +} +else +{ + if (!defined('PM_INBOX_ICON')) define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); + if (!defined('PM_OUTBOX_ICON')) define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); + if (!defined('NEWPM_ANIMATION')) define('NEWPM_ANIMATION', ""); +} + //define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); -//define('NEWPM_ANIMATION', ""); -// Icon candidate to animated fontawesome icons... -define('NEWPM_ANIMATION', e107::getParser()->toGlyph('fa-envelope')); /* $sc_style['PM_SEND_PM_LINK']['pre'] = "

    "; $sc_style['PM_SEND_PM_LINK']['post'] = ""; From c2f241d87166d6922eef8d73f27864129962c4e5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 2 May 2017 13:53:31 -0700 Subject: [PATCH 12/19] Issue #2610 - attempt to auto-remove legacy URL files from forum. --- e107_plugins/download/download_setup.php | 2 -- e107_plugins/forum/forum_setup.php | 24 ++++++++++++++++++++++++ e107_plugins/forum/plugin.xml | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/e107_plugins/download/download_setup.php b/e107_plugins/download/download_setup.php index d309b3341..f1fd3493e 100644 --- a/e107_plugins/download/download_setup.php +++ b/e107_plugins/download/download_setup.php @@ -83,8 +83,6 @@ class download_setup $bld = new eRouter; $bld->buildGlobalConfig(); - - } return $this->upgradeFilePaths($needed); diff --git a/e107_plugins/forum/forum_setup.php b/e107_plugins/forum/forum_setup.php index 6c7296651..79f93d52d 100644 --- a/e107_plugins/forum/forum_setup.php +++ b/e107_plugins/forum/forum_setup.php @@ -98,6 +98,30 @@ class forum_setup { $sql = e107::getDb(); + $config = e107::getPref('url_config'); + + if(!empty($config['forum'])) + { + e107::getConfig() + ->removePref('url_config/forum') + ->removePref('url_locations/forum') + ->save(false,true); + + if(file_exists(e_PLUGIN."forum/url/url.php")) + { + @unlink(e_PLUGIN."forum/url/url.php"); + @unlink(e_PLUGIN."forum/url/rewrite_url.php"); + } + + $bld = new eRouter; + $bld->buildGlobalConfig(); + + } + + + + + if($sql->isEmpty('forum_thread') === true && $sql->isTable('forum_t') && $sql->isEmpty('forum_t') === false) { $mes = e107::getMessage(); diff --git a/e107_plugins/forum/plugin.xml b/e107_plugins/forum/plugin.xml index 002e83927..8e68c54d7 100755 --- a/e107_plugins/forum/plugin.xml +++ b/e107_plugins/forum/plugin.xml @@ -1,5 +1,5 @@ - + This plugin is a fully featured forum system content From 6c828ec326df96d5169b39bd54123d55c1bf88f5 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 2 May 2017 15:31:21 -0700 Subject: [PATCH 13/19] Possible fix for hardcoded css URLs with css cache. --- e107_handlers/js_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 989a1b5c8..6daee89e2 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1597,7 +1597,7 @@ class e_jsmanager foreach($match[1] as $k=>$v) { - if(substr($v,5) == 'data:' || substr($v,4) == 'http') + if(strpos($v,'data:') === 0 || strpos($v,'http') === 0) { unset($match[0][$k]); continue; From fb02782a3d9adeb71ef57648baf55cd96e567ded Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 May 2017 11:39:30 -0700 Subject: [PATCH 14/19] Forum upgrade fix. --- e107_plugins/forum/forum_setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/forum/forum_setup.php b/e107_plugins/forum/forum_setup.php index 79f93d52d..9fff88347 100644 --- a/e107_plugins/forum/forum_setup.php +++ b/e107_plugins/forum/forum_setup.php @@ -80,7 +80,7 @@ class forum_setup $sql = e107::getDb(); - if(!$sql->isTable('forum_t')) // no table, so run a default plugin install procedure. + if(!$sql->isTable('forum_t') || !$sql->isEmpty('forum_thread')) // no table, so run a default plugin install procedure. { return false; // e107::getSingleton('e107plugin')->refresh('forum'); From 4e044b90b920eb43997fd16f1607773919a07c03 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 May 2017 11:40:12 -0700 Subject: [PATCH 15/19] Download: Fixes #2607 - download links. --- e107_plugins/download/request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index 301278386..fecf3c75c 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -136,7 +136,7 @@ if ($type == "file") { $row = $sql->fetch(); - $row['download_url'] = $tp->replaceConstants($row['download_url'],'abs'); + $row['download_url'] = $tp->replaceConstants($row['download_url']); // must be relative file-path. if (check_class($row['download_category_class']) && check_class($row['download_class'])) { From 7317fd130999d66f8bdfa0daa34f33f04d5e11f0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 May 2017 12:30:26 -0700 Subject: [PATCH 16/19] Admin > Language : LAN Fix. --- e107_admin/language.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e107_admin/language.php b/e107_admin/language.php index b7b54147f..b76609875 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -117,8 +117,8 @@ if(!empty($_GET['iframe'])) 'adminlanguage' => array('title'=> LANG_LAN_50, 'type'=>'dropdown', 'data' => 'str','help'=>'', 'writeParms'=>array('useValues'=>1,"default" => LANG_LAN_14)), 'multilanguage' => array('title'=> LANG_LAN_12, 'type'=>'boolean', 'data' => 'int','help'=>''), 'noLanguageSubs' => array('title'=> LANG_LAN_26, 'type'=>'boolean', 'data'=>'int', 'help'=> LANG_LAN_27), - 'multilanguage_subdomain' => array('title'=> LANG_LAN_18, 'type'=>'textarea', 'data'=>'str', 'help'=> LANG_LAN_19, 'writeParms'=>array('rows'=>3)), - 'multilanguage_domain' => array('title'=> LANG_LAN_106, 'type'=>'method', 'data'=>'str', 'help'=> LANG_LAN_19), + 'multilanguage_subdomain' => array('title'=> LANG_LAN_18, 'type'=>'textarea', 'data'=>'str', 'help'=> LANG_LAN_19, 'writeParms'=>array('rows'=>3, 'placeholder'=>'mydomain.com')), + 'multilanguage_domain' => array('title'=> LANG_LAN_106, 'type'=>'method', 'data'=>'str', 'help'=> LANG_LAN_107), 'multilanguage_verify_errorsonly' => array('title'=> LANG_LAN_33, 'type'=>'boolean', 'data' => 'int','help'=>''), ); @@ -1149,7 +1149,7 @@ function multilang_prefs() ".LANG_LAN_19." - +
    ".LANG_LAN_20."
    From f975847ea159b79f28e916ffefee2cb52b2392b1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 May 2017 13:27:17 -0700 Subject: [PATCH 17/19] News: Meta-description character limit option added. ie. {NEWS_DESCRIPTION: limit=x} --- e107_core/shortcodes/batch/news_shortcodes.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index df9e0fa6b..a95551abb 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -1120,7 +1120,15 @@ class news_shortcodes extends e_shortcode function sc_newsmetadiz($parm=null) { - return e107::getParser()->toHtml($this->news_item['news_meta_description'],true); + $text = e107::getParser()->toHtml($this->news_item['news_meta_description'],true); + + if(!empty($parm['limit'])) + { + $text = e107::getParser()->text_truncate($text, $parm['limit']); + } + + return $text; + } } From 963f35ded13ac27e572589ed8105fa587b8c54e0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 5 May 2017 10:11:40 -0700 Subject: [PATCH 18/19] Downloads: Fixes #2576 - Report Broken Download breadcrumb URLs and cleanup. --- e107_plugins/download/download_shortcodes.php | 9 +++- e107_plugins/download/e_url.php | 7 +++ .../download/handlers/download_class.php | 51 +++++++++++-------- 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index 1d0ebd766..5f28a7ef6 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -781,7 +781,14 @@ class download_shortcodes extends e_shortcode function sc_download_report_link() { $pref = e107::getPref(); - return (check_class($pref['download_reportbroken'])) ? "".LAN_dl_45."" : ""; + if(check_class($pref['download_reportbroken'])) + { + //$url = e_PLUGIN_ABS."download/download.php?action=report&id=".$this->var['download_id']; + $url = e107::url('download','report', $this->var); + return "".LAN_dl_45.""; + } + + return ''; } function sc_download_view_caption() diff --git a/e107_plugins/download/e_url.php b/e107_plugins/download/e_url.php index f03c2252a..3259b44fc 100644 --- a/e107_plugins/download/e_url.php +++ b/e107_plugins/download/e_url.php @@ -114,6 +114,13 @@ class download_url // plugin-folder + '_url' 'redirect' => '{e_PLUGIN}download/request.php?id=$1', // file-path of what to load when the regex returns true. ); + $config['report'] = array( + 'regex' => '^{alias}/report/([\d]*)/(.*)$', + 'sef' => '{alias}/report/{download_id}/{download_sef}', + 'redirect' => '{e_PLUGIN}download/download.php?action=report&id=$1', // file-path of what to load when the regex returns true. + + ); + $config['image'] = array( 'regex' => '^{alias}/image/([\d]*)/(.*)$', 'sef' => '{alias}/image/{download_id}/{download_sef}', diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index 038e1e19c..89825c63f 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -781,12 +781,21 @@ class download $dlrow = $sql->fetch(); - extract($dlrow); + // extract($dlrow); + + $download_name = $tp->toDB($dlrow['download_name']); + $download_id = (int) $dlrow['download_id']; + + $breadcrumb = array(); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e107::url('download','index', $dlrow)); + $breadcrumb[] = array('text' => $dlrow['download_category_name'], 'url' => e107::url('download','category', $dlrow)); // e_SELF."?action=list&id=".$dlrow['download_category_id']); + $breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e107::url('download','item', $dlrow)); //e_SELF."?action=view&id=".$dlrow['download_id']); + $breadcrumb[] = array('text' => LAN_dl_45, 'url' => null); if (isset($_POST['report_download'])) { $report_add = $tp->toDB($_POST['report_add']); - $download_name = $tp->toDB($download_name); + $user = USER ? USERNAME : LAN_GUEST; if ($pref['download_email']) @@ -798,36 +807,38 @@ class download sendemail(SITEADMINEMAIL, $subject, $report); } - $sql->insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'"); + $sql->insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$download_id}, '{$report_add}'"); - define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_47); - + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_45); + + $text = $frm->breadcrumb($breadcrumb); - $text = LAN_dl_48."

    ".LAN_dl_49.""; + $text .= "
    ".LAN_dl_48."
    + ".LAN_dl_49.""; return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $text, 'download-report', true); } else { - define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_51." ".$download_name); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_45." ".$download_name); // require_once(HEADERF); - $breadcrumb = array(); - $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e_SELF); - $breadcrumb[] = array('text' => $dlrow['download_category_name'], 'url' => e_SELF."?action=list&id=".$dlrow['download_category_id']); - $breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e_SELF."?action=view&id=".$dlrow['download_id']); - $breadcrumb[] = array('text' => LAN_dl_50, 'url' => null); + $text = $frm->breadcrumb($breadcrumb); - - $text .= " -
    - ".LAN_DOWNLOAD.": ".$download_name." -
    -
    ".LAN_dl_54."
    ".LAN_dl_55."
    -
    ".$frm->textarea('report_add')."
    -
    + + + $formUrl = e107::url('download', 'report', $dlrow); + $fileUrl = e107::url('download', 'view', $dlrow); + + $text .= " +
    +

    ".LAN_DOWNLOAD.": ".$download_name."

    +

    ".LAN_dl_54."
    ".LAN_dl_55."

    +
    +
    ".$frm->textarea('report_add', '')."
    +
    ".$frm->button('report_download',LAN_dl_45,'submit')."
    "; From ed5fc5e22c5c24f89d1f9a9a53ac978c3c171e37 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 5 May 2017 10:15:32 -0700 Subject: [PATCH 19/19] Gallery: Issue #2205 --- e107_plugins/gallery/e_shortcode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index d52119e24..e5f8a22ef 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -215,11 +215,11 @@ class gallery_shortcodes extends e_shortcode * Amount per row differs according to device, so they are not set here, only the amount. * @example {GALLERY_PORTFOLIO: placeholder=1&category=2} */ - function sc_gallery_portfolio($parms = '') + function sc_gallery_portfolio($parm=null) { $ns = e107::getRender(); $tp = e107::getParser(); - $parm = eHelper::scParams($parms); + // $parm = eHelper::scParams($parms); $cat = (!empty($parm['category'])) ? $parm['category'] : vartrue(e107::getPlugPref('gallery', 'slideshow_category'), false); //TODO Separate pref? $tmpl = e107::getTemplate('gallery', 'gallery');