本文整理汇总了PHP中DataListCP::SetTemplet方法的典型用法代码示例。如果您正苦于以下问题:PHP DataListCP::SetTemplet方法的具体用法?PHP DataListCP::SetTemplet怎么用?PHP DataListCP::SetTemplet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataListCP
的用法示例。
在下文中一共展示了DataListCP::SetTemplet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetUserType
CheckPurview('sys_User');
require_once DEDEINC . "/datalistcp.class.php";
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
if (empty($rank)) {
$rank = '';
} else {
$rank = " WHERE CONCAT(#@__admin.usertype)='{$rank}' ";
}
$dsql->SetQuery("SELECT rank,typename FROM `#@__admintype` ");
$dsql->Execute();
while ($row = $dsql->GetObject()) {
$adminRanks[$row->rank] = $row->typename;
}
$query = "SELECT #@__admin.*,#@__arctype.typename FROM #@__admin LEFT JOIN #@__arctype ON #@__admin.typeid = #@__arctype.id {$rank} ";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/sys_admin_user.htm");
$dlist->SetSource($query);
$dlist->Display();
function GetUserType($trank)
{
global $adminRanks;
if (isset($adminRanks[$trank])) {
return $adminRanks[$trank];
} else {
return "错误类型";
}
}
function GetChannel($c)
{
if ($c == "" || $c == 0) {
return "所有频道";
示例2: AutoCharset
$config = AutoCharset(unserialize(utf82gb($row['config'])));
} else {
if ($cfg_soft_lang == 'gb2312') {
$config = unserialize($row['config']);
}
}
foreach ($config as $key => $v) {
$config[$key]['value'] = "";
}
if ($cfg_soft_lang == 'utf-8') {
$config = AutoCharset($config, 'utf-8', 'gb2312');
$config = serialize($config);
$config = gb2utf8($config);
} else {
$config = serialize($config);
}
$query = "UPDATE `#@__payment` SET fee='',config='{$config}',enabled='0' WHERE id='{$pid}'";
$dsql->ExecuteNoneQuery($query);
//同时需要删除对应的缓存
$m_file = DEDEDATA . "/payment/" . $row['code'] . ".php";
@unlink($m_file);
ShowMsg("删除成功!", "sys_payment.php");
exit;
}
}
}
$sql = "SELECT * FROM `#@__payment` ORDER BY rank ASC";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/sys_payment.htm");
$dlist->SetSource($sql);
$dlist->display();
示例3: ltrim
//主表信息
$sByoU_neT_row = $dsql->GetOne("select * from #@__arctype where id='{$bid}' and topid!=45 limit 1");
//列表
$sByou_NET_list .= '
<tr>
<td colspan="5" class="tabTitle">
<a href="' . $BOOK_URL . ltrim($sByoU_neT_row['typedir'], '/') . '/" title="' . $sByoU_neT_row['typename'] . '" target="_blank">' . $sByoU_neT_row['typename'] . '</a>
/ 书签:' . $sq . '
</td>
<td width="25%" align="center" class="doPost">
<span class="itemDigg">
<a class="text_button" href="' . $TXT_URL . '?topid=' . $sByoU_neT_row['topid'] . '&id=' . $bid . '&date=' . $sByoU_neT_row['lastupdate'] . '" target="_blank">[下载TXT]</a>
</span>
<span class="itemManage">
<a href="' . $BOOK_URL . 'member/archives_do.php?dopost=delStow&aid=' . $bid . '">[删除收藏]</a>
</span>
</td>
</tr>
<tr>
<td colspan="6" class="tabTitle tbBtm">收藏时间:' . date('Y-m-d H:i:s', $sbYou_neT_row->addtime) . '</td>
</tr>
';
}
if (!$pagenum) {
$sByou_NET_list = '<tr><td> 暂时没有收藏!</td></tr>';
}
//加载模板
require_once DEDEINC . "/datalistcp.class.php";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEMEMBER . '/templets/mystow.htm');
$dlist->Display();
示例4: dirname
<?php
/**
* 自定义表单列表管理
*
* @version $Id: diy_main.php 1 18:31 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('c_List');
require_once DEDEINC . "/datalistcp.class.php";
require_once DEDEINC . "/common.func.php";
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$sql = "Select `diyid`,`name`,`table` From #@__diyforms order by diyid asc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/diy_main.htm");
$dlist->SetSource($sql);
$dlist->display();
$dlist->Close();
示例5: TestType
<?php
/**
* 自定义模型管理
*
* @version $Id: mychannel_main.php 1 15:26 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . '/config.php';
CheckPurview('temp_Other');
require_once DEDEINC . '/datalistcp.class.php';
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, '/');
$sql = "SELECT myt.aid,myt.tagname,tp.typename,myt.timeset,myt.endtime\r\n FROM `#@__mytag` myt LEFT JOIN `#@__arctype` tp ON tp.id=myt.typeid ORDER BY myt.aid DESC ";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . '/templets/mytag_main.htm');
$dlist->SetSource($sql);
$dlist->display();
function TestType($tname)
{
return $tname == '' ? '所有栏目' : $tname;
}
function TimeSetValue($ts)
{
return $ts == 0 ? '不限时间' : '限时标记';
}
示例6: dirname
<?php
require_once dirname(__FILE__) . '/config.php';
CheckPurview('a_List,a_AccList,a_MyList');
require_once DEDEINC . '/datalistcp.class.php';
if (empty($cid)) {
$cid = '0';
$whereSql = '';
}
if ($cid != 0) {
require_once DEDEINC . '/channelunit.func.php';
$whereSql = " And arc.typeid in (" . GetSonIds($cid) . ")";
}
$query = "SELECT arc.*,tp.typename FROM `#@__archives` AS arc\r\nLEFT JOIN #@__arctype AS tp ON arc.typeid = tp.id\r\nWHERE arc.arcrank = '-2' {$whereSql} order by arc.id desc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/recycling.htm");
$dlist->SetSource($query);
$dlist->display();
示例7: ltrim
//列表
$dsql->SetQuery($where_sql . " order by id desc limit {$offset},{$num}");
$dsql->Execute();
while ($list_row = $dsql->GetObject()) {
$topid = $list_row->topid;
if ($list_row->zuozhe) {
$list_zz = '<a style="color:#025b81;" href="' . $cfg_indexurl . 'author/?' . $list_row->id . '.html" target="_blank" title="' . $list_row->zuozhe . '">' . $list_row->zuozhe . '</a>';
} else {
$list_zz = '<font style="color:#343434;">未记录</font>';
}
$gxlb_i++;
$gxlb_i % 2 == 0 ? $class = ' class="odd"' : ($class = '');
$list_str .= '
<li' . $class . '>
<div class="c"><a href="' . $cfg_indexurl . SBYOU_NET_catalog($topid, 'typedir') . '.html" title="' . str_replace('·', '', SBYOU_NET_catalog($topid, 'typename')) . '">[' . str_replace('·', '', SBYOU_NET_catalog($topid, 'typename')) . ']</a></div>
<div class="title">
<div class="t"><a href="' . $cfg_indexurl . ltrim($list_row->typedir, '/') . '/" title="' . $list_row->typename . '" target="_blank">' . $list_row->typename . '</a></div>
<div class="n">' . SbYOU_Net_NEW($list_row->id, ltrim($list_row->typedir, '/')) . '</div>
</div>
<div class="words">' . $list_row->booksize . '</div>
<div class="author">' . $list_zz . '</div>
<div class="abover">' . ($list_row->overdate == 0 ? '<span>连载</span>' : '<font style="color:blue">完结</font>') . '</div>
<div class="time">' . date('Y-m-d', $list_row->lastupdate) . '</div>
</li>
';
}
//加载模板
require_once DEDEINC . "/datalistcp.class.php";
$dlist = new DataListCP();
$dlist->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $cfg_df_style . "/shuku.htm");
$dlist->Display();
示例8: dirname
<?php
/**
* 投票管理
*
* @version $Id: vote_main.php 1 23:54 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . "/datalistcp.class.php";
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$sql = "SELECT aid,votename,starttime,endtime,totalcount,isenable FROM #@__vote ORDER BY aid DESC";
$dlist = new DataListCP();
$issel = isset($issel) ? $issel : 0;
$aid = isset($aid) ? $aid : 0;
if ($issel == 1) {
$dlist->SetParameter('issel', $issel);
$dlist->SetTemplet(DEDEADMIN . "/templets/vote_select.htm");
} else {
$dlist->SetTemplet(DEDEADMIN . "/templets/vote_main.htm");
}
$dlist->SetSource($sql);
$dlist->display();
示例9: DataListCP
}
if (!is_numeric($id)) {
$id = '/' . $id;
$id_row = $dsql->GetOne("select * from dede_arctype where typedir='{$id}' and topid!=45 order by id desc limit 1");
if (!$id_row['id']) {
SBYOU_net_error('1', '请指定正确的文档!');
}
$id = $id_row['id'];
$topid = $id_row['topid'];
}
$sbyou_net = $topid;
//相关变量
$BOOK_URL = sbyou_net_sysconfig('cfg_basehost') . sbyou_net_sysconfig('cfg_indexurl');
$cfg_indexurl = sbyou_net_sysconfig('cfg_indexurl');
$templets = $cfg_indexurl . 'templets/' . sbyou_net_sysconfig('cfg_df_style');
//小说封面
$arctype_row = $dsql->GetOne("select * from dede_arctype where id={$id} limit 1");
//小说章节
$dsql->SetQuery("select * from dede_archives where typeid={$id} order by chapter_no asc,id asc");
$dsql->Execute();
while ($archives_row = $dsql->GetObject()) {
$list .= '<li><a href="' . $cfg_indexurl . str_replace('/', '', $arctype_row['typedir']) . '/' . $archives_row->id . '.html" title="' . $archives_row->title . '" target="_blank">' . $archives_row->title . '</a></li>';
}
//当前栏目
$catalog = SBYOU_NET_catalog($arctype_row['topid'], 'typename');
$catalog_typedir = SBYOU_NET_catalog($arctype_row['topid'], 'typedir');
//加载模板
require_once DEDEINC . "/datalistcp.class.php";
$dlist = new DataListCP();
$dlist->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $cfg_df_style . "/chapter.htm");
$dlist->Display();
示例10: GetPic
if (empty($ischeck)) {
$ischeck = 0;
$ischeckSql = '';
} else {
if ($ischeck == -1) {
$ischeckSql = " And ischeck < 1 ";
} else {
$ischeckSql = " And ischeck='{$ischeck}' ";
}
}
$selCheckArr = array(0 => '不限类型', -1 => '未审核', 1 => '内页', 2 => '首页');
$sql = "SELECT * FROM `#@__flink` WHERE CONCAT(`url`,`webname`,`email`) LIKE '%{$keyword}%' {$ischeckSql} ORDER BY dtime desc";
$dlist = new DataListCP();
$dlist->SetParameter('keyword', $keyword);
$dlist->SetParameter('ischeck', $ischeck);
$dlist->SetTemplet(DEDEADMIN . '/templets/friendlink_main.htm');
$dlist->SetSource($sql);
$dlist->display();
function GetPic($pic)
{
if ($pic == '') {
return '无图标';
} else {
return "<img src='{$pic}' width='88' height='31' border='0' />";
}
}
function GetSta($sta)
{
if ($sta == 1) {
return '内页';
}
示例11: dirname
<?php
/**
* 二级域名评论调用
*
* @author cha369
* @package dedecms
*/
require_once dirname(__FILE__) . "/../include/common.inc.php";
require_once DEDEINC . "/datalistcp.class.php";
$action = isset($action) ? trim($action) : '';
$id = isset($id) && is_numeric($id) ? $id : 0;
if ($id < 1) {
exit;
}
$siteurl = '';
$sql = "select arctype.siteurl from #@__archives arc left join #@__arctype arctype on arctype.id=arc.typeid where arc.id={$id}";
$row = $dsql->GetOne($sql);
if (is_array($row)) {
$siteurl = $row['siteurl'];
}
$sql = "SELECT fb.*,mb.userid,mb.face as mface,mb.spacesta,mb.scores\r\nFROM `#@__feedback` fb\r\nLEFT JOIN `#@__member` mb ON mb.mid = fb.mid\r\nWHERE fb.aid={$id} and fb.ischeck='1'\r\nORDER BY fb.id DESC";
$dlist = new DataListCP();
$dlist->pageSize = 6;
$dlist->SetParameter('id', $id);
$dlist->SetTemplet(DEDETEMPLATE . '/plus/comments_frame.htm');
$dlist->SetSource($sql);
$dlist->display();
示例12: ConvertStr
exit;
}
$typename = ConvertStr($row['typename']);
//当前栏目下级分类
$dsql->SetQuery("Select id,typename From `#@__arctype` where reid='{$id}' And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank");
$dsql->Execute();
while ($row = $dsql->GetObject()) {
$channellistnext .= "<a href='wap.php?action=list&id={$row->id}'>" . ConvertStr($row->typename) . "</a> ";
}
$channelnav = "<div class='sublist'>子栏目:" . $channellistnext . "</div>";
//栏目内容(分页输出)
$sids = GetSonIds($id, 1, true);
$varlist = "cfg_webname,typename,channelnav,channellist,channellistnext,cfg_templeturl,cfg_powerby";
ConvertCharset($varlist);
$dlist = new DataListCP();
$dlist->SetTemplet($cfg_basedir . "/wap/list.php");
$dlist->pageSize = 20;
$dlist->SetParameter("action", "list");
$dlist->SetParameter("id", $id);
$dlist->SetSource("Select id,title,pubdate,click From `#@__archives` where typeid in({$sids}) And arcrank=0 order by id desc");
$dlist->Display();
exit;
} else {
if ($action == 'article') {
//文档信息
$query = "\n\t Select tp.typename,tp.ishidden,arc.typeid,arc.title,arc.keywords,arc.arcrank,arc.pubdate,arc.writer,arc.click,addon.body From `#@__archives` arc \n\t left join `#@__arctype` tp on tp.id=arc.typeid\n\t left join `#@__addonarticle` addon on addon.aid=arc.id\n\t where arc.id='{$id}'\n\t";
$row = $dsql->GetOne($query, MYSQL_ASSOC);
foreach ($row as $k => $v) {
${$k} = $v;
}
unset($row);
示例13: update
{
$where = " where tag like '%$tag%'";
}
else
{
$where = '';
}
$neworderway = ($orderway == 'desc' ? 'asc' : 'desc');
$query = "Select * from `#@__tagindex` left join `#@__tagindex_ex` using(id) $where order by $orderby $orderway";
$dlist = new DataListCP();
$tag = stripslashes($tag);
$dlist->SetParameter("tag",$tag);
$dlist->SetParameter("orderway",$orderway);
$dlist->SetParameter("orderby",$orderby);
$dlist->pageSize = 20;
$dlist->SetTemplet(DEDEADMIN."/templets/ex_tags_main.htm");
$dlist->SetSource($query);
$dlist->Display();
exit();
}
/*
function update()
*/
else if($action == 'update')
{
$tid = isset($_POST['tid']) ? (int)$_POST['tid'] : 0;
if(empty($tid))
{
ShowMsg('没有选择要删除的tag!','-1');
exit();
示例14: GetSta
/**
* 自定义模型管理
*
* @version $Id: mychannel_main.php 1 15:26 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('c_List');
require_once DEDEINC . '/datalistcp.class.php';
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$sql = "SELECT id,nid,typename,addtable,isshow,issystem FROM `#@__channeltype` ORDER BY id DESC";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/mychannel_main.htm");
$dlist->SetSource($sql);
$dlist->display();
function GetSta($sta, $id)
{
if ($sta == 1) {
return $id != -1 ? "启用 > <a href='mychannel_edit.php?dopost=hide&id={$id}'><u>禁用</u></a>" : "固定项目";
} else {
return "禁用 > <a href='mychannel_edit.php?dopost=show&id={$id}'><u>启用</u></a>";
}
}
function IsSystem($s)
{
return $s == 1 ? "系统" : "自动";
}
示例15: ltrim
//列表
$dsql->SetQuery($where_sql . " order by id desc limit {$offset},{$num}");
$dsql->Execute();
while ($list_row = $dsql->GetObject()) {
$topid = $list_row->topid;
$gxlb_i++;
$gxlb_i % 2 == 0 ? $class = ' class="odd"' : ($class = '');
if ($list_row->zuozhe) {
$list_zz = '<a style="color:#025b81;" href="' . $cfg_indexurl . 'author/?' . $list_row->id . '.html" target="_blank" title="' . $list_row->zuozhe . '">' . $list_row->zuozhe . '</a>';
} else {
$list_zz = '<font style="color:#343434;">未记录</font>';
}
$list_str .= '
<li' . $class . '>
<div class="c"><a href="' . $cfg_indexurl . SBYOU_NET_catalog($topid, 'typedir') . '.html" title="' . str_replace('·', '', SBYOU_NET_catalog($topid, 'typename')) . '">[' . str_replace('·', '', SBYOU_NET_catalog($topid, 'typename')) . ']</a></div>
<div class="title">
<div class="t"><a href="' . $cfg_indexurl . ltrim($list_row->typedir, '/') . '/" title="' . $list_row->typename . '" target="_blank">' . $list_row->typename . '</a></div>
<div class="n">' . SbYOU_Net_NEW($list_row->id, ltrim($list_row->typedir, '/')) . '</div>
</div>
<div class="words">' . $list_row->booksize . '</div>
<div class="author">' . $list_zz . '</div>
<div class="abover">' . ($list_row->overdate == 0 || $list_row->overdate == '' ? '连载' : '完结') . '</div>
<div class="time">' . date('Y-m-d', $list_row->lastupdate) . '</div>
</li>
';
}
//加载模板
require_once DEDEINC . "/datalistcp.class.php";
$dlist = new DataListCP();
$dlist->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $cfg_df_style . "/catalog_list.htm");
$dlist->Display();