From 347246d2683ec13343d31987a67dd5d2db8aec60 Mon Sep 17 00:00:00 2001 From: camer0n Date: Tue, 13 Aug 2024 14:47:21 -0700 Subject: [PATCH 01/47] Fixes #5317 - Missing ID in creation log. --- e107_handlers/model_class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 5929d7365..d59b6831a 100755 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -3113,9 +3113,12 @@ class e_admin_model extends e_front_model return false; } + e107::getLog()->addSuccess('TABLE: '.$table, false); + e107::getLog()->addSuccess('ID: '.$res, false); e107::getLog()->save('ADMINUI_01'); - // e107::getAdminLog()->clear()->addSuccess($table,false)->addArray($sqlQry)->save('ADMINUI_01'); + + // e107::getLog()->clear()->addSuccess($table,false)->addArray($sqlQry)->save('ADMINUI_01'); // Set the reutrned ID $this->setId($res); From 2a65f8be5fa07f5fca8ee3daf48cef81eaf7f765 Mon Sep 17 00:00:00 2001 From: camer0n Date: Tue, 13 Aug 2024 14:47:21 -0700 Subject: [PATCH 02/47] Fixes #5317 - Missing ID in creation log. --- e107_handlers/model_class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 5929d7365..d59b6831a 100755 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -3113,9 +3113,12 @@ class e_admin_model extends e_front_model return false; } + e107::getLog()->addSuccess('TABLE: '.$table, false); + e107::getLog()->addSuccess('ID: '.$res, false); e107::getLog()->save('ADMINUI_01'); - // e107::getAdminLog()->clear()->addSuccess($table,false)->addArray($sqlQry)->save('ADMINUI_01'); + + // e107::getLog()->clear()->addSuccess($table,false)->addArray($sqlQry)->save('ADMINUI_01'); // Set the reutrned ID $this->setId($res); From 6fddef4d7ad47a55e00d5ba77486d7c5c3708996 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Mon, 16 Sep 2024 19:58:50 +0100 Subject: [PATCH 03/47] Updated newforumposts_menu to full page render Updated newforumposts_menu to full page render --- e107_plugins/forum/newforumposts_menu.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index 8ee591536..776f9bdbb 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -31,8 +31,14 @@ if(!class_exists('forum_newforumposts_menu')) function __construct() { $this->plugPref = e107::pref('forum'); // general forum preferences. - $this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager. - $this->forumObj = new e107forum; +// $this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager. + $menuPrefs = e107::getMenu()->pref();// ie. popup config details from within menu-manager. + $this->forumObj = new e107forum; + + parse_str($menuPrefs, $this->menuPref); + +// echo "


"; +// var_dump($this->menuPref); // Set some defaults ... if (!isset($this->menuPref['title'])) $this->menuPref['title'] = ""; @@ -43,6 +49,9 @@ if(!class_exists('forum_newforumposts_menu')) if (!isset($this->menuPref['scroll'])) $this->menuPref['scroll'] = ""; if (empty($this->menuPref['layout'])) $this->menuPref['layout'] = 'default'; +// echo "


