当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsTpl::fetch方法代码示例

本文整理汇总了PHP中XoopsTpl::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsTpl::fetch方法的具体用法?PHP XoopsTpl::fetch怎么用?PHP XoopsTpl::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsTpl的用法示例。


在下文中一共展示了XoopsTpl::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPingBodies

 function getPingBodies()
 {
     $tpl = new XoopsTpl();
     $tpl->assign(array('site_name' => d3pipes_common_convert_encoding_ietoutf8($this->mydirname, $GLOBALS['xoopsConfig']['sitename']), 'site_url' => XOOPS_URL . '/', 'page_url' => XOOPS_URL . '/modules/' . $this->mydirname . '/index.php?page=eachpipe&pipe_id=' . $this->pipe_id, 'rss_url' => XOOPS_URL . '/modules/' . $this->mydirname . '/index.php?page=xml&style=rss20&pipe_id=' . $this->pipe_id));
     $ping_body = $tpl->fetch('db:' . $this->mydirname . '_main_xmlrpc2ping.html');
     $extended_ping_body = $tpl->fetch('db:' . $this->mydirname . '_main_xmlrpc2extendedping.html');
     return array($ping_body, $extended_ping_body);
 }
开发者ID:nouphet,项目名称:rata,代码行数:8,代码来源:D3pipesPingXmlrpc2.class.php

示例2: 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');
}
开发者ID:nouphet,项目名称:rata,代码行数:25,代码来源:content.php

示例3: dirname

	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' ) ;
	}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:35,代码来源:list_functions.php

示例4: 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;
    }
}
开发者ID:naao,项目名称:d3diary,代码行数:59,代码来源:b_side_entry.php

示例5: 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;
    }
}
开发者ID:nouphet,项目名称:rata,代码行数:59,代码来源:menu.php

示例6: b_bulletin_bigstory_edit

function b_bulletin_bigstory_edit($options)
{
    $mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $tpl->assign(array('mydirname' => $mydirname, 'options' => $options));
    return $tpl->fetch('db:' . $mydirname . '_blockedit_bigstory.html');
}
开发者ID:nouphet,项目名称:rata,代码行数:11,代码来源:bulletin_bigstory.php

示例7: b_pico_mywaitings_edit

function b_pico_mywaitings_edit($options)
{
    $mydirname = empty($options[0]) ? 'pico' : $options[0];
    $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_mywaitings.html' : trim($options[1]);
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $tpl->assign(array('mydirname' => $mydirname, 'this_template' => $this_template));
    return $tpl->fetch('db:' . $mydirname . '_blockedit_mywaitings.html');
}
开发者ID:nouphet,项目名称:rata,代码行数:12,代码来源:mywaitings.php

示例8: b_d3dside_comment_show

function b_d3dside_comment_show( $options ){

	$mydirname = empty( $options[0] ) ? 'd3diary' : $options[0] ;
	$max_entry = empty( $options[1] ) ? 10 : intval( $options[1] ) ;
	$now_order = empty( $options[2] ) ? 'time' : trim( $options[2] ) ;
	$this_template = empty( $options[3] ) ? 'db:'.$mydirname.'_block_side_comment.html' : trim( $options[3] ) ;
	$limit_self = empty( $options[4] ) ? 0 : (int)$options[4] ;

	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_comment");
	$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 ;
	}

		list( $yd_comment, $yd_com_key ) =  $func->get_commentlist ($req_uid,$uid,$max_entry,false);

		$lang = array();
		$constpref = "_MB_" . strtoupper( $mydirname ) ;
		$lang['more'] = constant($constpref.'_COMMENT_LIST');

		$block="";

		$block['yd_comment'] = $yd_comment;
		$block['yd_com_key'] = $yd_com_key;
		$block['yd_uid'] = $req_uid;
		$block['lang'] = $lang;
		$block['mydirname'] = $mydirname;
		$block['mod_config'] = $mod_config ;
	
	$d3dConf->debug_appendtime('b_side_comment');

		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 ;
		}
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:53,代码来源:b_side_comment.php

示例9: b_d3diary_bloggerlist_show

