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


PHP getTpl函数代码示例

本文整理汇总了PHP中getTpl函数的典型用法代码示例。如果您正苦于以下问题:PHP getTpl函数的具体用法?PHP getTpl怎么用?PHP getTpl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: filters

    public static function filters($row, $inIds, $params)
    {
        global $modx;
        $pr = $modx->db->config['table_prefix'];
        $inparent = !empty($params['parent']) ? ' AND cont.parent IN(' . $params['parent'] . ')' : '';
        $intemplate = !empty($params['template']) ? ' AND cont.template=' . $params['template'] : '';
        $checkboxTpl = isset($params['checkboxTpl']) ? getTpl($params['checkboxTpl']) : self::$templates['checkboxTpl'];
        $checkboxOuterTpl = isset($params['checkboxOuterTpl']) ? getTpl($params['checkboxOuterTpl']) : self::$templates['checkboxOuterTpl'];
        $result = $modx->db->query('SELECT COUNT(*) as cnt,value,tmplvarid FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' ' . $inIds . '
			GROUP BY value ORDER BY value ASC');
        while ($inrow = $modx->db->getRow($result)) {
            if (!empty($inrow['value'])) {
                $checked = '';
                if (isset($_GET[$inrow['name']])) {
                    foreach ($_GET[$inrow['name']] as $names) {
                        if ($inrow['value'] == $names) {
                            $checked = 'checked="checked"';
                        }
                    }
                }
                $items .= $modx->parseText($checkboxTpl, array('name' => $row['name'], 'value' => $inrow['value'], 'active' => $checked, 'count' => $inrow['cnt']));
            }
        }
        return $modx->parseText($checkboxOuterTpl, array('title' => $row['title'], 'wrapper' => $items));
    }
开发者ID:myindexlike,项目名称:evofilter,代码行数:27,代码来源:checkbox.inc.php

示例2: vhost

 function vhost($data)
 {
     $data = unserialize($data);
     if (!is_object($data) || !$data->name) {
         return false;
     }
     $dir = $data->root;
     if ($dir && !is_dir($dir)) {
         mkdir($dir, 0750, true);
         // Block other's access to here
         chgrp($dir, 'www');
         file_put_contents($dir . '/index.php', getTpl('userdefault', $data));
     }
     $cmd = "chown -R {$data->owner} {$dir}";
     return shell_exec($cmd);
 }
开发者ID:BGCX261,项目名称:zhpanel-svn-to-git,代码行数:16,代码来源:daemon.php

示例3: webAdd

 public function webAdd()
 {
     $this->checkTrain();
     layout(false);
     $Ssid = D('ssid');
     $gw_id = I('get.gw_id', '');
     $ssid = $Ssid->getSsidByRid($gw_id);
     if (empty($ssid)) {
         $url = U('Ssid/ssidAdd', array('gw_id' => $gw_id));
         $this->error('请先添加热点', $url);
     }
     $tpl = getTpl();
     $this->assign('ssid', $ssid);
     $this->assign('tpl', $tpl);
     $this->display();
 }
开发者ID:leifuchen0111,项目名称:company,代码行数:16,代码来源:WebMagController.class.php

示例4: filters

    public static function filters($row, $inIds, $params)
    {
        global $modx;
        $pr = $modx->db->config['table_prefix'];
        $inparent = !empty($params['parent']) ? ' AND cont.parent IN(' . $params['parent'] . ')' : '';
        $intemplate = !empty($params['template']) ? ' AND cont.template=' . $params['template'] : '';
        $priceTpl = isset($params['priceTpl']) ? getTpl($params['priceTpl']) : self::$templates['priceTpl'];
        $priceOuterTpl = isset($params['priceOuterTpl']) ? getTpl($params['priceOuterTpl']) : self::$templates['priceOuterTpl'];
        $resm = $modx->db->query('SELECT min( cast(value as decimal) ) as value FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' order by value ASC');
        $rowm = $modx->db->getRow($resm);
        $row['min'] = $rowm['value'];
        $resm = $modx->db->query('SELECT max( cast(value as decimal) ) as value FROM ' . $pr . 'site_tmplvar_contentvalues as c
			LEFT join ' . $pr . 'site_content as cont ON (cont.id=c.contentid)
			WHERE tmplvarid="' . $row['id'] . '" ' . $inparent . ' ' . $intemplate . ' order by value ASC');
        $rowm = $modx->db->getRow($resm);
        $row['max'] = $rowm['value'];
        $items .= $modx->parseText($priceTpl, array('name' => $row['name'], 'min' => $row['min'], 'max' => $row['max']));
        return $modx->parseText($priceOuterTpl, array('title' => $row['title'], 'wrapper' => $items));
    }
开发者ID:myindexlike,项目名称:evofilter,代码行数:21,代码来源:price.inc.php

示例5: getpage

//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
$showpage = getpage("", "", "bencandy.php?fid={$fid}&id={$id}", 1, $rsdb[pages]);
if ($rsdb[iframeurl]) {
    $head_tpl = $foot_tpl = "template/default/none.htm";
    $main_tpl = "template/default/bencandy_iframe.htm";
}
/**
*上一篇与下一篇,比较影响速度
**/
$nextdb = $db->get_one("SELECT title,id,fid FROM {$_pre}content WHERE id<'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY id DESC LIMIT 1");
$nextdb[subject] = get_word($nextdb[title], 60);
$backdb = $db->get_one("SELECT title,id,fid FROM {$_pre}content WHERE id>'{$id}' AND fid='{$fid}' AND yz=1 ORDER BY id ASC LIMIT 1");
$backdb[subject] = get_word($backdb[title], 60);
require ROOT_PATH . "inc/head.php";
require getTpl("bencandy", $main_tpl);
require ROOT_PATH . "inc/foot.php";
/**
*文章检查
**/
function check_article($rsdb)
{
    global $fidDB, $web_admin, $groupdb, $timestamp, $lfjid, $lfjuid, $fid, $id, $buy, $lfjdb, $webdb, $pre, $_pre, $db;
    if ($lfjid && ($web_admin || $lfjid == $rsdb[uid] || in_array($lfjid, explode(",", $fidDB[admin])))) {
        $power = 1;
    }
    if (!$rsdb) {
        showerr("内容不存在");
    }
    if ($fidDB[allowviewcontent] && !$power && !in_array($groupdb[gid], explode(",", $fidDB[allowviewcontent]))) {
        showerr("本栏目设置,你所在用户组不允许浏览内容");
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:bencandy.php

示例6: intval

    $typedb[$type] = " checked ";
} else {
    $typedb[title] = " checked ";
}
$mid = intval($mid);
$module_select = "<select name='mid' onChange=\"window.location.href='?mid='+this.options[this.selectedIndex].value\"><option value='0'  style='color:#aaa;'>所有模型</option>";
foreach ($module_db as $key => $value) {
    $ckk = $mid == $key ? ' selected ' : ' ';
    $module_select .= "<option value='{$key}' {$ckk}>{$value}</option>";
}
$module_select .= "</select>";
if ($mid) {
    $SQL = " AND mid='{$mid}' ";
} else {
    $SQL = "";
}
$fid_select = "<select name='fid' onChange=\"if(this.options[this.selectedIndex].value=='-1'){alert('你不能选择大分类');}\"><option value='0' style='color:#aaa;'>所有栏目</option>";
foreach ($Fid_db[0] as $key => $value) {
    $fid_select .= "<option value='-1' style='color:red;'>{$value}</option>";
    foreach ($Fid_db[$key] as $key2 => $value2) {
        $ckk = $fid == $key2 ? ' selected ' : ' ';
        $fid_select .= "<option value='{$key2}' {$ckk}>&nbsp;&nbsp;|--{$value2}</option>";
    }
}
$fid_select .= "</select>";
if (!$mid) {
    showerr('MID不存在');
}
require ROOT_PATH . "inc/head.php";
require getTpl("search_" . intval($mid));
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:search.php

示例7: dirname

<?php

require_once dirname(__FILE__) . "/global.php";
@(include dirname(__FILE__) . "/data/guide_fid.php");
$forum_ups = "<A HREF='{$Murl}/'>Ê×Ò³</A>" . $GuideFid[$fid];
require_once getTpl("foot_nav");
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:6,代码来源:foot_nav.php

示例8: tempdir

    }
    if ($rs[icon]) {
        $rs[icon] = tempdir($rs[icon]);
    }
    $rs[posttime] = date("Y-m-d H:i:s", $rs[posttime]);
    $rs[full_content] = $rs[content];
    $rs[content] = kill_badword($rs[content]);
    $rs[username] = kill_badword($rs[username]);
    $rs[title] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "", $rs[content]);
    $rs[title] = get_word($rs[title], 50);
    $rs[content] = get_word($rs[content], $leng);
    $rs[content] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/", "<div class='quotecomment_div'>\\1</div>", $rs[content]);
    $rs[content] = str_replace("\n", "<br>", $rs[content]);
    if ($lfjuid) {
        if ($lfjuid === $rs[cuid] || $web_admin || $lfjuid === $rs[uid] || in_array($lfjid, explode(",", $rsdb[admin]))) {
            $rs[ifadmin] = 1;
        } else {
            $rs[ifadmin] = 0;
        }
    } else {
        $rs[ifadmin] = 0;
    }
    $listdb[] = $rs;
}
/**
*评论分页功能
**/
$showpage = getpage("`{$_pre}comments` A", " WHERE A.id='{$id}' {$SQL}", "?fid={$fid}&id={$id}", $rows);
$showpage = preg_replace("/\\?fid=([\\d]+)&id=([\\d]+)&page=([\\d]+)/is", "javascript:getcomment('comment_ajax.php?fid=\\1&id=\\2&page=\\3')", $showpage);
require_once getTpl('comment_ajax');
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:30,代码来源:comment_ajax.php

示例9: date

$ch_pagetype = 3;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
if ($rsdb[uid]) {
    $userdb = $db->get_one("SELECT * FROM {$pre}memberdata WHERE uid='{$rsdb['uid']}'");
    $userdb[username] = $rsdb[username];
    $userdb[regdate] = date("y-m-d H:i", $userdb[regdate]);
    $userdb[lastvist] = date("y-m-d H:i", $userdb[lastvist]);
    $userdb[icon] = tempdir($userdb[icon]);
    include_once ROOT_PATH . "data/level.php";
    $userdb[level] = $ltitle[$userdb[groupid]];
} else {
    $userdb[username] = preg_replace("/([\\d]+)\\.([\\d]+)\\.([\\d]+)\\.([\\d]+)/is", "\\1.\\2.*.*", $rsdb[ip]);
    $userdb[level] = "游客";
}
unset($picdb);
if ($rsdb[picnum] > 1) {
    $query = $db->query("SELECT * FROM {$_pre}pic WHERE id='{$id}'");
    while ($rs = $db->fetch_array($query)) {
        $rs[imgurl] = tempdir($imgurl = $rs[imgurl]);
        $rs[picurl] = eregi("^http:", $imgurl) ? $rs[imgurl] : "{$rs['imgurl']}.gif";
        $picdb[] = $rs;
    }
}
require ROOT_PATH . "inc/head.php";
require getTpl("bencandy_{$fidDB['mid']}", $main_tpl);
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:bencandy.php

示例10: newBook

            if ($_SESSION['table'] == 'book') {
                newBook();
            }
            if ($_SESSION['table'] == 'category') {
                newCategory();
            }
            header("Location: http://" . $_SERVER['HTTP_HOST'] . "/");
            exit;
    }
}
if (!$_SESSION['user_id']) {
    $error['{ERROR}'] = isset($_SESSION['error_login']) ? "<font color='#a52a2a'>" . $_SESSION['error_login'] . "</font>" : "";
    $params['{LOGIN}'] = getTpl("login", $error);
    login();
} else {
    $userName = getUserName();
    $params['{LOGIN}'] = "<p id=\"logout\">You enter as: " . $userName . "<br><a href=\"?logout\"> logout</a></p>";
}
if (isset($_GET['category'])) {
    $_SESSION['table'] = 'category';
}
if (isset($_GET['book'])) {
    $_SESSION['table'] = 'book';
}
if (isset($_SESSION['table'])) {
    $params['{CONTENT}'] = $_SESSION['table'] == 'category' ? getCategory() : getBooks();
} else {
    $params['{CONTENT}'] = getBooks();
}
echo getTpl("main", $params);
开发者ID:otereza,项目名称:library,代码行数:30,代码来源:index.php

