本文整理汇总了PHP中View::SetTemplet方法的典型用法代码示例。如果您正苦于以下问题:PHP View::SetTemplet方法的具体用法?PHP View::SetTemplet怎么用?PHP View::SetTemplet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::SetTemplet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lib_leftnav
function lib_leftnav(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "row|20,";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnertext());
$revalue = '';
$table = "#@__destinations";
$sql = "select id,kindname,pinyin from {$table} where pid= 0 and isopen=1 order by displayorder asc";
$kindnames = array();
$ids = $pinyin = array();
$arr = $dsql->getAll($sql);
for ($i = 0; isset($arr[$i]['id']); $i++) {
$ids[] = $arr[$i]['id'];
$kindname[] = $arr[$i]['kindname'];
$pinyin[] = $arr[$i]['pinyin'];
}
$GLOBALS['autoindex'] = 0;
for ($k = 0; isset($ids[$k]); $k++) {
$GLOBALS['autoindex']++;
$pv = new View(0);
$pv->Fields['kindname'] = $kindnames[$k];
$pv->Fields['kindid'] = $ids[$k];
$pv->Fields['pinyin'] = $pinyin[$k];
$pv->SetTemplet($innertext, 'string');
$revalue .= $pv->GetResult();
}
return $revalue;
}
示例2: lib_helplist
function lib_helplist(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "row|5,helpkindid|,flag|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
$helpkindid = isset($refObj->Fields['helpkindid']) ? $refObj->Fields['helpkindid'] : '';
//针对指定kindid只查询一个分类的信息.
$typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : '0';
if ($innertext == '') {
return '';
}
//获得类别ID总数的信息
$ids = array();
$kindnames = array();
if ($flag == 'all') {
$sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 order by displayorder asc";
} else {
if ($helpkindid == '') {
$sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 order by displayorder asc limit 0,{$row}";
} else {
$sql = "select id,kindname,litpic from #@__help_kind where webid=0 and isopen=1 and id={$helpkindid} order by displayorder asc limit 0,{$row}";
}
}
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$ids[] = $row['id'];
$kindnames[] = $row['kindname'];
//获取帮助分类名称
$imgsrc[] = $row['litpic'];
}
if (!isset($ids[0])) {
return '';
}
//如里分类不存在则退出
for ($i = 0; isset($ids[$i]); $i++) {
$pv = new View($typeid);
if ($imgsrc[$i] != '') {
$kindname = "<img src=\"{$imgsrc[$i]}\" alt=\"{$kindnames[$i]}\">";
} else {
$kindname = $kindnames[$i];
}
$url = $GLOBALS['cfg_base_url'] . "/help/index_{$ids[$i]}.html";
$pv->Fields['kindname'] = $kindname;
$pv->Fields['helpkindname'] = $kindnames[$i];
$pv->Fields['ids'] = $ids[$i];
$pv->Fields['id'] = $ids[$i];
$pv->Fields['sonid'] = $ids[$i];
$pv->Fields['url'] = $url;
$pv->Fields['litpic'] = $imgsrc[$i];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例3: lib_logo
function lib_logo(&$ctag, &$refObj)
{
$innertext = trim($ctag->GetInnertext());
$revalue = '';
$a = !empty($GLOBALS['typeid']) ? $GLOBALS['typeid'] : '0';
// $b=explode(',',$GLOBALS['cfg_logodisplay']);
// if(in_array($a,$b) || $a=='12')
$pv = new View(0);
$pv->SetTemplet($innertext, 'string');
$revalue .= $pv->GetResult();
return $revalue;
}
示例4: lib_attrgrouplist
function lib_attrgrouplist(&$ctag, &$refObj)
{
global $dsql;
$attlist = "row|8,flag|,filterid|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
$typeid = $typeid ? $typeid : $refObj->Fields['typeid'];
if (empty($typeid)) {
return '';
}
$tablearr = array('1' => '#@__line_attr', '2' => '#@__hotel_attr', '3' => '#@__car_attr', '4' => '#@__article_attr', '5' => '#@__spot_attr', '6' => '#@__photo_attr', '11' => '#@__jieban_attr', '13' => '#@__tuan_attr');
$tablename = isset($tablearr[$typeid]) ? $tablearr[$typeid] : '#@__model_attr';
if ($innertext == '') {
return '';
}
//获得类别ID总数的信息
$groupids = array();
$groupnames = array();
$w = !empty($filterid) ? " and id not in({$filterid})" : '';
//排除不要的项
$w .= $typeid > 13 ? " and typeid={$typeid}" : '';
//如果是扩展模块,则增加typeid判断
$dest_id = $GLOBALS['dest_id'] ? $GLOBALS['dest_id'] : 0;
if ($flag == 'bydestid') {
$w .= !empty($dest_id) ? " and FIND_IN_SET({$dest_id},destid)" : '';
}
$sql = "select id,attrname as groupname from {$tablename} where pid=0 and isopen=1 {$w} order by displayorder asc limit 0,{$row}";
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$groupids[] = $row['id'];
$groupnames[] = $row['groupname'];
//获取组名
}
if (!isset($groupids[0])) {
return '';
}
//如里不存在则退出
$GLOBALS['itemindex'] = 0;
for ($i = 0; isset($groupids[$i]); $i++) {
$GLOBALS['itemindex']++;
$pv = new View(0);
$pv->Fields['groupname'] = $groupnames[$i];
$pv->Fields['groupid'] = $groupids[$i];
$pv->Fields['attrid'] = $groupids[$i];
$pv->Fields['typeid'] = $typeid;
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例5: lib_getattrbygroupid
function lib_getattrbygroupid(&$ctag, &$refObj)
{
global $dsql;
$attlist = "row|80,typeid|,groupname|,groupid|,filterid|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$attrtable = array('1' => '#@__line_attr', '2' => '#@__hotel_attr', '3' => '#@__car_attr', '4' => '#@__article_attr', '5' => '#@__spot_attr', '6' => '#@__photo_attr', '11' => '#@__jieban_attr', '13' => '#@__tuan_attr');
$innertext = trim($ctag->GetInnertext());
$revalue = '';
$typeid = empty($typeid) ? $refObj->Fields['typeid'] : $typeid;
$tablename = isset($attrtable[$typeid]) ? $attrtable[$typeid] : '#@__model_attr';
$w = !empty($filterid) ? " and id not in({$filterid})" : '';
//排除不要的项
$w .= $typeid > 13 ? " and typeid={$typeid}" : '';
//如果是扩展模块,则增加typeid判断
if (!empty($groupname)) {
$sql = "select id from {$tablename} where attrname='{$groupname}' {$w}";
$row = $dsql->GetOne($sql);
if (is_array($row)) {
$pid = $row['id'];
}
} else {
$pid = empty($groupid) ? $refObj->Fields['attrid'] : $groupid;
}
if (empty($pid)) {
return;
}
$sql = "select id,attrname from {$tablename} where pid='{$pid}' {$w} order by displayorder asc limit 0,{$row}";
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$groupids[] = $row['id'];
$groupnames[] = $row['attrname'];
//获取组名
}
if (!isset($groupids[0])) {
return '';
}
//如里不存在则退出
$GLOBALS['itemindex'] = 0;
for ($i = 0; isset($groupids[$i]); $i++) {
$GLOBALS['itemindex']++;
$pv = new View(0);
$pv->Fields['groupname'] = $groupnames[$i];
$pv->Fields['groupid'] = $groupids[$i];
$pv->Fields['attrid'] = $groupids[$i];
$pv->Fields['typeid'] = $typeid;
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例6: lib_getcarguide
function lib_getcarguide(&$ctag, &$refObj)
{
global $dsql;
$attlist = "row|8,flag|,limit|0";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
switch ($flag) {
case 'stylelist':
$sqlstr = "select * from #@__car_kind order by displayorder asc";
break;
case 'brandlist':
$sqlstr = "select * from #@__car_brand where webid=0";
break;
case "pricerange":
$sqlstr = "select * from #@__car_pricelist where webid=0";
break;
}
//获得类别ID总数的信息
$groupids = array();
$groupnames = array();
if (empty($sqlstr)) {
return '';
}
$dsql->SetQuery($sqlstr);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$groupids[] = $row['id'];
$groupnames[] = $row['kindname'];
//获取组名
}
if (!isset($groupids[0])) {
return '';
}
//如里不存在则退出
$GLOBALS['itemindex'] = 0;
for ($i = 0; isset($groupids[$i]); $i++) {
$GLOBALS['itemindex']++;
$pv = new View(0);
$pv->Fields['groupname'] = $groupnames[$i];
$pv->Fields['kindid'] = $groupids[$i];
$pv->Fields['groupid'] = $groupids[$i];
$pv->Fields['attrid'] = $groupids[$i];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例7: lib_linechild
/**
* 获取线路子级id标签代码
*
* @version $Id: linechild.lib.php netman
* @package Stourweb.Taglib
* @copyright Copyright (c) 2007 - 2013, Stourweb, Inc.
* @link http://www.stourweb.com
*/
function lib_linechild(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "typeid|0,row|5";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$pid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : 0;
$pname = isset($refObj->Fields['kindname']) ? $refObj->Fields['kindname'] : '';
$pshownum = isset($refObj->Fields['shownum']) ? $refObj->Fields['shownum'] : 5;
$ppy = isset($refObj->Fields['pinyin']) ? $refObj->Fields['pinyin'] : '';
$innertext = trim($ctag->GetInnertext());
$revalue = '';
$sql = "select distinct a.kindname,a.kindname,a.id,a.pinyin,b.shownum from #@__destinations as a inner join #@__line_kindlist as b on a.id=b.kindid where a.pid={$pid} and a.isopen=1 order by b.displayorder asc limit 0,{$row}";
$dsql->SetQuery($sql);
$dsql->Execute();
$ctp = new STTagParse();
$ctp->SetNameSpace("field", "[", "]");
$ctp->LoadSource($innertext);
$GLOBALS['autoindex'] = 0;
$kindnames = $ids = $shownumber = array();
while ($row = $dsql->GetArray()) {
if (ExistLine($row['id'], 1)) {
$ids[] = $row['id'];
$kindnames[] = $row['kindname'];
//获取导航分类名称
$shownumber[] = !empty($row['shownum']) ? $row['shownum'] : 8;
$pinyin[] = $row['pinyin'];
}
}
//这里增加一个当没有子级时判断,将直接读取父级列表.
if (empty($ids[0])) {
$ids[] = $pid;
$kindnames[] = $pname;
$shownumber[] = $pshownum;
$pinyin[] = $ppy;
}
for ($i = 0; isset($ids[$i]); $i++) {
$pv = new View();
$pv->Fields['kindname'] = $kindnames[$i];
$pv->Fields['kindid'] = $ids[$i];
$pv->Fields['pinyin'] = $pinyin[$i];
$pv->Fields['shownum'] = $shownumber[$i];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例8: lib_arclist
function lib_arclist(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "flag|,groupname|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
if ($innertext == '') {
return '';
}
//获得类别ID总数的信息
$ids = array();
$typenames = array();
$pids = array();
if ($flag == 'attrlist') {
$sql = "select id from #@__article_attr where attrname='{$groupname}'";
$ar = $dsql->GetOne($sql);
$pid = $ar['id'];
$sql = "select id,attrname from #@__article_attr where pid = '{$pid}'";
}
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$ids[] = $row['id'];
$kindnames[] = $row['attrname'];
//获取子栏目名称
}
if (!isset($ids[0])) {
return '';
}
//如里不存在子栏目则退出
$GLOBALS['itemindex'] = 0;
for ($i = 0; isset($ids[$i]); $i++) {
$GLOBALS['itemindex']++;
$pv = new View($ids[$i]);
$pv->Fields['attrid'] = $ids[$i];
$pv->Fields['kindname'] = $kindnames[$i];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例9: lib_getrightcontent
function lib_getrightcontent(&$ctag, &$refObj)
{
global $dsql, $sys_webid;
include SLINEDATA . "/webinfo.php";
$attlist = "pagename|index";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : 0;
//
//if($typeid==0) return'';
//if($pagename=="")return'';
//$cloudlist="<div id=\"search_right\"></div>"; //云搜索
$webid = $GLOBALS['sys_child_webid'];
$innertext = $cloudlist;
$sql = "select moduleids from #@__module_config where webid={$webid} and shortname='{$pagename}' and typeid='{$typeid}'";
$row = $dsql->GetOne($sql);
if (is_array($row)) {
$mids = explode(',', $row['moduleids']);
//拆分
for ($i = 0; isset($mids[$i]); $i++) {
$sql = "select body from #@__module_list where aid='{$mids[$i]}' and webid={$sys_webid}";
$dsql->SetQuery($sql);
$dsql->Execute();
while ($arr = $dsql->GetArray()) {
$innertext .= $arr['body'];
}
}
}
$artlist = '';
if ($innertext == '') {
return '';
}
//如里为空则退出
$GLOBALS['itemindex'] = 0;
$GLOBALS['itemindex']++;
$pv = new View($typeid);
$pv->Fields['tagword'] = $refObj->Fields['tagword'];
$pv->Fields['kindlist'] = $refObj->Fields['kindlist'];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
return $artlist;
}
示例10: lib_slidenavlist
function lib_slidenavlist(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "row|20,";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnertext());
$revalue = '';
$sql = "select id,linkurl,kindname,litpic,remark,color from #@__plugin_leftnav where pid=0 and isopen=1 order by displayorder asc limit 0,{$row}";
$kindnames = array();
$ids = array();
$linkurls = array();
$litpics = array();
$arr = $dsql->getAll($sql);
for ($i = 0; isset($arr[$i]['id']); $i++) {
$id = $arr[$i]['id'];
$kindname = !empty($arr[$i]['color']) ? '<font color="' . $arr[$i]['color'] . '">' . $arr[$i]['kindname'] . '</font>' : $arr[$i]['kindname'];
//$kindname=$arr[$i]['kindname'];
$linkurl = $arr[$i]['linkurl'];
$litpic = $arr[$i]['litpic'];
$remark = $arr[$i]['remark'];
array_push($ids, $id);
array_push($kindnames, $kindname);
array_push($litpics, $litpic);
array_push($remarks, $remark);
array_push($linkurls, $linkurl);
}
$GLOBALS['autoindex'] = 0;
for ($k = 0; isset($ids[$k]); $k++) {
$GLOBALS['autoindex']++;
$pv = new View(0);
$pv->Fields['kindname'] = $kindnames[$k];
$pv->Fields['url'] = $linkurls[$k];
$pv->Fields['kindid'] = $ids[$k];
$pv->Fields['litpic'] = $litpics[$k];
$pv->Fields['remark'] = $remarks[$k];
$pv->SetTemplet($innertext, 'string');
$revalue .= $pv->GetResult();
}
return $revalue;
}
示例11: lib_if
function lib_if(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "row|20,showall|0";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$condition = isset($GLOBALS['condition'][$var]) ? $GLOBALS['condition'][$var] : 0;
//
$innertext = trim($ctag->GetInnertext());
$revalue = '';
if ($condition) {
$pv = new View(0);
$pv->Fields['typeid'] = 0;
$pv->Fields = $refObj->Fields;
$pv->SetTemplet($innertext, 'string');
$revalue .= $pv->GetResult();
}
return $revalue;
}
示例12: lib_destlist
function lib_destlist(&$ctag, &$refObj)
{
global $dsql;
include SLINEDATA . "/webinfo.php";
$attlist = "row|20,destid|,flag|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
$destid = isset($refObj->Fields['kindid']) ? $refObj->Fields['kindid'] : $destid;
$destid = empty($destid) ? 0 : $destid;
if ($innertext == '') {
return '';
}
$tablename = '#@__destinations';
//获得类别ID总数的信息
$ids = array();
$kindnames = array();
$sql = "select id,kindname from {$tablename} where pid='{$destid}' and isopen=1 order by displayorder asc,pinyin asc";
//获取下一级
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$ids[] = $row['id'];
$kindnames[] = $row['kindname'];
//目的地名称
}
if (!isset($ids[0])) {
return '';
}
//如里分类不存在则退出
for ($i = 0; isset($ids[$i]); $i++) {
$pv = new View(0);
$pv->Fields['destname'] = $kindnames[$i];
$pv->Fields['parentid'] = $ids[$i];
$pv->Fields['kindid'] = $ids[$i];
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}
示例13: lib_gettemplet
function lib_gettemplet(&$ctag, &$refObj)
{
global $dsql, $sys_webid;
include SLINEDATA . "/webinfo.php";
$attlist = "pagename|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = '';
$revalue = '';
$sql = "select b.path from #@__site_page a left join #@__site_page_config b on a.id=b.pageid where a.pagename='{$pagename}' and b.isuse = 1 and webid='{$sys_webid}'";
$row = $dsql->GetOne($sql);
if (!empty($row['path'])) {
$innertext = "{sline:include file='uploadtemplets/" . $row['path'] . "/index.htm'/}";
} else {
$innertext = "{sline:include file='public/" . $pagename . "_sys.htm'/}";
}
$pv = new View(0);
$pv->SetTemplet($innertext, 'string');
$revalue .= $pv->GetResult();
return $revalue;
}
示例14: lib_getsinglemodule
function lib_getsinglemodule(&$ctag, &$refObj)
{
global $dsql, $sys_webid;
include SLINEDATA . "/webinfo.php";
$attlist = "name|index";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = '';
$sql = "select body from #@__module_list where modulename='{$name}'";
$row = $dsql->GetOne($sql);
$innertext .= $row['body'];
$out = '';
if ($innertext == '') {
return '';
}
//如里为空则退出
$pv = new View(0);
$pv->SetTemplet($innertext, 'string');
$out .= $pv->GetResult();
return $out;
}
示例15: lib_getarcattrlist
function lib_getarcattrlist(&$ctag, &$refObj)
{
global $dsql;
$attlist = "row|8,flag|,filterid|";
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$artlist = '';
$sql = "select * from #@__article_attr where isopen=1 and pid!=0 order by displayorder asc";
if ($flag == 'mdd') {
$sql = "select a.*,count(b.id) as num from #@__article_attr as a inner join #@__article as b on find_in_set(a.id,b.attrid) where find_in_set({$kindid},b.kindlist) group by a.id";
}
//获得类别ID总数的信息
$groupids = array();
$groupnames = array();
$dsql->SetQuery($sql);
$dsql->Execute();
while ($row = $dsql->GetArray()) {
$groupids[] = $row['id'];
$groupnames[] = $row['attrname'];
//获取组名
}
if (!isset($groupids[0])) {
return '';
}
//如里不存在则退出
$GLOBALS['itemindex'] = 0;
for ($i = 0; isset($groupids[$i]); $i++) {
$GLOBALS['itemindex']++;
$pv = new View(0);
$pv->Fields['groupname'] = $groupnames[$i];
$pv->Fields['groupid'] = $groupids[$i];
$pv->Fields['attrid'] = $groupids[$i];
$pv->Fields['typeid'] = $typeid;
$pv->SetTemplet($innertext, 'string');
$artlist .= $pv->GetResult();
}
return $artlist;
}