From 6f1a066b30b550e25356c39f32ef17b197514ec6 Mon Sep 17 00:00:00 2001 From: instantflorian Date: Sat, 23 May 2020 16:34:56 +0200 Subject: [PATCH] Update bundled modules --- wbce/modules/addon_monitor/functions.php | 122 ++++---- wbce/modules/addon_monitor/info.php | 2 +- .../modules/droplets/example/ModifiedWhen.php | 4 +- wbce/modules/droplets/example/NextPage.php | 6 +- wbce/modules/droplets/example/Oneliner.php | 6 +- wbce/modules/droplets/example/ParentPage.php | 6 +- .../modules/droplets/example/PreviousPage.php | 6 +- .../modules/droplets/example/SiteModified.php | 4 +- wbce/modules/droplets/functions.inc.php | 6 +- wbce/modules/droplets/info.php | 7 +- wbce/modules/droplets/templates/list.twig | 6 +- wbce/modules/droplets/tool.php | 4 +- wbce/modules/jsadmin/info.php | 6 +- wbce/modules/jsadmin/tool.php | 20 +- wbce/modules/menu_link/functions.pageTree.php | 154 +++++----- wbce/modules/menu_link/info.php | 7 +- wbce/modules/menu_link/modify.php | 74 ++--- wbce/modules/menu_link/view.php | 28 +- wbce/modules/miniform/ajax_load_more.php | 38 +-- wbce/modules/miniform/frontend.css | 267 ++++++++++++++++++ wbce/modules/miniform/functions.php | 98 +++---- wbce/modules/miniform/info.php | 8 +- wbce/modules/miniform/install.php | 2 +- .../miniform/templates/confirm-email.htt | 48 ++++ wbce/modules/miniform/templates/email.htt | 47 +++ .../miniform/templates/email_field_value.htt | 2 + .../templates/form_DE_callme (HTML5).htt | 24 ++ .../miniform/templates/form_DE_callme.htt | 24 ++ .../templates/form_DE_contactform (HTML5).htt | 68 +++++ .../templates/form_DE_contactform.htt | 78 +++++ .../form_DE_full_contactform (HTML5).htt | 132 +++++++++ .../templates/form_DE_full_contactform.htt | 131 +++++++++ ..._DE_job_application_with_resume_upload.htt | 119 ++++++++ .../form_DE_mini_contactform (HTML5).htt | 31 ++ .../templates/form_DE_mini_contactform.htt | 29 ++ .../templates/form_EN_callme (HTML5).htt | 24 ++ .../miniform/templates/form_EN_callme.htt | 24 ++ .../templates/form_EN_contactform (HTML5).htt | 78 +++++ .../templates/form_EN_contactform.htt | 78 +++++ .../form_EN_full_contactform (HTML5).htt | 132 +++++++++ .../templates/form_EN_full_contactform.htt | 131 +++++++++ ..._EN_job_application_with_resume_upload.htt | 119 ++++++++ .../form_EN_mini_contactform (HTML5).htt | 31 ++ .../templates/form_EN_mini_contactform.htt | 29 ++ .../form_NL_bel_me_terug (HTML5).htt | 24 ++ .../templates/form_NL_bel_me_terug.htt | 24 ++ .../form_NL_contactformulier (HTML5).htt | 86 ++++++ .../templates/form_NL_contactformulier.htt | 86 ++++++ .../form_NL_mini_contactformulier (HTML5).htt | 37 +++ ...NL_uitgebreid_contactformulier (HTML5).htt | 140 +++++++++ .../form_NL_uitgebreid_contactformulier.htt | 140 +++++++++ .../form_nl_mini_contactformulier.htt | 37 +++ wbce/modules/miniform/uninstall.php | 2 +- wbce/modules/miniform/upgrade.php | 2 +- wbce/modules/outputfilter_dashboard/CHANGELOG | 3 + .../outputfilter_dashboard/backend_body.js | 2 +- wbce/modules/outputfilter_dashboard/info.php | 2 +- wbce/modules/pagecloner/info.php | 6 +- wbce/modules/pagecloner/tool_doclone.php | 80 +++--- .../show_menu2/classes/sm2_formatter.php | 88 +++--- wbce/modules/show_menu2/include.php | 2 +- wbce/modules/show_menu2/info.php | 5 +- .../account/Accounts.cfg.php | 20 ++ .../account/form_forgot.php | 46 +-- .../account/form_preferences.php | 4 +- .../email_templates/EN/testmail.txt.php | 2 +- wbce/modules/tool_account_settings/info.php | 8 +- .../tool_account_settings/languages/EN.php | 6 +- .../tool_account_settings/languages/PL.php | 4 +- .../templates/form_preferences.twig | 2 +- wbce/modules/wbSeoTool/functions.php | 82 +++--- wbce/modules/wbSeoTool/info.php | 12 +- wbce/modules/wysiwyg/add.php | 37 +-- wbce/modules/wysiwyg/delete.php | 30 +- wbce/modules/wysiwyg/index.php | 22 +- wbce/modules/wysiwyg/info.php | 5 +- wbce/modules/wysiwyg/install.php | 69 +---- wbce/modules/wysiwyg/languages/index.php | 4 +- wbce/modules/wysiwyg/modify.php | 109 ++++--- wbce/modules/wysiwyg/save.php | 72 +++-- wbce/modules/wysiwyg/search.php | 109 ++++--- wbce/modules/wysiwyg/uninstall.php | 2 + wbce/modules/wysiwyg/upgrade.php | 57 ++-- wbce/modules/wysiwyg/view.php | 39 +-- 84 files changed, 2946 insertions(+), 821 deletions(-) create mode 100644 wbce/modules/miniform/frontend.css create mode 100644 wbce/modules/miniform/templates/confirm-email.htt create mode 100644 wbce/modules/miniform/templates/email.htt create mode 100644 wbce/modules/miniform/templates/email_field_value.htt create mode 100644 wbce/modules/miniform/templates/form_DE_callme (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_DE_callme.htt create mode 100644 wbce/modules/miniform/templates/form_DE_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_DE_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_DE_full_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_DE_full_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_DE_job_application_with_resume_upload.htt create mode 100644 wbce/modules/miniform/templates/form_DE_mini_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_DE_mini_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_EN_callme (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_EN_callme.htt create mode 100644 wbce/modules/miniform/templates/form_EN_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_EN_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_EN_full_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_EN_full_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_EN_job_application_with_resume_upload.htt create mode 100644 wbce/modules/miniform/templates/form_EN_mini_contactform (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_EN_mini_contactform.htt create mode 100644 wbce/modules/miniform/templates/form_NL_bel_me_terug (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_NL_bel_me_terug.htt create mode 100644 wbce/modules/miniform/templates/form_NL_contactformulier (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_NL_contactformulier.htt create mode 100644 wbce/modules/miniform/templates/form_NL_mini_contactformulier (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier (HTML5).htt create mode 100644 wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier.htt create mode 100644 wbce/modules/miniform/templates/form_nl_mini_contactformulier.htt create mode 100644 wbce/modules/tool_account_settings/account/Accounts.cfg.php create mode 100644 wbce/modules/wysiwyg/uninstall.php diff --git a/wbce/modules/addon_monitor/functions.php b/wbce/modules/addon_monitor/functions.php index c7152e9da..43890dc3c 100644 --- a/wbce/modules/addon_monitor/functions.php +++ b/wbce/modules/addon_monitor/functions.php @@ -3,8 +3,8 @@ * WebsiteBaker CMS AdminTool: addonMonitor * * This file provides some functions for the addonMonitor Tool. - * - * + * + * * @platform CMS WebsiteBaker 2.8.x * @package addonMonitor * @author Christian M. Stefan (Stefek) @@ -13,11 +13,11 @@ */ // prevent this file from being accessed directly: -if(!defined('WB_PATH')) die("Cannot access this file directly"); +if(!defined('WB_PATH')) die("Cannot access this file directly"); if(!function_exists('getModulesArray')){ function getModulesArray(){ - global $database; + global $database; $aAddons['addons'] = array(); $aAddons['count_tools'] = 0; $aAddons['count_snippets'] = 0; @@ -25,56 +25,56 @@ function getModulesArray(){ $aAddons['count_wysiwygeditors'] = 0; $aAddons['default_wysiwyg'] = $database->get_one("SELECT `value` FROM `". TABLE_PREFIX ."settings` WHERE `name` = 'wysiwyg_editor'"); $sQueryAddons = ( - "SELECT DISTINCT a . * , + "SELECT DISTINCT a . * , IF( s.module IS NOT NULL , 'Y', 'N' ) AS active - FROM ".TABLE_PREFIX."addons a - LEFT JOIN ".TABLE_PREFIX."sections s - ON a.directory = s.module + FROM ".TABLE_PREFIX."addons a + LEFT JOIN ".TABLE_PREFIX."sections s + ON a.directory = s.module WHERE `function` LIKE '%page%' OR `function` LIKE '%snippet%' OR `function` LIKE '%tool%' OR `function` LIKE '%wysiwyg%'" ); - if($oAddons = $database->query($sQueryAddons)){ + if($oAddons = $database->query($sQueryAddons)){ $sLanguageFileLocation = WB_PATH."/modules/%s/languages/".LANGUAGE.".php"; $mod_name = ''; $module_name = ''; // Loop through addons - while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){ + while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){ // grab for page_id's and section_id's if Addon is a PAGE TYPE MODULE - if($aRec['function'] == 'page'){ + if($aRec['function'] == 'page'){ ++$aAddons['count_pagemodules']; if($aRec['active'] == 'Y'){ $sQueryActiveSections = ("SELECT `section_id`, `page_id` FROM `".TABLE_PREFIX."sections` WHERE `module` = '".$aRec['directory']."'"); if($oActiveSections = $database->query($sQueryActiveSections)){ - while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){ + while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){ $aRec['active_sections'][$aSections['section_id']] = $aSections['page_id']; - } - } + } + } } } - if($aRec['function'] == 'tool'){ + if($aRec['function'] == 'tool'){ $aAddons['count_tools']++; $sIconFile = WB_PATH."/modules/".$aRec['directory']."/tool_icon.png"; - if(is_readable($sIconFile)){ - $aRec['icon'] = "../../modules/".$aRec['directory']."/tool_icon.png"; - }else{ - $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/tool.png"; + if(is_readable($sIconFile)){ + $aRec['icon'] = "../../modules/".$aRec['directory']."/tool_icon.png"; + }else{ + $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/tool.png"; } - } - if($aRec['function'] == 'snippet'){ + } + if($aRec['function'] == 'snippet'){ ++$aAddons['count_snippets']; } if($aRec['function'] == 'wysiwyg'){ - ++$aAddons['count_wysiwygeditors']; + ++$aAddons['count_wysiwygeditors']; } - if($aRec['function'] == 'snippet' || $aRec['function'] == 'page'){ + if($aRec['function'] == 'snippet' || $aRec['function'] == 'page'){ $sIconFile = "/modules/".$aRec['directory']."/addon_icon.png"; - if(is_readable(WB_PATH.$sIconFile)){ - $aRec['icon'] = "../..".$sIconFile; + if(is_readable(WB_PATH.$sIconFile)){ + $aRec['icon'] = "../..".$sIconFile; }else{ $sType = ($aRec['function'] == 'snippet') ? 'snippet' : 'page_module'; - $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType.".png"; + $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType.".png"; } - } + } // replace description if description in the current LANGUAGE exists $sLanguageFile = sprintf($sLanguageFileLocation, $aRec['directory']); if(is_readable($sLanguageFile)){ @@ -85,7 +85,7 @@ function getModulesArray(){ } } $aAddons['addons'][] = $aRec; - } + } } return $aAddons; } @@ -99,43 +99,43 @@ function getTemplatesArray(){ $aAddons['count_pagetemplates'] = 0; $aAddons['count_acpthemes'] = 0; $sQueryAddons = ( - "SELECT DISTINCT a . * , - IF( p.template IS NOT NULL , 'Y', 'N' ) AS active - FROM ".TABLE_PREFIX."addons a - LEFT JOIN ".TABLE_PREFIX."pages p - ON a.directory = p.template + "SELECT DISTINCT a . * , + IF( p.template IS NOT NULL , 'Y', 'N' ) AS active + FROM ".TABLE_PREFIX."addons a + LEFT JOIN ".TABLE_PREFIX."pages p + ON a.directory = p.template WHERE `function` = 'theme' OR `function` = 'template' ORDER BY `function`, `name`" ); if($oAddons = $database->query($sQueryAddons)){ // Loop through addons - while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){ + while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){ // grab for page_id's Addon is used on different pages - if($aRec['function'] == 'template'){ - ++$aAddons['count_pagetemplates']; + if($aRec['function'] == 'template'){ + ++$aAddons['count_pagetemplates']; // grab for page_id's if Addon is used on different pages if($aRec['active'] == 'Y'){ $sQueryActiveSections = ("SELECT `page_id` FROM `".TABLE_PREFIX."pages` WHERE `template` = '".$aRec['directory']."'"); if($oActiveSections = $database->query($sQueryActiveSections)){ - while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){ + while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){ $aRec['active_pages'][] = $aSections['page_id']; - } - } - } + } + } + } }else{ ++$aAddons['count_acpthemes']; } // icon $sIconFile = "/templates/".$aRec['directory']."/preview.jpg"; - if(is_readable(WB_PATH.$sIconFile)){ - $aRec['icon'] = "../..".$sIconFile; + if(is_readable(WB_PATH.$sIconFile)){ + $aRec['icon'] = "../..".$sIconFile; }else{ $sType = ($aRec['function'] == 'theme') ? 'acp_theme' : 'page_template'; - $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType."_preview.jpg"; - } + $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/".$sType."_preview.jpg"; + } $aAddons['addons'][] = $aRec; - } + } } return $aAddons; } @@ -145,37 +145,37 @@ function getLanguagesArray(){ global $database; $aAddons['addons'] = array(); $sQueryAddons = ( - "SELECT DISTINCT a . * , - IF( p.language IS NOT NULL , 'Y', 'N' ) AS active - FROM ".TABLE_PREFIX."addons a - LEFT JOIN ".TABLE_PREFIX."pages p - ON a.directory = p.language + "SELECT DISTINCT a . * , + IF( p.language IS NOT NULL , 'Y', 'N' ) AS active + FROM ".TABLE_PREFIX."addons a + LEFT JOIN ".TABLE_PREFIX."pages p + ON a.directory = p.language WHERE type = 'language'" ); if($oAddons = $database->query($sQueryAddons)){ // Loop through addons - while($aRec = $oAddons->fetchRow(MYSQL_ASSOC)){ + while($aRec = $oAddons->fetchRow(MYSQLI_ASSOC)){ // grab for page_id's if Addon is used on different pages if($aRec['active'] == 'Y'){ $sQueryActiveSections = ("SELECT `page_id` FROM `".TABLE_PREFIX."pages` WHERE `language` = '".$aRec['directory']."'"); if($oActiveSections = $database->query($sQueryActiveSections)){ - while($aSections = $oActiveSections->fetchRow(MYSQL_ASSOC)){ + while($aSections = $oActiveSections->fetchRow(MYSQLI_ASSOC)){ $aRec['active_pages'][] = $aSections['page_id']; - } - } - } + } + } + } // icon $sIconFile = "/languages/".strtolower($aRec['directory']).".png"; - if(is_readable(WB_PATH.$sIconFile)){ - $aRec['icon'] = "../..".$sIconFile; + if(is_readable(WB_PATH.$sIconFile)){ + $aRec['icon'] = "../..".$sIconFile; }else{ $sType = ($aRec['function'] == 'theme') ? 'acp_theme' : 'frontend_template'; - $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/unknown.png"; - } + $aRec['icon'] = "../../modules/".basename(dirname(__FILE__))."/icons/unknown.png"; + } $aAddons['addons'][] = $aRec; - } + } } return $aAddons; } -} \ No newline at end of file +} diff --git a/wbce/modules/addon_monitor/info.php b/wbce/modules/addon_monitor/info.php index e42eca706..650836e72 100644 --- a/wbce/modules/addon_monitor/info.php +++ b/wbce/modules/addon_monitor/info.php @@ -2,7 +2,7 @@ $module_directory = 'addon_monitor'; $module_name = 'Addon Monitor'; $module_function = 'tool'; -$module_version = '0.6.6'; +$module_version = '0.6.7'; $module_status = 'stable'; $module_platform = '1.0.0'; $module_author = 'Christian M. Stefan (Stefek)'; diff --git a/wbce/modules/droplets/example/ModifiedWhen.php b/wbce/modules/droplets/example/ModifiedWhen.php index 9fe05b7b2..42a02dac8 100644 --- a/wbce/modules/droplets/example/ModifiedWhen.php +++ b/wbce/modules/droplets/example/ModifiedWhen.php @@ -1,3 +1,3 @@ -//:Displays the last modification time of the current page -//:Use [[ModifiedWhen]] +//:Displays the last modification time of the current page +//:Use [[ModifiedWhen]] global $database, $wb; if (PAGE_ID>0) { $query=$database->query("SELECT modified_when FROM ".TABLE_PREFIX."pages where page_id=".PAGE_ID); $mod_details=$query->fetchRow(); return "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0])."."; } \ No newline at end of file diff --git a/wbce/modules/droplets/example/NextPage.php b/wbce/modules/droplets/example/NextPage.php index 1cfc36772..113dba774 100644 --- a/wbce/modules/droplets/example/NextPage.php +++ b/wbce/modules/droplets/example/NextPage.php @@ -1,3 +1,3 @@ -//:Create a next link to your page -//:Display a link to the next page on the same menu level -$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show next $nxt = $nSib < $nSibCount ? $nSib + 1 : 0; if ($nxt > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$nxt){>> [a][menu_title]}]", '', '', ''); } else return '(no next)'; \ No newline at end of file +//:Create a next link to your page +//:Display a link to the next page on the same menu level +$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show next $nxt = $nSib < $nSibCount ? $nSib + 1 : 0; if ($nxt > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$nxt){>> [a][menu_title]}]", '', '', ''); } else return '(no next)'; diff --git a/wbce/modules/droplets/example/Oneliner.php b/wbce/modules/droplets/example/Oneliner.php index 7c680f9e8..0f553ffd6 100644 --- a/wbce/modules/droplets/example/Oneliner.php +++ b/wbce/modules/droplets/example/Oneliner.php @@ -1,3 +1,3 @@ -//:Create a random oneliner on your page -//:Use: [[OneLiner]]. The file with the oneliner data is located in /modules/droplets/example/oneliners.txt -$line = file (dirname(__FILE__)."/example/oneliners.txt"); shuffle($line); return $line[0]; \ No newline at end of file +//:Create a random oneliner on your page +//:Use: [[OneLiner]]. The file with the oneliner data is located in /modules/droplets/example/oneliners.txt +$line = file (dirname(__FILE__)."/example/oneliners.txt"); shuffle($line); return $line[0]; diff --git a/wbce/modules/droplets/example/ParentPage.php b/wbce/modules/droplets/example/ParentPage.php index f6a402604..8d94803c6 100644 --- a/wbce/modules/droplets/example/ParentPage.php +++ b/wbce/modules/droplets/example/ParentPage.php @@ -1,3 +1,3 @@ -//:Create a parent link to your page -//:Display a link to the parent page of the current page -$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show up level if ($nLevel > 0) { $lev = $nLevel - 1; return show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]}]", '', '', ''); } else return '(no parent)'; \ No newline at end of file +//:Create a parent link to your page +//:Display a link to the parent page of the current page +$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show up level if ($nLevel > 0) { $lev = $nLevel - 1; return show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]}]", '', '', ''); } else return '(no parent)'; diff --git a/wbce/modules/droplets/example/PreviousPage.php b/wbce/modules/droplets/example/PreviousPage.php index c494a5811..59cf908cd 100644 --- a/wbce/modules/droplets/example/PreviousPage.php +++ b/wbce/modules/droplets/example/PreviousPage.php @@ -1,3 +1,3 @@ -//:Create a previous link to your page -//:Display a link to the previous page on the same menu level -$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show previous $prv = $nSib > 1 ? $nSib - 1 : 0; if ($prv > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$prv){[a][menu_title] <<}]", '', '', ''); } else return '(no previous)'; \ No newline at end of file +//:Create a previous link to your page +//:Display a link to the previous page on the same menu level +$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, '[if(class==menu-current){[level] [sib] [sibCount] [parent]}]', '', '', ''); list($nLevel, $nSib, $nSibCount, $nParent) = explode(' ', $info); // show previous $prv = $nSib > 1 ? $nSib - 1 : 0; if ($prv > 0) { return show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, "[if(sib==$prv){[a][menu_title] <<}]", '', '', ''); } else return '(no previous)'; diff --git a/wbce/modules/droplets/example/SiteModified.php b/wbce/modules/droplets/example/SiteModified.php index 0db3482a5..370f3cfd3 100644 --- a/wbce/modules/droplets/example/SiteModified.php +++ b/wbce/modules/droplets/example/SiteModified.php @@ -1,3 +1,3 @@ -//:Create information on when your site was last updated. -//:Create information on when your site was last updated. Any page update counts. +//:Create information on when your site was last updated. +//:Create information on when your site was last updated. Any page update counts. global $database, $wb; if (PAGE_ID>0) { $query=$database->query("SELECT max(modified_when) FROM ".TABLE_PREFIX."pages"); $mod_details=$query->fetchRow(); return "This site was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0])."."; } \ No newline at end of file diff --git a/wbce/modules/droplets/functions.inc.php b/wbce/modules/droplets/functions.inc.php index 637aa4070..1a83e755a 100644 --- a/wbce/modules/droplets/functions.inc.php +++ b/wbce/modules/droplets/functions.inc.php @@ -56,7 +56,7 @@ function wbce_copy_droplet($droplet_id) TABLE_PREFIX, $droplet_id )); - $fetch_content = $query_content->fetchRow(MYSQL_ASSOC); + $fetch_content = $query_content->fetchRow(MYSQLI_ASSOC); $code = addslashes(str_replace($tags, '', $fetch_content['code'])); $new_name = $fetch_content['name'] . "_copy"; $name = $new_name; @@ -94,7 +94,7 @@ function wbce_copy_droplet($droplet_id) echo ''; echo ''; + echo ''; exit; } else { @@ -438,7 +438,7 @@ function wbce_list_droplets() if($query_droplets->numRows() > 0) { $list = array(); - while ($droplet = $query_droplets->fetchRow(MYSQL_ASSOC)) + while ($droplet = $query_droplets->fetchRow(MYSQLI_ASSOC)) { if(is_array($droplet) && isset($droplet['name'])) { diff --git a/wbce/modules/droplets/info.php b/wbce/modules/droplets/info.php index 36e7280f1..c13d888ee 100644 --- a/wbce/modules/droplets/info.php +++ b/wbce/modules/droplets/info.php @@ -13,7 +13,7 @@ $module_directory = 'droplets'; $module_name = 'Droplets'; $module_function = 'tool'; -$module_version = '2.2.7'; +$module_version = '2.2.8'; $module_platform = '1.4.0'; $module_author = 'Ruud, pcwacht, WebBird, cwsoft, Norhei, Colinax'; $module_license = 'GNU General Public License'; @@ -26,9 +26,12 @@ /** * Version history * + * v2.2.8 + * - MYSQL_ASSOC -> MYSQLI_ASSOC + * * v2.2.7 * - Add module_level core status - * - Update module_platform + * - Update module_platform * * v2.2.6 * - SectionPicker Droplet uses Insert class diff --git a/wbce/modules/droplets/templates/list.twig b/wbce/modules/droplets/templates/list.twig index d385de711..ff058a6e9 100644 --- a/wbce/modules/droplets/templates/list.twig +++ b/wbce/modules/droplets/templates/list.twig @@ -2,7 +2,7 @@
{% if backup_mgmt %} -' + {% endif %} diff --git a/wbce/modules/droplets/tool.php b/wbce/modules/droplets/tool.php index 53b0ee402..68cef274d 100644 --- a/wbce/modules/droplets/tool.php +++ b/wbce/modules/droplets/tool.php @@ -102,7 +102,7 @@ if(is_array($list) AND count($list)) { $twig_data['info'] = wbce_export_droplets($list); } - } + } break; // ----- import ----- case 'upload': @@ -134,7 +134,7 @@ "SELECT * FROM `%smod_droplets` WHERE `id` = '%d'", TABLE_PREFIX, $droplet_id )); - $fetch_content = $query_content->fetchRow(MYSQL_ASSOC); + $fetch_content = $query_content->fetchRow(MYSQLI_ASSOC); $twig_data['content'] = wbce_twig_display( array('data'=>$fetch_content), diff --git a/wbce/modules/jsadmin/info.php b/wbce/modules/jsadmin/info.php index 90bb7e286..122d7beb5 100644 --- a/wbce/modules/jsadmin/info.php +++ b/wbce/modules/jsadmin/info.php @@ -13,7 +13,7 @@ $module_directory = 'jsadmin'; $module_name = 'Javascript Admin'; $module_function = 'tool'; -$module_version = '1.4.3'; +$module_version = '1.4.4'; $module_platform = '1.4.0'; $module_author = 'Stepan Riha, Swen Uth'; $module_license = 'BSD License'; @@ -24,9 +24,11 @@ /** * Version history * + * 1.4.4 - fixes for MySQL-Strict (Bernd) + * * 1.4.3 * - Add module_level core status - * - Update module_platform + * - Update module_platform * * 1.4.2 * - Add Admintool Icon diff --git a/wbce/modules/jsadmin/tool.php b/wbce/modules/jsadmin/tool.php index 44c05f789..75f1aca74 100644 --- a/wbce/modules/jsadmin/tool.php +++ b/wbce/modules/jsadmin/tool.php @@ -27,11 +27,11 @@ // Include functions file require_once(WB_PATH.'/framework/functions.php'); - save_setting('mod_jsadmin_persist_order', isset($_POST['persist_order'])); - save_setting('mod_jsadmin_ajax_order_pages', isset($_POST['ajax_order_pages'])); - save_setting('mod_jsadmin_ajax_order_sections', isset($_POST['ajax_order_sections'])); + save_setting('mod_jsadmin_persist_order', (isset($_POST['persist_order'])) ? 1 : 0); + save_setting('mod_jsadmin_ajax_order_pages', (isset($_POST['ajax_order_pages'])) ? 1 : 0); + save_setting('mod_jsadmin_ajax_order_sections', (isset($_POST['ajax_order_sections'])) ? 1 : 0); // check if there is a database error, otherwise say successful - + if($database->is_error()) { $admin->print_error($database->get_error(), $js_back); } else { @@ -39,7 +39,7 @@ } } else { - + // Display form $persist_order = get_setting('mod_jsadmin_persist_order', true) ? 'checked="checked"' : ''; @@ -62,8 +62,8 @@ - /> - + /> +   @@ -72,6 +72,6 @@ - - + - * @copyright GPL v2 or any later + * @copyright GPL v2 or any later */ /** * nestedPagesArray - * + * * @global object $database * @global object $admin * @param int $iParent - * @return boolean|array + * @return boolean|array */ -function nestedPagesArray($iParent = 0) { - global $database, $admin; +function nestedPagesArray($iParent = 0) { + global $database, $admin; $iParent = intval($iParent); $sWhereClause = (PAGE_TRASH != 'inline') ? " WHERE `visibility` <> 'deleted'" : ''; $sPageCode = isPageCodeUsed() ? "p.`page_code`, " : ''; - $sUseTrash = ''; - // prepare SQL Query, build the query string first + $sUseTrash = ''; + // prepare SQL Query, build the query string first $sQuery = 'SELECT s.`module`, MAX(s.`publ_start` + s.`publ_end`) published, p.`link`, ' . '(SELECT MAX(`position`) FROM `{TP}pages` WHERE `parent` = p.`parent`) siblings, ' . 'p.`position`, p.`page_id`, p.`parent`, p.`level`, p.`language`, p.`admin_groups`, ' . 'p.`admin_users`, p.`viewing_groups`, p.`viewing_users`, p.`visibility`, ' - . 'p.`menu_title`, p.`page_title`, p.`page_trail`, p.`description`, p.`keywords`, ' . $sPageCode + . 'p.`menu_title`, p.`page_title`, p.`page_trail`, p.`description`, p.`keywords`, ' . $sPageCode // create json type of string of all the sections . 'GROUP_CONCAT(CAST(CONCAT(\' "\', s.`section_id`, \'" : "\', s.`module`, \'" \') AS CHAR) ' . 'ORDER BY s.`position` SEPARATOR \', \') `sections` ' - + . 'FROM `{TP}pages` p ' . 'INNER JOIN `{TP}sections` s ' . 'ON p.`page_id`=s.`page_id` ' . $sWhereClause.' ' . 'GROUP BY p.`page_id` ' - . 'ORDER BY p.`position` ASC'; - - $oPages = $database->query($sQuery); - $aPages = array(); + . 'ORDER BY p.`position` ASC'; + + $oPages = $database->query($sQuery); + $aPages = array(); if(!$oPages) return $aPages; // no pages in DB yet; return empty array $refs = array(); $aQueryKeys = array( 'page_id','siblings','position','parent','menu_title','page_title','level','page_trail', 'admin_groups','admin_users','position','module','sections', 'visibility', 'language' - ); + ); if(isPageCodeUsed()){ - $aQueryKeys[] = 'page_code'; + $aQueryKeys[] = 'page_code'; } - while($p = $oPages->fetchRow(MYSQL_ASSOC)) { + while($p = $oPages->fetchRow(MYSQLI_ASSOC)) { $thisref = &$refs[ $p['page_id'] ]; - foreach ($aQueryKeys as $key){ + foreach ($aQueryKeys as $key){ $thisref[$key] = $p[$key]; - } + } $thisref['root_parent'] = isset($p['root_parent']) ? $p['root_parent'] : 0; $thisref['pageIDKEY'] = $admin->getIDKEY($p['page_id']); $thisref['frontend_link'] = PAGES_DIRECTORY. $p['link'] .PAGE_EXTENSION; @@ -64,48 +64,48 @@ function nestedPagesArray($iParent = 0) { $in_group = false; foreach($admin->get_groups_id() as $cur_gid) { if (in_array($cur_gid, $aAdminGroups)) $in_group = true; - } + } // check modify permissions $thisref['can_modify'] = false; - if(($in_group) || is_numeric(array_search($admin->get_user_id(), $admin_users))){ + if(($in_group) || is_numeric(array_search($admin->get_user_id(), $admin_users))){ if($p['visibility'] == 'deleted'){ - $thisref['can_modify'] = (PAGE_TRASH == 'inline'); - } elseif ($p['visibility'] != 'deleted') { - $thisref['can_modify'] = true; - } - } else { - if ($p['visibility'] == 'private') { - continue; - } else { - $thisref['can_modify'] = false; + $thisref['can_modify'] = (PAGE_TRASH == 'inline'); + } elseif ($p['visibility'] != 'deleted') { + $thisref['can_modify'] = true; + } + } else { + if ($p['visibility'] == 'private') { + continue; + } else { + $thisref['can_modify'] = false; } } $thisref['canManageSections'] = ((MANAGE_SECTIONS == 'enabled' || MANAGE_SECTIONS == 1) && $admin->get_permission('pages_modify') == true && $thisref['can_modify'] == true); $thisref['pageIsMovable'] = ($admin->get_permission('pages_settings') == true && $thisref['can_modify'] == true); - $thisref['pageIsMovable'] = ($thisref['pageIsMovable'] && $thisref['siblings'] != 1); + $thisref['pageIsMovable'] = ($thisref['pageIsMovable'] && $thisref['siblings'] != 1); $thisref['canDeleteAndModify'] = ($admin->get_permission('pages_delete') == true && $thisref['can_modify'] == true); $thisref['canAddChild'] = ($admin->get_permission('pages_add')) == (true && $thisref['can_modify'] == true) && ($thisref['visibility'] != 'deleted'); $thisref['canModifyPage'] = ($admin->get_permission('pages_modify') == true && $thisref['can_modify'] == true); - $thisref['canModifySettings'] = ($admin->get_permission('pages_settings') == true && $thisref['can_modify'] == true); + $thisref['canModifySettings'] = ($admin->get_permission('pages_settings') == true && $thisref['can_modify'] == true); $thisref['canMoveUP'] = (isset($thisref['pageIsMovable']) && $thisref['position'] != 1); - $thisref['canMoveDOWN'] = (isset($thisref['pageIsMovable']) && $thisref['position'] != $thisref['siblings']); - + $thisref['canMoveDOWN'] = (isset($thisref['pageIsMovable']) && $thisref['position'] != $thisref['siblings']); + /** - * sectionCase: we can have several conditions for the section ICON + * sectionCase: we can have several conditions for the section ICON * (clock, noclock, clock_red and menu_link) */ $thisref['sectionCase'] = "noclock"; if($p['published'] != 0){ $thisref['sectionCase'] = ($admin->page_is_active($thisref)) ? "clock" : "clock_red"; - } + } if($p['module'] == 'menu_link') { $thisref['sectionCase'] = "menu_link"; // menu_link doesn't display sections (it's a special case) $thisref['menu_link'] = true; - } - + } + // reiterate the tree - if ($p['parent'] == $iParent) { - $aPages[ $p['page_id'] ] = &$thisref; + if ($p['parent'] == $iParent) { + $aPages[ $p['page_id'] ] = &$thisref; } else { $refs[ $p['parent'] ]['children'][ $p['page_id'] ] = &$thisref; } @@ -114,7 +114,7 @@ function nestedPagesArray($iParent = 0) { return $aPages; } -/** +/** * @global object $admin * @global object $database * @global type?? $field_set @@ -127,73 +127,73 @@ function parentPageList($nestedPagesArray, $iCurrentPageId = 0, $bAllLevels = fa global $admin, $database, $field_set; $iParentId = $database->get_one("SELECT `parent` FROM `{TP}pages` WHERE `page_id` = ".$iCurrentPageId); $sPageTrash = $database->get_one("SELECT `value` FROM `{TP}settings` WHERE `name` = 'page_trash'"); - + $aPages = array(); - foreach($nestedPagesArray as $p) { - // skip some pages where the user shouldn't have access - + foreach($nestedPagesArray as $p) { + // skip some pages where the user shouldn't have access + if ($iCurrentPageId != 0 && $p['parent'] == $iCurrentPageId) continue; if ($p['visibility'] == 'deleted' && $sPageTrash != 'inline') continue; #if ($p['visibility'] == 'none') continue; - + // get childs smaller than PAGE_LEVEL_LIMIT only! - if($p['level'] + 1 < PAGE_LEVEL_LIMIT || $bAllLevels == true) { - + if($p['level'] + 1 < PAGE_LEVEL_LIMIT || $bAllLevels == true) { + // space_trail - if(defined('DB_CHARSET') && DB_CHARSET == 'utf8'){ + if(defined('DB_CHARSET') && DB_CHARSET == 'utf8'){ $sSpacer = str_repeat(($p['level'] == 1 ? " " : "  "), (($p['level']))).(($p['level'] > 0) ? ($p['canMoveDOWN'] ? ' ├─ ' : ' └─ ') : "" - ); + ); $sSpacer = str_repeat("".(($p['canMoveDOWN'] || $p['canMoveUP']) && $p['level'] != 0 ? ' · ' : ' '), (($p['level']))).(($p['level'] > 0) ? ($p['canMoveDOWN'] ? ' ├─ ' : ' └─ ') : " " // the characters should actually look like in the above line, however it didn't work well // wenn saved from NetBeans IDE. // Also the variants chr(195).chr(238).' ' : ' '.chr(192).chr(238) // and sprintf(" %c%c ", 195, 238) sprintf(" %c%c ", 192, 238) didn't work well - ); + ); } else { // fallback if charset is not UTF-8 $sSpacer = str_repeat(" ", (($p['level'])*2*2)).(($p['level'] > 0) ? ($p['canMoveDOWN'] ? ' |-- ' : " '-- ") : "" - ); - } - + ); + } + $aPages[$p['page_id']] = $p; - $aPages[$p['page_id']]['space_trail'] = $sSpacer; - $aPages[$p['page_id']]['icon'] = ($p['parent'] == 0 && $field_set )? $p['language'] : 'none'; + $aPages[$p['page_id']]['space_trail'] = $sSpacer; + $aPages[$p['page_id']]['icon'] = ($p['parent'] == 0 && $field_set )? $p['language'] : 'none'; $aPages[$p['page_id']]['selected'] = ($p['page_id'] == $iParentId) ? ' selected="selected" ' : ''; $aPages[$p['page_id']]['disabled'] = ($p['page_id'] == $iCurrentPageId || $p['can_modify'] == false) - ? ' disabled="disabled" ' : ''; + ? ' disabled="disabled" ' : ''; if(isset($p['children'])){ $aPages = array_merge($aPages, parentPageList($p['children'], $iCurrentPageId, $bAllLevels)); } unset($p); - } - } + } + } return($aPages); } -/** +/** * @param array $nestedPagesArray * @return array */ -function pageTreeCombobox($nestedPagesArray, $iCurrentPageID) { +function pageTreeCombobox($nestedPagesArray, $iCurrentPageID) { $aPages = array(); - foreach($nestedPagesArray as $p) { + foreach($nestedPagesArray as $p) { $aPages[] = array( - 'page_id' => $p['page_id'], - 'menu_title' => drawSpacer($p).$p['menu_title'], - 'page_title' => $p['page_title'], + 'page_id' => $p['page_id'], + 'menu_title' => drawSpacer($p).$p['menu_title'], + 'page_title' => $p['page_title'], 'level' => $p['level'], 'visibility' => $p['visibility'], - ); - if(isset($p['children'])){ + ); + if(isset($p['children'])){ $aPages = array_merge($aPages, pageTreeCombobox($p['children'], $iCurrentPageID)); - } + } unset($p); - } + } return($aPages); } @@ -202,18 +202,18 @@ function drawSpacer($aPage){ $iLevel = $aPage['level']; $aPage['canMoveDOWN'] = isset($aPage['canMoveDOWN']) ? $aPage['canMoveDOWN'] : false; // space_trail - if(defined('DB_CHARSET') && DB_CHARSET == 'utf8'){ - + if(defined('DB_CHARSET') && DB_CHARSET == 'utf8'){ + $sSpacer = str_repeat(($iLevel == 1 ? " " : "  "), (($iLevel))).(($iLevel > 0) ? ($aPage['canMoveDOWN'] ? ' ├─ ' : ' └─ ') : "" - ); + ); } else { - + // fallback if charset is not UTF-8 $sSpacer = str_repeat(" ", (($iLevel)*2*2)).(($iLevel > 0) ? ($aPage['canMoveDOWN'] ? ' |-- ' : " '-- ") : "" - ); + ); } return $sSpacer; } @@ -224,7 +224,7 @@ function drawSpacer($aPage){ * @return int|bool (false if not menu_link) */ function isPageMenuLink($iPageID){ - $sSql = "SELECT COUNT(*) FROM `{TP}sections` + $sSql = "SELECT COUNT(*) FROM `{TP}sections` WHERE `page_id` = ".$iPageID." AND `module` = 'menu_link'"; return $GLOBALS['database']->get_one($sSql); } @@ -232,7 +232,7 @@ function isPageMenuLink($iPageID){ /** * check whether or not we have the mod_multilingal installed * ========================================================== - * + * * @return bool */ function isPageCodeUsed(){ @@ -246,7 +246,7 @@ function isPageCodeUsed(){ /** * check whether or not we have the mod_multilingal installed * ========================================================== - * + * * @return bool */ function isWysiwygHistoryUsed(){ @@ -255,4 +255,4 @@ function isWysiwygHistoryUsed(){ $bUseHistory = $GLOBALS['database']->field_exists('{TP}pages', 'page_code'); } return $bUseHistory; -} \ No newline at end of file +} diff --git a/wbce/modules/menu_link/info.php b/wbce/modules/menu_link/info.php index 3133462dd..4a55446fd 100644 --- a/wbce/modules/menu_link/info.php +++ b/wbce/modules/menu_link/info.php @@ -13,7 +13,7 @@ $module_directory = 'menu_link'; $module_name = 'Menu Link'; $module_function = 'page'; -$module_version = '2.9.5'; +$module_version = '2.9.6'; $module_platform = '1.4.0'; $module_author = 'Ryan Djurovich, thorn, Christian M. Stefan'; $module_license = 'GNU General Public License'; @@ -24,9 +24,12 @@ /** * Version history * + * 2.9.6 + * - MYSQL_ASSOC -> MYSQLI_ASSOC + * * 2.9.5 * - Add module_level core status - * - Update module_platform + * - Update module_platform * * 2.9.4 * - Add module_name translation diff --git a/wbce/modules/menu_link/modify.php b/wbce/modules/menu_link/modify.php index 73b723fb7..11e6d6132 100644 --- a/wbce/modules/menu_link/modify.php +++ b/wbce/modules/menu_link/modify.php @@ -26,14 +26,14 @@ // get target page_id $sql_result = $database->query("SELECT * FROM `{TP}mod_menu_link` WHERE `section_id` = ".$section_id); -$aData = $sql_result->fetchRow(MYSQL_ASSOC); +$aData = $sql_result->fetchRow(MYSQLI_ASSOC); // Get list of all visible pages and build a page-tree // get list of all page_ids and page_titles global $aMenulinkTitles; $aMenulinkTitles = array(); if ($query_page = $database->query("SELECT `page_id`, `menu_title` FROM `{TP}pages`")) { - while($page = $query_page->fetchRow(MYSQL_ASSOC)) + while($page = $query_page->fetchRow(MYSQLI_ASSOC)) $aMenulinkTitles[$page['page_id']] = $page['menu_title']; } @@ -43,7 +43,7 @@ #debug_dump($aLinks); foreach($aLinks as $p) { if ($query_section = $database->query("SELECT `section_id`, `namesection` FROM `{TP}sections` WHERE `page_id` = ".$p['page_id']." ORDER BY `position`")) { - while($section = $query_section->fetchRow(MYSQL_ASSOC)) { + while($section = $query_section->fetchRow(MYSQLI_ASSOC)) { // get section-anchor if (defined('SEC_ANCHOR') && SEC_ANCHOR != '') { if (isset($section['namesection'])) { @@ -53,7 +53,7 @@ $aTargets[$p['page_id']][] = '[#'.SEC_ANCHOR.$section['section_id'].'] '; } else { $aTargets[$p['page_id']] = array(); - } + } } } } @@ -74,19 +74,19 @@ - -   @@ -102,12 +102,12 @@ '; @@ -44,15 +44,15 @@ function getSelectTemplate($current = null) { $list .= ''; return $list; } - - + + function getTemplates($pattern = '') { if(!$pattern) $pattern = dirname(__FILE__).DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'form_*.htt'; foreach(glob($pattern) as $filename) { $name = substr( basename($filename,".htt") , 5); $title = ucwords (str_replace(array("_","-")," ", $name)); $this->templates[$title] = substr( basename($filename,".htt") , 5); - + } return $this->templates; } @@ -73,7 +73,7 @@ function get_template($name) { $tmp = str_replace($var,$value,$tmp); return $tmp; } - + function get_upload_limit() { $max_upload = (int)(ini_get('upload_max_filesize')); $max_post = (int)(ini_get('post_max_size')); @@ -81,7 +81,7 @@ function get_upload_limit() { $upload_mb = min($max_upload, $max_post, $memory_limit); return $upload_mb; } - + function get_upload_whitelist($template) { if(preg_match('/{WHITELIST (.*)}/i',$template,$name)) { $this->upload_whitelist = strtolower($name[1]); @@ -96,14 +96,14 @@ function check_whitelist($filename) { function add_template($template, $var, $value) { $tmp = str_ireplace($var,$value,$template); return $tmp; - } - + } + function page($pid = 0) { global $database, $wb; $link = $database->get_one("SELECT link FROM ".TABLE_PREFIX."pages WHERE `page_id` = '".$pid."'"); return $wb->page_link($link); } - + function safe_get_post($postfield) { global $MF; $this->isArray = false; @@ -140,13 +140,13 @@ function safe_get_post($postfield) { $val = preg_replace("/(\n)/","",$val); return $val?$val:''; } - + function stripslashes_deep($value) { $value = is_array($value) ? array_map(array($this,'stripslashes_deep'), $value) : stripslashes($value); return $value; } - function captcha($section_id = 0) { + function captcha($section_id = 0) { require_once(WB_PATH.'/include/captcha/captcha.php'); ob_start(); call_captcha("all","",$section_id); @@ -154,7 +154,7 @@ function captcha($section_id = 0) { ob_end_clean(); return $captcha; } - + function reCaptcha($siteKey = null) { $rval = ''; if($siteKey) { @@ -163,7 +163,7 @@ function reCaptcha($siteKey = null) { } return $rval; } - + function reCaptcha_check($secretKey = null) { if($secretKey) { if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) { @@ -176,7 +176,7 @@ function reCaptcha_check($secretKey = null) { } return false; } - + // Insert or Update table with posted fields in array function update_record ( $table, $id_field, $data ) { global $database; @@ -213,7 +213,7 @@ function get_record ( $table, $id_field, $id) { $result = array(); $res = $database->query("SELECT * FROM ".TABLE_PREFIX.$table." WHERE `$id_field` = '$id'"); if($res) { - while ($row = $res->fetchRow(MYSQL_ASSOC)) { + while ($row = $res->fetchRow(MYSQLI_ASSOC)) { $result[] = $row; } } @@ -232,27 +232,27 @@ function get_history ( $id, $max = 20) { $result = array(); $res = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_miniform_data WHERE `section_id` = '$id' order by message_id desc limit 0,$max "); if($res) { - while ($row = $res->fetchRow(MYSQL_ASSOC)) { + while ($row = $res->fetchRow(MYSQLI_ASSOC)) { $result[] = $row; } } return $result; } - + function count_messages($section_id) { global $database; $res = $database->query("SELECT message_id FROM ".TABLE_PREFIX."mod_miniform_data WHERE `section_id` = '$section_id'"); return ($res) ? $res->numRows() : 0; } - + function build_pagelist($parent, $this_page) { global $database, $links; $iterated_parents = array(); // keep count of already iterated parents to prevent duplicates $table_pages = TABLE_PREFIX."pages"; - if ( $query = $database->query("SELECT link, menu_title, page_title, page_id, level - FROM ".$table_pages." - WHERE parent = ".$parent." + if ( $query = $database->query("SELECT link, menu_title, page_title, page_id, level + FROM ".$table_pages." + WHERE parent = ".$parent." ORDER BY level, position ASC")) { while($res = $query->fetchRow()) { $links[$res['page_id']] = $res['page_id'].'|'.str_repeat(" - ",$res['level']).$res['menu_title'].' ('.$res['page_title'].')'; @@ -263,9 +263,9 @@ function build_pagelist($parent, $this_page) { } } } - - - + + + //HTML Email funtionality function mail_old_version ($to = NULL, $from = NULL, $subject = NULL, $html_message = NULL, $plain_message = NULL) { if (!$to || !$from || !$subject || !$html_message) return false; @@ -289,14 +289,14 @@ function mail_old_version ($to = NULL, $from = NULL, $subject = NULL, $html_mess $mailbody .= '--PHP-mixed-'.$random_hash.'--'.$lf; return @mail( $to, $subject, $mailbody, $headers ); } - - + + function mail($fromaddress, $toaddress, $subject, $message, $fromname='', $replyto = '') { if (!class_exists('wbmailer')){ require_once(WB_PATH."/framework/class.wbmailer.php"); } $toArray = explode(',',$toaddress); - + $myMail = new wbmailer(); // set user defined from address if ($fromaddress!='') { @@ -307,35 +307,35 @@ function mail($fromaddress, $toaddress, $subject, $message, $fromname='', $reply $myMail->AddReplyTo($replyto); // REPLY TO: } // define recepient and information to send out - + foreach ($toArray as $toAddr) { // TO: $myMail->AddAddress($toAddr); } $myMail->Subject = $subject; // SUBJECT $myMail->Body = $message; // CONTENT (HTML) - $textbody = strip_tags($message); - $textbody = str_replace("\t","",$textbody); - while (strpos($textbody,"\n\n\n") !== false) - $textbody = str_replace("\n\n\n","\n\n",$textbody); - while (strpos($textbody,"\r\n\r\n\r\n") !== false) - $textbody = str_replace("\r\n\r\n\r\n","\r\n\r\n",$textbody); + $textbody = strip_tags($message); + $textbody = str_replace("\t","",$textbody); + while (strpos($textbody,"\n\n\n") !== false) + $textbody = str_replace("\n\n\n","\n\n",$textbody); + while (strpos($textbody,"\r\n\r\n\r\n") !== false) + $textbody = str_replace("\r\n\r\n\r\n","\r\n\r\n",$textbody); $myMail->AltBody = $textbody; // CONTENT (TEXT) - + foreach($this->attachements as $filename => $file) { $myMail->AddAttachment($file, $filename); } - + /* $myMail->SMTPAutoTLS = false; // tell phpmailer not to autouse TLS is not configured */ - + $myMail->SMTPOptions = array( // allow self_signed ssl. 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) - ); + ); // check if there are any send mail errors, otherwise say successful if (!$myMail->Send()) { $this->error = $myMail->ErrorInfo; @@ -344,10 +344,10 @@ function mail($fromaddress, $toaddress, $subject, $message, $fromname='', $reply return true; } } - - + + function remote_data($url = ''){ - + if (!function_exists('curl_init')){ die('Sorry cURL is not installed!'); } @@ -370,13 +370,13 @@ function load_history($section_id, $user_id = 0, $guid = '') { $res = $database->get_one($query); if($res) $_SESSION['form'] = $this->unserialize($res); return; - + } - + function serialize ($sObject) { return serialize($sObject); } - + function unserialize($sObject) { $__ret = preg_replace_callback( '/s:([0-9]+):\"(.*?)\";/', function ($matches) { return "s:".strlen($matches[2]).':"'.$matches[2].'";'; }, @@ -391,7 +391,7 @@ function guid() { } return sprintf('%04X%04X%04X%04X%04X%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)); } - + function escapeString($string) { global $database; if(is_object($database->DbHandle)) { @@ -400,14 +400,14 @@ function escapeString($string) { $rval = mysql_real_escape_string($string); } return $rval; - } - + } + } //end class function isAjaxRequest () { if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest") return true; return false; - + } function sendOutput($data) { if(isAjaxRequest()) { diff --git a/wbce/modules/miniform/info.php b/wbce/modules/miniform/info.php index ed98812c6..ef8e69143 100644 --- a/wbce/modules/miniform/info.php +++ b/wbce/modules/miniform/info.php @@ -11,9 +11,9 @@ * @version 0.21.0 * @lastmodified July 22, 2019 * - * + * v0.22 - MYSQL_ASSOC -> MYSQLI_ASSOC (Bernd) * v0.21 - Move 'modify template' to separate page. (Stefanek) - * v0.20 - Handles a bug with save file reported by user colinax. (Stefanek) + * v0.20 - Handles a bug with save file reported by user colinax. (Stefanek) * v0.19 - Implement AdminTool functionality (WBCE CMS only). (Stefanek) * v0.18 - Small correction in Ajax delete function. (Stefanek) * Added support for Bootstrap alerts. (Stefanek) @@ -32,7 +32,7 @@ $module_directory = 'miniform'; $module_name = 'MiniForm'; $module_function = 'page'; -$module_version = '0.21.0'; +$module_version = '0.22.0'; $module_platform = '2.8.x'; $module_author = 'Ruud / Dev4me'; $module_license = 'GNU General Public License'; @@ -43,4 +43,4 @@ $module_function = 'page, tool'; $tool_name = 'MiniForm Overview'; $tool_description = 'View Settings and Entries of all MiniForm Sections.'; -} \ No newline at end of file +} diff --git a/wbce/modules/miniform/install.php b/wbce/modules/miniform/install.php index 4e10b31fc..1361efe0b 100644 --- a/wbce/modules/miniform/install.php +++ b/wbce/modules/miniform/install.php @@ -8,7 +8,7 @@ * @license http://www.gnu.org/licenses/gpl.html * @platform WebsiteBaker 2.8.x * @requirements PHP 5.6 and higher - * @version 0.15.0 + * @version 0.15.0 * @lastmodified April 30, 2019 * */ diff --git a/wbce/modules/miniform/templates/confirm-email.htt b/wbce/modules/miniform/templates/confirm-email.htt new file mode 100644 index 000000000..ebbcf049e --- /dev/null +++ b/wbce/modules/miniform/templates/confirm-email.htt @@ -0,0 +1,48 @@ + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ {WEBSITE_TITLE} +
+ {HEADER}
+ {SUBJECT} +
+ + + + +
+ + {MAILMESSAGE} +
+
+
+ {WEBSITE_TITLE} +
+
+
+
+
+ diff --git a/wbce/modules/miniform/templates/email.htt b/wbce/modules/miniform/templates/email.htt new file mode 100644 index 000000000..e454c83da --- /dev/null +++ b/wbce/modules/miniform/templates/email.htt @@ -0,0 +1,47 @@ + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ {WEBSITE_TITLE} +
+ {HEADER} +
+ + + + +
+ + {MAILMESSAGE} +
+
+
+ {WEBSITE_TITLE} +
+
+
+
+
+ diff --git a/wbce/modules/miniform/templates/email_field_value.htt b/wbce/modules/miniform/templates/email_field_value.htt new file mode 100644 index 000000000..15edacbe5 --- /dev/null +++ b/wbce/modules/miniform/templates/email_field_value.htt @@ -0,0 +1,2 @@ + {FIELD}:{VALUE} + \ No newline at end of file diff --git a/wbce/modules/miniform/templates/form_DE_callme (HTML5).htt b/wbce/modules/miniform/templates/form_DE_callme (HTML5).htt new file mode 100644 index 000000000..fcaf61eec --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_callme (HTML5).htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_DE_callme.htt b/wbce/modules/miniform/templates/form_DE_callme.htt new file mode 100644 index 000000000..f95ccffce --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_callme.htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_DE_contactform (HTML5).htt new file mode 100644 index 000000000..1cbcce525 --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_contactform (HTML5).htt @@ -0,0 +1,68 @@ +
+
{STATUSMESSAGE}
+
+

Kontaktformular

+ Felder mit * müssen ausgefüllt werden +
+ + + + {ASPFIELDS} +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_contactform.htt b/wbce/modules/miniform/templates/form_DE_contactform.htt new file mode 100644 index 000000000..b2d2278c0 --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_contactform.htt @@ -0,0 +1,78 @@ +
+
{STATUSMESSAGE}
+
+

Kontaktformular

+ Felder mit * müssen ausgefüllt werden +
+ + + + {ASPFIELDS} + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_full_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_DE_full_contactform (HTML5).htt new file mode 100644 index 000000000..bdb333d90 --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_full_contactform (HTML5).htt @@ -0,0 +1,132 @@ +
+
{STATUSMESSAGE}
+
+

Kontaktformular

+ Felder mit * müssen ausgefüllt werden +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_full_contactform.htt b/wbce/modules/miniform/templates/form_DE_full_contactform.htt new file mode 100644 index 000000000..165ed99dc --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_full_contactform.htt @@ -0,0 +1,131 @@ +
+
{STATUSMESSAGE}
+
+

Kontaktformular

+ Felder mit * müssen ausgefüllt werden +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_job_application_with_resume_upload.htt b/wbce/modules/miniform/templates/form_DE_job_application_with_resume_upload.htt new file mode 100644 index 000000000..17416d81c --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_job_application_with_resume_upload.htt @@ -0,0 +1,119 @@ + +
+
{STATUSMESSAGE}
+
+

Bewerbungsformular

+ Bitte mit * gekennzeichnete Felder ausfüllen +
+ + + + {ASPFIELDS} + +
+

Posten

+
+ +
+
+
+

Persönliche Angaben

+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+

Lebenslauf hochladen

{WHITELIST doc,docx,odt,pdf,rtf,txt} + (Erlaubte Dateitypen: {UPLOAD_WHITELIST} - Max. Dateigröße: {UPLOAD_LIMIT} MB)
+ +
+ + +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
diff --git a/wbce/modules/miniform/templates/form_DE_mini_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_DE_mini_contactform (HTML5).htt new file mode 100644 index 000000000..8f2e5a665 --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_mini_contactform (HTML5).htt @@ -0,0 +1,31 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_DE_mini_contactform.htt b/wbce/modules/miniform/templates/form_DE_mini_contactform.htt new file mode 100644 index 000000000..c81689e2f --- /dev/null +++ b/wbce/modules/miniform/templates/form_DE_mini_contactform.htt @@ -0,0 +1,29 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_EN_callme (HTML5).htt b/wbce/modules/miniform/templates/form_EN_callme (HTML5).htt new file mode 100644 index 000000000..4dfb3f6a0 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_callme (HTML5).htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_EN_callme.htt b/wbce/modules/miniform/templates/form_EN_callme.htt new file mode 100644 index 000000000..ea8856cf6 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_callme.htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_EN_contactform (HTML5).htt new file mode 100644 index 000000000..4397cc825 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_contactform (HTML5).htt @@ -0,0 +1,78 @@ +
+
{STATUSMESSAGE}
+
+

Contactform

+ Items marked with * are required +
+ + + + {ASPFIELDS} + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_contactform.htt b/wbce/modules/miniform/templates/form_EN_contactform.htt new file mode 100644 index 000000000..880c12d0b --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_contactform.htt @@ -0,0 +1,78 @@ +
+
{STATUSMESSAGE}
+
+

Contactform

+ Items marked with * are required +
+ + + + {ASPFIELDS} + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_full_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_EN_full_contactform (HTML5).htt new file mode 100644 index 000000000..fef238789 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_full_contactform (HTML5).htt @@ -0,0 +1,132 @@ +
+
{STATUSMESSAGE}
+
+

Please fill our contactform

+ Items marked with * are required +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_full_contactform.htt b/wbce/modules/miniform/templates/form_EN_full_contactform.htt new file mode 100644 index 000000000..be5503fd2 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_full_contactform.htt @@ -0,0 +1,131 @@ +
+
{STATUSMESSAGE}
+
+

Please fill our contactform

+ Items marked with * are required +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_job_application_with_resume_upload.htt b/wbce/modules/miniform/templates/form_EN_job_application_with_resume_upload.htt new file mode 100644 index 000000000..400a2a8cb --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_job_application_with_resume_upload.htt @@ -0,0 +1,119 @@ + +
+
{STATUSMESSAGE}
+
+

Demo company - Job Application Form

+ Items marked with * are required +
+ + + + {ASPFIELDS} + +
+

Position

+
+ +
+
+
+

Personal information

+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+

Resume upload

{WHITELIST doc,docx,odt,pdf,rtf,txt} + (allowed file types: {UPLOAD_WHITELIST} - max filesize: {UPLOAD_LIMIT}Mb)
+ +
+ + +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
diff --git a/wbce/modules/miniform/templates/form_EN_mini_contactform (HTML5).htt b/wbce/modules/miniform/templates/form_EN_mini_contactform (HTML5).htt new file mode 100644 index 000000000..2d3d02ca2 --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_mini_contactform (HTML5).htt @@ -0,0 +1,31 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_EN_mini_contactform.htt b/wbce/modules/miniform/templates/form_EN_mini_contactform.htt new file mode 100644 index 000000000..f9be4cd9e --- /dev/null +++ b/wbce/modules/miniform/templates/form_EN_mini_contactform.htt @@ -0,0 +1,29 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_NL_bel_me_terug (HTML5).htt b/wbce/modules/miniform/templates/form_NL_bel_me_terug (HTML5).htt new file mode 100644 index 000000000..bb2aeb81c --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_bel_me_terug (HTML5).htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_NL_bel_me_terug.htt b/wbce/modules/miniform/templates/form_NL_bel_me_terug.htt new file mode 100644 index 000000000..42d31cf77 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_bel_me_terug.htt @@ -0,0 +1,24 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_NL_contactformulier (HTML5).htt b/wbce/modules/miniform/templates/form_NL_contactformulier (HTML5).htt new file mode 100644 index 000000000..032981cf3 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_contactformulier (HTML5).htt @@ -0,0 +1,86 @@ +
+
{STATUSMESSAGE}
+
+
diff --git a/wbce/modules/miniform/templates/form_NL_contactformulier.htt b/wbce/modules/miniform/templates/form_NL_contactformulier.htt new file mode 100644 index 000000000..b2353b524 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_contactformulier.htt @@ -0,0 +1,86 @@ +
+
{STATUSMESSAGE}
+
+

Contactformulier

+ Velden met een * zijn verplicht +
+ + + + {ASPFIELDS} + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_NL_mini_contactformulier (HTML5).htt b/wbce/modules/miniform/templates/form_NL_mini_contactformulier (HTML5).htt new file mode 100644 index 000000000..e2d592433 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_mini_contactformulier (HTML5).htt @@ -0,0 +1,37 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier (HTML5).htt b/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier (HTML5).htt new file mode 100644 index 000000000..cd01de634 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier (HTML5).htt @@ -0,0 +1,140 @@ +
+
{STATUSMESSAGE}
+
+

Contactformulier

+ Velden met een * zijn verplicht +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier.htt b/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier.htt new file mode 100644 index 000000000..06277db21 --- /dev/null +++ b/wbce/modules/miniform/templates/form_NL_uitgebreid_contactformulier.htt @@ -0,0 +1,140 @@ +
+
{STATUSMESSAGE}
+
+

Contactformulier

+ Velden met een * zijn verplicht +
+ + + + {ASPFIELDS} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+
diff --git a/wbce/modules/miniform/templates/form_nl_mini_contactformulier.htt b/wbce/modules/miniform/templates/form_nl_mini_contactformulier.htt new file mode 100644 index 000000000..3b4d835ba --- /dev/null +++ b/wbce/modules/miniform/templates/form_nl_mini_contactformulier.htt @@ -0,0 +1,37 @@ +
+
{STATUSMESSAGE}
+
+
+ + + + +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
diff --git a/wbce/modules/miniform/uninstall.php b/wbce/modules/miniform/uninstall.php index 5777e3b5d..3f29af349 100644 --- a/wbce/modules/miniform/uninstall.php +++ b/wbce/modules/miniform/uninstall.php @@ -8,7 +8,7 @@ * @license http://www.gnu.org/licenses/gpl.html * @platform WebsiteBaker 2.8.x * @requirements PHP 5.6 and higher - * @version 0.15.0 + * @version 0.15.0 * @lastmodified April 30, 2019 * */ diff --git a/wbce/modules/miniform/upgrade.php b/wbce/modules/miniform/upgrade.php index 186e0e257..de25fa71b 100644 --- a/wbce/modules/miniform/upgrade.php +++ b/wbce/modules/miniform/upgrade.php @@ -8,7 +8,7 @@ * @license http://www.gnu.org/licenses/gpl.html * @platform WebsiteBaker 2.8.x * @requirements PHP 5.6 and higher - * @version 0.15.0 + * @version 0.15.0 * @lastmodified April 30, 2019 * */ diff --git a/wbce/modules/outputfilter_dashboard/CHANGELOG b/wbce/modules/outputfilter_dashboard/CHANGELOG index aafb9310c..62aaed8e2 100644 --- a/wbce/modules/outputfilter_dashboard/CHANGELOG +++ b/wbce/modules/outputfilter_dashboard/CHANGELOG @@ -2,6 +2,9 @@ Header: Version-History 1.5: +1.5.12 %(bernd, 16 May 2020)% + - fixed hardcodet admin-dir in backend_body.js + 1.5.11 %(mrbaseman, 9 Jan 2020)% - remove gpc functions which have been deprecated since php 5.4 - replace curly braces for array index diff --git a/wbce/modules/outputfilter_dashboard/backend_body.js b/wbce/modules/outputfilter_dashboard/backend_body.js index 2457d2656..ed1aff449 100644 --- a/wbce/modules/outputfilter_dashboard/backend_body.js +++ b/wbce/modules/outputfilter_dashboard/backend_body.js @@ -54,7 +54,7 @@ $(document).ready(function() // --| drag&drop -var MODULE_URL = WB_URL + '/admin/admintools/tool.php?tool=outputfilter_dashboard'; +var MODULE_URL = ADMIN_URL + '/admintools/tool.php?tool=outputfilter_dashboard'; var ICONS = WB_URL + '/modules/outputfilter_dashboard/images'; var AJAX_PLUGINS = WB_URL + '/modules/outputfilter_dashboard/ajax'; diff --git a/wbce/modules/outputfilter_dashboard/info.php b/wbce/modules/outputfilter_dashboard/info.php index 7459d7e7b..2ec31a8ba 100755 --- a/wbce/modules/outputfilter_dashboard/info.php +++ b/wbce/modules/outputfilter_dashboard/info.php @@ -41,7 +41,7 @@ $module_directory = 'outputfilter_dashboard'; $module_name = 'Output Filter Dashboard'; $module_function = 'tool'; -$module_version = '1.5.11'; +$module_version = '1.5.12'; $module_platform = 'WebsiteBaker 2.8.x or WBCE'; $module_author = 'Thomas "thorn" Hornik , Christian M. Stefan (Stefek) , Martin Hecht (mrbaseman) '; $module_license = 'GNU General Public License, Version 3'; diff --git a/wbce/modules/pagecloner/info.php b/wbce/modules/pagecloner/info.php index 8a800667e..0d6928eea 100644 --- a/wbce/modules/pagecloner/info.php +++ b/wbce/modules/pagecloner/info.php @@ -13,7 +13,7 @@ $module_directory = 'pagecloner'; $module_name = 'Page Cloner'; $module_function = 'tool'; -$module_version = '1.0.5'; +$module_version = '1.0.6'; $module_platform = '1.0.0'; $module_author = 'John Maats, PCWacht, Dietrich Roland Pehlke, Stephan Kuehn, vBoedefeld, WebBird, Colinax'; $module_license = 'GNU General Public License'; @@ -24,6 +24,8 @@ /** * Version history + * v1.0.6 - fixes for MySQL-Strict (Bernd) + * * v1.0.5 * - Copies section names too (thanks to kleo) * @@ -45,7 +47,7 @@ * - copy pics for minigallery (thx to florian: http://forum.wbce.org/viewtopic.php?pid=2137#p2137) * * v1.0.0 (03.11.2015) - * - try to copy modules in a generic way + * - try to copy modules in a generic way * * v0.60 (WebBird; 06.07.2015) * - fixed problem with mysql_real_escape_string() (deprecated) diff --git a/wbce/modules/pagecloner/tool_doclone.php b/wbce/modules/pagecloner/tool_doclone.php index 3e03429ae..a3c40aad2 100644 --- a/wbce/modules/pagecloner/tool_doclone.php +++ b/wbce/modules/pagecloner/tool_doclone.php @@ -40,8 +40,8 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { global $page_id, $section_id; // Get page list from database $query = "SELECT * FROM `".TABLE_PREFIX."pages` WHERE `page_id` = ".$pagetoclone; - $get_page = $database->query($query); - $is_page = $get_page->fetchRow( MYSQL_ASSOC ); + $get_page = $database->query($query); + $is_page = $get_page->fetchRow( MYSQLI_ASSOC ); // Work-out what the link and page filename should be if($parent == '0') { @@ -58,7 +58,7 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { $filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($title).'.php'; make_dir(WB_PATH.PAGES_DIRECTORY.'/'.$parent_section); } - + // Check if a page with same page filename exists $get_same_page = $database->query("SELECT `page_id` FROM `".TABLE_PREFIX."pages` WHERE `link` = '$link'"); if($get_same_page->numRows() > 0 OR file_exists(WB_PATH.PAGES_DIRECTORY.$link.'.php') OR file_exists(WB_PATH.PAGES_DIRECTORY.$link.'/')) { @@ -78,15 +78,15 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { $order->clean($parent); // Get new order $position = $order->get_new($parent); - + // Insert page into pages table $template = $is_page['template']; $visibility = $visibility; $admin_groups = $is_page['admin_groups']; $viewing_groups = $is_page['viewing_groups']; $query = "INSERT INTO `".TABLE_PREFIX."pages` " - . "(`page_title`,`menu_title`,`parent`,`template`,`target`,`position`,`visibility`,`searching`,`menu`,`language`,`admin_groups`,`viewing_groups`,`modified_when`,`modified_by`) VALUES ('" - . ($database->escapeString($page_title))."','".($database->escapeString($title))."','$parent','$template','_top','$position','$visibility','1','1','".DEFAULT_LANGUAGE."','$admin_groups','$viewing_groups','".time()."','".$admin->get_user_id()."')"; + . "(`page_title`,`menu_title`,`parent`,`template`,`target`,`position`,`visibility`,`searching`,`menu`,`language`,`admin_groups`,`viewing_groups`,`modified_when`,`modified_by`,`link`,`description`,`keywords`,`page_trail`,`admin_users`,`viewing_users`,`visibility_backup`) VALUES ('" + . ($database->escapeString($page_title))."','".($database->escapeString($title))."','$parent','$template','_top','$position','$visibility','1','1','".DEFAULT_LANGUAGE."','$admin_groups','$viewing_groups','".time()."','".$admin->get_user_id()."','','','','','','','')"; $database->query($query); if($database->is_error()) { @@ -94,24 +94,24 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { } // Get the page id $page_id = $database->get_one("SELECT LAST_INSERT_ID()"); - + // Work out level $level = level_count($page_id); // Work out root parent $root_parent = root_parent($page_id); // Work out page trail $page_trail = get_page_trail($page_id); - + // Update page with new level and link $database->query("UPDATE `".TABLE_PREFIX."pages` SET `link` = '$link', `level` = '$level', `root_parent` = '$root_parent', `page_trail` = '$page_trail' WHERE `page_id` = '$page_id'"); - + // Create a new file in the /pages dir create_access_file($filename, $page_id, $level); - + // Make new sections, database $query = "SELECT * FROM `".TABLE_PREFIX."sections` WHERE `page_id` = '$pagetoclone'"; - $get_section = $database->query($query); - while (false != ($is_section=$get_section->fetchRow( MYSQL_ASSOC ))) { + $get_section = $database->query($query); + while (false != ($is_section=$get_section->fetchRow( MYSQLI_ASSOC ))) { // Add new record into the sections table $from_section = $is_section['section_id']; $position = $is_section['position']; @@ -121,16 +121,16 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { $publ_end = $is_section['publ_end']; $namesection = $is_section['namesection']; $database->query("INSERT INTO `".TABLE_PREFIX."sections` (`page_id`,`position`,`module`,`block`,`publ_start`,`publ_end`,`namesection`) VALUES ('$page_id','$position', '$module','$block','$publ_start','$publ_end','$namesection')"); - + // Get the section id $section_id = $database->get_one("SELECT LAST_INSERT_ID()"); - - require(WB_PATH.'/modules/'.$module.'/info.php'); + + require(WB_PATH.'/modules/'.$module.'/info.php'); // Include the selected modules add file if it exists if(file_exists(WB_PATH.'/modules/'.$module.'/add.php')) { require(WB_PATH.'/modules/'.$module.'/add.php'); } - + // copy module settings per section $query = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%mod_".$module."%' AND TABLE_SCHEMA='".DB_NAME."'"; $res = $database->query($query); @@ -179,20 +179,20 @@ function clone_page($title,$parent,$pagetoclone,$copy_title,$visibility) { $dst = $mediaDir."/minigallery/$section_id"; recurse_copy($src, $dst); } - + } return $page_id; } function clone_subs($pagetoclone,$parent,$copy_title,$visibility) { global $admin, $database; - + // Get page list from database $query = "SELECT * FROM `".TABLE_PREFIX."pages` WHERE `parent` = ".$pagetoclone." AND `page_id` <> ".$parent; $get_subpages = $database->query($query); - + if($get_subpages AND $get_subpages->numRows() > 0) { - while(false != ($page = $get_subpages->fetchRow( MYSQL_ASSOC ))) { + while(false != ($page = $get_subpages->fetchRow( MYSQLI_ASSOC ))) { #echo 'clonepage('.$page['page_title'].','.$parent.','.$page['page_id'].')
'; $newnew_page = clone_page($page['menu_title'],$parent,$page['page_id'],$copy_title,$visibility); #echo 'clonesubs('.$page['page_id'].','.$newnew_page.','.$copy_title.','.$visibility.')
'; @@ -206,16 +206,16 @@ function clone_lines($tablename, $pagetoclone, $page_id, $from_section, $section $query = "DELETE FROM `$tablename` WHERE `section_id` = ".$section_id; $database->query($query); // is there a page_id ? - $query = $database->query("DESCRIBE `$tablename` `page_id`"); + $query = $database->query("DESCRIBE `$tablename` `page_id`"); $setPageId = $query->numRows() ? "`page_id` = $page_id," : ""; - $query = "SHOW COLUMNS FROM `$tablename` WHERE `extra` = 'auto_increment'"; $colautoinc = $database->get_one($query); - $autoinc = $colautoinc ? ", `$colautoinc` = NULL" : ""; - + //$autoinc = $colautoinc ? ", `$colautoinc` = NULL" : ""; + $autoinc = $colautoinc ? ", `$colautoinc` = 0" : ""; + $query1 = "CREATE TEMPORARY TABLE tmp SELECT * FROM `$tablename` WHERE `section_id` = ".$from_section; $query2 = "UPDATE tmp SET $setPageId `section_id` = $section_id $autoinc"; - $query3 = "INSERT INTO `$tablename` SELECT * FROM tmp"; + $query3 = "INSERT INTO `$tablename` SELECT * FROM tmp"; $query4 = "DROP TEMPORARY TABLE IF EXISTS tmp"; for ($i = 1; $i < 5; $i++) { @@ -223,20 +223,20 @@ function clone_lines($tablename, $pagetoclone, $page_id, $from_section, $section } } -function recurse_copy($src,$dst) { - $dir = opendir($src); - mkdir($dst); - while( $file = readdir($dir)) { - if (( $file != '.' ) && ( $file != '..' )) { - if ( is_dir($src . '/' . $file) ) { - recurse_copy($src . '/' . $file,$dst . '/' . $file); - } else { - copy($src . '/' . $file,$dst . '/' . $file); - } - } - } - closedir($dir); -} +function recurse_copy($src,$dst) { + $dir = opendir($src); + mkdir($dst); + while( $file = readdir($dir)) { + if (( $file != '.' ) && ( $file != '..' )) { + if ( is_dir($src . '/' . $file) ) { + recurse_copy($src . '/' . $file,$dst . '/' . $file); + } else { + copy($src . '/' . $file,$dst . '/' . $file); + } + } + } + closedir($dir); +} // Clone selected page $new_page = clone_page($title,$parent,$pagetoclone,$copy_title,$visibility); @@ -245,7 +245,7 @@ function recurse_copy($src,$dst) { if ($include_subs == '1') { clone_subs($pagetoclone,$new_page,$copy_title,$visibility); } - + // Check if there is a db error, otherwise say successful if($database->is_error()) { $admin->print_error($database->get_error(),'tool_clone.php?pagetoclone='.$pagetoclone); diff --git a/wbce/modules/show_menu2/classes/sm2_formatter.php b/wbce/modules/show_menu2/classes/sm2_formatter.php index 9118f1bf4..efcc4c247 100644 --- a/wbce/modules/show_menu2/classes/sm2_formatter.php +++ b/wbce/modules/show_menu2/classes/sm2_formatter.php @@ -10,8 +10,8 @@ * @license GNU GPL2 (or any later version) */ -// This class is the default menu formatter for sm2. If desired, you can -// create your own formatter class and pass the object into show_menu2 +// This class is the default menu formatter for sm2. If desired, you can +// create your own formatter class and pass the object into show_menu2 // as $aItemFormat. define('SM2_CONDITIONAL','if\s*\(([^\)]+)\)\s*{([^}]*)}\s*(?:else\s*{([^}]*)}\s*)?'); define('SM2_COND_TERM','\s*(\w+)\s*(<|<=|==|=|=>|>|!=)\s*([\w\-]+)\s*'); @@ -25,7 +25,7 @@ class SM2_Formatter var $menuClose; var $topItemOpen; var $topMenuOpen; - + var $isFirst; var $page; var $url; @@ -37,16 +37,16 @@ class SM2_Formatter // output the data function output($aString) { if(defined('SM2_CORRECT_MENU_LINKS') && SM2_CORRECT_MENU_LINKS == true){ - $aString = sm2_correct_menu_links($aString); + $aString = sm2_correct_menu_links($aString); } if ($this->flags & SM2_BUFFER) { $this->output .= $aString; } else { - echo $aString; + echo $aString; } } - + // set the default values for all of our formatting items function set($aFlags, $aItemOpen, $aItemClose, $aMenuOpen, $aMenuClose, $aTopItemOpen, $aTopMenuOpen) { $this->flags = $aFlags; @@ -67,25 +67,25 @@ function initialize() { } } - // start a menu + // start a menu function startList(&$aPage, &$aUrl) { $currClass = ''; $currItem = $this->menuOpen; - + // use the top level menu open if this is the first menu if ($this->topMenuOpen) { $currItem = $this->topMenuOpen; $currClass .= ' menu-top'; $this->topMenuOpen = false; } - + // add the numbered menu class only if requested if (($this->flags & SM2_NUMCLASS) == SM2_NUMCLASS) { $currClass .= ' menu-'.$aPage['level']; } - + $this->prettyLevel += 1; - + // replace all keywords in the output if ($this->flags & SM2_PRETTY) { $this->output("\n".str_repeat(' ',$this->prettyLevel). @@ -94,10 +94,10 @@ function startList(&$aPage, &$aUrl) { else { $this->output($this->format($aPage, $aUrl, $currItem, $currClass)); } - + $this->prettyLevel += 3; } - + // start an item within the menu function startItem(&$aPage, &$aUrl, $aCurrSib, $aSibCount) { // generate our class list @@ -113,10 +113,10 @@ function startItem(&$aPage, &$aUrl, $aCurrSib, $aSibCount) { // if item has child(ren) and is not topmost level $currClass .= ' menu-expand'; } - if (array_key_exists('sm2_is_curr', $aPage)) { + if (array_key_exists('sm2_is_curr', $aPage)) { $currClass .= ' menu-current'; } - elseif (array_key_exists('sm2_is_parent', $aPage)) { + elseif (array_key_exists('sm2_is_parent', $aPage)) { // not set if false, so existence = true $currClass .= ' menu-parent'; } @@ -151,26 +151,26 @@ function startItem(&$aPage, &$aUrl, $aCurrSib, $aSibCount) { } $this->output($this->format($aPage, $aUrl, $currItem, $currClass, $aCurrSib, $aSibCount)); } - + // find and replace all keywords, setting the state variables first - function format(&$aPage, &$aUrl, &$aCurrItem, &$aCurrClass, - $aCurrSib = 0, $aSibCount = 0) + function format(&$aPage, &$aUrl, &$aCurrItem, &$aCurrClass, + $aCurrSib = 0, $aSibCount = 0) { $this->page = &$aPage; $this->url = &$aUrl; $this->currClass = trim($aCurrClass); $this->currSib = $aCurrSib; $this->sibCount = $aSibCount; - + $item = $this->format2($aCurrItem); - + unset($this->page); unset($this->url); unset($this->currClass); - + return $item; } - + // find and replace all keywords function format2(&$aCurrItem) { if (!is_string($aCurrItem)) return ''; @@ -184,7 +184,7 @@ function format2(&$aCurrItem) { array($this, 'replace'), $aCurrItem); } - + // replace the keywords function replace($aMatches) { $aMatch = $aMatches[1]; @@ -239,7 +239,7 @@ function replace($aMatches) { } return $retval; } - + // conditional replacement function replaceIf(&$aExpression, &$aIfValue, &$aElseValue) { // evaluate all of the tests in the conditional (we don't do short-circuit @@ -265,7 +265,7 @@ function replaceIf(&$aExpression, &$aIfValue, &$aElseValue) { $ok = $ok && $rgTests[$n+1]; } } - + // return the formatted expression if the test succeeded return $ok ? $this->format2($aIfValue) : $this->format2($aElseValue); } @@ -273,7 +273,7 @@ function replaceIf(&$aExpression, &$aIfValue, &$aElseValue) { // conditional test function ifTest(&$aKey, &$aOperator, &$aValue) { global $wb; - + // find the correct operand $operand = false; switch($aKey) { @@ -281,7 +281,7 @@ function ifTest(&$aKey, &$aOperator, &$aValue) { // we need to wrap the class names in spaces so we can test for a unique // class name that will not match prefixes or suffixes. Same must be done // for the value we are testing. - $operand = " $this->currClass "; + $operand = " $this->currClass "; break; case 'target': $operand = $this->page['target']; @@ -317,14 +317,14 @@ function ifTest(&$aKey, &$aOperator, &$aValue) { return ''; } - // do the test + // do the test $ok = false; - switch ($aOperator) { + switch ($aOperator) { case '<': - $ok = ($operand < $aValue); + $ok = ($operand < $aValue); break; case '<=': - $ok = ($operand <= $aValue); + $ok = ($operand <= $aValue); break; case '=': case '==': @@ -333,7 +333,7 @@ function ifTest(&$aKey, &$aOperator, &$aValue) { $ok = strstr($operand, " $aValue ") !== FALSE; } else { - $ok = ($operand == $aValue); + $ok = ($operand == $aValue); } if ($aOperator == '!=') { $ok = !$ok; @@ -341,15 +341,15 @@ function ifTest(&$aKey, &$aOperator, &$aValue) { break; case '>=': $ok = ($operand >= $aValue); - break; + break; case '>': $ok = ($operand > $aValue); - break; + break; } - + return $ok; } - + // finish the current menu item function finishItem() { if ($this->flags & SM2_PRETTY) { @@ -363,17 +363,17 @@ function finishItem() { // finish the current menu function finishList() { $this->prettyLevel -= 3; - + if ($this->flags & SM2_PRETTY) { $this->output("\n".str_repeat(' ',$this->prettyLevel).$this->menuClose."\n"); } else { $this->output($this->menuClose); } - + $this->prettyLevel -= 1; } - + // cleanup the state of the formatter after everything has been output function finalize() { if ($this->flags & SM2_PRETTY) { @@ -398,7 +398,7 @@ function getOutput() { * @param string $sMenu the prepopulated menu string * @return string the menu string with correctly replaced URLs * ---------------------------------------------------------------------- - * + * */ function sm2_correct_menu_links($sMenu){ if(defined('SM2_CORRECT_MENU_LINKS') && true){ @@ -406,18 +406,18 @@ function sm2_correct_menu_links($sMenu){ $aMenuLinks = array(); $rMenuLinks = $database->query("SELECT * FROM `{TP}mod_menu_link`"); - $i = 0; + $i = 0; if($rMenuLinks->numRows() > 0) { - while($row = $rMenuLinks->fetchRow(MYSQL_ASSOC)) { + while($row = $rMenuLinks->fetchRow(MYSQLI_ASSOC)) { //$aMenuLinks[$i] = $row; if(!empty($row['target_page_id'])){ - $aMenuLinks[$i]['replace_url'] = get_page_link($row['target_page_id']).''.PAGE_EXTENSION; + $aMenuLinks[$i]['replace_url'] = get_page_link($row['target_page_id']).''.PAGE_EXTENSION; if(!empty($row['anchor'])){ $aMenuLinks[$i]['replace_url'] .= '#'.str_replace('#', '', $row['anchor']); } $aMenuLinks[$i]['replace_url'] = WB_URL.PAGES_DIRECTORY.$aMenuLinks[$i]['replace_url']; } - if(!empty($row['extern'])){ + if(!empty($row['extern'])){ $sTargetUrl = str_replace('[WB_URL]', WB_URL, $row['extern']); $aMenuLinks[$i]['replace_url'] = $sTargetUrl; } diff --git a/wbce/modules/show_menu2/include.php b/wbce/modules/show_menu2/include.php index 06794879a..5aed0ab9f 100644 --- a/wbce/modules/show_menu2/include.php +++ b/wbce/modules/show_menu2/include.php @@ -35,7 +35,7 @@ function error_logs($error_str) { - $log_error = (SM2_DEBUG AND SM2_DEBUG === true) ? true : false; + $log_error = true; if ( ! function_exists('error_log') ) $log_error = false; diff --git a/wbce/modules/show_menu2/info.php b/wbce/modules/show_menu2/info.php index 85e1727fb..d0a95861e 100644 --- a/wbce/modules/show_menu2/info.php +++ b/wbce/modules/show_menu2/info.php @@ -13,7 +13,7 @@ $module_directory = 'show_menu2'; $module_name = 'show_menu2'; $module_function = 'snippet'; -$module_version = '4.13.2'; +$module_version = '4.13.3'; $module_platform = '1.4.0'; $module_author = 'Brodie Thiesfield, Manuela v.d.Decken, Norbert Heimsath (heimsath.org)'; $module_license = 'GNU General Public License v2'; @@ -23,9 +23,10 @@ /** * Version history * + * 4.13.3 - MYSQL_ASSOC -> MYSQLI_ASSOC (Bernd) * 4.13.2 * - Add module_level core status - * - Update module_platform + * - Update module_platform * - Update readme files * * 4.13.1 diff --git a/wbce/modules/tool_account_settings/account/Accounts.cfg.php b/wbce/modules/tool_account_settings/account/Accounts.cfg.php new file mode 100644 index 000000000..387bfceb0 --- /dev/null +++ b/wbce/modules/tool_account_settings/account/Accounts.cfg.php @@ -0,0 +1,20 @@ +; +;########################################### +;# Accounts.cfg.php +;# saved: Tue, 12 May 20 20:16:04 +0000 +;########################################### + + +[Signup_Account_Settings] +signup_double_opt_in = 0 +user_activated_on_signup = 1 +use_html_email_templates = 0 +accounts_manager_superadmin = 1 +accounts_manager_email = "" +support_email = "" +notify_on_user_changes = 1 +preferences_template = "" +signup_template = "" +login_template = "" + + diff --git a/wbce/modules/tool_account_settings/account/form_forgot.php b/wbce/modules/tool_account_settings/account/form_forgot.php index 72c9541c6..d821ec915 100644 --- a/wbce/modules/tool_account_settings/account/form_forgot.php +++ b/wbce/modules/tool_account_settings/account/form_forgot.php @@ -28,9 +28,9 @@ $sSql = "SELECT * FROM `{TP}users` WHERE `email`='".$sEmail."'"; if(($rRow = $database->query($sSql))){ - if($aUser = $rRow->fetchRow(MYSQL_ASSOC)) { + if($aUser = $rRow->fetchRow(MYSQLI_ASSOC)) { if(strlen($aUser['signup_confirmcode']) > 25){ - header("Location: ".ACCOUNT_URL."/signup_continue_page.php?switch=wrong_inputs"); + header("Location: ".ACCOUNT_URL."/signup_continue_page.php?switch=wrong_inputs"); exit(0); // break up the script here } $iUserID = (int) $aUser['user_id']; @@ -44,26 +44,26 @@ // current password $sCurrentPw = $aUser['password']; - // generate new password + // generate new password $sNewPasswordRaw = $oAccounts->GenerateRandomPassword(); $sNewPasswordEnc = $oAccounts->doPasswordEncode($sNewPasswordRaw); - + // prepare E-Mail with login details to send to the user via email $aTokenReplace = array( - 'LOGIN_DISPLAY_NAME' => $aUser['display_name'], - 'LOGIN_NAME' => $aUser['username'], - 'LOGIN_WEBSITE_TITLE' => WEBSITE_TITLE, - 'LOGIN_PASSWORD' => $sNewPasswordRaw, + 'LOGIN_DISPLAY_NAME' => $aUser['display_name'], + 'LOGIN_NAME' => $aUser['username'], + 'LOGIN_WEBSITE_TITLE' => WEBSITE_TITLE, + 'LOGIN_PASSWORD' => $sNewPasswordRaw, 'LOGIN_URL' => ACCOUNT_URL . '/login.php' - ); + ); $sOnScreenSwitch = 'forgot_login_details_sent'; - $sEmailTemplateName = 'password_recovery_mail'; - $sEmailSubject = ''; + $sEmailTemplateName = 'password_recovery_mail'; + $sEmailSubject = ''; $sMailTo = $sEmail; $checkSend = $oAccounts->sendEmail($sMailTo, $aTokenReplace, $sEmailTemplateName, $sEmailSubject); - if ($checkSend === true) { + if ($checkSend === true) { // update the new password in the database $aUpdateUser = array( 'user_id' => $iUserID, @@ -71,32 +71,32 @@ 'last_reset' => time(), ); - if($database->updateRow('{TP}users', 'user_id', $aUpdateUser)){ - header("Location: ".ACCOUNT_URL."/signup_continue_page.php?lc=".$sLC."&switch=".$sOnScreenSwitch."&email=".$sMailTo); + if($database->updateRow('{TP}users', 'user_id', $aUpdateUser)){ + header("Location: ".ACCOUNT_URL."/signup_continue_page.php?lc=".$sLC."&switch=".$sOnScreenSwitch."&email=".$sMailTo); exit(0); - } else { + } else { // Error updating database $oMsgBox->error($MESSAGE['RECORD_MODIFIED_FAILED']); if(WB_DEBUG) { $oMsgBox->error($database->get_error().'
'.$sSql); } } - + } else { // tell user: WRONG INPUTS $aUpdateUser = array( 'user_id' => $aUser['user_id'], 'password' => $sCurrentPw - ); + ); $database->updateRow('{TP}users', 'user_id', $aUpdateUser); - header("Location: ".ACCOUNT_URL."/signup_continue_page.php?lc=".$sLC."&switch=wrong_inputs&from=resend_forgot_pass&mail_err=".$checkSend); + header("Location: ".ACCOUNT_URL."/signup_continue_page.php?lc=".$sLC."&switch=wrong_inputs&from=resend_forgot_pass&mail_err=".$checkSend); exit(0); - } + } } } else { // no record found - Email doesn't exist, so tell the user $oMsgBox->error($MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND']); } - } else { + } else { // Query failed if(WB_DEBUG) { $oMsgBox->error('SystemError:: Database query failed!'); @@ -104,7 +104,7 @@ } } } -} +} if($oMsgBox->hasErrors() == false ) { $oMsgBox->info($MESSAGE['FORGOT_PASS_NO_DATA'], 0, 1); } @@ -113,7 +113,7 @@ // Get the template file for forgot_login_details $aToTwig = array( - 'EMAIL' => $email, - 'MESSAGE_BOX' => $oMsgBox->fetchDisplay(), + 'EMAIL' => $email, + 'MESSAGE_BOX' => $oMsgBox->fetchDisplay(), ); $oAccounts->useTwigTemplate('form_forgot.twig', $aToTwig); diff --git a/wbce/modules/tool_account_settings/account/form_preferences.php b/wbce/modules/tool_account_settings/account/form_preferences.php index e079aa70d..c35850891 100644 --- a/wbce/modules/tool_account_settings/account/form_preferences.php +++ b/wbce/modules/tool_account_settings/account/form_preferences.php @@ -59,8 +59,8 @@ 'TIME_ZONES' => getTimeZonesArray($TIMEZONES, true), 'LANGUAGES' => getLanguagesArray(), - 'DATE_FORMATS' => getDateFormatsArray($DATE_FORMATS), - 'TIME_FORMATS' => getTimeFormatsArray($TIME_FORMATS), + 'DATE_FORMATS' => getTimeFormatsArray($DATE_FORMATS), + 'TIME_FORMATS' => getDateFormatsArray($TIME_FORMATS), 'NEW_PASSWORD' => $wb->passwordField('new_password'), 'REFFERER_URL' => $sHttpReferer, diff --git a/wbce/modules/tool_account_settings/email_templates/EN/testmail.txt.php b/wbce/modules/tool_account_settings/email_templates/EN/testmail.txt.php index c9218917b..b1ecc816e 100644 --- a/wbce/modules/tool_account_settings/email_templates/EN/testmail.txt.php +++ b/wbce/modules/tool_account_settings/email_templates/EN/testmail.txt.php @@ -3,7 +3,7 @@ Hello {{WBMAILER_DEFAULT_SENDERNAME}}, this email was generated by your Website "{{LOGIN_WEBSITE_TITLE}}" [{{WB_URL}}] for testing purposes. -Since you received it, it seems as if the email configuration is working as expected. +Since you recieved it, it seems as if the email configuration is working as expected. Feel free to delete this email. diff --git a/wbce/modules/tool_account_settings/info.php b/wbce/modules/tool_account_settings/info.php index 92ec2618e..219ffce50 100644 --- a/wbce/modules/tool_account_settings/info.php +++ b/wbce/modules/tool_account_settings/info.php @@ -1,21 +1,21 @@ * @copyright Christian M. Stefan * @license see LICENSE.md of this package */ - + // prevent this file from being accessed directly -defined('WB_PATH') or die(header('Location: ../index.php')); +defined('WB_PATH') or die(header('Location: ../index.php')); $module_directory = 'tool_account_settings'; $module_name = 'Account and Signups configuration'; $module_function = 'tool'; -$module_version = '0.0.5'; +$module_version = '0.0.6'; $module_platform = '1.3.2'; // WBCE $module_author = 'Christian M. Stefan (Stefek)'; $module_icon = 'fa fa-user-circle-o'; diff --git a/wbce/modules/tool_account_settings/languages/EN.php b/wbce/modules/tool_account_settings/languages/EN.php index e9b399abc..c4fdc1a6b 100644 --- a/wbce/modules/tool_account_settings/languages/EN.php +++ b/wbce/modules/tool_account_settings/languages/EN.php @@ -32,7 +32,7 @@ $TOOL_TXT['CONFIG'] = 'Configuration'; $TOOL_TXT['OVERVIEW'] = 'Overview'; -$TOOL_TXT['USERLINK'] = 'User'; +$TOOL_TXT['USERLINK'] = 'Benutzer'; $TOOL_TXT['ACTIVATE'] = 'Activate'; $TOOL_TXT['DEACTIVATE'] = 'Deactivate'; @@ -69,10 +69,10 @@ $TEXT['REGISTER_THANKYOU'] = 'Thank you for registering on our website.'; $TEXT['REGISTER_CHECK_MAIL_ACTIVATION_USER'] = 'Please check your emails now and click on the confirmation link in the email we just have sent to you.'; -$TEXT['REGISTER_GENEREC_EMAIL_NOT_RECIEVED'] =' If you did not receive the email, please wait some minutes and/or look into your spam folder too.'; +$TEXT['REGISTER_GENEREC_EMAIL_NOT_RECIEVED'] =' If you did not recieve the email, please wait some minutes and/or look into your spam folder too.'; $TEXT['REGISTER_LOGIN_SENT_TO_USER'] = 'Your login data was just sent to your email address.'; $TEXT['REGISTER_USER_ACTIVATED'] = 'The account has been activated. The login data was sent to the corresponding email address.'; -$TEXT['REGISTER_ACTIVATION_PENDING'] = 'Please be patient. You will receive an email with your login data when we have approved and activated your account.'; +$TEXT['REGISTER_ACTIVATION_PENDING'] = 'Please be patient. You will recieve an email with your login data when we have approved and activated your account.'; $TEXT['REGISTER_GDPR_PHRASE'] = 'I confirm that I have read and that I accept the privacy policy. I agree upon storing and processing of the supplied personal data.'; diff --git a/wbce/modules/tool_account_settings/languages/PL.php b/wbce/modules/tool_account_settings/languages/PL.php index 09284e898..426db1cb5 100644 --- a/wbce/modules/tool_account_settings/languages/PL.php +++ b/wbce/modules/tool_account_settings/languages/PL.php @@ -77,8 +77,8 @@ $TEXT['REGISTER_THANKYOU'] = 'Thank you for registering on our website.'; $TEXT['REGISTER_CHECK_MAIL_ACTIVATION_USER'] = 'Please check your emails now and click on the confirmation link in the email we just have sent to you.'; -$TEXT['REGISTER_GENEREC_EMAIL_NOT_RECIEVED'] =' If you did not receive the email, please wait some minutes and/or look into your spam folder too.'; +$TEXT['REGISTER_GENEREC_EMAIL_NOT_RECIEVED'] =' If you did not recieve the email, please wait some minutes and/or look into your spam folder too.'; $TEXT['REGISTER_LOGIN_SENT_TO_USER'] = 'Your login data was just sent to your email address.'; $TEXT['REGISTER_USER_ACTIVATED'] = 'The account has been activated. The login data was sent to the corresponding email address.'; -$TEXT['REGISTER_ACTIVATION_PENDING'] = 'Please be patient. You will receive an email with your login data when we have approved and activated your account.'; +$TEXT['REGISTER_ACTIVATION_PENDING'] = 'Please be patient. You will recieve an email with your login data when we have approved and activated your account.'; $TEXT['REGISTER_GDPR_PHRASE'] = 'I confirm that I have read and that I accept the privacy policy. I agree upon storing and processing of the supplied personal data.'; diff --git a/wbce/modules/tool_account_settings/templates/form_preferences.twig b/wbce/modules/tool_account_settings/templates/form_preferences.twig index 04969c178..1a922d0dd 100644 --- a/wbce/modules/tool_account_settings/templates/form_preferences.twig +++ b/wbce/modules/tool_account_settings/templates/form_preferences.twig @@ -34,7 +34,7 @@ diff --git a/wbce/modules/wbSeoTool/functions.php b/wbce/modules/wbSeoTool/functions.php index 24487affb..2ca087799 100644 --- a/wbce/modules/wbSeoTool/functions.php +++ b/wbce/modules/wbSeoTool/functions.php @@ -3,8 +3,8 @@ * WebsiteBaker CMS Functions * * functions.php - * - * + * + * * @platform CMS WebsiteBaker 2.8.x * @package WBCE CMS Functions by Stefek * @author Christian M. Stefan (Stefek) @@ -16,7 +16,7 @@ if(!defined('WB_PATH')) exit("Cannot access this file directly ".__FILE__); if(!function_exists('pagesArray')){ - + /** * Get the full array of all WebsiteBaker CMS Pages at once. * @@ -40,41 +40,41 @@ function pagesArray($bProcessSeo = FALSE) { global $database, $admin; // prepare SQL Query, build the query string first $sUseTrash = (PAGE_TRASH != 'inline') ? " WHERE `visibility` <> 'deleted'" : ''; - $sProcessSeo = ($bProcessSeo == TRUE) ? ', p.`description`, p.`keywords` ' : ' '; + $sProcessSeo = ($bProcessSeo == TRUE) ? ', p.`description`, p.`keywords` ' : ' '; $sProcessRewriteUrl = ''; $bRewriteUrlExists = FALSE; if(defined("REWRITE_URL") == TRUE && REWRITE_URL != ''){ $oCheckDbTable = $database->query("SHOW COLUMNS FROM `{TP}pages` LIKE '".REWRITE_URL."'"); $bRewriteUrlExists = $oCheckDbTable->numRows() > 0 ? TRUE : FALSE; - $sProcessRewriteUrl = ($bRewriteUrlExists == TRUE) ? ' p.`'.REWRITE_URL.'`,' : ''; + $sProcessRewriteUrl = ($bRewriteUrlExists == TRUE) ? ' p.`'.REWRITE_URL.'`,' : ''; } - + $bMySql_57 = false; $sRunningMySqlVersion = $database->get_one("SELECT VERSION()"); if(version_compare($sRunningMySqlVersion, "10.0", "<" )) { $bMySql_57 = version_compare( $sRunningMySqlVersion, "5.7.0", ">="); } $sQueryModule = ( $bMySql_57 === true) ? "ANY_VALUE(s.`module`)" : "s.`module`"; - + $sQuery = 'SELECT '.$sQueryModule.', MAX(s.`publ_start` + s.`publ_end`) published, p.`link`, ' . '(SELECT MAX(`position`) FROM `{TP}pages` WHERE `parent`=p.`parent`) siblings, ' . 'p.`position`, p.`page_id`, p.`parent`, p.`level`, p.`language`, p.`admin_groups`, ' . (($bRewriteUrlExists == TRUE ) ? 'p.`'.REWRITE_URL.'`, ' : '' ) .'' . 'p.`admin_users`, p.`viewing_groups`, p.`viewing_users`, p.`visibility`, ' - . 'p.`menu_title`, p.`page_title`, p.`page_trail`'.$sProcessSeo.'' + . 'p.`menu_title`, p.`page_title`, p.`page_trail`'.$sProcessSeo.'' . 'FROM `{TP}pages` p ' . 'INNER JOIN `{TP}sections` s ' . 'ON p.`page_id`=s.`page_id` ' . $sUseTrash.' ' . 'GROUP BY p.`page_id` ' . 'ORDER BY p.`position` ASC'; - + $oPages = $database->query($sQuery); - + $aPages = array(); - $refs = array(); + $refs = array(); // create $aPages[] Array - while($page = $oPages->fetchRow(MYSQL_ASSOC)) { + while($page = $oPages->fetchRow(MYSQLI_ASSOC)) { if (isset($page["ANY_VALUE(s.`module`)"])){ $page["module"] = $page["ANY_VALUE(s.`module`)"]; } @@ -93,15 +93,15 @@ function pagesArray($bProcessSeo = FALSE) { $thisref['admin_groups'] = $page['admin_groups']; $thisref['admin_users'] = $page['admin_users']; $thisref['position'] = $page['position']; - if($bProcessSeo == TRUE) { + if($bProcessSeo == TRUE) { $thisref['description'] = $page['description']; $thisref['keywords'] = $page['keywords']; } - if(($bRewriteUrlExists == TRUE)) { + if(($bRewriteUrlExists == TRUE)) { $thisref[REWRITE_URL] = $page[REWRITE_URL]; } $thisref['frontend_link'] = PAGES_DIRECTORY . $page['link'] . PAGE_EXTENSION; - $thisref['modify_page_url']= '../pages/modify.php?page_id='.$page['page_id']; + $thisref['modify_page_url']= '../pages/modify.php?page_id='.$page['page_id']; // Admin Groups (get user permissions) $admin_groups = explode(',', str_replace('_', '', $page['admin_groups'])); @@ -109,49 +109,49 @@ function pagesArray($bProcessSeo = FALSE) { $in_group = FALSE; foreach($admin->get_groups_id() as $cur_gid) { if (in_array($cur_gid, $admin_groups)) $in_group = TRUE; - } + } // check modify permissions $thisref['can_modify'] = FALSE; - if(($in_group) || is_numeric(array_search($admin->get_user_id(), $admin_users))){ + if(($in_group) || is_numeric(array_search($admin->get_user_id(), $admin_users))){ if($page['visibility'] == 'deleted'){ - $thisref['can_modify'] = (PAGE_TRASH == 'inline') ? TRUE : FALSE; - } elseif ($page['visibility'] != 'deleted') { - $thisref['can_modify'] = TRUE; - } - } else { - if ($page['visibility'] == 'private') { - continue; - } else { - $thisref['can_modify'] = FALSE; + $thisref['can_modify'] = (PAGE_TRASH == 'inline') ? TRUE : FALSE; + } elseif ($page['visibility'] != 'deleted') { + $thisref['can_modify'] = TRUE; + } + } else { + if ($page['visibility'] == 'private') { + continue; + } else { + $thisref['can_modify'] = FALSE; } } $thisref['canManageSections'] = (MANAGE_SECTIONS == 'enabled' && $admin->get_permission('pages_modify') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; $thisref['page_movable'] = ($admin->get_permission('pages_settings') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; $thisref['page_movable'] = ($thisref['page_movable'] && $thisref['siblings'] != 1) ? TRUE : FALSE; $thisref['canMoveUP'] = ($thisref['page_movable'] && $thisref['position'] != 1) ? TRUE : FALSE; - $thisref['canMoveDOWN'] = ($thisref['page_movable'] && $thisref['position'] != $thisref['siblings']) ? TRUE : FALSE; + $thisref['canMoveDOWN'] = ($thisref['page_movable'] && $thisref['position'] != $thisref['siblings']) ? TRUE : FALSE; $thisref['canDeleteAndModify'] = ($admin->get_permission('pages_delete') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; $thisref['canAddChild'] = ($admin->get_permission('pages_add')) == (TRUE && $thisref['can_modify'] == TRUE) && ($thisref['visibility'] != 'deleted') ? TRUE : FALSE; $thisref['canModifyPage'] = ($admin->get_permission('pages_modify') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; - $thisref['canModifySettings'] = ($admin->get_permission('pages_settings') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; + $thisref['canModifySettings'] = ($admin->get_permission('pages_settings') == TRUE && $thisref['can_modify'] == TRUE) ? TRUE : FALSE; $thisref['modifySettingsURL'] = '../pages/settings.php?page_id='.$page['page_id']; $thisref['restoreURL'] = '../pages/restore.php?page_id='.$page['page_id']; - + # sectionICON $thisref['sectionICON'] = "noclock_16.png"; if($page['published'] != 0){ $thisref['sectionICON'] = ($admin->page_is_active($thisref)) ? "clock_16.png" : "clock_red_16.png"; - } + } if($page['module'] == 'menu_link') { $thisref['sectionICON'] = "menu_link_16.png"; $thisref['menu_link'] = TRUE; - } - if ($thisref['canManageSections'] == TRUE){ + } + if ($thisref['canManageSections'] == TRUE){ $thisref['sectionsURL'] = '../pages/sections.php?page_id='.$thisref['page_id']; - } - - if ($page['parent'] == 0) { - $aPages[ $page['page_id'] ] = &$thisref; + } + + if ($page['parent'] == 0) { + $aPages[ $page['page_id'] ] = &$thisref; } else { $refs[ $page['parent'] ]['children'][ $page['page_id'] ] = &$thisref; } @@ -161,8 +161,8 @@ function pagesArray($bProcessSeo = FALSE) { } } -if (!function_exists('get_language_array')) -{ +if (!function_exists('get_language_array')) +{ /** * This experimental function will return a multilingual array * @@ -171,9 +171,9 @@ function pagesArray($bProcessSeo = FALSE) { * * @return array **/ - + // (EXPERIMENTAL) THIS FUNCTION AIN'T USED AS OF THIS VERSION AND MAY NEVER BE. - function get_language_array() + function get_language_array() { $aLanguage = array(); $sLoc = dirname(__FILE__) . '/languages'; @@ -186,7 +186,7 @@ function get_language_array() $aLanguage = array_merge($aLanguage, parse_ini_file($sLoc . '/'.LANGUAGE.'.ini')); if(is_readable($sLoc . '/'.LANGUAGE.'_custom.ini')) $aLanguage = array_merge($aLanguage, parse_ini_file($sLoc . '/'.LANGUAGE.'_custom.ini')); - } + } return $aLanguage; } } diff --git a/wbce/modules/wbSeoTool/info.php b/wbce/modules/wbSeoTool/info.php index b64d4ab51..52d26ae2b 100644 --- a/wbce/modules/wbSeoTool/info.php +++ b/wbce/modules/wbSeoTool/info.php @@ -3,19 +3,19 @@ * WebsiteBaker CMS AdminTool: wbSeoTool * * This file defines the obligatory variables required for WebsiteBaker CMS - * - * + * + * * @platform CMS WebsiteBaker 2.8.x * @package wbSeoTool * @author Christian M. Stefan (Stefek) * @copyright Christian M. Stefan * @license http://www.gnu.org/licenses/gpl-2.0.html */ - + $module_directory = 'wbSeoTool'; $module_name = 'SEO Tool'; $module_function = 'tool'; -$module_version = '0.6.1'; +$module_version = '0.6.2'; $module_status = 'Stable'; $module_platform = '2.8.3'; $module_author = 'Christian M. Stefan '; @@ -25,8 +25,8 @@ /** * Version history - * + * * 0.6.1 * - Add Admintool Icon * - **/ \ No newline at end of file + **/ diff --git a/wbce/modules/wysiwyg/add.php b/wbce/modules/wysiwyg/add.php index e24e7ee91..8c9981f80 100644 --- a/wbce/modules/wysiwyg/add.php +++ b/wbce/modules/wysiwyg/add.php @@ -1,28 +1,19 @@ query($sql); +// Insert an extra row into the database +$sql = 'INSERT INTO `' . TABLE_PREFIX . 'mod_wysiwyg` ' + . 'SET `page_id`=' . $page_id . ', ' + . '`section_id`=' . $section_id . ', ' + . '`content`=\'\', ' + . '`text`=\'\''; +$database->query($sql); \ No newline at end of file diff --git a/wbce/modules/wysiwyg/delete.php b/wbce/modules/wysiwyg/delete.php index 01effcae4..31e894272 100644 --- a/wbce/modules/wysiwyg/delete.php +++ b/wbce/modules/wysiwyg/delete.php @@ -1,26 +1,14 @@ Access denied

Cannot access this file directly

'); -} -/* -------------------------------------------------------- */ + // Delete record from the database -$database->query("DELETE FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'"); +$database->query("DELETE FROM " . TABLE_PREFIX . "mod_wysiwyg WHERE section_id = '$section_id'"); \ No newline at end of file diff --git a/wbce/modules/wysiwyg/index.php b/wbce/modules/wysiwyg/index.php index d566512be..f57b490f3 100644 --- a/wbce/modules/wysiwyg/index.php +++ b/wbce/modules/wysiwyg/index.php @@ -1,22 +1,2 @@ query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wysiwyg`"); - $mod_wysiwyg = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_wysiwyg` ( ' +if (defined('WB_URL')) { + // Create table + // $database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wysiwyg`"); + $mod_wysiwyg = 'CREATE TABLE IF NOT EXISTS `' . TABLE_PREFIX . 'mod_wysiwyg` ( ' . ' `section_id` INT NOT NULL DEFAULT \'0\',' . ' `page_id` INT NOT NULL DEFAULT \'0\',' . ' `content` LONGTEXT NOT NULL ,' . ' `text` LONGTEXT NOT NULL ,' . ' PRIMARY KEY ( `section_id` ) ' . ' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'; - $database->query($mod_wysiwyg); - -// remove old version of search (deprecated) -// $mod_search = "SELECT * FROM ".TABLE_PREFIX."search WHERE value = 'wysiwyg'"; -// $insert_search = $database->query($mod_search); -// if( $insert_search->numRows() == 0 ) -// { -// // Insert info into the search table -// // Module query info -// $field_info = array(); -// $field_info['page_id'] = 'page_id'; -// $field_info['title'] = 'page_title'; -// $field_info['link'] = 'link'; -// $field_info['description'] = 'description'; -// $field_info['modified_when'] = 'modified_when'; -// $field_info['modified_by'] = 'modified_by'; -// $field_info = serialize($field_info); -// $database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'wysiwyg', '$field_info')"); -// // Query start -// $query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title, [TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by FROM [TP]mod_wysiwyg, [TP]pages WHERE "; -// $database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'wysiwyg')"); -// // Query body -// $query_body_code = " [TP]pages.page_id = [TP]mod_wysiwyg.page_id AND [TP]mod_wysiwyg.text [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'"; -// $database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'wysiwyg')"); -// // Query end -// $query_end_code = ""; -// $database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'wysiwyg')"); -// -// // Insert blank row (there needs to be at least on row for the search to work) -// $database->query("INSERT INTO ".TABLE_PREFIX."mod_wysiwyg (page_id,section_id) VALUES ('0','0')"); -// } -} + $database->query($mod_wysiwyg); +} \ No newline at end of file diff --git a/wbce/modules/wysiwyg/languages/index.php b/wbce/modules/wysiwyg/languages/index.php index f187483a5..f57b490f3 100644 --- a/wbce/modules/wysiwyg/languages/index.php +++ b/wbce/modules/wysiwyg/languages/index.php @@ -1,4 +1,2 @@ get_one($sql)) ) { +// Get page content htmlspecialchars +$sql = 'SELECT `content` FROM `' . TABLE_PREFIX . 'mod_wysiwyg` WHERE `section_id`=' . (int) $section_id; +if (($content = $database->get_one($sql))) { $content = (str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content)); $content = htmlspecialchars($content); -}else { - $content = ''; -} - -if(mb_detect_encoding($content, 'UTF-8, '.strtoupper(DEFAULT_CHARSET)) === 'UTF-8'){ - # der String ist in UTF-8 kodiert -//$content = (utf8_decode($content)); -//$content = (iconv("UTF-8", strtoupper(DEFAULT_CHARSET), $content)); +} else { + $content = ''; } -// $content = utf8_decode($content); -if(!isset($wysiwyg_editor_loaded)) { - $wysiwyg_editor_loaded=true; - if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) { - function show_wysiwyg_editor($name,$id,$content,$width,$height) { - echo ''; - } - } else { - $id_list = array(); - $sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` '; - $sql .= 'WHERE `page_id`='.(int)$page_id.' AND `module`=\'wysiwyg\''; - if (($query_wysiwyg = $database->query($sql))) { - while($wysiwyg_section = $query_wysiwyg->fetchRow()) { - $entry='content'.$wysiwyg_section['section_id']; - $id_list[] = $entry; - } - require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'); - } - } +if (!isset($wysiwyg_editor_loaded)) { + $wysiwyg_editor_loaded = true; + + if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR == "none" OR !file_exists(WB_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php')) { + function show_wysiwyg_editor($name, $id, $content, $width, $height) { + include_once WB_PATH . '/include/editarea/wb_wrapper_edit_area.php'; + echo registerEditArea ($name,'js',true,'both',true,true,600,450,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, help'); + echo ''; + } + } else { + $id_list = array(); + $sql = 'SELECT `section_id` FROM `' . TABLE_PREFIX . 'sections` '; + $sql .= 'WHERE `page_id`=' . (int) $page_id . ' AND `module`=\'wysiwyg\''; + if (($query_wysiwyg = $database->query($sql))) { + while ($wysiwyg_section = $query_wysiwyg->fetchRow()) { + $entry = 'content' . $wysiwyg_section['section_id']; + $id_list[] = $entry; + } + require(WB_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php'); + } + } } - ?> +
- - + + getFTAN()."\n"; -show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350'); +echo $admin->getFTAN() . "\n"; +show_wysiwyg_editor('content' . $section_id, 'content' . $section_id, $content, '100%', '350'); ?> - - +
+ + + - -
- - - -
+ + + +
-
+
\ No newline at end of file diff --git a/wbce/modules/wysiwyg/save.php b/wbce/modules/wysiwyg/save.php index 3e169acf6..418e93dab 100644 --- a/wbce/modules/wysiwyg/save.php +++ b/wbce/modules/wysiwyg/save.php @@ -1,69 +1,65 @@ checkFTAN()) { - $admin->print_header(); - $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); + $admin->print_header(); + $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id); } + // After check print the header $admin->print_header(); // Include the WB functions file -require_once(WB_PATH.'/framework/functions.php'); +require_once(WB_PATH . '/framework/functions.php'); -$sMediaUrl = WB_URL.MEDIA_DIRECTORY; +$sMediaUrl = WB_URL . MEDIA_DIRECTORY; $bBackLink = isset($_POST['pagetree']); + // Update the mod_wysiwygs table with the contents -if(isset($_POST['content'.$section_id])) { - $content = $_POST['content'.$section_id]; - $searchfor = '@(<[^>]*=\s*")('.preg_quote($sMediaUrl).')([^">]*".*>)@siU'; - $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content); - $text = strip_tags($content); - $sql = 'UPDATE `'.TABLE_PREFIX.'mod_wysiwyg` ' - . 'SET `content`=\''.$database->escapeString($content).'\', ' - . '`text`=\''.$database->escapeString($text).'\' ' - . 'WHERE `section_id`='.(int)$section_id; - $database->query($sql); +if (isset($_POST['content' . $section_id])) { + $content = $_POST['content' . $section_id]; + $searchfor = '@(<[^>]*=\s*")(' . preg_quote($sMediaUrl) . ')([^">]*".*>)@siU'; + $content = preg_replace($searchfor, '$1{SYSVAR:MEDIA_REL}$3', $content); + $text = strip_tags($content); + $sql = 'UPDATE `' . TABLE_PREFIX . 'mod_wysiwyg` ' . 'SET `content`=\'' . $database->escapeString($content) . '\', ' . '`text`=\'' . $database->escapeString($text) . '\' ' . 'WHERE `section_id`=' . (int) $section_id; + $database->query($sql); } -$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? '#'.SEC_ANCHOR.$section['section_id'] : '' ); -if(defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION){ - $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.'&wysiwyg='.$section_id; -} elseif ( $bBackLink ) { - $edit_page = ADMIN_URL.'/pages/index.php'; +$sec_anchor = (defined('SEC_ANCHOR') && (SEC_ANCHOR != '') ? '#' . SEC_ANCHOR . $section['section_id'] : ''); +if (defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION) { + $edit_page = ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '&wysiwyg=' . $section_id; +} elseif ($bBackLink) { + $edit_page = ADMIN_URL . '/pages/index.php'; } else { - $edit_page = ADMIN_URL.'/pages/modify.php?page_id='.$page_id.$sec_anchor; + $edit_page = ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . $sec_anchor; } // Check if there is a database error, otherwise say successful -if($database->is_error()) { - $admin->print_error($database->get_error(), $js_back); +if ($database->is_error()) { + $admin->print_error($database->get_error(), $js_back); } else { - $admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page ); + $admin->print_success($MESSAGE['PAGES_SAVED'], $edit_page); } // Print admin footer -$admin->print_footer(); +$admin->print_footer(); \ No newline at end of file diff --git a/wbce/modules/wysiwyg/search.php b/wbce/modules/wysiwyg/search.php index f9bd30c68..215a1c34e 100644 --- a/wbce/modules/wysiwyg/search.php +++ b/wbce/modules/wysiwyg/search.php @@ -1,65 +1,58 @@ query(" - SELECT content - FROM $table - WHERE section_id='$func_section_id' - "); - - if($query->numRows() > 0) { - if($res = $query->fetchRow()) { - $mod_vars = array( - 'page_link' => $func_page_link, - 'page_link_target' => "#wb_section_$func_section_id", - 'page_title' => $func_page_title, - 'page_description' => $func_page_description, - 'page_modified_when' => $func_page_modified_when, - 'page_modified_by' => $func_page_modified_by, - 'text' => $res['content'].$divider, - 'max_excerpt_num' => $max_excerpt_num - ); - if(print_excerpt2($mod_vars, $func_vars)) { - $result = true; - } - } - } - return $result; + extract($func_vars, EXTR_PREFIX_ALL, 'func'); + static $search_sql = FALSE; + if (function_exists('search_make_sql_part')) { + if ($search_sql === FALSE) + $search_sql = search_make_sql_part($func_search_url_array, $func_search_match, array( + '`content`' + )); + } else { + $search_sql = '1=1'; + } + + // how many lines of excerpt we want to have at most + $max_excerpt_num = $func_default_max_excerpt; + $divider = "."; + $result = false; + + // we have to get 'content' instead of 'text', because strip_tags() dosen't remove scripting well. + // scripting will be removed later on automatically + $table = TABLE_PREFIX . "mod_wysiwyg"; + $query = $func_database->query(" + SELECT content + FROM $table + WHERE section_id='$func_section_id' + "); + + if ($query->numRows() > 0) { + if ($res = $query->fetchRow()) { + $mod_vars = array( + 'page_link' => $func_page_link, + 'page_link_target' => "#wb_section_$func_section_id", + 'page_title' => $func_page_title, + 'page_description' => $func_page_description, + 'page_modified_when' => $func_page_modified_when, + 'page_modified_by' => $func_page_modified_by, + 'text' => $res['content'] . $divider, + 'max_excerpt_num' => $max_excerpt_num + ); + if (print_excerpt2($mod_vars, $func_vars)) { + $result = true; + } + } + } + return $result; } - -?> +?> \ No newline at end of file diff --git a/wbce/modules/wysiwyg/uninstall.php b/wbce/modules/wysiwyg/uninstall.php new file mode 100644 index 000000000..87402114a --- /dev/null +++ b/wbce/modules/wysiwyg/uninstall.php @@ -0,0 +1,2 @@ +getTableEngine($sTable))) { - if(('myisam' != strtolower($sOldType))) { - if(!$database->query('ALTER TABLE `'.$sTable.'` Engine = \'MyISAM\' ')) { - $msg = $database->get_error(); - } - } +$msg = ''; +$sTable = TABLE_PREFIX . 'mod_wysiwyg'; +if (($sOldType = $database->getTableEngine($sTable))) { + if (('myisam' != strtolower($sOldType))) { + if (!$database->query('ALTER TABLE `' . $sTable . '` Engine = \'MyISAM\' ')) { + $msg = $database->get_error(); + } + } } else { - $msg .= $database->get_error().'
'; + $msg .= $database->get_error() . '
'; } + // change internal absolute links into relative links -$sTable = TABLE_PREFIX.'mod_wysiwyg'; -$sql = 'UPDATE `'.$sTable.'` '; -$sql .= 'SET `content` = REPLACE(`content`, \'"'.WB_URL.MEDIA_DIRECTORY.'\', \'"{SYSVAR:MEDIA_REL}\')'; +$sTable = TABLE_PREFIX . 'mod_wysiwyg'; +$sql = 'UPDATE `' . $sTable . '` '; +$sql .= 'SET `content` = REPLACE(`content`, \'"' . WB_URL . MEDIA_DIRECTORY . '\', \'"{SYSVAR:MEDIA_REL}\')'; if (!$database->query($sql)) { - $msg .= $database->get_error().'
'; -} - -// ------------------------------------ \ No newline at end of file + $msg .= $database->get_error() . '
'; +} \ No newline at end of file diff --git a/wbce/modules/wysiwyg/view.php b/wbce/modules/wysiwyg/view.php index f413fc96f..ec1179f7a 100644 --- a/wbce/modules/wysiwyg/view.php +++ b/wbce/modules/wysiwyg/view.php @@ -1,31 +1,22 @@ get_one($sql)) ) { - $content = str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content ); +$sql = 'SELECT `content` FROM `' . TABLE_PREFIX . 'mod_wysiwyg` WHERE `section_id`=' . (int) $section_id; +if (($content = $database->get_one($sql))) { + $content = str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content); } -echo $content; + +echo $content; \ No newline at end of file