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


PHP DataListCP::SetTemplate方法代码示例

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


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

示例1: time

    $cip = "";
}
if (empty($dtime)) {
    $dtime = 0;
}
if ($adminid > 0) {
    $where .= " AND #@__log.adminid='{$adminid}' ";
}
if ($cip != "") {
    $where .= " AND #@__log.cip LIKE '%{$cip}%' ";
}
if ($dtime > 0) {
    $nowtime = time();
    $starttime = $nowtime - $dtime * 24 * 3600;
    $where .= " AND #@__log.dtime>'{$starttime}' ";
}
$sql = "SELECT #@__log.*,#@__admin.userid FROM #@__log\n     LEFT JOIN #@__admin ON #@__admin.id=#@__log.adminid\n     WHERE 1=1 {$where} ORDER BY #@__log.lid DESC";
$adminlist = "";
$dsql->SetQuery("SELECT id,uname FROM #@__admin");
$dsql->Execute('admin');
while ($myrow = $dsql->GetObject('admin')) {
    $adminlist .= "<option value='{$myrow->id}'>{$myrow->uname}</option>\r\n";
}
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("adminid", $adminid);
$dlist->SetParameter("cip", $cip);
$dlist->SetParameter("dtime", $dtime);
$dlist->SetTemplate(DEDEADMIN . "/templets/log_list.htm");
$dlist->SetSource($sql);
$dlist->Display();
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:log_list.php

示例2: dirname

<?php

