101
xsell
Re: Blocks (anywhere) 2 Quastions
  • 2009/9/3 23:26

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


I see where is the error Now , there seem duplicate function call ,
"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




102
xsell
Blocks (anywhere) 2 Quastions
  • 2009/9/3 20:58

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Hello
i do not know where to get support for Blocks anywhere plugin. so had to ask here
1- i have disabled block . but when i use the block anywhere plugin to show the block some where in my site . It Shows up , dont seem the plugin Respect the Stats of the Block if Disabled or Enabled .

2- i have block enabled on the Center of my Site . and tried to use the plug in to put the same block at the site Header , For Some reason the Site Breaks , won't Show any thing until Disable the block from the center of my site or remove <{block id=1}> from my site header.




103
xsell
Re: adding Function to Block
  • 2009/8/29 18:06

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Thx Man ,

But it did not work , when edited like u Did , i get The Same thing in the Block Option but the Fild Box filled already with word 'date' .

the code i send first has errors , this is the Working Code , the Module Has only this block .
<?php
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."&nbsp;";
    
$form .= "<input type='hidden' name='options[]' value='";
    
$form .= "date'";
    
$form .= " />";
    
$form .= "<input type='text' name='options[]' value='".$options[1]."' />&nbsp;"._MB_MESSAGE_NUM."";
    return 
$form;
}

?>


2- i tried to do this .
edited xoops_version.php to look like
$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';


in the block i edited it to
$Badwordfilter $xoopsModuleConfig['message'];


that did not work .. Look stupid .. i'm not any of php Guy .. just learning lol



104
xsell
adding Function to Block
  • 2009/8/28 20:43

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 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..

<?php
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."&nbsp;";
    
$form .= "<input type='hidden' name='options[]' value='";
    
$form .= "date'";
    
$form .= " />";
    
$form .= "<input type='text' name='options[]' value='".$options[1]."' />&nbsp;"._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';



105
xsell
Re: Censored Word
  • 2009/8/27 16:35

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Thx trabis , Working On it Now.



106
xsell
Censored Word
  • 2009/8/27 8:09

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


what is the functions XOOPS uses for Censoring bad words.. i need to adopte it for Custom module..



107
xsell
Re: Intergate Xoops Captcha
  • 2009/8/26 5:13

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Thx Ghia i Decided to use stand alone Captcha file.



108
xsell
Re: Intergate Xoops Captcha
  • 2009/8/25 21:05

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Thx Ghia .. i will see that.. But tell me is wiwi module same simplywiki module if Yes .. well nothing about Captcha in the mentioned files



109
xsell
Intergate Xoops Captcha
  • 2009/8/25 8:43

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


Hello
i have this simple Module for a Form to contact me , i need to use XOOPS Captcha with it ,

How ? and I need the Function for xoops_version.php to be able to enable or disable the captcha .. this is the Form .
<?php

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 
"<form action="call.php" method="post">n";
   echo 
"<table class="outer" width="100%" cellspacing="1" cellpadding="0" border="0">n";
   echo 
"<tr>n";
   echo 
"<th>"._MD_call."</th>n";
   echo 
"<th>"._MI_callA."</th>n";
   echo 
"</tr>";
   echo 
"<tr>";
   echo 
"<td class="odd">n";
   echo 
"<input type="text" value="" name="name" size="20" maxlength="20"></td>n";
   echo 
"</td><td>";
   echo 
"<textarea rows=4 cols=75 name=comment wrap=physical></textarea>";

    echo 
"<tr>n";
   echo 
"<td class="odd">n";
   echo 
"<input type="submit" name="submit" value="Send"></p>n";
   echo 
"</table>";
   echo 
"</form>";


  
xoops_cp_footer();
?>


this wht i added to the xoops_version.php
$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';

I just do not know how to make the verifytype Function . in the above form



110
xsell
Re: New modules XSITEMAP by Urbanspaceman
  • 2009/8/23 5:52

  • xsell

  • Quite a regular

  • Posts: 245

  • Since: 2008/9/2 1


thanks Man. keep up the Good work :)




TopTop
« 1 ... 8 9 10 (11) 12 13 14 ... 21 »



Login

Who's Online

243 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 243


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits