示例#1
0
 function loadPage($page_id)
 {
     $objUrl = new FriendlyurlModel();
     $pageInfo = $this->load($page_id, 'pages');
     if ($pageInfo) {
         $pageInfo['url'] = $objUrl->getUrl($pageInfo['url_id']);
         $pageInfo['meta'] = $objUrl->getMetaData($pageInfo['url_id']);
     }
     return $pageInfo;
 }
示例#2
0
 function assignCommons()
 {
     global $params;
     ##prod info
     $this->assign('ProductTitle', PRODUCT_NAME);
     ##skin dir
     $this->assign('skin', '/' . $this->location . '/views/');
     $this->assign('bento', '/bento/');
     ##global url http/https
     if (empty($_SERVER["HTTPS"])) {
         $this->assign('httpUrl', 'http://' . URL . '/');
     } else {
         $this->assign('httpUrl', 'https://' . URL . '/');
     }
     ##site settings
     $objSettings = Settings::getInstance();
     $settings = $objSettings->getEntrys();
     $this->assign('Settings', $settings);
     $metaTitle = $settings['meta']['default-meta-title'];
     $metaDescription = $settings['meta']['default-meta-description'];
     $metaKeywords = $settings['meta']['default-meta-keywords'];
     if (!empty($params['_urlrequest'])) {
         $objUrls = new FriendlyurlModel();
         $objUrls->parseRequest($params['_urlrequest']);
         $urlMeta = $objUrls->getMetaData($objUrls->url_id);
         if (!empty($urlMeta['title'])) {
             $metaTitle = $urlMeta['title'];
         }
         if (!empty($urlMeta['description'])) {
             $metaDescription = $urlMeta['description'];
         }
         if (!empty($urlMeta['keywords'])) {
             $metaKeywords = $urlMeta['keywords'];
         }
         $this->assign('urlrequest', $params['_urlrequest']);
     }
     ##meta deta
     $this->assign('metaTitle', $metaTitle);
     $this->assign('metaDescription', $metaDescription);
     $this->assign('metaKeywords', $metaKeywords);
     ##global filesystem path
     $this->assign('fsPath', DIR);
     ##user vars
     $objAuthentication = Authentication::getInstance();
     if ($objAuthentication->loggedIn()) {
         $objUser = new UserModel($objAuthentication->user_id);
         $this->assign('loggedIn', true);
         $this->assign('UserInfo', $objUser->getInfo());
     } else {
         $this->assign('loggedIn', false);
     }
 }
示例#3
0
 function loadArticle($article_id)
 {
     $article = $this->load($article_id, 'blog_articles');
     $objUrl = new FriendlyurlModel();
     if (!empty($article)) {
         $article['tags'] = $this->getArticleTags($article['id']);
         $article['url'] = $objUrl->getUrl($article['url_id']);
         $article['category'] = $this->db->getOne("SELECT `title` FROM `blog_categories` WHERE `id` = " . intval($article['category_id']));
         $article['meta'] = $objUrl->getMetaData($article['url_id']);
     }
     return $article;
 }