示例11: showerr

$_erp = $Fid_db[tableid][$fid];
$rsdb = $db->get_one("SELECT A.* FROM `{$_pre}content{$_erp}` A WHERE A.id='{$id}'");
if (!$rsdb) {
    showerr("×ÊÁϲ»´æÔÚ");
}
$fid = $rsdb[fid];
$mid = $rsdb[mid];
unset($urldb, $titledb);
$query = $db->query("SELECT * FROM {$_pre}pic WHERE id='{$id}'");
while ($rs = $db->fetch_array($query)) {
    $urldb[] = "'" . tempdir($rs[imgurl]) . "'";
    $titledb[] = "'" . addslashes($rs[name]) . "'";
}
if (!$urldb) {
    if ($rsdb[picurl]) {
        header("location:" . tempdir($rsdb[picurl]));
        exit;
    }
    echo '<SCRIPT LANGUAGE="JavaScript">
	<!--
		alert("NO IMG");
	self.close();
	//-->
	</SCRIPT>';
    exit;
}
$urldb = implode(",", $urldb);
$titledb = implode(",", $titledb);
require ROOT_PATH . "inc/head.php";
require getTpl("show_img");
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:show_img.php

示例12: dirname

<?php

require_once dirname(__FILE__) . "/" . "global.php";
$rsdb = $db->get_one("SELECT A.*,S.* FROM {$_pre}content A LEFT JOIN {$_pre}sort S ON A.fid=S.fid WHERE A.id='{$id}'");
if (!$rsdb) {
    die("µØÖ·ÓÐÎó,Çë¼ì²éÖ®");
}
@(include dirname(__FILE__) . "/data/guide_fid.php");
require ROOT_PATH . "inc/head.php";
require getTpl("comment");
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:11,代码来源:comment.php

