7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
9 * @package Magic3 Framework
10 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11 * @copyright Copyright 2006-2010 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: blogLib.php 3629 2010-09-25 01:22:57Z fishbone $
14 * @link http://www.magic3.org
16 require_once(dirname(__FILE__) . '/blogLibDb.php');
20 private $db; // DB接続オブジェクト
21 private $blogId = ''; // ブログID
22 private $templateId = ''; // テンプレートID
27 function __construct()
30 $this->db = new blogLibDb();
40 global $gRequestManager;
45 $langId = $gEnvManager->getDefaultLanguage();
47 // 記事IDからブログID、テンプレートIDを取得
48 $entryId = $gRequestManager->trimValueOf(M3_REQUEST_PARAM_BLOG_ENTRY_ID);
49 if (empty($entryId)) $entryId = $gRequestManager->trimValueOf(M3_REQUEST_PARAM_BLOG_ENTRY_ID_SHORT); // 略式ブログ記事ID
50 if (!empty($entryId)){
51 $ret = $this->db->getEntryItem($entryId, $langId, $row);
53 $this->templateId = $row['bl_template_id'];
54 $this->blogId = $row['bl_id'];; // ブログID
58 $blogId = $gRequestManager->trimValueOf(M3_REQUEST_PARAM_BLOG_ID);
59 if (empty($blogId)) $blogId = $gRequestManager->trimValueOf(M3_REQUEST_PARAM_BLOG_ID_SHORT); // 略式ブログID
61 $ret = $this->db->getBlogInfoById($blogId, $row);
63 $this->templateId = $row['bl_template_id'];
64 $this->blogId = $row['bl_id'];; // ブログID
68 $init = true; // 初期化完了
71 * URLパラメータからオプションのテンプレートを取得
73 * @return string テンプレートID
75 function getOptionTemplate()
80 return $this->templateId;
85 * @return string ブログID