Esempio n. 1
0
if (empty($tempr[tempid])) {
    printerror('ErrorUrl', '', 1);
}
$search .= '&line=' . $line . '&tempid=' . $tempid;
if (empty($mid)) {
    $mid = $tempr['modid'];
}
$page = (int) $_GET['page'];
$page = RepPIntvar($page);
$start = 0;
$page_line = 10;
//每页显示链接数
$offset = $page * $line;
//总偏移量
//系统模型
$ret_r = ReturnReplaceListF($mid);
//总数
if (!empty($add)) {
    $totalnum = (int) $_GET['totalnum'];
    if ($totalnum < 1) {
        $totalquery = "select count(*) as total from {$dbtbpre}enewstagsdata where tagid='{$tagid}'" . $add;
        $num = $empire->gettotal($totalquery);
    } else {
        $num = $totalnum;
    }
    $search .= '&totalnum=' . $num;
}
$query = "select classid,id from {$dbtbpre}enewstagsdata where tagid='{$tagid}'" . $add;
$query .= " order by newstime desc limit {$offset},{$line}";
$sql = $empire->query($query);
if ($tagr['tagid'] && empty($add) && $search == '&tagname=' . $tagname . '&line=' . $public_r['tagslistnum'] . '&tempid=' . $public_r['tagstempid']) {
Esempio n. 2
0
$listtemp = str_replace("[!--ecms.num--]", $num, $listtemp);
$url = "<a href='" . ReturnSiteIndexUrl() . "'>" . $fun_r['index'] . "</a>&nbsp;>&nbsp;" . $fun_r['adsearch'];
$pagetitle = $fun_r['adsearch'] . " " . $search_r[keyboard];
$listtemp = ReplaceSvars($listtemp, $url, 0, $pagetitle, $pagetitle, $pagetitle, $add, 0);
$rownum = $tempr[rownum];
if (empty($rownum)) {
    $rownum = 1;
}
$formatdate = $tempr[showdate];
$subnews = $tempr[subnews];
$subtitle = $tempr[subtitle];
$docode = $tempr[docode];
$modid = $tempr[modid];
$listvar = str_replace('[!--news.url--]', $public_r[newsurl], $tempr[listvar]);
//字段
$ret_r = ReturnReplaceListF($tempr[modid]);
//取得列表模板
$list_exp = "[!--empirenews.listtemp--]";
$list_r = explode($list_exp, $listtemp);
$listtext = $list_r[1];
$no = $offset + 1;
$changerow = 1;
while ($r = $empire->fetch($sql)) {
    //替换列表变量
    $repvar = ReplaceListVars($no, $listvar, $subnews, $subtitle, $formatdate, $url, $have_class, $r, $ret_r, $docode);
    $listtext = str_replace("<!--list.var" . $changerow . "-->", $repvar, $listtext);
    $changerow += 1;
    //超过行数
    if ($changerow > $rownum) {
        $changerow = 1;
        $string .= $listtext;
Esempio n. 3
0
function sys_eShowSp2($spid, $spr, $line, $strlen)
{
    global $empire, $dbtbpre, $public_r, $class_r, $emod_r;
    $sql = sys_ReturnTogQuery('sp', $spid, $line, '', '');
    if (!$sql) {
        return "";
    }
    //取得模板
    $tr = sys_ReturnBqTemp($spr['tempid']);
    if (empty($tr['tempid'])) {
        return "";
    }
    $listtemp = str_replace('[!--news.url--]', $public_r[newsurl], $tr[temptext]);
    $subnews = $tr[subnews];
    $listvar = str_replace('[!--news.url--]', $public_r[newsurl], $tr[listvar]);
    $rownum = $tr[rownum];
    $formatdate = $tr[showdate];
    $docode = $tr[docode];
    //替换模板变量
    $listtemp = ReplaceSpClassname($listtemp, $spid, $spr);
    if (empty($rownum)) {
        $rownum = 1;
    }
    //字段
    $ret_r = ReturnReplaceListF($tr[modid]);
    //列表
    $list_exp = "[!--empirenews.listtemp--]";
    $list_r = explode($list_exp, $listtemp);
    $listtext = $list_r[1];
    $no = 1;
    $changerow = 1;
    while ($r = $empire->fetch($sql)) {
        if (empty($class_r[$r[classid]][tbname])) {
            continue;
        }
        $infor = $empire->fetch1("select * from {$dbtbpre}ecms_" . $class_r[$r[classid]][tbname] . " where id='{$r['id']}'");
        if (empty($infor[checked])) {
            continue;
        }
        $infor[oldtitle] = $infor[title];
        //替换列表变量
        $repvar = ReplaceListVars($no, $listvar, $subnews, $strlen, $formatdate, $url, $have_class, $infor, $ret_r, $docode);
        $listtext = str_replace("<!--list.var" . $changerow . "-->", $repvar, $listtext);
        $changerow += 1;
        //超过行数
        if ($changerow > $rownum) {
            $changerow = 1;
            $string .= $listtext;
            $listtext = $list_r[1];
        }
        $no++;
    }
    //多余数据
    if ($changerow <= $rownum && $listtext != $list_r[1]) {
        $string .= $listtext;
    }
    $string = $list_r[0] . $string . $list_r[2];
    echo $string;
}
Esempio n. 4
0
function ReUserjs($jsr, $addpath)
{
    global $empire, $public_r;
    DoFileMkDir($addpath . $jsr['jsfilename']);
    //建目录
    //取得js模板
    $jstemptext = GetTheJstemp($jsr[jstempid]);
    $ret_r = ReturnReplaceListF($jstemptext[modid]);
    //字段
    $jstemptext[temptext] = str_replace('[!--news.url--]', $public_r[newsurl], $jstemptext[temptext]);
    $temp_r = explode("[!--empirenews.listtemp--]", $jstemptext[temptext]);
    $query = stripSlashes($jsr[jssql]);
    $query = RepSqlTbpre($query);
    $sql = $empire->query($query);
    $no = 1;
    while ($r = $empire->fetch($sql)) {
        $r[oldtitle] = $r[title];
        //替换列表变量
        $repvar = ReplaceListVars($no, $temp_r[1], $jstemptext[subnews], $jstemptext[subtitle], $jstemptext[showdate], $url, 0, $r, $ret_r);
        $allnew .= $repvar;
        $no++;
    }
    $allnew = "document.write(\"" . addslashes(stripSlashes(str_replace("\r\n", "", $temp_r[0] . $allnew . $temp_r[2]))) . "\");";
    WriteFiletext_n($addpath . $jsr['jsfilename'], $allnew);
}