WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?php global $database, $wb; //check if sID is setif(empty($sID) || !is_numeric($sID)) $output = '<p>you must specify a sectionID to run the "ColorboxOnLoad" droplet</p>';else{ $output = ""; $cookie = "sID_".$sID; // EXPIRATION // @parameter: 'expire' // @required: no $expire = (!isset($expire)) ? (120) : $expire; if (!isset($_COOKIE[$cookie])) setcookie($cookie, '1', time()+$expire); //setcookie($cookie, '1', time()+60*60*24*7); else return $output; //we stop the script here // GET SECTION // @parameter: 'sID' // @required: yes! if($module_check = $database->get_one(sprintf("SELECT `module` FROM `%s` WHERE `section_id` = '%d'", TABLE_PREFIX."sections" ,$sID ))) { $section_id = intval($sID); // [!]variable needed for the included file ob_start(); require(WB_PATH.'/modules/'.$module_check.'/view.php'); // here is our content within two divs, one is hidden via style definition $output .= '<div style="display:none;"><div id="colorbox_section">'.ob_get_contents().'</div></div>'; ob_end_clean(); } else // if requested Section doesn't exist $output .= "<p>The requested section wasn't found</p>"; // width & height $width = (!isset($width) || !is_numeric($width)) ? ( 550 ) : intval($width); $height = (!isset($height)|| !is_numeric($height)) ? ( 420 ) : intval($height); $output .= <<<_SCRIPT<script type="text/javascript">/* <![CDATA[ */ $(document).ready( function () { $('.cboxOnLoad').colorbox({ inline: true, href: '#colorbox_section', innerWidth: $width, innerHeight: $height, maxWidth: "98%", maxHeight: "98%", }); $('a.cboxOnLoad').click(); });/* ]]> */</script>_SCRIPT; // BOX TITLE // @parameter: 'title' // @required: no if(isset($title) && is_string($title)){ $title = sprintf(' title="%s"', $title); $title = str_replace('"','', $title); }else $title = ''; $output .= '<a class="colorbox"></a>'; // needed to initialize Maverik's cBox snippet $output .= '<a class="cboxOnLoad" '.$title.' href="#"></a>'; }return $output;?>
<?php global $database, $wb; //check if sID is setif(empty($sID) || !is_numeric($sID)){ $output = '<p>you must specify a sectionID to run the "ColorboxOnLoad" droplet</p>';}else{ $output = ""; $cookie = "sID_".$sID; // EXPIRATION // @parameter: 'expire' // @required: no $expire = (!isset($expire)) ? (120) : $expire; if (!isset($_COOKIE[$cookie])) { setcookie($cookie, '1', time()+$expire); //setcookie($cookie, '1', time()+60*60*24*7); } else { return $output; //we stop the script here } // GET SECTION // @parameter: 'sID' // @required: yes! if($module_check = $database->get_one(sprintf("SELECT `module` FROM `%s` WHERE `section_id` = '%d'", TABLE_PREFIX."sections" ,$sID ))) { $section_id = intval($sID); // [!]variable needed for the included file ob_start(); require(WB_PATH.'/modules/'.$module_check.'/view.php'); // here is our content within two divs, one is hidden via style definition $output .= '<div style="display:none;"><div id="colorbox_section">'.ob_get_contents().'</div></div>'; ob_end_clean(); } else { // if requested Section doesn't exist $output .= "<p>The requested section wasn't found</p>"; } // width & height $width = (!isset($width) || !is_numeric($width)) ? ( 550 ) : intval($width); $height = (!isset($height)|| !is_numeric($height)) ? ( 420 ) : intval($height); $output .= <<<_SCRIPT<script type="text/javascript">/* <![CDATA[ */ $(document).ready( function () { $('.cboxOnLoad').colorbox({ inline: true, href: '#colorbox_section', innerWidth: $width, innerHeight: $height, maxWidth: "98%", maxHeight: "98%", }); $('a.cboxOnLoad').click(); });/* ]]> */</script>_SCRIPT; // BOX TITLE // @parameter: 'title' // @required: no if(isset($title) && is_string($title)){ $title = sprintf(' title="%s"', $title); $title = str_replace('"','', $title); }else { $title = ''; } $output .= '<a class="colorbox"></a>'; // needed to initialize Maverik's cBox snippet $output .= '<a class="cboxOnLoad" '.$title.' href="#"></a>';}return $output;?>