'';\n }\n }\n}\nreturn(($returnvalue == '''') ? true : $returnvalue);\n', 'Puts Edit-Buttons on every page you have rights for. 1=modify page, 2=modify pagesettings, 4=modify sections, or add values to combine buttons.', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[iEditThisPage?show=7]].\n1=modify page, 2=modify pagesettings, 4=modify sections, or add values to combine buttons.\nYou can format the appearance using CSS-class ''div.iEditThisPage'' in your basic-css file\n@author: Manuela von der Decken\n@changed 2022-04-09\n'),
(3, 'iPageIcon', '\n// @author: Manuela von der Decken, Dietmar Wöllbrink\n// @param int $type: 0=page_icon(default) | 1=menu_icon_0 | 2=menu_icon_1\n// @param string $icon: name of a default image placed in WB_PATH/TEMPLATE/\n// @return: a valid image-URL or empty string\n//\n$oReg = \\bin\\WbAdaptor::getInstance();\n$database = $oReg->getDatabase();\n$oDb = $database;\n$oTrans = $oReg->getTranslate();\n$oApp = $oReg->getApplication();\n$type = (!isset($type) ? 0 : (intval($type) % 3));\n$icontypes = [\n 0 => ''page_icon'',\n 1 => ''menu_icon_0'',\n 2 => ''menu_icon_1''\n ];\n$icon_url = '''';\nif (isset($icon) && is_readable($oReg->AppPath.''/templates/''.$oReg->Template.''/''.$icon)) {\n $icon_url = $oReg->AppUrl.''/templates/''.$oReg->Template.''/''.$icon;\n}\n$tmp_trail = array_reverse($oApp->page_trail);\nforeach ($tmp_trail as $pid) {\n $sql = ''SELECT `''.$icontypes[$type].''` '';\n $sql .= ''FROM `''.$oReg->TablePrefix.''pages` '';\n $sql .= ''WHERE `page_id`=''.(int)$pid;\n if (($icon = $oDb->get_one($sql)) != false) {\n $icon = ltrim(str_replace(''\\\\'', ''/'', $icon), ''/'');\n if (is_file($oReg->AppPath.''/''.$icon)) {\n $icon_url = $oReg->AppUrl.''/''.$icon;\n break;\n }\n }\n}\nreturn $icon_url;\n', 'search for an image in current page. If no image is present, the image of the parent page is inherited.', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[iPageIcon?type=1]]\nDisplay the page-icon(0)(default) or menu_icon_0(1) or menu_icon_1(2) if found\n'),
(4, 'iSectionPicker', '\n/*\n * Copyright (C) 2020 Manuela von der Decken \n *\n * DO NOT ALTER OR REMOVE COPYRIGHT OR THIS HEADER\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License 2 for more details.\n *\n * You should have received a copy of the GNU General Public License 2\n * along with this program. If not, see .\n */\n/**\n * iSectionPicker\n *\n * @category Addon\n * @package Droplet\n * @copyright Manuela von der Decken \n * @author Manuela von der Decken \n * @author dietmarWöllbrink \n * @license GNU General Public License 2\n * @version 0.0.1 $Rev: 4 $\n * @revision $Id: iSectionPicker.php 4 2025-08-08 07:53:04Z Uwe $\n * @since File available since 07.03.2020\n * @deprecated no / since 0000/00/00\n * @description xxx\n */\n// import global objects\n $oReg = \\bin\\WbAdaptor::getInstance();\n $oApp = $wb = ($oReg->getApplication() ?? $GLOBALS[''wb'']);\n $oDb = $database = $oReg->getDatabase();\n $sContent = '''';\n// sanitize argument $sid\n $iSectionId = \\intval($sid ?? 0);\n// try to load the section and the corresponding page\n $sql = ''SELECT `s`.*, ''\n// . ''`p`.`viewing_groups`, ''\n . ''`p`.`visibility`, ''\n . ''`p`.`link`, ''\n . ''`p`.`page_title`, ''\n . ''`p`.`menu_title` ''\n . ''FROM `''.$oDb->TablePrefix.''sections` `s` ''\n . ''INNER JOIN `''.$oDb->TablePrefix.''pages` `p` ''\n . ''ON `p`.`page_id`=`s`.`page_id` ''\n . ''WHERE `s`.`section_id` = ''.$iSectionId.'' ''\n . ''AND (''.\\time().'' BETWEEN `s`.`publ_start` AND `s`.`publ_end`) ''\n . ''AND `active` = 1 ''\n . ''AND `p`.`visibility` NOT IN (\\''deleted\\'',\\''none\\'')'';\n try {\n $oResultSet = $oDb->query($sql);\n if (($aRecord = $oResultSet->fetchRow(\\MYSQLI_ASSOC))) {\n unset($sql);\n// if matching record found\n $module = $sModuleName = $aRecord[''module''];\n $section_id = $aRecord[''section_id''];\n $page_id = $aRecord[''page_id''];\n if (!$oApp->isPageVisible($page_id)) {\n throw new \\InvalidArgumentException(''no valid visibility'');\n }\n// include the buffered view.php of the needed module\n $sFrontendViewFile = $oReg->AppPath.''modules/''.$sModuleName.''/view.php'';\n if (\\is_readable($sFrontendViewFile)){\n \\ob_start();\n require $sFrontendViewFile;\n $sContent = \\ob_get_clean();\n } else {\n throw new \\InvalidArgumentException(\\sprintf(''%s/view.php not found/readable'',$sModuleName));\n }\n// define path and url to frontend.*\n $sFrontendPath = $oReg->AppPath.''modules/''.$sModuleName.''/frontend'';\n $sFrontendUrl = $oReg->AppUrl.''modules/''.$sModuleName.''/frontend'';\n//check out if conternt already contains a link to frontend.css\n $sFrontendCss = '''';\n $sPattern = ''/]*?src\\s*=\\s*\\"''.\\preg_quote($sFrontendUrl, ''/'').''css\\".*?\\/>/si'';\n if (!\\preg_match($sPattern, $sContent)) {\n// if not, then try to find and include frontend.css\n if (\\is_readable($sFrontendPath.''.css'')) {\n $sFrontendCss = ''\n \n '';\n }\n }\n//check out if conternt already contains a \n '';\n }\n }\n $sContent = $sFrontendCss.$sFrontendJs.$sContent;\n }//end pageisvisible\n } catch (\\Throwable $ex) {\n /* place to insert different error/logfile messages */\n $sErrMessage = ''[''.\\basename(__FILE__, ''.php'').'' :: ''.$ex->getMessage().'']'';\n $sContent = (($oReg->Debug ?? false) ? $sErrMessage : true);\n }\n return (empty($sContent) ? ''page not visible, no content found'' : $sContent);\n', 'Load the view.php from any other section-module', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[iSectionPicker?sid=123]]\n'),
(5, 'LastModifiedPages', '\n $oReg = \\bin\\WbAdaptor::getInstance();\n $oTrans = $oReg->getTranslate();\n $oApp = $oReg->getApplication();\n $iMax = (int)($max ?? 1);\n $sRetval = nl2br(sprintf($oTrans->TEXT_MODIFIED_PAGE,$iMax));\n if ($iMax > 1){\n $sRetval = nl2br(sprintf($oTrans->TEXT_MODIFIED_PAGES,$iMax));\n }\n $iNow = time();\n $sSql = ''\n SELECT\n `p`.`page_title`,`p`.`modified_when`,`p`.`modified_by`,`p`.`link`\n ,`p`.`page_id` ,UNIX_TIMESTAMP() `time_now`,`u`.`display_name`\n FROM `''.$oReg->TablePrefix.''pages` `p`\n INNER JOIN `''.$oReg->TablePrefix.''users` `u`\n ON `u`.`user_id` = `p`.`modified_by`\n HAVING `p`.`modified_when`<= `time_now`\n ORDER BY `p`.`modified_when` DESC\n '';\n $i = 0;\n if ($oPages = $oReg->Db->query($sSql)){}\n while (($aPages=$oPages->fetchRow(MYSQLI_ASSOC))){\n $sLink = ''''.$aPages[''page_title''].'''';\n if ($oApp->page_id != $aPages[''page_id'']) {\n $sLink = ''''.$aPages[''page_title''].'''';\n }\n $date = \\bin\\helpers\\PreCheck::dateFormatToStrftime($oReg->DateFormat,$aPages[''modified_when'']);\n $time = \\bin\\helpers\\PreCheck::dateFormatToStrftime($oReg->TimeFormat,$aPages[''modified_when'']);\n $sRetval .= nl2br(sprintf(" %s %s %s \\n",$sLink,$date, "".$time));\n $i++;\n if ($i >= $iMax ){break;}\n }\n return (empty($sRetval) ? nl2br(sprintf($oTrans->NO_MODIFIED_PAGES)) : $sRetval);\n', 'Displays the last modification time of pages', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[LastModifiedPages?max=5]]\n'),
(6, 'LoginBox', '\n//global $wb;\n$oReg = \\bin\\WbAdaptor::getInstance();\n$database = $oReg->getDatabase();\n$oLang = $oReg->getTranslate();\n$oRequest = $oReg->getRequester();\n$oApp = $oReg->getApplication();\n$oLang->enableAddon(''templates/''.TEMPLATE);\n$return_value = ''
''.PHP_EOL;\n$return_admin = '' '';\n// Return a system permission\n$get_permission = function ($name, $type = ''system'')use ($oApp)\n{\n // Append to permission type\n $type .= ''_permissions'';\n // Check if we have a section to check for\n if ($name == ''start'') {\n return true;\n } else {\n // Set system permissions var\n $system_permissions = $oApp->get_session(''SYSTEM_PERMISSIONS'');\n // Set module permissions var\n $module_permissions = $oApp->get_session(''MODULE_PERMISSIONS'');\n // Set template permissions var\n $template_permissions = $oApp->get_session(''TEMPLATE_PERMISSIONS'');\n // Return true if system perm = 1\n if (isset($$type) && is_array($$type) && is_numeric(array_search($name, $$type))) {\n if ($type == ''system_permissions'') {\n return true;\n } else {\n return false;\n }\n } else {\n if ($type == ''system_permissions'') {\n return false;\n } else {\n return true;\n }\n }\n }\n}\n;\n$get_page_permission = function ($page, $action = ''admin'')use ($database, $oApp)\n{\n if ($action != ''viewing'') {$action = ''admin'';}\n $action_groups = $action.''_groups'';\n $action_users = $action.''_users'';\n if (is_array($page)) {\n $groups = $page[$action_groups];\n $users = $page[$action_users];\n } else {\n $sql = ''SELECT ''.$action_groups.'',''.$action_users.'' FROM `''.TABLE_PREFIX.''pages` ''.''WHERE `page_id` = ''.(int)$page.'' '';\n if ($oResults = $database->query($sql)) {\n $aResult = $oResults->fetchRow(\\MYSQLI_ASSOC);\n $groups = explode('','', str_replace(''_'', '''', $aResult[$action_groups]));\n $users = explode('','', str_replace(''_'', '''', $aResult[$action_users]));\n }\n }\n $in_group = false;\n foreach ($oApp->get_groups_id() as $cur_gid) {\n if (in_array($cur_gid, $groups)) {\n $in_group = true;\n }\n }\n if (!$in_group && !is_numeric(array_search($oApp->getUserId(), $users))) {\n return false;\n }\n return true;\n}\n;\n// Get redirect\n$redirect_url = ((isset($_SESSION[''HTTP_REFERER'']) && $_SESSION[''HTTP_REFERER''] != '''') ? $_SESSION[''HTTP_REFERER''] : WB_URL);\n$redirect_url = (isset($redirect) && ($redirect != '''') ? $redirect : $redirect_url);\nif ((FRONTEND_LOGIN == ''enabled'') && (defined(''VISIBILITY'') && (VISIBILITY != ''private'')) && ($oApp->get_session(''USER_ID'') == '''')) {\n $return_value .= ''''.PHP_EOL;\n} elseif ((FRONTEND_LOGIN == ''enabled'') && (is_numeric($oApp->get_session(''USER_ID'')))) {\n $return_value .= ''''.PHP_EOL;\n}\n$return_value .= ''
''.PHP_EOL;\nreturn $return_value;\n', 'Puts a Login / Logout box on your page.', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[LoginBox?redirect=url]]\nAbsolute or relative url possible\nRemember to enable frontend login in your website settings!!\n@changed 2022-04-09\n'),
(7, 'Lorem', '\n$lorem = [];\n$lorem[] = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut odio. Nam sed est. Nam a risus et est iaculis adipiscing. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer ut justo. In tincidunt viverra nisl. Donec dictum malesuada magna. Curabitur id nibh auctor tellus adipiscing pharetra. Fusce vel justo non orci semper feugiat. Cras eu leo at purus ultrices tristique.
";\n$lorem[] = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
";\n$lorem[] = "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
";\n$lorem[] = "Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
";\n$lorem[] = "Cras consequat magna ac tellus. Duis sed metus sit amet nunc faucibus blandit. Fusce tempus cursus urna. Sed bibendum, dolor et volutpat nonummy, wisi justo convallis neque, eu feugiat leo ligula nec quam. Nulla in mi. Integer ac mauris vel ligula laoreet tristique. Nunc eget tortor in diam rhoncus vehicula. Nulla quis mi. Fusce porta fringilla mauris. Vestibulum sed dolor. Aliquam tincidunt interdum arcu. Vestibulum eget lacus. Curabitur pellentesque egestas lectus. Duis dolor. Aliquam erat volutpat. Aliquam erat volutpat. Duis egestas rhoncus dui. Sed iaculis, metus et mollis tincidunt, mauris dolor ornare odio, in cursus justo felis sit amet arcu. Aenean sollicitudin. Duis lectus leo, eleifend mollis, consequat ut, venenatis at, ante.
";\n$lorem[] = "Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
";\nif (!isset($blocks)){ $blocks=1;}\n$blocks = (int)$blocks - 1;\nif ($blocks <= 0){ $blocks = 0;}\nif ($blocks > 5){ $blocks = 5;}\n$returnvalue = "";\nfor ( $i=0 ; $i<=$blocks ; $i++) {\n $returnvalue .= $lorem[$i];\n}\nreturn $returnvalue;\n', 'Create Lorum Ipsum text', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[Lorem?blocks=6]] (max 6 paragraphs)\n'),
(8, 'ModifiedWhen', '\nglobal $database, $wb;\nif (PAGE_ID>0) {\n$query=$database->query("SELECT `modified_when` FROM `".TABLE_PREFIX."pages` WHERE `page_id`=".PAGE_ID);\n$mod_details=$query->fetchRow();\nreturn "This page was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";\n}\n', 'Displays the last modification time of the current page', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[ModifiedWhen]]\n'),
(9, 'NextPage', '$sInfo = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER|SM2_SHOWHIDDEN, ''[if(class==menu-current){[level] [sib] [sibCount] [parent]}]'', '''', '''', '''');\n$aInfo = (empty($sInfo) ? [] : explode('' '', $sInfo));\n$nxt = 0;\n$sRetval = '''';\nif (sizeof($aInfo)){\n list($nLevel, $nSib, $nSibCount, $nParent) = $aInfo;\n $nxt = $nSib < $nSibCount ? $nSib + 1 : 0;\n}\n// show next\nif ($nxt > 0) {\n $sRetval = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER|SM2_SHOWHIDDEN, "[if(sib==$nxt){>> [a][menu_title]}]", '''', '''', '''');\n}\nreturn $sRetval;\n', 'Create a next link to your page', [[timestamp]], 1, 1, 0, 0, 0, 'Display a link to the next page on the same menu level\n'),
(10, 'Oneliner', '$line = file (dirname(__FILE__)."/example/oneliners.txt");\nshuffle($line);\nreturn $line[0];\n', 'Create a random oneliner on your page', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[OneLiner]].\nThe file with the oneliner data is located in /modules/droplets/example/oneliners.txt;\n'),
(11, 'ParentPage', '$info = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER, ''[if(class==menu-current){[level] [sib] [sibCount] [parent]}]'', '''', '''', '''');\nlist($nLevel, $nSib, $nSibCount, $nParent) = explode('' '', $info);\n// show up level\nif ($nLevel > 0) {\n$lev = $nLevel - 1;\nreturn show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB|SM2_BUFFER, "[if(level==$lev){[a][menu_title]}]", '''', '''', '''');\n}\nelse\nreturn ''(no parent)'';\n', 'Create a parent link to your page', [[timestamp]], 1, 1, 0, 0, 0, 'Display a link to the parent page of the current page\n'),
(12, 'PreviousPage', '$sInfo = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER|SM2_SHOWHIDDEN, ''[if(class==menu-current){[level] [sib] [sibCount] [parent]}]'', '''', '''', '''');\n$aInfo = (empty($sInfo) ? [] : explode('' '', $sInfo));\n$prv = 0;\n$sRetval = '''';\nif (sizeof($aInfo)){\n list($nLevel, $nSib, $nSibCount, $nParent) = $aInfo;\n $prv = $nSib > 1 ? $nSib - 1 : 0;\n}\n// show previous\nif ($prv > 0) {\n $sRetval = show_menu2(0, SM2_CURR, SM2_START, SM2_ALL|SM2_BUFFER|SM2_SHOWHIDDEN, "[if(sib==$prv){[a][menu_title] <<}]", '''', '''', '''');\n}\nreturn $sRetval;\n', 'Create a previous link to your page', [[timestamp]], 1, 1, 0, 0, 0, 'Display a link to the previous page on the same menu level\n'),
(13, 'RandomImage', '$dir = ((isset($dir) && ($dir != ''''))?$dir:'''');\n$folder = opendir(WB_PATH.MEDIA_DIRECTORY.''/''.$dir.''/.'');\n$names = array();\nwhile ($file = readdir($folder)) {\n $ext = strtolower(substr($file, -4));\n if ($ext == ".jpg" || $ext == ".gif" || $ext == ".png") {\n $names[count($names)] = $file;\n }\n}\nclosedir($folder);\nshuffle($names);\n$image = $names[0];\n$name = substr($image, 0, -4);\nreturn '''';\n', 'Get a random image from a folder in the MEDIA folder.', [[timestamp]], 1, 1, 0, 0, 0, 'Commandline to use: [[RandomImage?dir=subfolder_in_mediafolder]]\n'),
(14, 'SearchBox', '\n$return_value = '''';\nif (SHOW_SEARCH) {\n $oTrans = Translate::getInstance();\n if (!isset($msg)){$msg=$oTrans->TEXT_SEARCHING;}\n $return_value = ''
''.PHP_EOL;\n } catch (\\Throwable $ex) {\n /* place to insert different error/logfile messages */\n $sContent = ''$scontent = ''.$ex->getMessage();\n }\n return $sContent;\n', 'Insert Full Date and Clock', [[timestamp]], 1, 1, 0, 0, 0, 'usage: [[showDateBlock?title=Allgemeine Termine&pre=Heute ist&desc=Terminänderungen bleiben vorbehalten]]\ncan be call without parameters\n'),
(18, 'ShowRandomWysiwyg', 'global $database;\n$content = '' '';\nif (isset($section)) {\n if( preg_match(''/^[0-9]+(?:\\s*[\\,\\|\\-\\;\\:\\+\\#\\/]\\s*[0-9]+\\s*)*$/'', $section)) {\n if (is_readable(WB_PATH.''/modules/wysiwyg/view.php'')) {\n // if valid arguments given and module wysiwyg is installed\n // split and sanitize arguments\n $aSections = preg_split(''/[\\s\\,\\|\\-\\;\\:\\+\\#\\/]+/'', $section);\n $section_id = $aSections[array_rand($aSections)]; // get random element\n ob_start(); // generate output by wysiwyg module\n require(WB_PATH.''/modules/wysiwyg/view.php'');\n $content = ob_get_clean();\n }\n }\n}\nreturn $content;\n', 'Randomly display one WYSIWYG section from a given list', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[ShowRandomWysiwyg?section=10,12,15,20]]\npossible Delimiters: [ ,;:|-+#/ ]\n'),
(19, 'ShowRootParent', '\n/*\n * possible return values:\n * if current page is a real root page = ''own title''\n * if current page is root page after a language page = ''own title''\n * all others shows the root page/menu title of the current branch\n * if page_id = 0, the default_page[$title] is loaded\n * language pages in root are ignored and show the default_page[$title]\n */\n// process selection\n$title = (($show ?? ''p'') == ''m'' ? ''menue_title'' : ''page_title'');\n$oReg = \\bin\\WbAdaptor::getInstance();\n$oApp = $oReg->getApplication();\n$iCurrPageId = $GLOBALS[''page_id''];\n$sRetval = '''';\nif ($iCurrPageId) { // if current page > 0\n $aPage = $oApp->getPage($iCurrPageId);\n if ($aPage) {\n $aPageTrail = \\explode('','', $aPage[''page_trail'']);\n if (($oReg->PageLanguages ?? 0)) {\n \\array_shift($aPageTrail); // remove language level\n }\n if (\\count($aPageTrail)) { // if at least one page exists (root or root after language)\n $iRootPageId = \\array_shift($aPageTrail);\n $aPage = $oApp->getPage($iRootPageId);\n if ($aPage) {\n $sRetval = $aPage[$title];\n }\n }\n }\n}\n// try to load the default page if an error occurred before\nif (!$sRetval) {\n $iDefaultPageId = ($oApp->default_page_id ?? 0);\n if ($iDefaultPageId) {\n $aPage = $oApp->getPage($iDefaultPageId);\n if ($aPage) {\n $sRetval = $aPage[$title];\n }\n }\n}\nreturn $sRetval;\n', 'Shows the parent page_title or menu_title of a page tree', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[ShowRootParent?show=m]] shows menu_title\nUse [[ShowRootParent]] or [[ShowRootParent?show=p]] shows page_tile\n'),
(20, 'ShowWysiwyg', 'global $database, $section_id, $module;\n$content = '' '';\n$section = isset($section) ? intval($section) : 0;\nif ($section) {\nif (is_readable(WB_PATH.''/modules/wysiwyg/view.php'')) {\n// if valid section is given and module wysiwyg is installed\n$iOldSectionId = intval($section_id); // save old SectionID\n$section_id = $section;\nob_start(); // generate output by regulary wysiwyg module\nrequire(WB_PATH.''/modules/wysiwyg/view.php'');\n$content = ob_get_clean();\n$section_id = $iOldSectionId; // restore old SectionId\n}\n}\nreturn $content;\n', 'Display one defined WYSIWYG section', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[ShowWysiwyg?section=10]]\n'),
(21, 'SiteMapChildRL', '\n$oApp = \\bin\\WbAdaptor::getInstance()->getApplication();\n$content = '''';\nif (isset($start) && !empty($start)) {\n $iChild = (isset($start) && is_numeric($start) ? $start : 0);\n if ($iChild > 0){\n $content = ''''.\n show_menu2(SM2_ALLMENU,\n $iChild,\n SM2_ALL,\n SM2_ALL|SM2_ALLINFO|SM2_BUFFER,\n ''
''.''[a][page_title]'',\n ''
'',\n ''
'');\n }\n}\nreturn ($content.'''');\n', 'List of pages below current page or page_id. Modified for servicelinks.', [[timestamp]], 1, 1, 0, 0, 0, '[[SiteMapChildRL?start=11]]\n(optional parameter) start=page_id\n@change 20220410\n'),
(22, 'SiteModified', '\n$oDb = \\database::getInstance();\n$oTrans = \\Translate::getInstance();\n$oTrans->enableAddon(''templates/''.TEMPLATE);\n$retVal = '' '';\nif (PAGE_ID > 0) {\n $sSqlSet = ''SELECT `p`.`modified_when`, `p`.`modified_by`, `u`.`display_name` FROM `''.TABLE_PREFIX.''pages` `p` ''\n . ''LEFT JOIN `''.TABLE_PREFIX.''users` `u` ON (`u`.`user_id` = `p`.`modified_by`) ''\n . ''WHERE `p`.`page_id` = ''.PAGE_ID;\n $oRes = $oDb->query($sSqlSet);\n $aRes = $oRes->fetchRow(MYSQLI_ASSOC);\n $sDate = date("d-m-Y H:i", $aRes[''modified_when'']+TIMEZONE);\n $retVal = sprintf($oTrans->MESSAGE_PAGE_MODIFIED, $sDate, $aRes[''display_name'']);\n}\nreturn is_array($retVal) ? '' '' : $retVal;\n', 'Create information on when your site was last updated.', [[timestamp]], 1, 1, 0, 0, 0, 'Create information on when your site was last updated. Any page update counts.\n'),
(23, 'Text2Image', '//clean up old files..\n$dir = WB_PATH.''/temp/'';\n$dp = opendir($dir) or die (''Could not open ''.$dir);\nwhile ($file = readdir($dp)) {\nif ((preg_match(''/img_/'',$file)) && (filemtime($dir.$file)) < (strtotime(''-10 minutes''))) {\nunlink($dir.$file);\n}\n}\nclosedir($dp);\n$imgfilename = ''img_''.rand().''_''.time().''.jpg'';\n//create image\n$padding = 0;\n$font = 3;\n$height = imagefontheight($font) + ($padding * 2);\n$width = imagefontwidth($font) * strlen($text) + ($padding * 2);\n$image_handle = imagecreatetruecolor($width, $height);\n$text_color = imagecolorallocate($image_handle, 0, 0, 0);\n$background_color = imagecolorallocate($image_handle, 255, 255, 255);\n$bg_height = imagesy($image_handle);\n$bg_width = imagesx($image_handle);\nimagefilledrectangle($image_handle, 0, 0, $bg_width, $bg_height, $background_color);\nimagestring($image_handle, $font, $padding, $padding, $text, $text_color);\nimagejpeg($image_handle,WB_PATH.''/temp/''.$imgfilename,100);\nimagedestroy($image_handle);\nreturn '''';\n', 'Create an image from the textparameter', [[timestamp]], 1, 1, 0, 0, 0, 'Use [[text2image?text=The text to create]]\n'),
(24, 'year', '$datum = date("Y");\nreturn "$datum";\n', 'zeigt das aktuelle Jahr an', [[timestamp]], 1, 1, 0, 0, 0, '[[year]] zeigt die Jahrezahl\n'),
(25, 'Zitate', '$line = file (dirname(__FILE__)."/example/oneliners.txt");\nshuffle($line);\nreturn $line[0];\n', 'Create a random oneliner on your page', [[timestamp]], 1, 1, 0, 0, 0, 'Use: [[Zitate]].\nThe file with the oneliner data is located in /modules/droplets/example/oneliners.txt;\n');
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_form_fields`
--
CREATE TABLE `[[dbprefix]]mod_form_fields` (
`field_id` int(11) NOT NULL AUTO_INCREMENT,
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`layout` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`position` int(11) NOT NULL DEFAULT '0',
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`type` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`required` int(11) NOT NULL DEFAULT '0',
`value` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`extra` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`active` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_form_settings`
--
CREATE TABLE `[[dbprefix]]mod_form_settings` (
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`layout` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`description` varchar(512) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email_to` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`email_from` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email_fromname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email_subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`success_page` int(11) NOT NULL DEFAULT '-1',
`success_email_to` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`success_email_from` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`success_email_fromname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`success_email_text` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`success_email_subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`stored_submissions` int(11) NOT NULL DEFAULT '80',
`delete_submissions` int(11) NOT NULL DEFAULT '30',
`max_submissions` int(11) NOT NULL DEFAULT '1',
`perpage_submissions` int(11) NOT NULL DEFAULT '10',
`use_captcha` int(11) NOT NULL DEFAULT '0',
`subject_email` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`captcha_action` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`divider` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`captcha_style` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`send_confirmmail` int(11) NOT NULL DEFAULT '0',
`data_protection_link` int(11) NOT NULL DEFAULT '-1',
`use_data_protection` int(11) NOT NULL DEFAULT '0',
`use_captcha_auth` int(11) NOT NULL DEFAULT '0',
`prevent_user_confirmation` int(11) NOT NULL DEFAULT '0',
`info_dsgvo_in_mail` int(11) NOT NULL DEFAULT '0',
`title_placeholder` int(11) NOT NULL DEFAULT '1',
`form_required` int(11) NOT NULL DEFAULT '0',
`frontend_css` int(11) NOT NULL DEFAULT '0',
`header` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`field_loop` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`extra` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`footer` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`spam_submissions` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`section_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_form_submissions`
--
CREATE TABLE `[[dbprefix]]mod_form_submissions` (
`submission_id` int(11) NOT NULL AUTO_INCREMENT,
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`submitted_when` int(11) NOT NULL DEFAULT '0',
`submitted_by` int(11) NOT NULL DEFAULT '0',
`body` text COLLATE utf8mb4_unicode_ci NOT NULL,
`sub_delete` int(11) NOT NULL DEFAULT '0',
`form_ip` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`submission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_jsadmin`
--
CREATE TABLE `[[dbprefix]]mod_jsadmin` (
`id` int(11) NOT NULL DEFAULT '0',
`name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `[[dbprefix]]mod_jsadmin`
--
INSERT INTO `[[dbprefix]]mod_jsadmin` VALUES
(1, 'mod_jsadmin_persist_order', 1),
(2, 'mod_jsadmin_ajax_order_pages', 1),
(3, 'mod_jsadmin_ajax_order_sections', 1);
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_menu_link`
--
CREATE TABLE `[[dbprefix]]mod_menu_link` (
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`target_page_id` int(11) NOT NULL DEFAULT '0',
`redirect_type` int(11) NOT NULL DEFAULT '301',
`anchor` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`extern` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`section_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_news_comments`
--
CREATE TABLE `[[dbprefix]]mod_news_comments` (
`comment_id` int(11) NOT NULL AUTO_INCREMENT,
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`post_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`comment` text COLLATE utf8mb4_unicode_ci NOT NULL,
`commented_when` int(11) NOT NULL DEFAULT '0',
`commented_by` int(11) NOT NULL DEFAULT '0',
`active` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_news_groups`
--
CREATE TABLE `[[dbprefix]]mod_news_groups` (
`group_id` int(11) NOT NULL AUTO_INCREMENT,
`section_id` int(11) NOT NULL DEFAULT '0',
`page_id` int(11) NOT NULL DEFAULT '0',
`active` int(11) NOT NULL DEFAULT '0',
`position` int(11) NOT NULL DEFAULT '0',
`title` varchar(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`group_id`),
UNIQUE KEY `ident_news` USING BTREE (`section_id`,`title`(127))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `[[dbprefix]]mod_news_layouts`
--
CREATE TABLE `[[dbprefix]]mod_news_layouts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`layout` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`header` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`post_loop` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`footer` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`post_header` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`post_footer` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`comments_header` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`comments_loop` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`comments_footer` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`comments_page` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `ident_layout` USING BTREE (`id`,`layout`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=4 ;
--
-- Dumping data for table `[[dbprefix]]mod_news_layouts`
--
INSERT INTO `[[dbprefix]]mod_news_layouts` VALUES
(1, 'default_layout', '\n