AntiWPA Forum

Full Version: Need help fixing error!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Please help me fix that error:

Parse error: syntax error, unexpected T_IF, expecting T_WHILE in /home/gin/public_html/sks/classes/import_export.php on line 864

Code:
public function character_data( $parser, $data )
    {
        if ( !$this->curr_element )
        {
            return;
        }
        $this->whitespace_strip( $data );
        $i = 0;
        while ( $i < count( $this->xml_tags ) )
        {
            if ( $data != "" )
            {
                do
                {
                    if ( !( $this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) )
                    {
                        break;
                    }
                    else
                    {
                        if ( isset( $this->row_array[$this->xml_tags[$i]['field']] ) )
                        {
                            $this->row_array[$this->xml_tags[$i]['field']] .= $data;
                        }
                        else
                        {
                            $this->row_array[$this->xml_tags[$i]['field']] = $data;
                        }
                        break;
                    }
                }
                if ( ( $this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) && !isset( $this->row_array[$this->xml_tags[$i]['field']] ) )
                {
                    $this->row_array[$this->xml_tags[$i]['field']] = "";
                }
                break;
            } while ( 0 );
            ++$i;
        }
    }

line 864: if ( ( $this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) && !isset( $this->row_array[$this->xml_tags[$i]['field']] ) )

Thanks for help!
(07-13-2012 11:43 AM)trytofly Wrote: [ -> ]Hi,

Please help me fix that error:

Parse error: syntax error, unexpected T_IF, expecting T_WHILE in /home/gin/public_html/sks/classes/import_export.php on line 864

Thanks for help!

http://ru2.php.net/manual/en/control-str....while.php

maybe so
PHP Code:
...................................................................
do
{
    if ( !( 
$this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) )
    {
        break;
    }
    else
    {
        if ( isset( 
$this->row_array[$this->xml_tags[$i]['field']] ) )
        {
            
$this->row_array[$this->xml_tags[$i]['field']] .= $data;
        }
        else
        {
            
$this->row_array[$this->xml_tags[$i]['field']] = $data;
        }
        break;
    }
}while ( 
); //THERE
if ( ( $this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) && !isset( $this->row_array[$this->xml_tags[$i]['field']] ) )
{

................................................................... 
removed
(07-13-2012 02:11 PM)2nick Wrote: [ -> ]
(07-13-2012 11:43 AM)trytofly Wrote: [ -> ]Hi,

Please help me fix that error:

Parse error: syntax error, unexpected T_IF, expecting T_WHILE in /home/gin/public_html/sks/classes/import_export.php on line 864

Thanks for help!

http://ru2.php.net/manual/en/control-str....while.php

maybe so
PHP Code:
...................................................................
do
{
    if ( !( 
$this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) )
    {
        break;
    }
    else
    {
        if ( isset( 
$this->row_array[$this->xml_tags[$i]['field']] ) )
        {
            
$this->row_array[$this->xml_tags[$i]['field']] .= $data;
        }
        else
        {
            
$this->row_array[$this->xml_tags[$i]['field']] = $data;
        }
        break;
    }
}while ( 
); //THERE
if ( ( $this->xml_tags[$i]['field'] == $this->curr_element || $this->xml_tags[$i]['alias'] == $this->curr_element ) && !isset( $this->row_array[$this->xml_tags[$i]['field']] ) )
{

................................................................... 

Thanks you fixed this code.

Now i have that :

Warning: implode() [function.implode]: Invalid arguments passed in /home/gint/public_html/sks/classes/import_export.php on line 345

Warning: implode() [function.implode]: Invalid arguments passed in /home/gintaras/public_html/skelbimai/classes/import_export.php on line 355

line 345: $ext_fields = implode( $this->ad_ignore_tags, ",");
line 355: $ext_fields = implode( $this->user_ignore_tags, "," );

Code:
public function getexportcsvfields( $d = "" )
    {
        if ( $d )
        {
            $data = $d;
        }
        else
        {
            $data = $this->data;
        }
        if ( $data == "ad" )
        {
            $listings = new listings( );
            $fields = $listings->getTableCSVFields( );
            $ext_fields = implode( $this->ad_ignore_tags, ",");

            if ( $fields )
            {
                $fields .= ",";
            }
            $fields .= $ext_fields;
            return $fields;
        }
        $users = new users( );
        $fields = $users->getTableCSVFields( );
        $ext_fields = implode( $this->user_ignore_tags, "," );
        if ( $fields )
        {
            $fields .= ",";
        }
        $fields .= $ext_fields;
        return $fields;
    }

idk how to fix that implode error Sad someone can help me? Thanks!!
(07-16-2012 06:10 AM)CarrioS Wrote: [ -> ]Try this-> you had wrong order of array and string in IMPLODE function

PHP Code:
public function getexportcsvfields$d "" )
    {
        if ( 
$d )
        {
            
$data $d;
        }
        else
        {
            
$data $this->data;
        }
        if ( 
$data == "ad" )
        {
            
$listings = new listings( );
            
$fields $listings->getTableCSVFields( );
            
$ext_fields implode(","$this->ad_ignore_tags);

            if ( 
$fields )
            {
                
$fields .= ",";
            }
            
$fields .= $ext_fields;
            return 
$fields;
        }
        
$users = new users( );
        
$fields $users->getTableCSVFields( );
        
$ext_fields implode(",",  $this->user_ignore_tags);
        if ( 
$fields )
        {
            
$fields .= ",";
        }
        
$fields .= $ext_fields;
        return 
$fields;
    } 


Nope not working ...

Warning: implode() [function.implode]: Invalid arguments passed in /home/gint/public_html/sks/classes/import_export.php on line 345

Warning: implode() [function.implode]: Invalid arguments passed in /home/gint/public_html/sks/classes/import_export.php on line 356
(07-16-2012 07:02 AM)CarrioS Wrote: [ -> ]Probably $this->ad_ignore_tags AND $this->user_ignore_tags are both UNDEFINIED


Try and add there this instead of your script.. (TEST ONLY-new variables)

PHP Code:
public function getexportcsvfields$d "" )
    {
        if ( 
$d )
        {
            
$data $d;
        }
        else
        {
            
$data $this->data;
        }
        if ( 
$data == "ad" )
        {
            
$listings = new listings( );
            
$fields $listings->getTableCSVFields( );
            
$ext_fields implode(","$test1=array("value1""value3"));

            if ( 
$fields )
            {
                
$fields .= ",";
            }
            
$fields .= $ext_fields;
            return 
$fields;
        }
        
$users = new users( );
        
$fields $users->getTableCSVFields( );
        
$ext_fields implode(","$test2=array("value2""value4"));
        if ( 
$fields )
        {
            
$fields .= ",";
        }
        
$fields .= $ext_fields;
        return 
$fields;
    } 