示例13: foreach

        foreach ($postdb as $key => $value) {
            if ($value && table_field("{$_pre}content_{$mid}", $key)) {
                $_sql .= " AND B.`{$key}`='{$value}' ";
                $rsdb[$key][$value] = " selected ";
            }
        }
        //分页功能
        //$showpage=getpage("{$_pre}content A LEFT JOIN {$_pre}content_$mid B ON A.id=B.id","WHERE A.mid='$mid' AND $field LIKE '%$keyword%' $_sql","?mid=$mid&keyword=$keyword&action=search&type=$type",$rows);
        $SQL = "SELECT A.*,B.* FROM {$_pre}content A LEFT JOIN {$_pre}content_{$mid} B ON A.id=B.id WHERE A.mid='{$mid}' AND {$field} LIKE '%{$keyword}%' {$_sql} LIMIT {$min},{$rows} ";
    }
    $query = $db->query("{$SQL}");
    while ($rs = $db->fetch_array($query)) {
        $rs[posttime] = date("Y-m-d", $rs[posttime]);
        $listdb[] = $rs;
    }
    if (!$listdb) {
        showerr("很抱歉,没有找到你要查询的内容");
    }
    $typedb[$type] = " checked ";
} else {
    $typedb[title] = " checked ";
}
$mid = intval($mid);
$colordb[$mid] = "red;";
require ROOT_PATH . "inc/head.php";
if ($mid) {
    require getTpl("search_{$mid}");
} else {
    require getTpl("search");
}
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:31,代码来源:search.php

