/** * Gets the root url for your installation * * @param boolean $with_index true if index.php in the url is needed * @return string */ function osc_base_url($with_index = false) { if (MULTISITE) { $path = osc_multisite_url(); } else { $path = WEB_PATH; } // add the index.php if it's true if ($with_index) { $path .= "index.php"; } return osc_apply_filter('base_url', $path, $with_index); }
/** * Gets the root url of oc-admin for your installation * * @param boolean $with_index true if index.php in the url is needed * @return string */ function osc_admin_base_url($with_index = false) { $path = ''; if (MULTISITE) { $path = osc_multisite_url(); } else { $path = WEB_PATH; } $path .= "oc-admin/"; if ($with_index) { $path .= "index.php"; } return $path; }
function __construct() { $this->val = array(); $web_pat = MULTISITE ? osc_multisite_url() : WEB_PATH; $this->name = substr(md5($web_pat), 0, 5); $this->expires = time() + 3600; // 1 hour by default if (isset($_COOKIE[$this->name])) { list($vars, $vals) = explode("&", $_COOKIE[$this->name]); $vars = explode("._.", $vars); $vals = explode("._.", $vals); while (list($key, $var) = each($vars)) { $this->val["{$var}"] = $vals[$key]; $_COOKIE["{$var}"] = $vals[$key]; } } }