
"Fatal error: Cannot redeclare smart() (previously declared
thats when Having same block twice .
is there a workaround way to use the same function in One File twice , without renam the function
include("../../../mainfile.php");
include_once XOOPS_ROOT_PATH."/modules/message/message.textsanitizer.php";
function b_message_blocks_show($options) {
global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsTheme;
$block = array();
$myts =& messageTextSanitizer::getInstance();
$sql=$xoopsDB->query("select count(xid) from ".$xoopsDB->prefix("message"));
include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
list($numrows) = $xoopsDB->fetchRow($sql);
$result = $xoopsDB->query("SELECT name, comment, submitter, ip, date FROM ".$xoopsDB->prefix("message")." order by xid desc limit ".$options[1]."");
include XOOPS_ROOT_PATH."/modules/message/badwords.php";
while($myrow = $xoopsDB->fetchArray($result)){
$message= array();
$Badwordfilter = $xoopsModuleConfig['message']; //
$message['name'] = $myts->htmlSpecialChars($myrow['name']);
$message['comment'] = $myts->makeTareaData4Show(SmartCensor($myrow['comment'], $Badwordfilter),0);
$message['date'] = formatTimestamp($myrow['date'],'m');
$block['lang_xname'] = _MB_MESSAGENAME;
$block['lang_xcomment'] = _MB_MESSAGE_COMMENT;
$block['lang_xdate'] = _MB_MESSAGEDATE;
$block['lang_xsubmit'] = _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;
}
?>
$modversion['config'][1]['name'] = 'message';
$modversion['config'][1]['title'] = '_MI_MESAAGE';
$modversion['config'][1]['description'] = '';
$modversion['config'][1]['formtype'] = 'textbox';
$modversion['config'][1]['valuetype'] = 'int';
$Badwordfilter = $xoopsModuleConfig['message'];
$Badwordfilter = 0;
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;
}
?>
// 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';
include("../../../mainfile.php");
include '../../../include/cp_header.php';
if ( file_exists(XOOPS_ROOT_PATH."/modules/call/language/".$xoopsConfig['language']."/main.php") )
{
include_once(XOOPS_ROOT_PATH."/modules/call/language/".$xoopsConfig['language']."/main.php");
}
else
{
include_once(XOOPS_ROOT_PATH."/modules/call/language/english/main.php");
}
echo "";
xoops_cp_footer();
?>
$modversion['config'][1]['name'] = 'verifytype';
$modversion['config'][1]['title'] = '_MI_VERTYPE';
$modversion['config'][1]['description'] = '_MI_VERTYPEDSC';
$modversion['config'][1]['formtype'] = 'yesno';
$modversion['config'][1]['valuetype'] = 'int';
$modversion['config'][1]['default'] = '0';