Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help fixing error!
07-13-2012, 11:43 AM (This post was last modified: 07-13-2012 11:45 AM by trytofly.)
Post: #1
Need help fixing error!
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!
Find all posts by this user
Quote this message in a reply
07-13-2012, 02:11 PM
Post: #2
RE: Need help fixing error!
(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']] ) )
{

................................................................... 
Find all posts by this user
Quote this message in a reply
07-13-2012, 05:29 PM (This post was last modified: 07-15-2012 03:47 PM by gerard.)
Post: #3
RE: Need help fixing error!
removed
Find all posts by this user
Quote this message in a reply
07-15-2012, 10:21 AM (This post was last modified: 07-15-2012 10:23 AM by trytofly.)
Post: #4
RE: Need help fixing error!
(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!!
Find all posts by this user
Quote this message in a reply
07-16-2012, 06:29 AM (This post was last modified: 07-16-2012 06:42 AM by trytofly.)
Post: #5
RE: Need help fixing error!
(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
Find all posts by this user
Quote this message in a reply
07-16-2012, 07:51 AM (This post was last modified: 07-16-2012 08:07 AM by trytofly.)
Post: #6
RE: Need help fixing error!
(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;
    }
Find all posts by this user
Quote this message in a reply
07-16-2012, 08:09 AM
Post: #7
RE: Need help fixing error!
(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 ?
Find all posts by this user
Quote this message in a reply
07-16-2012, 11:20 AM (This post was last modified: 07-16-2012 11:32 AM by trytofly.)
Post: #8
RE: Need help fixing 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!


Attached File(s)
.zip  import_export.zip (Size: 10.48 KB / Downloads: 10)
Find all posts by this user
Quote this message in a reply
07-16-2012, 01:15 PM
Post: #9
RE: Need help fixing error!
(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


Attached File(s)
.zip  import_export.zip (Size: 8.44 KB / Downloads: 9)
Find all posts by this user
Quote this message in a reply
07-16-2012, 01:24 PM
Post: #10
RE: Need help fixing error!
(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
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | Homepage | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication