[support] url() create a strange path

Davide Michel 'ZioBudda' Morelli michel at ziobudda.net
Fri Mar 7 15:46:53 UTC 2008


Hi all. I'm creating a little class for interface Drupal to a internal 
web application (all via php language).

I have created this function (that is a part of a class) and I call it 
from a file called temp/1.php:
 
public function shoplastnews() {
        $this->setDirTheme();
        $view = views_get_view('l1');
        $view->is_cacheable = 0;
        views_sanitize_view($view);
        $tmp2 = views_build_view('items',$view,array(),false,5);
        $ret = array();
        $i = 0;
        foreach($tmp2['items'] as $key => $data) {
            //print_r($data);
            $node = node_load($data->nid);
            $ret[$i]['nid'] = $node->nid;
            $ret[$i]['titolo'] = $node->title;
            $ret[$i]['created'] = $node->created;
            $ret[$i]['link'] = url("node/".$node->nid);
            //$ret[$i]['link'] = l("nnn","node/".$node->nid);   //this 
does not works, too
            $i++;
        }
        $this->resetWd();
        return $ret;
    }       

The function works in right way but not for url() (or the link) function 
where before the right url is prepend  "temp/"  that is the directory 
where my script is running.
Where is my error ?

M.

--
Michel 'ZioBudda' Morelli                       michel at ziobudda.net
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net                         ICQ: 58351764  
http://www.ziobuddalabs.it                      Skype: zio_budda
http://www.ajaxblog.it        			MSN: michel at ziobuddalabs.it                   
						JABBER: michel at gmail.com



More information about the support mailing list