function b_d3diary_bloggerlist_show( $options ){

	global $xoopsUser,$xoopsDB;
	
	$mydirname = empty( $options[0] ) ? 'd3diary' : $options[0] ;
	$max_entry = empty( $options[1] ) ? 10 : intval( $options[1] ) ;
	$params['order'] = $now_order = empty( $options[2] ) ? 'time' : trim( $options[2] ) ;
	$this_template = empty( $options[3] ) ? 'db:'.$mydirname.'_block_bloggerlist.html' : trim( $options[3] ) ;

	if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ;

	$constpref = '_MB_' . strtoupper( $mydirname ) ;

	require_once dirname( dirname(__FILE__) ).'/class/d3diaryConf.class.php';
	$d3dConf = D3diaryConf::getInstance($mydirname, 0, "b_bloggerlist");
	$func =& $d3dConf->func ;
	$mod_config =& $d3dConf->mod_config ;

	$uid = $d3dConf->uid;
	$req_uid = $d3dConf->req_uid; // overrided by d3dConf
	
	$params['ofst_key'] = "bgbofst" ;
	$_offset_ = $func->getpost_param($params['ofst_key']);
	$offset = isset($_offset_) ?(int)$_offset_ : 0;

	list( $blogger, $blogger2, $bloggernavi ) = $func->get_bloggerlist ( $req_uid, $uid, $max_entry, $offset, $params );

	$block="";

	$block['blogger'] = $blogger;
	$block['blogger2'] = $blogger2;
	$block['bloggernavi'] = $bloggernavi;
	$block['mydirname'] = $mydirname;
	$block['mod_config'] = $mod_config;
	$block['lang']['other'] = constant($constpref.'_OTHER');
	$block['lang']['more'] = constant($constpref.'_MORE');
	$block['lang']['newdiary'] = constant($constpref.'_NEWDIARY');
	$block['lang']['newphoto'] = constant($constpref.'_NEWPHOTO');
	
	$d3dConf->debug_appendtime('b_bloggerlist');

	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 ;
	}

}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:52,代码来源:b_bloggerlist.php

示例10: b_pico_subcategories_edit

function b_pico_subcategories_edit($options)
{
    $mydirname = empty($options[0]) ? 'pico' : $options[0];
    $categories = trim(@$options[1]) === '' ? array() : array_map('intval', explode(',', $options[1]));
    $this_template = empty($options[2]) ? 'db:' . $mydirname . '_block_subcategories.html' : trim($options[2]);
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $tpl->assign(array('mydirname' => $mydirname, 'categories' => $categories, 'categories_imploded' => implode(',', $categories), 'order_options' => b_pico_list_allowed_order(), 'this_template' => $this_template));
    return $tpl->fetch('db:' . $mydirname . '_blockedit_subcategories.html');
}
开发者ID:nouphet,项目名称:rata,代码行数:13,代码来源:subcategories.php

示例11: fetch

 function fetch($tplfile, $cache_id = null, $compile_id = null, $display = false)
 {
     $filename = $this->mEnvironment->findFile($tplfile, '/templates');
     if (empty($filename)) {
         $this->template_dir = NBFRAME_BASE_DIR . '/templates';
     } else {
         $this->template_dir = dirname($filename);
         $tplfile = basename($filename);
     }
     if (!$compile_id) {
         $compile_id = $this->mDirName . '_admin_';
     }
     return parent::fetch($tplfile, $cache_id, $compile_id, $display);
 }
开发者ID:nobunobuta,项目名称:xoopscube_NBFrame,代码行数:14,代码来源:NBFrameAdminTpl.class.php

示例12: b_d3dside_friends_show

function b_d3dside_friends_show( $options ){

	$mydirname = empty( $options[0] ) ? 'd3diary' : $options[0] ;
	$max_entry = empty( $options[1] ) ? 10 : intval( $options[1] ) ;
	$now_order = empty( $options[2] ) ? 'time' : trim( $options[2] ) ;
	$this_template = empty( $options[3] ) ? 'db:'.$mydirname.'_block_side_friends.html' : trim( $options[3] ) ;

	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_fiends");
	$func =& $d3dConf->func ;
	$mPerm =& $d3dConf->mPerm ;

	$uid = $d3dConf->uid;
	$req_uid = $d3dConf->req_uid; // overrided by d3dConf
	
	//if( $req_uid > 0 || $uid > 0 ) {
	if( $req_uid > 0 ) {
		$block="";
		if ( $mPerm->d3d_conf['use_friend'] === true ) {
			list( $yd_friends, $yd_friendsnavi ) =  $func->get_friends ($mPerm->req_friends);

			$lang = array();
			$constpref = "_MB_" . strtoupper( $mydirname ) ;
			$lang['more'] = constant($constpref.'_DIARY_FRIENDSVIEW');

			$block['yd_friends'] = $yd_friends;
			$block['yd_friendsnavi'] = $yd_friendsnavi;
			$block['yd_uid'] = $req_uid;
			$block['lang'] = $lang;
			$block['mydirname'] = $mydirname;
		}
	
	$d3dConf->debug_appendtime('b_side_friends');

		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 ;
		}
	}

}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:49,代码来源:b_side_friends.php