/**
 * @version        $Id: mygroup.php 1 12:11 2010年9月13日Z tianya $
 * @package        DedeCMS.Module.Group
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/system/config.php";
require_once DEDEINC . "/datalistcp.class.php";
$menutype = 'mydede';
$sql = "SELECT * FROM #@__groups WHERE ishidden='0' AND uid='" . $cfg_ml->M_ID . "'  ORDER BY threads DESC,stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
//这两句的顺序不能更换
$dl->SetTemplate(_SYSTEM_ . "/mygroup.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
开发者ID:healthguo,项目名称:PHP,代码行数:22,代码来源:mygroup.php

示例3: VALUES

                            $row3 = "INSERT INTO\r\n                `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n                VALUES ('admin','{$row['id']}','{$cfg_ml->M_ID}','{$cfg_ml->M_LoginID}','inbox','{$row['subject']}','{$row['sendtime']}','{$row['writetime']}','{$row['hasview']}','{$row['isadmin']}','{$row['message']}')";
                            $dsql->ExecuteNoneQuery($row3);
                        }
                    }
                    if ($state == "1") {
                        $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=1";
                        $tname = "收件箱";
                    } else {
                        if ($state == "-1") {
                            $wsql = "toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=0";
                            $tname = "收件箱";
                        } else {
                            $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!=''";
                            $tname = "收件箱";
                        }
                    }
                } else {
                    $wsql = " `fromid` ='{$cfg_ml->M_ID}' AND folder LIKE 'outbox'";
                    $tname = "已发信息";
                }
                $query = "SELECT * FROM `#@__member_pms` WHERE {$wsql} ORDER BY sendtime DESC";
                $dlist = new DataListCP();
                $dlist->pageSize = 20;
                $dlist->SetParameter("dopost", $dopost);
                $dlist->SetTemplate(DEDEMEMBER . '/templets/pm-main.htm');
                $dlist->SetSource($query);
                $dlist->Display();
            }
        }
    }
}
开发者ID:Miliup,项目名称:miliofficeweb,代码行数:31,代码来源:pm.php

示例4: IsChecklog

//获得是否审核的表述
function IsChecklog($ischeck)
{
    $s = '';
    $s = $ischeck == '1' ? "<font color=blue>已审核</font>" : "<font color=red>未审核</font>";
    return $s;
}
function JstrimJajxLog($str, $len)
{
    $str = cn_substr($str, $len);
    $str = str_replace('&#039;', '"', $str);
    $str = str_replace('&lt;', '<', $str);
    $str = str_replace('&gt;', '>', $str);
    return $str;
}
$row = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table}");
$totalnum = $row['dd'];
$rows = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table} WHERE ischeck=1");
$checknum = $rows['dd'];
$rowss = $dsql->GetOne("SELECT COUNT({$id}) AS dd FROM {$table} WHERE ischeck=0");
$ischecknum = $rowss['dd'];
$sql = "SELECT * FROM {$table} WHERE 1=1 {$where} ORDER BY dtime DESC";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("type", $type);
$dlist->SetParameter("totalnum", $totalnum);
$dlist->SetParameter("checknum", $checknum);
$dlist->SetParameter("ischecknum", $ischecknum);
$dlist->SetTemplate($tpl);
$dlist->SetSource($sql);
$dlist->Display();
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:member_info_main.php

示例5: DataListCP

     $dlist->SetTemplate(DEDEMEMBER . "/space/{$_vars['spacestyle']}/listalbum.htm");
     $dlist->SetSource($query);
     $dlist->Display();
     exit;
 } else {
     if ($action == 'guestbook') {
         if (empty($mtype)) {
             $mtype = 0;
         }
         include_once DEDEINC . '/datalistcp.class.php';
         $query = "SELECT mg.*,mb.face,mb.userid,mb.sex From `#@__member_guestbook` mg \n    left join `#@__member` mb on mb.userid=mg.gid \n    where mg.mid='{$_vars['mid']}' order by mg.aid desc";
         $dlist = new DataListCP();
         $dlist->pageSize = 10;
         $dlist->SetParameter("uid", $_vars['userid']);
         $dlist->SetParameter("action", $action);
         $dlist->SetTemplate(DEDEMEMBER . "/space/{$_vars['spacestyle']}/guestbook.htm");
         $dlist->SetSource($query);
         $dlist->Display();
         exit;
     } else {
         if ($action == 'friend') {
             if (empty($mtype)) {
                 $mtype = 0;
             }
             include_once DEDEINC . '/arc.memberlistview.class.php';
             include_once DEDEINC . '/channelunit.func.php';
             $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n          from `#@__archives` arc\n          left join `#@__arctype` tp on arc.typeid=tp.id\n          where arc.mid='{$_vars['mid']}' {$addqSql} order by arc.id desc";
             $dlist = new MemberListview();
             $dlist->pageSize = 8;
             $dlist->SetParameter("mtype", $mtype);
             $dlist->SetParameter("uid", $_vars['userid']);
开发者ID:wshudong,项目名称:hbypsy,代码行数:31,代码来源:space_action.php

示例6: GetMemberID

    }
    $sql = "SELECT * FROM #@__moneycard_record {$addsql} ORDER BY aid DESC";
    $dlist = new DataListCP();
    $dlist->pageSize = 25;
    //设定每页显示记录数(默认25条)
    if (isset($isexp)) {
        $dlist->SetParameter("isexp", $isexp);
    }
    $dlist->dsql->SetQuery("SELECT * FROM #@__moneycard_type ");
    $dlist->dsql->Execute('ts');
    while ($rw = $dlist->dsql->GetArray('ts')) {
        $TypeNames[$rw['tid']] = $rw['pname'];
    }
    $tplfile = DEDEADMIN . "/templets/cards_manmage.htm";
    //这两句的顺序不能更换
    $dlist->SetTemplate($tplfile);
    //载入模板
    $dlist->SetSource($sql);
    //设定查询SQL
    $dlist->Display();
    //显示
}
function GetMemberID($mid)
{
    global $dsql;
    if ($mid == 0) {
        return '0';
    }
    $row = $dsql->GetOne("SELECT userid FROM #@__member WHERE mid='{$mid}' ");
    if (is_array($row)) {
        return "<a href='member_view.php?mid={$mid}'>" . $row['userid'] . "</a>";
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:cards_manage.php

示例7: _get_smalltype

$keywords = preg_replace("#[\"\r\n\t\\*\\?\\(\\)\$%']#", " ", trim($keywords));
$keywords = addslashes($keywords);
$addsql = "WHERE gid='{$id}' AND closed='0' ";
if ($typeid > 0) {
    $addsql .= "AND smalltype='{$typeid}' ";
}
if (!empty($keywords)) {
    $addsql .= "AND subject like '%" . $keywords . "%' ";
}
function _get_smalltype($id, $_field = 'name')
{
    global $db;
    $row = $db->GetOne("SELECT `id`,`name` FROM `#@__group_smalltypes` WHERE id='{$id}'");
    if (isset($row[$_field])) {
        return '[' . $row[$_field] . ']';
    }
}
static $row_fields = false;
$sql = "SELECT tid,subject,digest,displayorder,replies,lastpost,lastposter,smalltype,author,views FROM #@__group_threads {$addsql} ORDER BY displayorder DESC, lastpost DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter('id', $id);
$dl->SetParameter("keywords", $keywords);
$dl->SetParameter("typeid", $typeid);
//这两句的顺序不能更换
$dl->SetTemplate(GROUP_TPL . '/groupdisplay.html');
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
开发者ID:healthguo,项目名称:PHP,代码行数:31,代码来源:groupdisplay.php

示例8: ShowMsg

}
$arcsta = $cInfos['arcsta'];
//禁止访问无权限的模型
if ($cInfos['usertype'] != '' && $cInfos['usertype'] != $cfg_ml->M_MbType) {
    ShowMsg('你无权限访问该部分', '-1');
    exit;
}
if ($cid == 0) {
    $positionname = $cInfos['typename'] . " &gt;&gt; ";
} else {
    $positionname = str_replace($cfg_list_symbol, " &gt;&gt; ", $tl->GetPositionName()) . " &gt;&gt; ";
}
$whereSql = " where arc.channel = '{$channelid}' And arc.mid='{$mid}' ";
if ($keyword != '') {
    $keyword = cn_substr(trim(ereg_replace("[><\\|\"\r\n\t%\\*\\.\\?\\(\\)\$ ;,'%-]", "", stripslashes($keyword))), 30);
    $keyword = addslashes($keyword);
    $whereSql .= " And (arc.title like '%{$keyword}%') ";
}
if ($cid != 0) {
    $whereSql .= " And arc.typeid in (" . GetSonIds($cid) . ")";
}
$query = "select arc.aid,arc.aid as id,arc.typeid,arc.senddate,arc.channel,arc.click,arc.title,arc.mid,tp.typename\r\n        from `{$cInfos['addtable']}` arc\r\n        left join `#@__arctype` tp on tp.id=arc.typeid\r\n        {$whereSql}\r\n        order by arc.aid desc ";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("dopost", "listArchives");
$dlist->SetParameter("keyword", $keyword);
$dlist->SetParameter("cid", $cid);
$dlist->SetParameter("channelid", $channelid);
$dlist->SetTemplate(DEDEMEMBER . "/templets/content_sg_list.htm");
$dlist->SetSource($query);
$dlist->Display();
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:content_sg_list.php

示例9: array

$dsql->SetQuery("SELECT id,classname,pid,rank FROM #@__story_catalog ORDER BY rank asc");
$dsql->Execute();
$ranks = array();
$btypes = array();
$stypes = array();
while ($row = $dsql->GetArray()) {
    if ($row['pid'] == 0) {
        $btypes[$row['id']] = $row['classname'];
    } else {
        $stypes[$row['pid']][$row['id']] = $row['classname'];
    }
    $ranks[$row['id']] = $row['rank'];
}
$addquery = "";
$orderby = " order by b.bid desc ";
if ($catid != 0) {
    $addquery .= " And (b.bcatid='{$catid}' Or b.catid='{$catid}') ";
}
if ($keyword != "") {
    $addquery .= " And (b.bookname like '%{$keyword}%' Or b.author like '%{$keyword}%') ";
}
$query = "\r\n   SELECT b.bid,b.catid,b.bookname,b.booktype,b.litpic,b.postnum,b.senddate,b.ischeck, c.id AS cid,c.classname FROM #@__story_books b\r\n   LEFT JOIN #@__story_catalog c on c.id = b.catid WHERE mid={$cfg_ml->M_ID} AND b.bid>0 {$addquery} {$orderby}\r\n";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("keyword", $keyword);
$dlist->SetParameter("catid", $cid);
$dlist->SetParameter("orderby", $orderby);
$dlist->SetTemplate(dirname(__FILE__) . "/templets/book/story_books.htm");
$dlist->SetSource($query);
$dlist->Display();
$dlist->Close();
开发者ID:healthguo,项目名称:PHP,代码行数:31,代码来源:mybooks.php

示例10: showMsg

 if ($action == 'list') {
     if (empty($diy->public)) {
         showMsg('后台关闭前台浏览', 'javascript:;');
         exit;
     }
     include_once DEDEINC . '/datalistcp.class.php';
     if ($diy->public == 2) {
         $query = "SELECT * FROM `{$diy->table}` ORDER BY id DESC";
     } else {
         $query = "SELECT * FROM `{$diy->table}` WHERE ifcheck=1 ORDER BY id DESC";
     }
     $datalist = new DataListCP();
     $datalist->pageSize = 10;
     $datalist->SetParameter('action', 'list');
     $datalist->SetParameter('diyid', $diyid);
     $datalist->SetTemplate(DEDEINC . "/../templets/plus/{$diy->listTemplate}");
     $datalist->SetSource($query);
     $fieldlist = $diy->getFieldList();
     $datalist->Display();
 } else {
     if ($action == 'view') {
         if (empty($diy->public)) {
             showMsg('后台关闭前台浏览', 'javascript:;');
             exit;
         }
         if (empty($id)) {
             showMsg('非法操作!未指定id', 'javascript:;');
             exit;
         }
         if ($diy->public == 2) {
             $query = "SELECT * FROM {$diy->table} WHERE id='{$id}' ";
开发者ID:km1994,项目名称:baisha,代码行数:31,代码来源:diy.php

示例11: GetArcUrl

        $query = "SELECT addon.*, arctype.* FROM {$addontable} addon \n        LEFT JOIN #@__arctype arctype ON arctype.id = addon.typeid\n        {$where} {$orderby}";
    } else {
        $query = "SELECT main.id AS aid,main.*,main.description AS description1, type.* \n    FROM {$maintable} main \n    LEFT JOIN #@__arctype type ON type.id = main.typeid \n    LEFT JOIN {$addontable} addon ON addon.aid = main.id \n    {$where}  {$orderby}";
    }
    $sql = $query;
} else {
    $sql = urldecode($sql);
    $query = $sql;
}
$sql = urlencode($sql);
//生成sql的唯一序列化字符串,并将sql语句记录到session中去
$sqlhash = md5($sql);
$_SESSION[$sqlhash] = $sql;
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("hash", $sqlhash);
$dlist->SetParameter("mid", $mid);
if (file_exists(DEDEROOT . "/templets/default/{$template}")) {
    $templatefile = DEDEROOT . "/templets/default/{$template}";
} else {
    $templatefile = DEDEROOT . "/templets/default/advancedsearch.htm";
}
$dlist->SetTemplate($templatefile);
$dlist->SetSource($query);
require_once DEDEINC . "/channelunit.class.php";
//获得一个指定档案的链接
function GetArcUrl($aid, $typeid, $timetag, $title, $ismake = 0, $rank = 0, $namerule = '', $artdir = '', $money = 0)
{
    return GetFileUrl($aid, $typeid, $timetag, $title, $ismake, $rank, $namerule, $artdir, $money);
}
$dlist->Display();
开发者ID:bthtml,项目名称:web-hwxf,代码行数:31,代码来源:advancedsearch.php

示例12: _ShowLoad

  </tr>
  <tr>
    <td height="90">&nbsp;</td>
    <td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php 
                echo $row['rule'];
                ?>
</textarea></td>
  </tr>
  <tr>
    <td height="32">&nbsp;</td>
    <td colspan="2"><input class="nbt" type="submit" name="Submit" value="保存规则" /> 
    <input type="reset" class="nbt" name="Submit2" value="重置" /></td>
  </tr>
</table>
</form>
<?php 
                exit;
            }
        }
    }
}
//loadedit
/*---------------
function _ShowLoad(){ }
-------------*/
$sql = "";
$sql = "Select id,url,title,lang,issource From `#@__co_onepage` order by id desc";
$dlist = new DataListCP();
$dlist->SetTemplate(DEDEADMIN . "/templets/article_coonepage_rule.htm");
$dlist->SetSource($sql);
$dlist->Display();
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:article_coonepage_rule.php

