Exemplo n.º 1
0
function blog_url($nickname, $return = false)
{
    global $request;
    if (pretty_urls() && environment('subdomains')) {
        global $prefix;
        if (!empty($prefix)) {
            $base = 'http://' . $request->domain;
        } else {
            $base = 'http://' . $nickname . '.' . $request->domain;
        }
    } else {
        $q = '?';
        if (pretty_urls()) {
            $q = '';
        }
        $base = base_url(true) . $q . 'twitter/' . $nickname;
    }
    if (!(substr($base, -1) == '/')) {
        $base = $base . "/";
    }
    if ($return) {
        return $base;
    } else {
        echo $base;
    }
}
Exemplo n.º 2
0
 function breadcrumbs()
 {
     $controller = $this->params['resource'];
     $links = array();
     $html = "";
     $links[] = '<a href="' . $this->base . '">Home</a>';
     if (isset($this->resource) && $this->resource != 'introspection') {
         if (pretty_urls()) {
             $links[] = '<a href="' . $this->base . '' . $this->resource . '">' . ucwords($this->resource) . '</a>';
         } else {
             $links[] = '<a href="' . $this->base . '?' . $this->resource . '">' . ucwords($this->resource) . '</a>';
         }
     }
     if ($this->id != 0 && isset($this->resource) && $this->resource != 'introspection') {
         $links[] = '<a href="' . $this->entry_url($this->id) . '">Entry ' . ucwords($this->id) . '</a>';
     } elseif (isset($this->resource) && $this->new_url()) {
         $links[] = '<a href="' . $this->new_url() . '">New ' . classify($this->resource) . '</a>';
     }
     $html = "<span>";
     foreach ($links as $key => $val) {
         if ($key > 0) {
             $html .= " | ";
         }
         $html .= $val;
     }
     $html .= "</span>";
     return $html;
 }
Exemplo n.º 3
0
function omb_request_munger(&$request, &$route)
{
    global $omb_routes;
    // look for a dbscript omb Route in the POST/GET params
    $params = array_merge($_GET, $_POST);
    foreach ($omb_routes as $func) {
        if (array_key_exists($func, $params)) {
            // if found, lie to the mapper about the URI
            if (pretty_urls()) {
                $request->set('uri', $request->base . "" . $func);
            } else {
                $request->set('uri', $request->base . "?" . $func);
            }
            $request->set('params', array($func));
        }
    }
}