示例13: CreateLetter

 function CreateLetter($model_id = null)
 {
     $model_handler = xoops_getmodulehandler('model', 'newsletter');
     $newsletter_handler = xoops_getmodulehandler('content', 'newsletter');
     $model_obj = $model_handler->get($model_id);
     if (!empty($model_id) && is_object($model_obj)) {
         include_once XOOPS_ROOT_PATH . "/modules/newsletter/include/functions.render.php";
         include_once XOOPS_ROOT_PATH . '/class/template.php';
         $xoopsTpl = new XoopsTpl();
         $xoopsTpl->assign('letter_title', $model_obj->getVar('model_title'));
         $xoopsTpl->assign('header_img', $model_obj->getVar('header_img'));
         $xoopsTpl->assign('header_desc', $model_obj->getVar('header_desc'));
         $xoopsTpl->assign('footer_desc', $model_obj->getVar('footer_desc'));
         $tplName = newsletter_getTemplate($model_obj->getVar('model_type'), $model_obj->getVar('tpl_name'));
         $tplName = XOOPS_ROOT_PATH . "/modules/newsletter/templates/" . $tplName;
         $letter_content = $xoopsTpl->fetch($tplName);
         //create letter
         $newsletter_obj = $newsletter_handler->create();
         $newsletter_obj->setVar('model_id', $model_obj->getVar('model_id'));
         $newsletter_obj->setVar('letter_title', $model_obj->getVar('model_title'));
         $newsletter_obj->setVar('letter_content', $letter_content);
         $newsletter_obj->setVar('create_time', time());
         $newsletter_obj->setVar('is_users', 0);
         $newsletter_obj->setVar('is_sent', 0);
         $letter_id = $newsletter_handler->insert($newsletter_obj);
         //update model field in "last_create_time"
         $next_create_time = 0;
         switch ($model_obj->getVar('peried')) {
             case 'day':
                 $next_create_time = $model_obj->getVar('next_create_time') + 24 * 3600;
                 break;
             case 'week':
                 $next_create_time = $model_obj->getVar('next_create_time') + 7 * 24 * 3600;
                 break;
             case 'date':
                 $next_create_time = $model_obj->getVar('next_create_time') + date('t') * 24 * 3600;
                 break;
             case 'manual':
                 $next_create_time = time();
                 break;
         }
         $model_obj->setVar('next_create_time', $next_create_time);
         $model_obj->setVar('last_create_time', time());
         $model_handler->insert($model_obj);
         return $letter_id;
     }
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:47,代码来源:content.php

示例14: b_gnavi_archive_show

function b_gnavi_archive_show( $options )
{
	global $xoopsDB ;

	$mydirname = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0] ;
	$this_template = 'db:'.$mydirname.'_block_archive.html';

	if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ;
	require dirname(dirname(__FILE__)).'/include/read_configs.php' ;

	$block = array() ;

	$constpref = '_MB_' . strtoupper( $mydirname ) ;
	$myts =& MyTextSanitizer::getInstance() ;
	$result = $xoopsDB->query( "SELECT date FROM $table_photos WHERE status>0 ORDER BY date DESC" ) ;

	$count = 1 ;
	while( $photo = $xoopsDB->fetchArray( $result ) ) {

		$photo['link'] = date ("Ym",$photo["date"]) ;
		//$photo['text'] = date ("Y? m??",$photo["date"]) ;
		$_year = date("Y",$photo["date"]);
		$_month = date("m",$photo["date"]);
		$photo['text'] = sprintf( constant( $constpref.'_ARCH_POSTMONTH'), $_year, $_month ) ;

		if($count>1){
			if($block['archive'][$count-1]['link']!=$photo['link']){
				$block['archive'][$count++] = $photo ;
			}
		}else{
			$block['archive'][$count++] = $photo ;
		}
	}

	$block['mod_url'] = $mod_url ;

	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 ;
	}
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:46,代码来源:archive.php

示例15: b_pico_tags_edit

function b_pico_tags_edit($options)
{
    global $pico_blocks_tags_order_options;
    // options
    $mytrustdirname = basename(dirname(dirname(__FILE__)));
    $mydirname = empty($options[0]) ? $mytrustdirname : $options[0];
    $limit = empty($options[1]) ? 10 : intval($options[1]);
    $listorder = in_array(@$options[2], $pico_blocks_tags_order_options) ? $options[2] : 'count DESC';
    $sqlorder = in_array(@$options[3], $pico_blocks_tags_order_options) ? $options[3] : 'count DESC';
    $this_template = empty($options[4]) ? 'db:' . $mydirname . '_block_tags.html' : trim($options[4]);
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $tpl->assign(array('mydirname' => $mydirname, 'limit' => $limit, 'listorder' => $listorder, 'sqlorder' => $sqlorder, 'order_options' => $pico_blocks_tags_order_options, 'this_template' => $this_template));
    return $tpl->fetch('db:' . $mydirname . '_blockedit_tags.html');
}
开发者ID:nouphet,项目名称:rata,代码行数:18,代码来源:tags.php


注:本文中的XoopsTpl::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。