GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Feb-2004, 21:12
BRuTAL_HiTMAN_ BRuTAL_HiTMAN_ is offline
New Member
 
Join Date: Feb 2004
Posts: 9
BRuTAL_HiTMAN_ is on a distinguished road

Fatal Error message...


Ok, i have IBP v 1.2, and i just installed the signature randomizer, and when you click my controls/edit signature, i get this:

"Fatal error: Call to undefined function: sig_randomizer_signature() in /home/ben/public_html/forums/sources/Usercp.php on line 1871"


help me plz...
  #2  
Old 29-Feb-2004, 21:15
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Check around the code you inserted and make sure that it aligns up with the code you were supposed to install or paste in their.

Basically, it looks like you forgot to declare a specific function. You might need to change something inside your config file.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #3  
Old 29-Feb-2004, 21:17
BRuTAL_HiTMAN_ BRuTAL_HiTMAN_ is offline
New Member
 
Join Date: Feb 2004
Posts: 9
BRuTAL_HiTMAN_ is on a distinguished road

i did this..


i took this:

PHP Code:

function signature()
     {
         global $ibforums, $DB, $std, $print;
         
        $t_sig = $this->parser->unconvert( $this->member['signature'], $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html'] );
        
        $ibforums->lang['the_max_length'] = $ibforums->vars['max_sig_length'] ? $ibforums->vars['max_sig_length'] : 0;
        
        if ( $ibforums->vars['sig_allow_html'] == 1 )
        {
            $this->member['signature'] = $this->parser->parse_html($this->member['signature'], 0);
        }
         
         $this->output .= $this->html->signature($this->member['signature'], $t_sig, $std->return_md5_check());
         
         $this->page_title = $ibforums->lang['t_welcome'];
         $this->nav        = array( "<a href='".$this->base_url."act=UserCP&amp;CODE=00'>".$ibforums->lang['t_title']."</a>" );
         
     }" 



and replaced it with this:

PHP Code:

// Start SigRandomizer 2
     function signature() {
         global $ibforums, $DB, $std, $print;
        
        $ibforums->lang['the_max_length'] = $ibforums->vars['max_sig_length'] ? $ibforums->vars['max_sig_length'] : 0;

        // Build group perms and check if we do SigRandomizer
        $grps = explode(",", $ibforums->vars['sig_randomizer_grps']);
        $enable = ($ibforums->vars['sig_randomizer_max'] > 1 || strlen($ibforums->vars['sig_randomizer_max']) == 0)? true: false;
        $enable = ($enable && (in_array($ibforums->member['mgroup'], $grps) || $grps[0] == '*'))? true: false;
        if($ibforums->vars['sig_randomizer'] && $enable){
            // Prepare signatures
            $sigs = preg_split("/\?=\*=\?/", $this->member['signature']);
            $t_sigs = Array();
            $i = 0;
            foreach($sigs as $sig){
                $t_sigs[$i] = $this->parser->unconvert( $sig, $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html'] );
                $i++;
            }
                        
            // Delete
            if(!empty($ibforums->input['del'])){
                $newsigs = Array();
                foreach($sigs as $k => $v){
                    if($k != $ibforums->input['del'] - 1)
                        $newsigs[] = $v;
                }
                $sigs = $newsigs;
                $newsigs = implode("?=*=?", $newsigs);
                $newsigs = preg_replace( "/'/", "\\'", $newsigs);
                $DB->query("UPDATE ibf_members SET signature='".$newsigs."' WHERE id ='".$ibforums->member['id']."'");
            }

            // Edit
            if(!empty($ibforums->input['edit'])){
                if($ibforums->input['edit'] == 'new'){
                    $t_sig = "";
                }
                else {
                    $t_sig = $t_sigs[$ibforums->input['edit'] - 1];
                    $t_sigs[$ibforums->input['edit'] - 1] = "";
                }
                $t_sigs = implode("?=*=?", $t_sigs);
                    
                 $this->output .= $this->html->sig_randomizer_edit(&$t_sig, &$t_sigs, $ibforums->input['edit'], $std->return_md5_check());
            }
            // Show list
            else {
                // Prepare links
                if(count($sigs) < $ibforums->vars['sig_randomizer_max'] || strlen($ibforums->vars['sig_randomizer_max']) == 0){
                    $links['new'] = $this->base_url . "&act=UserCP&CODE=22&edit=new";
                    $links['new'] = "<a href='{$links['new']}'><b>{$ibforums->lang['cp_sig_randomizer_new']}</b></a>";
                }
                $links['edit'] = $this->base_url . "&act=UserCP&CODE=22&edit=";
                $links['del'] = $this->base_url . "&act=UserCP&CODE=22&del=";
                // Start skin
                $max = (strlen($ibforums->vars['sig_randomizer_max']) == 0)? $ibforums->lang['cp_sig_randomizer_unlimited']: $ibforums->vars['sig_randomizer_max'];
                $ibforums->lang['cp_sig_randomizer_status'] = 
                    sprintf($ibforums->lang['cp_sig_randomizer_status'], count($sigs), $max);
                 $this->output .= $this->html->sig_randomizer_start(&$links);
                // Process signatures
                foreach($sigs as $i => $sig){
                    if($ibforums->vars['sig_allow_html'] == 1)
                        $sig = $this->parser->parse_html($sig, 0);
                     $this->output .= $this->html->sig_randomizer_signature(&$sig, &$links, $i + 1);
                }
            }
        }
        else if($ibforums->vars['sig_randomizer'] && $ibforums->vars['sig_randomizer_max'] === '0'){
            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'sig_randomizer_disabled' ) );
        }
        else {
            $sigs = preg_split("/\?=\*=\?/", $this->member['signature']);
            $this->member['signature'] = $sigs[0];
            $t_sig = $this->parser->unconvert( $this->member['signature'], $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html'] );
            if($ibforums->vars['sig_allow_html'] == 1)
                $this->member['signature'] = $this->parser->parse_html($this->member['signature'], 0);
             $this->output .= $this->html->signature($this->member['signature'], $t_sig, $std->return_md5_check());
        }

         $this->page_title = $ibforums->lang['t_welcome'];
         $this->nav        = array( "<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" );
     }
    // End SigRandomizer 2 


Last edited by BRuTAL_HiTMAN_ : 29-Feb-2004 at 21:25. Reason: using PHP tag..
  #4  
Old 29-Feb-2004, 21:28
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
is sig_randomizer_signature declared anywhere inside other code that you might have pasted?

Be my only other suggestion until someone who knows mroe about IPB comes along.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #5  
Old 01-Mar-2004, 08:02
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Quote:
Originally Posted by BRuTAL_HiTMAN_
... i just installed the signature randomizer, and when you click my controls/edit signature, i get this:

"Fatal error: Call to undefined function: sig_randomizer_signature() in /home/ben/public_html/forums/sources/Usercp.php on line 1871"


help me plz...

This is easy... everytime you see an error like this it simply means that PHP include file that has the FUNCTION sig_randomizer_signature() was NOT included anywhere in the code.

Just use your IDE's Search Tool to look where the function was defined i.e. search for the string function sig_randomizer_signature and then note the file that it reports back. Just put a line to the top of the FAILING script e.g.

PHP Code:

<?php

// to correct the missing function error
include_once( './path/to/the/file_with_the_missing_function.inc.php' );

// the rest of the original script

?>

  #6  
Old 01-Mar-2004, 10:59
BRuTAL_HiTMAN_ BRuTAL_HiTMAN_ is offline
New Member
 
Join Date: Feb 2004
Posts: 9
BRuTAL_HiTMAN_ is on a distinguished road
Quote:
Originally Posted by JdS
This is easy... everytime you see an error like this it simply means that PHP include file that has the FUNCTION sig_randomizer_signature() was NOT included anywhere in the code.

Just use your IDE's Search Tool to look where the function was defined i.e. search for the string function sig_randomizer_signature and then note the file that it reports back. Just put a line to the top of the FAILING script e.g.

PHP Code:

<?php

// to correct the missing function error
include_once( './path/to/the/file_with_the_missing_function.inc.php' );

// the rest of the original script

?>



im dont really understand what i should do to fix this...
  #7  
Old 01-Mar-2004, 11:11
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
It's OK, I'll try again...

Can you ask the person who wrote this hack: Where is the FUNCTION sig_randomizer_signature() defined?

Or if you you can show me the link to this hack, I will take a look at it for you tomorrow.
  #8  
Old 01-Mar-2004, 11:22
BRuTAL_HiTMAN_ BRuTAL_HiTMAN_ is offline
New Member
 
Join Date: Feb 2004
Posts: 9
BRuTAL_HiTMAN_ is on a distinguished road
Quote:
Originally Posted by JdS
It's OK, I'll try again...

Can you ask the person who wrote this hack: Where is the FUNCTION sig_randomizer_signature() defined?

Or if you you can show me the link to this hack, I will take a look at it for you tomorrow.

PHP Code:

foreach($sigs as $i => $sig){
                    if($ibforums->vars['sig_allow_html'] == 1)
                        $sig = $this->parser->parse_html($sig, 0);
                     $this->output .= $this->html->sig_randomizer_signature(&$sig, &$links, $i + 1);
                }
            }
        } 


  #9  
Old 01-Mar-2004, 11:41
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Yes, I saw that... this is USING the custom function named sig_randomizer_signature().

Before you USE a custom function in your PHP scripts, you have to CREATE or DEFINE it first...

So let's say I want to use a custom function named color_me_red(), first I CREATE or DEFINE the function; like this:

PHP Code:

<?php

// Creating a function...

function color_me_red( $string )
{
  return( "<span style=\"color:red;\">$string</span>" ); 
}

// NOW, if I want to USE the function in my scripts; I do this...

$black = 'J de Silva';
$colored_red = color_me_red( $black );

// $colored_red === '<span style="color:red;">J de Silva</span>'
?>


So... now look for the code CREATING the function sig_randomizer_signature()!
  #10  
Old 01-Mar-2004, 21:27
BRuTAL_HiTMAN_ BRuTAL_HiTMAN_ is offline
New Member
 
Join Date: Feb 2004
Posts: 9
BRuTAL_HiTMAN_ is on a distinguished road
i fixed it, see, most of the steps where just copying from another notepad file, and i saw this:

</table>
EOF;
}

at the end of the size of my files, and i didn't even pay attention to the scroll bar, and i just copioed and pasted from that point and up, i was just rushing through it...
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:00.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.