예제 #1
0
 /** 
  * generate single
  */
 function generateSingleURIFullPath($node_data)
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $fp = $Node->getFullPathDetail($node_data['id']);
     $fullpath = "";
     foreach ($fp as $f) {
         if ($f['node_group'] == 'page') {
             if ($f['uri_title'] != '') {
                 $title = $this->cleanTitle($f['uri_title']);
             } else {
                 $title = $this->cleanTitle($f['title']);
             }
             // for blog/news pages prepend date
             if ($f['node_controller'] == 'news') {
                 $title = preg_replace("/-/", "/", substr($f['created'], 0, 10)) . "/{$title}";
             }
             if ($fullpath == '') {
                 $fullpath = $title . $fullpath;
             } else {
                 $fullpath = $title . str_replace('/', $this->conf['delimiter'], $fullpath);
             }
             if ($this->conf['hash'] == true) {
                 $fullpath = '/' . sprintf('%08X', crc32($fullpath));
             } else {
                 $fullpath = '/' . $fullpath;
             }
         }
         if (!preg_match("/" . $this->conf['append'] . "\$/", $fullpath)) {
             $fullpath = $fullpath . $this->conf['append'];
         }
     }
     return $fullpath;
 }