1
Hello
I have A module with one Block , this Module For ShoutBox ,
the block Shows the Messages , Has One Option to set How many Message the ShoutBox Shows up ..
I intergated to the Block Badword filter .. to enable or disable the Bad word filter i use .
$Badwordfilter = 0;
0 for Off 1 for on
I need to make this Option Done from the Blocks on the Control Module , when click Edit block and there be able set it to 0 or 1 instaed editing the File from ftp .
this the block after i edited it..
include("../../../mainfile.php");
include_once XOOPS_ROOT_PATH."/modules/message/send.textsanitizer.php";
function b_send_blocks_show($options) {
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsTheme;
$block = array();
$myts =& sendTextSanitizer::getInstance();
$sql=$xoopsDB->query("select count(xid) from ".$xoopsDB->prefix("send"));
include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
list($numrows) = $xoopsDB->fetchRow($sql);
$result = $xoopsDB->query("SELECT name, message, submitter, ip, date FROM ".$xoopsDB->prefix("message")." order by xid desc limit ".$options[1]."");
while($myrow = $xoopsDB->fetchArray($result)){
$message= array();
$Badwordfilter = 0; // on or off
$message['name'] = $myts->htmlSpecialChars($myrow['name']);
$message['comment'] = $myts->makeTareaData4Show(SmartCensor($myrow['comment'], $Badwordfilter),0);
$message['date'] = formatTimestamp($myrow['date'],'m');
$block['lang_name'] = _MB_MESSAGENAME;
$block['lang_mesage'] = _MB_MESSAGE_COMMENT;
$block['lang_date'] = _MB_MESSAGEDATE;
$block['lang_submit'] = _MB_MESSAGESUBMIT;
$block['lang_guestuser'] = _MB_MESSAGEGUESTUSER;
$block['message'][] = $message;
}
return $block;
}
function b_message_blocks_edit($options) {
$form = ""._MB_MESSAGE_DISP." ";
$form .= ";
$form .= "date'";
$form .= " />";
$form .= ".$options[1]."' /> "._MB_MESSAGE_NUM."";
return $form;
}
?>
this the part for the block in xoops_version.php
// Blocks
$modversion['blocks'][1]['file'] = "message_blocks.php";
$modversion['blocks'][1]['name'] = _MI_MESSAGE_TITLE;
$modvertion['blocks'][1]['description'] = "MESSAGE";
$modversion['blocks'][1]['show_func'] = "b_message_blocks_show";
$modversion['blocks'][1]['edit_func'] = "b_message_blocks_edit";
$modversion['blocks'][1]['can_clone'] = true ;
$modversion['blocks'][1]['options'] = "date|10|19";
$modversion['blocks'][1]['template'] = 'message_blocks.html';