本文整理汇总了PHP中XoopsTpl类的典型用法代码示例。如果您正苦于以下问题:PHP XoopsTpl类的具体用法?PHP XoopsTpl怎么用?PHP XoopsTpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XoopsTpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gnavi_footer
function gnavi_footer()
{
global $mod_copyright, $mydirname;
$tpl = new XoopsTpl();
$tpl->assign(array('mod_copyright' => $mod_copyright));
$tpl->display("db:{$mydirname}_footer.html");
}
示例2: callbackSetupUser
/**
* Checks whether the site is closed now, and whether all of must modules
* have been installed. This function is called through delegates.
* @var XoopsUser &$xoopsUser
* @see preBlockFilter()
*/
function callbackSetupUser(&$principal, &$controller, &$context)
{
$accessAllowFlag = false;
$xoopsConfig = $controller->mRoot->mContext->getXoopsConfig();
if (!empty($_POST['xoops_login'])) {
$controller->checkLogin();
return;
} else {
if (@$_GET['op'] == 'logout') {
// GIJ
$controller->logout();
return;
} elseif (is_object($context->mXoopsUser)) {
foreach ($context->mXoopsUser->getGroups() as $group) {
if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
$accessAllowFlag = true;
break;
}
}
}
}
if (!$accessAllowFlag) {
require_once XOOPS_ROOT_PATH . '/class/template.php';
$xoopsTpl = new XoopsTpl();
$xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_isuser' => is_object($context->mXoopsUser), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
$xoopsTpl->compile_check = true;
// @todo filebase template with absolute file path
$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/legacy/templates/legacy_site_closed.html');
exit;
}
}
示例3: b_d3downloads_list_edit
function b_d3downloads_list_edit( $options )
{
require_once dirname( dirname(__FILE__) ).'/include/common_functions.php' ;
$mydirname = empty( $options[0] ) ? 'd3downloads' : $options[0] ;
$categories = trim( @$options[1] ) === '' ? array() : array_map( 'intval' , explode( ',' , $options[1] ) ) ;
$selected_order = empty( $options[2] ) || ! in_array( $options[2] , d3download_list_order() ) ? 'd.date DESC' : $options[2] ;
$max_entry = empty( $options[3] ) ? 10 : intval( $options[3] ) ;
$date_format = empty( $options[4] ) ? 'Y/m/d' : htmlspecialchars ( $options[4] , ENT_QUOTES ) ;
$show_body = empty( $options[5] ) ? false : true ;
$this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_block_list.html' : trim( $options[6] ) ;
$intree = empty( $options[7] ) ? 0 : 1 ;
if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ;
// getcategories_list
$categories_list = array() ;
$categories_list = d3download_get_categories_list( $mydirname ) ;
require_once XOOPS_ROOT_PATH.'/class/template.php' ;
$tpl = new XoopsTpl() ;
$tpl->assign( array(
'mydirname' => $mydirname ,
'categories' => implode( ',' , $categories ) ,
'order_options' => d3download_list_order() ,
'selected_order' => $selected_order ,
'max_entry' => $max_entry ,
'date_format' => $date_format ,
'show_body' => $show_body ,
'intree' => $intree ,
'categories_list' => $categories_list ,
'this_template' => $this_template ,
) ) ;
return $tpl->fetch( 'db:'.$mydirname.'_blockedit_list.html' ) ;
}
示例4: b_pico_content_edit
function b_pico_content_edit($options)
{
// options
$mytrustdirname = basename(dirname(dirname(__FILE__)));
$mydirname = empty($options[0]) ? $mytrustdirname : $options[0];
$content_id = intval(@$options[1]);
$this_template = empty($options[2]) ? 'db:' . $mydirname . '_block_content.html' : trim($options[2]);
$process_body = empty($options[3]) ? false : true;
// mydirname check
if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
die('Invalid mydirname');
}
// get content_title
$db =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$contents = array(0 => '--');
$result = $db->query("SELECT content_id,subject,c.cat_depth_in_tree FROM " . $db->prefix($mydirname . "_contents") . " o LEFT JOIN " . $db->prefix($mydirname . "_categories") . " c ON o.cat_id=c.cat_id ORDER BY c.cat_order_in_tree,o.weight");
while (list($id, $sbj, $depth) = $db->fetchRow($result)) {
$contents[$id] = sprintf('%06d', $id) . ': ' . str_repeat('--', $depth) . $myts->makeTboxData4Show($sbj, 1, 1);
}
require_once XOOPS_ROOT_PATH . '/class/template.php';
$tpl = new XoopsTpl();
$tpl->assign(array('mydirname' => $mydirname, 'contents' => $contents, 'content_id' => $content_id, 'this_template' => $this_template, 'process_body' => $process_body));
return $tpl->fetch('db:' . $mydirname . '_blockedit_content.html');
}
示例5: myalbum_footer
function myalbum_footer()
{
global $mod_copyright, $mydirnumber;
$tpl = new XoopsTpl();
$tpl->assign(array('mod_copyright' => $mod_copyright));
$tpl->display("db:myalbum{$mydirnumber}_footer.html");
}
示例6: b_gnavi_menu_show
function b_gnavi_menu_show($options)
{
global $xoopsDB;
$mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
$cat_limit = empty($options[1]) ? 0 : 1;
$this_template = 'db:' . $mydirname . '_block_menu.html';
if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
die('Invalid mydirname');
}
require dirname(dirname(__FILE__)) . '/include/read_configs.php';
$myts =& MyTextSanitizer::getInstance();
$result = $xoopsDB->query("SELECT c1.cid ,c1.title,c1.imgurl ,c2.cid AS ccid, c2.title AS ctitle, c2.imgurl AS cimgurl FROM {$table_cat} c1 LEFT JOIN {$table_cat} c2 ON c1.cid=c2.pid WHERE c1.pid=0 ORDER BY c1.weight,c2.weight ");
if (preg_match('/' . '\\/modules\\/' . $mydirname . '/', htmlspecialchars(getenv('REQUEST_URI')))) {
$gcid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
$glid = empty($_GET['lid']) ? 0 : intval($_GET['lid']);
$ocid = $gcid;
if ($gcid) {
if (!($result2 = $xoopsDB->query("SELECT pid FROM {$table_cat} WHERE cid={$gcid}"))) {
echo $xoopsDB->logger->dumpQueries();
exit;
}
list($gpid) = $xoopsDB->fetchRow($result2);
$gcid = $gpid > 0 ? $gpid : $gcid;
}
} else {
$gcid = 0;
$glid = 0;
$ocid = 0;
}
$blk = array();
while ($content_row = $xoopsDB->fetchArray($result)) {
$cat_id = intval($content_row['cid']);
$blk[$cat_id]['cid'] = intval($content_row['cid']);
$blk[$cat_id]['title'] = $myts->makeTboxData4Show($content_row['title']);
$blk[$cat_id]['imgurl'] = $content_row['imgurl'];
$blk[$cat_id]['active'] = intval($content_row['cid']) == $ocid && $glid == 0 ? 1 : 0;
if ((!$cat_limit || $gcid == $cat_id) && intval($content_row['ccid']) > 0) {
$blk[$cat_id]['contents'][] = array('cid' => intval($content_row['ccid']), 'title' => $myts->makeTboxData4Show($content_row['ctitle']), 'imgurl' => $content_row['cimgurl'], 'active' => intval($content_row['ccid']) == $ocid && $glid == 0 ? 1 : 0);
}
}
$block = array();
$block['categories'] = $blk;
if (preg_match('/page=map/', htmlspecialchars(getenv('REQUEST_URI')))) {
$block['mod_url'] = XOOPS_URL . '/modules/' . $mydirname . "/index.php?page=map&";
} elseif (preg_match('/page=category/', htmlspecialchars(getenv('REQUEST_URI')))) {
$block['mod_url'] = XOOPS_URL . '/modules/' . $mydirname . "/index.php?page=category&";
} else {
$block['mod_url'] = XOOPS_URL . '/modules/' . $mydirname . "/index.php?";
}
if (empty($options['disable_renderer'])) {
require_once XOOPS_ROOT_PATH . '/class/template.php';
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$ret['content'] = $tpl->fetch($this_template);
return $ret;
} else {
return $block;
}
}
示例7: b_d3dside_entry_show
function b_d3dside_entry_show($options)
{
$mydirname = empty($options[0]) ? 'd3diary' : $options[0];
$max_entry = empty($options[1]) ? 10 : (int) $options[1];
$now_order = empty($options[2]) ? 'time' : trim($options[2]);
$this_template = empty($options[3]) ? 'db:' . $mydirname . '_block_side_entry.html' : trim($options[3]);
$limit_self = empty($options[4]) ? 0 : (int) $options[4];
$show_category = empty($options[5]) ? false : true;
if (!get_magic_quotes_gpc()) {
$params['categories'] = empty($options[6]) ? array() : explode(',', addslashes($options[6]));
$params['tags'] = empty($options[7]) ? array() : explode(',', addslashes($options[7]));
} else {
$params['categories'] = empty($options[6]) ? array() : explode(',', $options[6]);
$params['tags'] = empty($options[7]) ? array() : explode(',', $options[7]);
}
if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
die('Invalid mydirname');
}
require_once dirname(dirname(__FILE__)) . '/class/d3diaryConf.class.php';
$d3dConf = D3diaryConf::getInstance($mydirname, 0, "b_side_entry");
$func =& $d3dConf->func;
$mod_config =& $d3dConf->mod_config;
$uid = $d3dConf->uid;
$req_uid = $d3dConf->req_uid;
// overrided by d3dConf
if ($limit_self == 1) {
// always show diarylist page
$req_uid = 0;
} elseif ($limit_self == 2 && $req_uid > 0) {
// not show for personal page
return;
} elseif ($limit_self == 3 && $req_uid == 0) {
// not show except for personal page
return;
}
$entry = $func->get_blist($req_uid, $uid, $max_entry, true, $params);
$lang = array();
$constpref = "_MB_" . strtoupper($mydirname);
$lang['more'] = constant($constpref . '_MORE');
$block = "";
$block['yd_list'] = $entry;
$block['yd_uid'] = $req_uid;
$block['show_category'] = $show_category;
$block['categories'] = implode(',', $params['categories']);
$block['tags'] = implode(',', $params['tags']);
$block['lang'] = $lang;
$block['mydirname'] = $mydirname;
$block['mod_config'] = $mod_config;
$d3dConf->debug_appendtime('b_side_entry');
if (empty($options['disable_renderer'])) {
require_once XOOPS_ROOT_PATH . '/class/template.php';
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$ret['content'] = $tpl->fetch($this_template);
return $ret;
} else {
return $block;
}
}
示例8: b_oledrion_promotion_show_duplicatable
/**
* Bloc à la volée
*/
function b_oledrion_promotion_show_duplicatable($options)
{
$options = explode('|', $options);
$block = b_oledrion_promotion_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('db:oledrion_block_promotion.tpl');
}
示例9: render
function render($target = null)
{
require_once XOOPS_ROOT_PATH . '/class/template.php';
$tpl = new XoopsTpl();
$tpl->assign($this->getAssign());
$tpl->assign('xoops_module_header', pico_main_render_moduleheader($this->mydirname, $GLOBALS['xoopsModuleConfig'], $this->getHtmlHeader()));
$tpl->display($this->getTemplateName());
}
示例10: b_myshop_promotion_show_duplicatable
function b_myshop_promotion_show_duplicatable($options)
{
$options = explode('|', $options);
$block =& b_myshop_promotion_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('db:myshop_block_promotion.html');
}
示例11: b_oledrion_category_lists_duplicatable
/**
* Bloc à la volée
*/
function b_oledrion_category_lists_duplicatable($options)
{
$options = explode('|', $options);
$block =& b_oledrion_category_lists_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('oledrion_block_category_lists.html');
}
示例12: b_myshop_category_duplicatable
/**
* Random block
*/
function b_myshop_category_duplicatable($options)
{
$options = explode('|', $options);
$block =& b_myshop_category($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('db:myshop_block_categories.html');
}
示例13: b_marquee_custom
function b_marquee_custom($options)
{
$options = explode('|', $options);
$block =& b_marquee_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('db:marquee_block.html');
}
示例14: b_oledrion_mostviewed_lists_duplicatable
/**
* Bloc à la volée
*/
function b_oledrion_mostviewed_lists_duplicatable($options)
{
$options = explode('|', $options);
$block = b_oledrion_mostviewed_lists_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('oledrion_block_mostviewed_lists.tpl');
}
示例15: b_news_topics_onthefly
function b_news_topics_onthefly($options)
{
$options = explode('|', $options);
$block =& b_news_topics_show($options);
$tpl = new XoopsTpl();
$tpl->assign('block', $block);
$tpl->display('db:news_block_topics.html');
}