示例14: dirname

<?php

require dirname(__FILE__) . "/global.php";
/**
*为获取标签参数
**/
$chdb[main_tpl] = getTpl("city");
/**
*标签
**/
$ch_fid = 0;
//是否定义了栏目专用标签
$ch_pagetype = 4;
//2,为list页,3,为bencandy页
$ch_module = $webdb[module_id] ? $webdb[module_id] : 99;
//系统特定ID参数,每个系统不能雷同
$ch = 0;
//不属于任何专题
require ROOT_PATH . "inc/label_module.php";
require ROOT_PATH . "inc/head.php";
require getTpl("city");
require ROOT_PATH . "inc/foot.php";
开发者ID:xubo245,项目名称:liuyangzhang,代码行数:22,代码来源:city.php

示例15: dirname

<?php

require dirname(__FILE__) . "/" . "global.php";
if (!$web_admin) {
    showerr('你无权操作');
}
if ($step) {
    $array[content] = $content;
    //$array[content]=filtrate($content);
    $array[uid] = $lfjuid;
    $array[username] = $lfjid;
    $array[posttime] = $timestamp;
    $str = addslashes(serialize($array));
    $db->query("UPDATE {$_pre}content SET reply='{$str}' WHERE id='{$id}'");
    refreshto("./?fid={$fid}", "回复成功", 1);
} else {
    $rsdb = $db->get_one("SELECT * FROM {$_pre}content WHERE id='{$id}'");
    extract(unserialize($rsdb[reply]));
}
require ROOT_PATH . "inc/head.php";
require getTpl("replyguestbook");
require ROOT_PATH . "inc/foot.php";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:22,代码来源:replyguestbook.php


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