"; +// var_dump($this->menuPref); + $this->cacheTag .= "_".$this->menuPref['layout']; From 416997604e07b867f5d6388ced2a0fab854d1d22 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sun, 22 Sep 2024 19:59:18 +0100 Subject: [PATCH 04/47] Update view_shortcodes.php --- .../forum/shortcodes/batch/view_shortcodes.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index b1b6fb381..a80660b8b 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -154,18 +154,26 @@ class plugin_forum_view_shortcodes extends e_shortcode function sc_topic_views($parm = null) { - $val = ($this->var['thread_views']) ? $this->var['thread_views'] : '0'; - + + if(!empty($parm['raw'])) + { + return $val; + } + return e107::getParser()->toBadge($val); } function sc_topic_replies($parm = null) { - $val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0'; + if(!empty($parm['raw'])) + { + return $val; + } + return e107::getParser()->toBadge($val); } From bb26d8929f55ea9e4c1a572463945f5672805d67 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 23 Sep 2024 09:10:45 +0200 Subject: [PATCH 05/47] Update lan_newspost.php typo --- e107_languages/English/admin/lan_newspost.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_languages/English/admin/lan_newspost.php b/e107_languages/English/admin/lan_newspost.php index 5b405f24b..dc657f2da 100644 --- a/e107_languages/English/admin/lan_newspost.php +++ b/e107_languages/English/admin/lan_newspost.php @@ -241,5 +241,5 @@ define("LAN_NEWS_112", "Select the URL format. Either record count (eg. page=20, // v2.4 -define("LAN_NEWS_113", "Limt to self-authored news posts only"); -define("LAN_NEWS_114", "Enable this preference to restrict group members from viewing and editing news posts authored by other administrators."); \ No newline at end of file +define("LAN_NEWS_113", "Limit to self-authored news posts only"); +define("LAN_NEWS_114", "Enable this preference to restrict group members from viewing and editing news posts authored by other administrators."); From 5b89ccb4f7c7dd33bebc25ebe9dc5fd4824f2479 Mon Sep 17 00:00:00 2001 From: Jimako Date: Wed, 25 Sep 2024 22:42:39 +0200 Subject: [PATCH 06/47] Update e_pluginbuilder_class.php Fix for correct test of table name - mistypo --- e107_handlers/e_pluginbuilder_class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_handlers/e_pluginbuilder_class.php b/e107_handlers/e_pluginbuilder_class.php index 283e650a9..9cf3cf69c 100644 --- a/e107_handlers/e_pluginbuilder_class.php +++ b/e107_handlers/e_pluginbuilder_class.php @@ -1966,7 +1966,7 @@ class " . $pluginFolder . "_adminArea extends e_admin_dispatcher $vars['mode'] = $tp->filter($vars['mode']); $vars['pluginName'] = $tp->filter($vars['pluginName']); - $vars['table'] = !empty($var['table']) ? $tp->filter($vars['table']) : ''; + $vars['table'] = !empty($vars['table']) ? $tp->filter($vars['table']) : ''; $vars['pid'] = $tp->filter($vars['pid']); $FIELDS = $this->buildAdminUIFields($vars); From dc102f8722c2677fbe12108dcef72783ce1c65d2 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sat, 28 Sep 2024 22:17:34 +0100 Subject: [PATCH 07/47] Minor bug correction and update Minor bug correction and update Still work in progress --- e107_plugins/forum/newforumposts_menu.php | 52 ++++++++++------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index 776f9bdbb..ab38ff52b 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -14,8 +14,6 @@ e107::lan('forum','menu',true); // English_menu.php or {LANGUAGE}_menu.php include_once(e_PLUGIN.'forum/forum_class.php'); - - if(!class_exists('forum_newforumposts_menu')) { class forum_newforumposts_menu // plugin folder + menu name (without the .php) @@ -54,7 +52,6 @@ if(!class_exists('forum_newforumposts_menu')) $this->cacheTag .= "_".$this->menuPref['layout']; - if($text = e107::getCache()->retrieve($this->cacheTag, $this->cacheTime, true)) { e107::getDebug()->log("New Forum Posts Menu Cache Rendered"); @@ -63,6 +60,7 @@ if(!class_exists('forum_newforumposts_menu')) return null; } +/* $sql = e107::getDb(); $this->total['topics'] = $sql->count("forum_thread"); @@ -73,14 +71,11 @@ if(!class_exists('forum_newforumposts_menu')) $tmp = $sql->fetch(); $this->total['views'] = intval($tmp["sum"]); } - +*/ $this->render(); } - - - private function getQuery() { $max_age = vartrue($this->menuPref['maxage'], 0); @@ -95,7 +90,6 @@ if(!class_exists('forum_newforumposts_menu')) return false; } - $this->menuPref['layout'] = vartrue($this->menuPref['layout'], 'default'); switch($this->menuPref['layout']) { @@ -141,11 +135,9 @@ if(!class_exists('forum_newforumposts_menu')) ORDER BY t.thread_lastpost DESC LIMIT 0, ".vartrue($this->menuPref['display'],10); } - return $qry; } - private function render() { $tp = e107::getParser(); @@ -173,9 +165,6 @@ if(!class_exists('forum_newforumposts_menu')) $template = e107::getTemplate('forum','newforumposts_menu',$layout); - - - $param = array(); foreach($this->menuPref as $k=>$v) @@ -183,7 +172,6 @@ if(!class_exists('forum_newforumposts_menu')) $param['nfp_'.$k] = $v; } - if($qry) { if($results = $sql->gen($qry)) @@ -195,22 +183,34 @@ if(!class_exists('forum_newforumposts_menu')) $sc = e107::getScBatch('view', 'forum')->setScVar('param',$param); - $list = $tp->parseTemplate($template['start'], true); +// $list = $tp->parseTemplate($template['start'], true); + $text = $tp->parseTemplate($template['start'], true); while($row = $sql->fetch()) { +// var_dump ($row); +// echo "
"; + $row['thread_sef'] = $this->forumObj->getThreadSef($row); $sc->setScVar('postInfo', $row); $sc->setVars($row); - $list .= $tp->parseTemplate($template['item'], true, $sc); +// $list .= $tp->parseTemplate($template['item'], true, $sc); + $text .= $tp->parseTemplate($template['item'], true, $sc); + + ++$total_topics; + $total_views += $row['thread_views']; + $total_replies += $row['thread_total_replies']; + } - $TOTALS = array('TOTAL_TOPICS'=>$this->total['topics'], 'TOTAL_VIEWS'=>$this->total['views'], 'TOTAL_REPLIES'=>$this->total['replies']); +// $TOTALS = array('TOTAL_TOPICS'=>$this->total['topics'], 'TOTAL_VIEWS'=>$this->total['views'], 'TOTAL_REPLIES'=>$this->total['replies']); + $TOTALS = array('TOTAL_TOPICS'=>$total_topics, 'TOTAL_VIEWS'=>$total_views, 'TOTAL_REPLIES'=>$total_replies); - $list .= $tp->parseTemplate($template['end'], true, $TOTALS); - - $text = $list; +// $list .= $tp->parseTemplate($template['end'], true, $TOTALS); + $text .= $tp->parseTemplate($template['end'], true, $TOTALS); +// +// $text = $list; } else { @@ -221,7 +221,7 @@ if(!class_exists('forum_newforumposts_menu')) { $text = LAN_FORUM_MENU_016; } - +//var_dump ($text); $caption = $this->getCaption(); if(!empty($this->menuPref['scroll'])) @@ -230,7 +230,6 @@ if(!class_exists('forum_newforumposts_menu')) } // e107::debug('menuPref', $this->menuPref); - e107::getCache()->set($this->cacheTag, $text, true); $ns->tablerender($caption, $text, 'nfp_menu'); @@ -261,7 +260,6 @@ if(!class_exists('forum_newforumposts_menu')) //$caption = !empty($this->menuPref['caption'][e_LANGUAGE]) ? $this->menuPref['caption'][e_LANGUAGE] : $this->menuPref['caption']; } - if (empty($caption)) { $caption = LAN_PLUGIN_FORUM_LATESTPOSTS; @@ -270,14 +268,8 @@ if(!class_exists('forum_newforumposts_menu')) return $caption; } - } - } - -new forum_newforumposts_menu; - - - +new forum_newforumposts_menu; \ No newline at end of file From 8d2e28c5e76d541778a2daef93f3094743e14714 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Sun, 6 Oct 2024 16:42:59 +0100 Subject: [PATCH 08/47] Update forum_shortcodes.php Bug correction. e_BASE gives the path to the full plugin folder from where it's used. Switching to e_HTTP, since online.php is on the root... --- e107_plugins/forum/shortcodes/batch/forum_shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php index e27fd4ca9..831bd4f49 100644 --- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -185,7 +185,7 @@ class forum_shortcodes extends e_shortcode } // String candidate for USERLIST wrapper - $text .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; + $text .= "
".LAN_FORUM_0037." ".LAN_FORUM_0038; } return $text; } From fcac366705bcaa20ec63cf165a0019dcb7b66be6 Mon Sep 17 00:00:00 2001 From: Jimako Date: Thu, 10 Oct 2024 16:03:41 +0200 Subject: [PATCH 09/47] plugin builder - admin links --- e107_handlers/e_pluginbuilder_class.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/e107_handlers/e_pluginbuilder_class.php b/e107_handlers/e_pluginbuilder_class.php index 283e650a9..5bb929506 100644 --- a/e107_handlers/e_pluginbuilder_class.php +++ b/e107_handlers/e_pluginbuilder_class.php @@ -669,7 +669,7 @@ $content .= '}'; 'keywords' => array('one','two','three'), 'category' => array('category'), 'copyright' => array('copyright'), - // 'adminLinks' => array('url','description','icon','iconSmall','primary'), + 'adminLinks' => array('url', 'description', 'icon', 'iconSmall', 'icon128'), // 'sitelinks' => array('url','description','icon','iconSmall') ); @@ -729,21 +729,27 @@ $content .= '}'; $existingXml = e_PLUGIN.$this->pluginName."/plugin.xml"; if(file_exists($existingXml)) { - $p = e107::getXml()->loadXMLfile($existingXml,true); + $p = e107::getXml()->loadXMLfile($existingXml, 'advanced'); - // print_a($p); + // print_a($p); $defaults = array( "main-name" => varset($p['@attributes']['name']), "main-lang" => varset($p['@attributes']['lan']), "author-name" => varset($p['author']['@attributes']['name']), "author-url" => varset($p['author']['@attributes']['url']), - "description-description" => varset($p['description']), - "summary-summary" => varset($p['summary'], $p['description']), + "description-description" => varset($p['description']['@value']), + "summary-summary" => varset($p['summary'], $p['summary']['@value']), "category-category" => varset($p['category']), "copyright-copyright" => varset($p['copyright']), "keywords-one" => varset($p['keywords']['word'][0]), "keywords-two" => varset($p['keywords']['word'][1]), "keywords-three" => varset($p['keywords']['word'][2]), + "adminLinks-url" => varset($p['adminLinks']['link'][0]['@attributes']['url']), + "adminLinks-description" => varset($p['adminLinks']['link'][0]['@attributes']['description']), + "adminLinks-icon" => varset($p['adminLinks']['link'][0]['@attributes']['icon']), + "adminLinks-iconSmall" => varset($p['adminLinks']['link'][0]['@attributes']['iconSmall']), + "adminLinks-icon128" => varset($p['adminLinks']['link'][0]['@attributes']['icon128']), + ); unset($p); @@ -1023,7 +1029,7 @@ $template = <<