Example #1
0
 public function setUrl($url)
 {
     if ($url != $this->val('alias_url')) {
         $a = new Alias($this->db);
         $url = Alias::generateAliasUrl(myTrim($url));
         $new_url = $url;
         $a->loadByUrl($new_url);
         $counter = 0;
         while ($a->is_loaded && $a->val('alias_id') != $this->val('alias_id')) {
             $counter += 1;
             $new_url = $url . '-' . $counter;
             $a->loadByUrl($new_url);
         }
         $this->data['alias_url'] = $new_url;
     }
 }
Example #2
0
            $master_template = 'partials/' . $path[1];
            $page_template = 'partials/' . $path[1];
            break;
            // CUSTOMER SECTION
        // CUSTOMER SECTION
        default:
            $theme = 'parfumerie';
            $custAuth = new CustomerAuthentication($db);
            $pg = $path[0];
            if (strlen($pg) > 0) {
                if (file_exists($home_dir . 'views/pages/' . $pg . '.v.php') || file_exists($home_dir . 'controllers/pages/' . $pg . '.c.php')) {
                    $page_template = 'pages/' . $pg;
                } else {
                    require_once $home_dir . 'models/alias.m.php';
                    $alias = new Alias($db);
                    $alias->loadByUrl($raw_path);
                    if ($alias->is_loaded) {
                        $path = explode('/', $alias->val('alias_path'));
                        $page_template = 'pages/' . $path[0];
                        $raw_path = $alias->val('alias_path');
                    } else {
                        $page_template = 'pages/notfound';
                    }
                }
            } else {
                $page_template = 'pages/front';
            }
    }
}
// run controller code if exists
$controller_path = $page_template . '.c.php';