Пример #1
0
        $newstempstr = str_replace('[!--info.vote--]', $myvotetext, $newstempstr);
    }
    //评分
    if (strstr($newstemptext, '[!--pinfopfen--]')) {
        $pinfopfen = $add[infopfennum] ? round($add[infopfen] / $add[infopfennum]) : 0;
        $newstempstr = str_replace('[!--pinfopfen--]', $pinfopfen, $newstempstr);
        $newstempstr = str_replace('[!--infopfennum--]', $add[infopfennum], $newstempstr);
    }
    $string = $newstempstr;
    //替换变量
    $string = str_replace('[!--p.title--]', strip_tags($ptitle), $string);
    $string = str_replace('[!--next.page--]', $thisnextlink, $string);
    $string = str_replace('[!--page.url--]', $truepage, $string);
    $string = str_replace('[!--title.select--]', $titleselect, $string);
    return $string;
}
if (empty($newstemp_r['tempid'])) {
    printerror('ErrorUrl', '', 1);
}
//页面支持标签
if ($public_r['dtncanbq']) {
    $newstemp_r[temptext] = DtNewsBq('text' . $newstemp_r[tempid], $newstemp_r[temptext], 1);
} else {
    if ($public_r['searchtempvar']) {
        $newstemp_r[temptext] = ReplaceTempvar($newstemp_r[temptext]);
    }
}
$string = DtGetHtml($r, $newstemp_r, $mid, $tbname, $line, $page_line, $start, $page, $search);
echo stripSlashes($string);
db_close();
$empire = null;
Пример #2
0
    //分页
    if ($pagefunr['rewrite'] == 1) {
        $listpage = InfoUsePage($num, $line, $page_line, $start, $page, $search, $pagefunr);
    } else {
        $listpage = page1($num, $line, $page_line, $start, $page, $search);
    }
} else {
    $listpage = page1($num, $line, $page_line, $start, $page, $search);
    //分页
}
//页面支持标签
if ($public_r['dtcanbq']) {
    $tempr[temptext] = DtNewsBq('list' . $tempid, $tempr[temptext], 0);
} else {
    if ($public_r['searchtempvar']) {
        $tempr[temptext] = ReplaceTempvar($tempr[temptext]);
    }
}
$listtemp = $tempr[temptext];
$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]);
//公共
$listtemp = str_replace('[!--newsnav--]', $url, $listtemp);
Пример #3
0
$query .= " order by " . $myorder . " limit {$offset},{$line}";
$sql = $empire->query($query);
$listpage = page1($num, $line, $page_line, $start, $page, $search);
//取得模板
if ($search_r['tempid']) {
    $tempr = $empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " . GetTemptb("enewssearchtemp") . " where tempid='" . $search_r['tempid'] . "' limit 1");
} elseif (empty($class_r[$search_r[trueclassid]][searchtempid])) {
    $tempr = $empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " . GetTemptb("enewssearchtemp") . " where isdefault=1 limit 1");
} else {
    $tempr = $empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " . GetTemptb("enewssearchtemp") . " where tempid='" . $class_r[$search_r[trueclassid]][searchtempid] . "' limit 1");
}
$have_class = 1;
//替换公共模板变量
$listtemp = $tempr[temptext];
if ($public_r['searchtempvar']) {
    $listtemp = ReplaceTempvar($listtemp);
}
$search_r[keyboard] = ehtmlspecialchars($search_r[keyboard]);
$listtemp = str_replace("[!--show.page--]", $listpage, $listtemp);
$listtemp = str_replace("[!--keyboard--]", $search_r[keyboard], $listtemp);
$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];
Пример #4
0
function DtNewsBq($classid, $indextext, $ecms = 0)
{
    global $empire, $dbtbpre, $public_r, $emod_r, $class_r, $class_zr, $fun_r, $navclassid, $navinfor, $class_tr, $level_r, $etable_r;
    $cachetime = $ecms == 1 ? $public_r['dtncachetime'] : $public_r['dtcachetime'];
    $file = ECMS_PATH . 'e/data/tmp/dt_temp' . $classid . '.php';
    if ($cachetime && file_exists($file)) {
        $filetime = filemtime($file);
        if (time() - $cachetime * 60 <= $filetime) {
            ob_start();
            include $file;
            $string = ob_get_contents();
            ob_end_clean();
            $string = RepExeCode($string);
            //解析代码
            return $string;
        }
    }
    $indextext = stripSlashes($indextext);
    $indextext = ReplaceTempvar($indextext);
    //替换全局模板变量
    //替换标签
    $indextext = DoRepEcmsLoopBq($indextext);
    $indextext = RepBq($indextext);
    //写文件
    WriteFiletext($file, AddCheckViewTempCode() . $indextext);
    //读取文件内容
    ob_start();
    include $file;
    $string = ob_get_contents();
    ob_end_clean();
    $string = RepExeCode($string);
    //解析代码
    return $string;
}
Пример #5
0
    GetDownloadPage();
    //下载地址页面
    ReGbooktemp();
    //留言板模板
    ReLoginIframe();
    //登陆状态模板
    ReSchAlltemp();
    //全站搜索模板
    //生成首页
    $indextemp = GetIndextemp();
    NewsBq(0, $indextemp, 1, 0);
    //--- 更新反馈表单 ---
    $sql = $empire->query("select bid,btemp from {$dbtbpre}enewsfeedbackclass order by bid");
    while ($r = $empire->fetch($sql)) {
        //替换公共变量
        $btemp = ReplaceTempvar($r['btemp']);
        $btemp = str_replace("[!--cp.header--]", "<? include(\"../../data/template/cp_1.php\");?>", $btemp);
        $btemp = str_replace("[!--cp.footer--]", "<? include(\"../../data/template/cp_2.php\");?>", $btemp);
        $file = "../tool/feedback/temp/feedback" . $r[bid] . ".php";
        $btemp = "<?\r\nif(!defined('InEmpireCMS'))\r\n{exit();}\r\n?>" . $btemp;
        WriteFiletext($file, $btemp);
    }
    //--- 评论表情文件 ---
    InstallGetPlfaceJs();
    echo "更新文件完毕.<script>self.location.href='index.php?enews=success&f=6&defaultdata={$defaultdata}';</script>";
    exit;
} else {
    GetConfig(1);
    //更新参数设置
    GetClass();
    //更新栏目
Пример #6
0
function PreviewIndexpage($tempid, $userid, $username)
{
    global $empire, $dbtbpre, $public_r, $emod_r, $class_r, $class_zr, $fun_r, $navclassid, $navinfor, $class_tr, $level_r, $etable_r;
    //验证权限
    CheckLevel($userid, $username, $classid, "template");
    $tempid = (int) $tempid;
    if (!$tempid) {
        printerror('ErrorUrl', '');
    }
    $tempr = $empire->fetch1("select tempid,temptext from {$dbtbpre}enewsindexpage where tempid='{$tempid}'");
    if (!$tempr['tempid']) {
        printerror('ErrorUrl', '');
    }
    $indextext = stripSlashes($tempr['temptext']);
    $indextext = ReplaceTempvar($indextext);
    //替换全局模板变量
    $pr = $empire->fetch1("select sitekey,siteintro from {$dbtbpre}enewspublic limit 1");
    //页面
    $pagetitle = ehtmlspecialchars($public_r['sitename']);
    $pagekey = ehtmlspecialchars($pr['sitekey']);
    $pagedes = ehtmlspecialchars($pr['siteintro']);
    $url = "<a href=\"" . ReturnSiteIndexUrl() . "\">" . $fun_r['index'] . "</a>";
    //栏目导航
    $onclick = '';
    $file = ECMS_PATH . DASHBOARD . '/data/tmp/indexpage' . $tempid . '.php';
    $indextext = ReplaceSvars($indextext, $url, 0, $pagetitle, $pagekey, $pagedes, $add, 0);
    $indextext = str_replace("[!--page.stats--]", $onclick, $indextext);
    //替换标签
    $indextext = DoRepEcmsLoopBq($indextext);
    $indextext = RepBq($indextext);
    //写文件
    WriteFiletext($file, AddCheckViewTempCode() . $indextext);
    //读取文件内容
    ob_start();
    include $file;
    $string = ob_get_contents();
    ob_end_clean();
    $string = RepExeCode($string);
    //解析代码
    echo stripSlashes($string);
    exit;
}
Пример #7
0
function ReplaceSvars($temp, $url, $classid, $title, $key, $des, $add, $repvar = 1)
{
    global $public_r, $class_r, $class_zr;
    if ($repvar == 1) {
        $temp = ReplaceTempvar($temp);
    }
    $temp = str_replace('[!--class.menu--]', $public_r['classnavs'], $temp);
    //栏目导航
    $temp = str_replace('[!--newsnav--]', $url, $temp);
    //位置导航
    $temp = str_replace('[!--pagetitle--]', $title, $temp);
    $temp = str_replace('[!--pagekey--]', $key, $temp);
    $temp = str_replace('[!--pagedes--]', $des, $temp);
    $temp = str_replace('[!--self.classid--]', 0, $temp);
    $temp = str_replace('[!--news.url--]', $public_r['newsurl'], $temp);
    return $temp;
}