Exemple #1
0
function is_simple_perm($a1, $a2)
{
    $b = array();
    foreach ($a1 as $i) {
        $b[] = $a2[$i];
    }
    return _all($b);
}
Exemple #2
0
            }
        }
        $side_list .= '</ul>';
    }
    $side_list .= '</li>';
}
$_tpl->assign('side_list', $side_list);
/*内容*/
if (!empty($_GET['d']) && is_numeric($_GET['d'])) {
    $_sql = "SELECT * FROM tg_article where pid=" . $_pid . " AND id=" . $_GET['d'];
} else {
    $_sql = "SELECT * FROM tg_article where pid=" . $_pid;
}
global $_system;
_page($_sql, $_system['pics_list_num']);
$_article = _all(_query($_sql . " LIMIT {$_pageabsolute}," . $_system['pics_list_num']));
if (!count($_article)) {
    //echo '没数据,请添加右边内容数据';
    Module();
    exit;
}
_paging($_pid, 2);
$_tpl->assign('page_num', $page_num);
$_tpl->assign('article_list', $_article);
$_tpl->assign('article', $_article[0]);
if (isset($_GET['d']) && is_numeric($_GET['d'])) {
    $pos = _query("SELECT id,pid,title FROM tg_article where pid=" . $_pid);
    $pos_arr = array();
    $_all_id = array();
    while (!!($_rows = _fetch_list($pos))) {
        array_push($pos_arr, $_rows);
Exemple #3
0
<?php

if (!defined("IN_TG")) {
    echo "error";
    exit;
}
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 'On');
//$start_time=_runtime();
//define("start_time",_runtime());
//$GLOBALS["start_time"]=_runtime();
//引入函数库
require ROOT_PATH . '/includes/global.func.php';
require ROOT_PATH . '/includes/mysql.func.php';
//创建数据库连接
_connect();
//选择一款数据库
_select_db();
//选择一款字符集
_set_names();
//设置导航;
$_tpl->assign('nav', _all(_query("SELECT mid,module_name FROM tg_module")));
//设置banner;
$_tpl->assign('banner', _all(_query("SELECT banner_src,title FROM tg_banner where recom=1")));
//设置页面参数;
if (!!($_system = _fetch_array("SELECT * FROM tg_system LIMIT 1"))) {
    $_tpl->assign('system', $_system);
}
//设置用户信息;
$_tpl->assign('user', _all(_query("SELECT * FROM tg_user")));
Exemple #4
0
<?php

if (!defined("IN_TG")) {
    echo "error";
    exit;
}
$_mid = _data(_query("SELECT mid FROM tg_module"), 'mid');
foreach ($_mid as $key => $value) {
    $_tpl->assign('_data_' . $value, _all(_query("SELECT * FROM tg_article WHERE recom=1 AND mid=" . $value)));
}