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
// For example:$text_content = $_POST['content'];$droplets_allow = array('[[gallery]]','[[droplet]]','[[droplet2]]');if ($group_id == 2) { // Only activate and use droplets from $droplet_allow array, and other print only as text, or replace [[loginBox]] with [loginBox] or whatever.. ???????????????????????? What would be the code for this ?}
$get_droplet = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets where active=1 ORDER BY name");
$get_droplet = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets where active=1 AND admin_view=0 ORDER BY name");
[[ in <span>[</span>[ ------ this could do the trick..
$text_content = $_POST['content'];$droplets_allow = array('[[gallery]]','[[droplet]]','[[droplet2]]');$droplets_deny = array('[[loginBox]]','[[systemDroplet1]]');// for example: when droplet from deny array above appears, replace [[ with <span>[</span>[preg_replace($droplets_deny, ??? which code to put here to replace [[ WITH <span>[</span>[ ???? , $text_content);
<?php// Get pages and put them into the pages list$template->set_block('main_block', 'droplets_list_block', 'page_list');$get_droplet = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_droplets where active=1 ORDER BY name");if($get_droplet->numRows() > 0) { // Loop through pages $list = ""; while($droplet = $get_droplet->fetchRow()) { // method page_is_visible was introduced with WB 2.7 $title = stripslashes($droplet['name']); $desc = stripslashes($droplet['description']); $comm = stripslashes($droplet['comments']); $template->set_var('TITLE', $title); $template->set_var('DESC', $desc); $list .= "<div id='".$title."' class='hidden'><b>".$title.": </b> ".$desc."<br>".$comm."</div>"; $template->parse('page_list', 'droplets_list_block', true); }} else { $template->set_var('TITLE', 'None found'); $template->parse('page_list', 'droplets_list_block', false);}$template->set_var('LIST', $list);$template->set_var("CHARSET", defined('DEFAULT_CHARSET') ? DEFAULT_CHARSET : 'utf-8' );// Parse the template object?>
<?php// Get pages and put them into the pages list$template->set_block('main_block', 'droplets_list_block', 'page_list');$sql = 'SELECT `name`,`description`,`comments` ';$sql .= 'FROM `'.TABLE_PREFIX.'mod_droplets` ';$sql .= 'WHERE `active`=1'.(($admin->ami_group_member('1')) ? '' : ' AND `admin_view`=0').' ';$sql .= 'ORDER BY `name`';$list = "";if( ($get_droplet = $database->query($sql)) ) { // Loop through the list while($droplet = $get_droplet->fetchRow()) { // method page_is_visible was introduced with WB 2.7 $title = stripslashes($droplet['name']); $desc = stripslashes($droplet['description']); $comm = stripslashes($droplet['comments']); $template->set_var('TITLE', $title); $template->set_var('DESC', $desc); $list .= "<div id='".$title."' class='hidden'><b>".$title.": </b> ".$desc."<br>".$comm."</div>"; $template->parse('page_list', 'droplets_list_block', true); }}if( $list == '') { $template->set_var('TITLE', 'None found'); $template->parse('page_list', 'droplets_list_block', false);}$template->set_var('LIST', $list);$template->set_var("CHARSET", defined('DEFAULT_CHARSET') ? DEFAULT_CHARSET : 'utf-8' );// Parse the template object?>
$text_content = $_POST['content'];$droplets_allow = array('[[gallery]]','[[droplet]]','[[droplet2]]');$droplets_deny = array('[[loginBox]]','[[systemDroplet1]]');preg_replace($droplets_deny, ??? which code to put here to replace [[ WITH <span>[</span>[ ???? , $text_content);
I would change the 'forbidden' dropletnames to something less guesseable something like [[This_is_a_loginbox_wich_only_I_know_the_existence_off]]
<?php// Update the mod_wysiwygs table with the contentsif(isset($_POST['content'.$section_id])) { $content = $admin->add_slashes($_POST['content'.$section_id]); // searching in $text will be much easier this way $text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0); $query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'"; $database->query($query); }?>
<?php// Include the WB functions filerequire_once(WB_PATH.'/framework/functions.php');// Update the mod_wysiwygs table with the contentsif(isset($_POST['content'.$section_id])) { $content = $_POST['content'.$section_id]; $denyDroplets = array(); $sql = 'SELECT `name` FROM `'.TABLE_PREFIX.'mod_droplets` '; $sql .= 'WHERE `active`=1'.(($admin->ami_group_member('1')) ? '' : ' AND `admin_view`=0'); if( ($droplets = $database->query($sql)) ) { while( $droplet = $droplets->fetchRow()){ // <<<< typo fixed $denyDroplets[] = $droplet['name']; } } if(sizeof($denyDroplets) > 0){ $denyDroplets = implode('|',$denyDroplets); $pattern = '/\[\[('.$denyDroplets.').*?\]\]/i'; $content = preg_replace($pattern, '', $content); } $content = $admin->add_slashes($content); // searching in $text will be much easier this way $text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0); $query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'"; $database->query($query); }?>