Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/10/2012, 11:31
miguelruso
 
Fecha de Ingreso: octubre-2012
Ubicación: Corrientes
Mensajes: 2
Antigüedad: 11 años, 6 meses
Puntos: 0
Parse error: syntax error, unexpected T_RETURN, expecting T_WHILE

Hola, necesito ayuda, no encuentro el error o no se cual es el error.
Sale error con return y while:

Parse error: syntax error, unexpected T_RETURN, expecting T_WHILE

Este es el codigo:

Código PHP:
    public function getnavbarlinks$type )
    {
        global 
$db;
        global 
$crt_lang;
        
$result fetchAssocList"select ".TABLE_CUSTOM_PAGES.".*, ".TABLE_CUSTOM_PAGES."_lang.title from ".TABLE_CUSTOM_PAGES." LEFT JOIN ".TABLE_CUSTOM_PAGES."_lang on ".TABLE_CUSTOM_PAGES.".`id` = ".TABLE_CUSTOM_PAGES."_lang.`id` where ".TABLE_CUSTOM_PAGES.".navlink='{$type}' and read_only=0 and active=1 and `lang_id`='{$crt_lang}' order by `order_no`" );
        
$no count$result );
        
$i 0;
        while ( 
$i $no )
        {
            
$result[$i]['moved'] = 0;
            
$result[$i]['parent'] = 0;
            
$result[$i]['str'] = "";
            
$result[$i]['title'] = clean$result[$i]['title'] );
            
$result[$i]['url_title'] = _urlencode$result[$i]['title'] );
            
$result[$i]['level'] = 1;
            ++
$i;
        }
        
$found 1;
        do
        {
            if ( 
$found )
            {
                
$found 0;
                
$i 0;
                do
                {
                } while ( !( 
$i $no ) );
                if ( 
$result[$i]['parent_id'] && !$result[$i]['moved'] )
                {
                    
$found 1;
                    
$element $result[$i];
                    
array_splice$result$i);
                    
$found 0;
                    
$level 1;
                    
$j 0;
                    while ( 
$j $no && !$found )
                    {
                        if ( 
$result[$j]['id'] == $element['parent_id'] )
                        {
                            
$pos_parent $j;
                            
$pos $j 1;
                            while ( 
$pos $no && $result[$pos]['parent_id'] == $element['parent_id'] && $result[$pos]['order_no'] < $element['order_no'] )
                            {
                                ++
$pos;
                                if ( 
$pos $no && $result[$pos]['parent_id'] == $result[$pos 1]['id'] )
                                {
                                    
$p $result[$pos]['parent_id'];
                                    do
                                    {
                                        if ( 
$pos $no && $result[$pos]['parent_id'] == $p )
                                        {
                                            ++
$pos;
                                        }
                                    } while ( 
);
                                }
                            }
                            
$ss $result[$pos_parent]['str'];
                            
$result[$pos_parent]['parent'] = 1;
                            
$found 1;
                            
$level $result[$pos_parent]['level'];
                        }
                        ++
$j;
                    }
                    
array_splice$result$pos0, array( $element ) );
                    
$result[$pos]['str'] = $ss."&nbsp;&nbsp;&nbsp;";
                    
$result[$pos]['moved'] = 1;
                    
$result[$pos]['level'] = $level 1;
                    
$j 0;
                    while ( 
$j $no )
                    {
                        if ( 
$result[$j]['parent_id'] == $element['id'] )
                        {
                            
$result[$j]['moved'] = 0;
                        }
                        ++
$j;
                    }
                }
                if ( 
$result[$i]['parent_id'] == )
                {
                    
$result[$i]['str'] = "";
                }
                ++
$i;
            } while ( 
);
        }
        return 
$result;
    } 
El error sale en la line donde esta return $result; al final del código.

Muchas Gracias