示例13: DataListCP

            $db->ExecuteNoneQuery("UPDATE #@__group_guestbook SET message='" . $message . "',title='" . $title . "' WHERE bid='{$id}'");
        }
    } else {
        if ($action == "edit") {
            $row = $db->GetOne("SELECT * FROM #@__group_guestbook WHERE bid='{$id}'");
            $title = $row['title'];
            $message = $row['message'];
        }
    }
}
//列表加载模板
$wheresql = "WHERE gid='{$gid}'";
if (!empty($keyword)) {
    $wheresql .= " AND    (title like '%" . $keyword . "%' OR message like '%" . $keyword . "%')";
}
if (!empty($username)) {
    $wheresql .= " AND uname like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__group_guestbook {$wheresql} ORDER BY stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("keyword", $keyword);
$dl->SetParameter("username", $username);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_guestbook.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:group_guestbook.php

示例14: filter

        }
    }
}
//列表加载模板
$wheresql = "WHERE gid='{$gid}'";
if (!empty($username)) {
    $wheresql .= " AND username like '%" . $username . "%'";
}
$sql = "SELECT * FROM #@__group_user {$wheresql} ORDER BY jointime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
$dl->SetParameter("username", $username);
$dl->SetParameter("id", $id);
$dl->SetParameter("gid", $gid);
//这两句的顺序不能更换
$dl->SetTemplate(DEDEADMIN . "/templets/group_user.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
function filter($var)
{
    return $var == '' ? false : true;
}
function GetMaster($user)
{
    global $ismaster;
    $master = explode(",", $ismaster);
    if (in_array($user, $master)) {
        return "<img src='img/adminuserico.gif'> 管理员";
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:group_user.php

示例15: GetSta

require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . "/datalistcp.class.php";
CheckPurview('shops_Operations');
if (!isset($oid)) {
    exit("<a href='javascript:window.close()'>无效操作!</a>");
}
$oid = preg_replace("#[^-0-9A-Z]#", "", $oid);
if (empty($oid)) {
    exit("<a href='javascript:window.close()'>无效订单号!</a>");
}
$row = $dsql->GetOne("SELECT * FROM #@__shops_userinfo WHERE oid='{$oid}'");
$sql = "SELECT o.*,p.title,p.price as uprice,d.dname FROM #@__shops_orders as o left join #@__shops_products as p on o.oid=p.oid left join #@__shops_delivery as d on d.pid=o.pid WHERE o.oid='{$oid}'";
$dlist = new DataListCP();
$dlist->pageSize = 20;
$dlist->SetParameter("oid", $oid);
$dlist->SetTemplate(DEDEADMIN . "/templets/shops_operations_cart.htm");
$dlist->SetSource($sql);
$dlist->Display();
$dlist->Close();
function GetSta($sta, $oid)
{
    global $dsql;
    $row = $dsql->GetOne("SELECT paytype FROM #@__shops_orders WHERE oid='{$oid}'");
    $payname = $dsql->GetOne("SELECT name,fee FROM #@__payment WHERE id='{$row['paytype']}'");
    if ($sta == 0) {
        return $payname['name'] . " 手续费:" . $payname['fee'] . "元";
    } else {
        if ($sta == 1) {
            return '<font color="red">已付款,等发货</font>';
        } else {
            if ($sta == 2) {
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:shops_operations_cart.php


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