with

$ext_fields = implode(",", $test1=array("value1", "value3"));
$ext_fields = implode(",", $test2=array("value2", "value4"));

now is ok! no errors Wink

Code:
public function getimportfields( )
    {
        global $db;
        if ( $this->data == "ad" )
        {
            $result = $db->getTableFields( TABLE_ADS );
        }
        else
        {
            $result = $db->getTableFields( TABLE_USERS );
        }
        return $result;
    }

    public function getimportcsvfields( $d = "" )
    {
        if ( $d )
        {
            $data = $d;
        }
        else
        {
            $data = $this->data;
        }
        if ( $data == "ad" )
        {
            $listings = new listings( );
            $fields = $listings->getTableCSVFields( 0 );
            return $fields;
        }
        $users = new users( );
        $fields = $users->getTableCSVFields( 0 );
        return $fields;
    }
(07-16-2012 08:04 AM)CarrioS Wrote: [ -> ]So $this->ad_ignore_tags AND $this->user_ignore_tags are both UNDEFINIED

How can i fix that error ?
(07-16-2012 08:13 AM)CarrioS Wrote: [ -> ]It should be definied..some text there..
Send me the full file. I dont know where it should be definied..there is problem..

There is it! Thanks you for help!
(07-16-2012 11:20 AM)trytofly Wrote: [ -> ]
(07-16-2012 08:13 AM)CarrioS Wrote: [ -> ]It should be definied..some text there..
Send me the full file. I dont know where it should be definied..there is problem..

There is it! Thanks you for help!

Try please and rate me Big Grin
(07-16-2012 01:15 PM)kingofseo Wrote: [ -> ]
(07-16-2012 11:20 AM)trytofly Wrote: [ -> ]
(07-16-2012 08:13 AM)CarrioS Wrote: [ -> ]It should be definied..some text there..
Send me the full file. I dont know where it should be definied..there is problem..

There is it! Thanks you for help!

Try please and rate me Big Grin

Nope not working Sad

Warning: implode() [function.implode]: Invalid arguments passed in /home/gint/public_html/sks/classes/import_export.php on line 338

Warning: implode() [function.implode]: Invalid arguments passed in /home/gint/public_html/sks/classes/import_export.php on line 348
Pages: 1 2
Reference URL's