1
onasre
Cant find my Error .
  • 2009/11/29 23:42

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


Hello

I 'm working on a Module , am about done . there is One thing i could not find wht i'm doing wrong for this Block .

The Block is to Enable or disable Anti-spam .

this is the modversion Section

$modversion['blocks'][1]['file'] = "callus_blocks.php";
$modversion['blocks'][1]['name'] = "callus";
$modvertion['blocks'][1]['description'] = "Call us Block";
$modversion['blocks'][1]['show_func'] = "b_callus_blocks_show";
$modversion['blocks'][1]['edit_func'] = "b_callus_blocks_edit";
$modversion['blocks'][1]['options'] = "1|0";
$modversion['blocks'][1]['template'] = 'callus_blocks.html';


this is my Block Content.

function b_callus_blocks_show() {

        
$block['lang_send'] = _MB_CALLUS_SENDMSG;
        
$block['lang_name'] = _MB_CALLUS_MSGNAME;
        
$block['lang_subject'] = _MB_CALLUS_SUBJECT;
        
$block['lang_email'] = _MB_CALLUS_EMAIL;
        
$block['lang_comment'] = _MB_CALLUS_MESSAGE;
         
$block['lang_code'] = _MB_CALLUS_CODE;
         
           
$captcha $options[1];
           
return 
$block;
}

function 
b_callus_blocks_edit() {



    
$form "active anti spam: ;
    if ( 
$options[1] == ) {
        
$form .= " selected";
    }
    
$form .= " />Yes;
    if ( 
$options[1] == ) {
        
$form .= " selected";
    }
    
$form .= " />No";
    return 
$form;
}
?>


Now at the Block Template.

<td> <{if $block.captcha == 1}>td>
<
td><img src="<{$xoops_url}>/modules/callus/captcha_callus.php">td>
tr>
<
tr>
<
td><{$block.lang_code}>:td>
<
td><input type="text" name="captcha_num" size="20" />td>
tr>
<{/if}>


No errors Prints out , but there is error somewhere because the captcha dose Not Show up reagrds the Value (yes , No )

Any Idea

2
trabis
Re: Cant find my Error .
  • 2009/11/29 23:57

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


try this:

function b_callus_blocks_show($options) {

        
$block['lang_send'] = _MB_CALLUS_SENDMSG;
        
$block['lang_name'] = _MB_CALLUS_MSGNAME;
        
$block['lang_subject'] = _MB_CALLUS_SUBJECT;
        
$block['lang_email'] = _MB_CALLUS_EMAIL;
        
$block['lang_comment'] = _MB_CALLUS_MESSAGE;
         
$block['lang_code'] = _MB_CALLUS_CODE;
         
           
$block['captcha'] = $options[0];
           
return 
$block;
}

function 
b_callus_blocks_edit($options) {



    
$form "active anti spam: ;
    if ( 
$options[0] == ) {
        
$form .= " selected";
    }
    
$form .= " />Yes;
    if ( 
$options[0] == ) {
        
$form .= " selected";
    }
    
$form .= " />No";
    return 
$form;
}
?>


and in xoops_version you can change to this:
$modversion['blocks'][1]['file'] = "callus_blocks.php";
$modversion['blocks'][1]['name'] = "callus";
$modvertion['blocks'][1]['description'] = "Call us Block";
$modversion['blocks'][1]['show_func'] = "b_callus_blocks_show";
$modversion['blocks'][1]['edit_func'] = "b_callus_blocks_edit";
$modversion['blocks'][1]['options'] = "0";
$modversion['blocks'][1]['template'] = 'callus_blocks.html';

3
onasre
Re: Cant find my Error .
  • 2009/11/30 0:42

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


Thx Trabis , That worked Perfect , and i see where is the Mistakes i Done , Thank you

Login

Who's Online

223 user(s) are online (139 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

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

Latest GitHub Commits