本文整理匯總了PHP中XoopsTpl::xoops_setTemplateDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsTpl::xoops_setTemplateDir方法的具體用法?PHP XoopsTpl::xoops_setTemplateDir怎麽用?PHP XoopsTpl::xoops_setTemplateDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XoopsTpl
的用法示例。
在下文中一共展示了XoopsTpl::xoops_setTemplateDir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
// If there are no articles
if (!Bulletin::isPublishedExists($mydirname, $storyid)) {
redirect_header($mydirurl . '/index.php', 2, _MD_NOSTORY);
exit;
}
require_once XOOPS_ROOT_PATH . '/class/template.php';
$article = new Bulletin($mydirname, $storyid);
$gperm =& BulletinGP::getInstance($mydirname);
if (!$gperm->proceed4topic('can_read', $article->getVar('topicid'))) {
// redirect_header($mydirurl.'/index.php',2,_NOPERM);
exit;
}
$datetime = formatTimestamp($article->getVar('published'), $bulletin_date_format);
$tpl = new XoopsTpl();
$tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes');
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(0);
$tpl->assign('charset', _CHARSET);
$tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$tpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$tpl->assign('slogan', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
$tpl->assign('xoops_version', htmlspecialchars(XOOPS_VERSION, ENT_QUOTES));
$tpl->assign('site_image', htmlspecialchars($bulletin_imgurl_on_print, ENT_QUOTES));
$tpl->assign('story_title', $article->getVar('title'));
$tpl->assign('story_date', $datetime);
$tpl->assign('story_topic', $article->topic_title());
$tpl->assign('story_hometext', $article->getVar('hometext'));
$tpl->assign('story_id', $storyid);
$tpl->assign('story_bodytext', $article->getDividedBodytext());
$tpl->assign('this_comes_from', sprintf(_MD_THISCOMESFROM, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));