private function getUrl($blog = null) { $url = false; if (!$blog) { $urls = blogBlog::getUrl(false, true); } else { if (isset($blog['status']) && $blog['status'] == blogBlogModel::STATUS_PUBLIC) { $urls = blogBlog::getUrl($blog, true); } } if (isset($urls) && is_array($urls)) { $url = array_shift($urls); } return $url; }
/** * Get settlements of blog without blog url (aka slug) * * @param array $blog * @return array array of key-value storages where 'single' key means if only this blog settled to url and 'url' means pure url (without slug) */ public static function getPureSettlements($blog) { if (isset($blog['url'])) { unset($blog['url']); } $settlements = array(); $urls = blogBlog::getUrl($blog, true); foreach ($urls as &$url) { if (strpos($url, '%blog_url%') === false) { $settlements[] = array('single' => true, 'url' => $url); } else { $settlements[] = array('single' => false, 'url' => str_replace('%blog_url%/', '', $url)); } } unset($url); return $settlements; }
public function url() { return blogBlog::getUrl(); }