will paid you to fix php errors

Discussion in 'Programming' started by teampower, May 30, 2007.

  1. #1
    I need somoene to help me i just install a new mod and is not working and now when i trie to login to the forums im not enable
    here is what show up

    Fatal error: Call to undefined function: fprintf() in /home/guru/public_html/forums/Sources/PliggBridge.php on line 55
    pm if anyone can help
    here is the forums
    www.forums.guruhit.com
    thanks
     
    teampower, May 30, 2007 IP
  2. smalldog

    smalldog Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    It's better if you will ask here i think... simplemachines.org/community/index.php
     
    smalldog, May 30, 2007 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    fprintf was only introduced in php5 you are probably using a version of php lower than 5 as fprintf isn't contained in an extension but is part of the base php5 build.

    
    if( !function_exists( 'fprintf' ) )
    {
    	function fprintf( $handle, $format )
    	{
    		$argstr = null ;
    		if( ( $args = func_num_args( ) ) >= 3 )
    		{
    			if( is_resource( $handle ) )
    			{
    				for( $start = 2 ; $start < $args; $start++ )
    				{
    					$argstr .= '"'.func_get_arg( $start ).'",';
    				}
    				eval( sprintf( '$data = sprintf("%s", %s );', $format, preg_replace( '~,$~', '', $argstr ) ) );
    				if( $data )
    				{
    					return fwrite( $handle, $data );	
    				}
    			}		
    		}			
    	}
    }
    // just a test
    $handle = fopen('file.txt', 'w+');
    if( fprintf( $handle, 'The name of the programmer is %s and he is a %s', 'Joe', 'Male' ) )
    {	
    	echo file_get_contents( 'file.txt' );
    }
    @fclose( $handle );
    
    PHP:
    Sticking that inside one of your includes should fix that error, however the chances are if the writers depended on one php5 function they will have depended on more, most of which can be rewritten in php, but some cannot, post and lemme know what happens.
     
    krakjoe, May 30, 2007 IP
  4. ccasselman

    ccasselman Peon

    Messages:
    412
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    Joe, has a great post. It sounds like a php verison problem.
     
    ccasselman, May 30, 2007 IP
  5. serialCoder

    serialCoder Guest

    Best Answers:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    yep, i agree, and i second that if there is one php5 specific function there's definitely more
     
    serialCoder, May 31, 2007 IP
  6. teampower

    teampower Well-Known Member

    Messages:
    1,798
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    thanks for all the person who make the mod fix it
     
    teampower, May 31, 2007 IP
  7. w2earn

    w2earn Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    krakjoe,

    I am getting following error

    at

    please help


     
    w2earn, Sep 4, 2007 IP