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
What else can i try?Tnx, Housy
<?php// here your section $section_id = 65;// query for section call$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = '$section_id' ");// query to check if section exists and output with fitting mod view.phpif($query_sections->numRows() > 0) { $section = $query_sections->fetchRow(); $section_id = $section['section_id']; $module = $section['module']; require(WB_PATH.'/modules/'.$module.'/view.php');} ?>
Quote from: Housy on May 31, 2010, 01:03:49 AMWhat else can i try?Tnx, Housyhi Housy,try this one in code section or in your template... Code: [Select]<?php// here your section $section_id = 65;// query for section call$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = '$section_id' ");// query to check if section exists and output with fitting mod view.phpif($query_sections->numRows() > 0) { $section = $query_sections->fetchRow(); $section_id = $section['section_id']; $module = $section['module']; require(WB_PATH.'/modules/'.$module.'/view.php');} ?>best regards martin
Code: [Select] <!-- global block starts here --> <div id="topleft"> <!-- change to your favorite css #id --> <?php ob_start(); page_content(2); //INFOBOX PAGE CONTENT 2 in my case $topl=ob_get_contents(); ob_end_clean(); if ($topl=="") { $section_id = 65; // ID from the section that stays always if pagecontent 2 has no content $query_sec = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = '$section_id' "); if($query_sec->numRows() > 0) { $section = $query_sec->fetchRow(); $section_id = $section['section_id']; $module = $section['module']; require(WB_PATH.'/modules/'.$module.'/view.php'); } } else { echo '<div align="center">'; echo $topl; echo '</div>'; } ?> </div> <!-- end of the global block -->Hi guys,i use this piece of code for global blocks! I've got it from vyni! The Trick is that you can have default view for a global block (with the section_id you choose) and if you want another content on one or more sites only set up a section and set it up to the content of the global block - and on this page the content is like you want it!regards martin
<!-- global block starts here --> <div id="topleft"> <!-- change to your favorite css #id --> <?php ob_start(); page_content(2); //INFOBOX PAGE CONTENT 2 in my case $topl=ob_get_contents(); ob_end_clean(); if ($topl=="") { $section_id = 65; // ID from the section that stays always if pagecontent 2 has no content $query_sec = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = '$section_id' "); if($query_sec->numRows() > 0) { $section = $query_sec->fetchRow(); $section_id = $section['section_id']; $module = $section['module']; require(WB_PATH.'/modules/'.$module.'/view.php'); } } else { echo '<div align="center">'; echo $topl; echo '</div>'; } ?> </div> <!-- end of the global block -->
Hi!If your server does not allow the include-command in your template's index.php<?php include (WB_URL."/pages/blocks/block1.php"); ?> due to security-settings, try this instead:<?php $handle = fopen (WB_URL."/pages/blocks/block1.php", "r");while (!feof($handle)) { $buffer = fgets($handle, 4096); print_r ($buffer); } ?>Works well greets masju