Beispiel #1
0
 <?=$ecms_hashur['form']?>
   <input name="fmid" type="hidden" id="fmid" value="<?=$mid?>">
   <tr class="header"> 
     <td width="4%"><div align="center">选择 </div></td>
     <td width="6%"><div align="center">ID</div></td>
     <td width="4%"><div align="center">排序</div></td>
     <td width="32%" height="25"><div align="center">分类名称</div></td>
     <td width="21%"><div align="center">所属系统模型</div></td>
     <td width="16%" height="25"><div align="center">操作</div></td>
     <td width="17%">操作</td>
   </tr>
   <?php
 while($r=$empire->fetch($sql))
 {
 	$modr=$empire->fetch1("select mid,mname from {$dbtbpre}enewsmod where mid='$r[mid]'");
 	$turl=sys_ReturnBqInfoTypeUrl($r['typeid']);
 ?>
   <tr bgcolor="#FFFFFF"> 
     <td><div align="center"> 
         <input name="classid[]" type="checkbox" id="classid[]" value="<?=$r[typeid]?>">
       </div></td>
     <td><div align="center"> 
         <?=$r[typeid]?>
         <input name="typeid[]" type="hidden" id="typeid[]" value="<?=$r[typeid]?>">
       </div></td>
     <td><div align="center"> 
         <input name="myorder[]" type="text" id="myorder[]" value="<?=$r[myorder]?>" size="6">
       </div></td>
     <td height="25"> <div align="center"><a href="<?=$turl?>" target="_blank"> 
         <?=$r[tname]?>
         </a></div></td>
Beispiel #2
0
function DtGetHtml($add, $newstemp_r, $mid, $tbname, $line, $page_line, $start, $page, $search)
{
    global $public_r, $class_r, $class_zr, $class_tr, $fun_r, $empire, $dbtbpre, $emod_r, $level_r;
    //更新点击
    $empire->query("update {$dbtbpre}ecms_" . $tbname . " set onclick=onclick+1 where id='{$add['id']}' limit 1");
    $add['onclick'] = $add['onclick'] + 1;
    //模板参数
    $newstemptext = $newstemp_r[temptext];
    $formatdate = $newstemp_r[showdate];
    //页面
    $pagetitle = ehtmlspecialchars($add[title]);
    $url = ReturnClassLink($add[classid]);
    //导航
    $newstemptext = DtInfo_ReplaceSvars($newstemptext, $url, $add[classid], $pagetitle, $add[keyboard], $pagetitle);
    //相关信息
    if (strstr($newstemptext, '[!--other.link--]')) {
        $keyboardtext = GetKeyboard($add[keyboard], $add[keyid], $add[classid], $add[id], $class_r[$add[classid]][link_num]);
    }
    //分页字段
    $ptitle = $add['title'];
    $truepage = '';
    $titleselect = '';
    $expage = '[!--empirenews.page--]';
    //分页符
    $pf = $emod_r[$mid]['pagef'];
    if ($pf && strstr($add[$pf], $expage)) {
        $n_r = explode($expage, $add[$pf]);
        $thispagenum = count($n_r);
        if ($page < 0 || $page > $thispagenum - 1) {
            $page = 0;
        }
        $add[$pf] = $n_r[$page];
        if ($page) {
            $ti_r = explode('[/!--empirenews.page--]', $n_r[$page]);
            if (count($ti_r) >= 2) {
                $ptitle = $ti_r[0];
                $add[$pf] = $ti_r[1];
            } else {
                $ptitle = $add['title'] . '(' . ($page + 1) . ')';
            }
        }
        //伪静态
        $pagefunr = eReturnRewriteInfoUrl($add['classid'], $add['id'], 0);
        $pagefunr['repagenum'] = 0;
        //取得分页
        $truepage = InfoUsePage($thispagenum, $line, $page_line, $start, $page, $search, $pagefunr);
        //下拉式分页
        if (strstr($newstemptext, '[!--title.select--]')) {
            for ($j = 0; $j < $thispagenum; $j++) {
                $spurl = eReturnRewritePageLink($pagefunr, $j);
                if ($j == 0) {
                    $sptitle = $add[title];
                } else {
                    $ti_r = explode('[/!--empirenews.page--]', $n_r[$j]);
                    $sptitle = count($ti_r) >= 2 ? $ti_r[0] : $add[title] . '(' . ($j + 1) . ')';
                }
                $select = '';
                if ($page == $j) {
                    $ptitle = $sptitle;
                    $select = ' selected';
                }
                $titleselect .= '<option value="' . $spurl . '"' . $select . '>' . $sptitle . '</option>';
            }
            $titleselect = '<select name="titleselect" onchange="self.location.href=this.options[this.selectedIndex].value">' . $titleselect . '</select>';
        }
        //下一页链接
        if ($page == $thispagenum - 1) {
            $thisnextlink = eReturnRewritePageLink($pagefunr, 0);
        } else {
            $thisnextlink = eReturnRewritePageLink($pagefunr, $page + 1);
        }
    }
    //返回替换验证字符
    $docheckrep = ReturnCheckDoRepStr();
    if ($add[newstext]) {
        if (empty($public_r['dorepword']) && $docheckrep[3]) {
            $add[newstext] = ReplaceWord($add[newstext]);
            //过滤字符
        }
        if (empty($public_r['dorepkey']) && $docheckrep[4] && !empty($add[dokey])) {
            $add[newstext] = ReplaceKey($add['newstext'], $add['classid']);
        }
        if ($public_r['opencopytext']) {
            $add[newstext] = AddNotCopyRndStr($add[newstext]);
            //随机复制字符
        }
    }
    //变量
    $tempf = $emod_r[$mid]['tempf'];
    $fr = explode(',', $tempf);
    $fcount = count($fr) - 1;
    //变量替换
    $newstempstr = $newstemptext;
    //模板
    for ($i = 1; $i < $fcount; $i++) {
        $f = $fr[$i];
        $value = $add[$f];
        if ($f == 'downpath') {
            if (strstr($newstemptext, '[!--downpath--]')) {
                $value = ReturnDownSoftHtml($add);
            }
        } elseif ($f == 'onlinepath') {
            if (strstr($newstemptext, '[!--onlinepath--]')) {
                $value = ReturnOnlinepathHtml($add);
            }
        } elseif ($f == 'morepic') {
            if (strstr($newstemptext, '[!--morepic--]')) {
                $value = ReturnMorepicpathHtml($add);
            }
        } elseif ($f == 'newstime') {
            if (strstr($newstemptext, '[!--newstime--]')) {
                $value = date($formatdate, $value);
            }
        } elseif ($f == 'befrom') {
            if ($docheckrep[1] && strstr($newstemptext, '[!--befrom--]')) {
                $value = ReplaceBefrom($value);
            }
        } elseif ($f == 'writer') {
            if ($docheckrep[2] && strstr($newstemptext, '[!--writer--]')) {
                $value = ReplaceWriter($value);
            }
        } elseif ($f == 'titlepic') {
            if (empty($value)) {
                $value = $public_r[newsurl] . 'e/data/images/notimg.gif';
            }
        } elseif ($f == 'title') {
        } else {
            if (!strstr($emod_r[$mid]['editorf'], ',' . $f . ',')) {
                if (strstr($emod_r[$mid]['tobrf'], ',' . $f . ',')) {
                    $value = nl2br($value);
                }
                if (!strstr($emod_r[$mid]['dohtmlf'], ',' . $f . ',')) {
                    $value = RepFieldtextNbsp(ehtmlspecialchars($value));
                }
            }
        }
        $newstempstr = str_replace('[!--' . $f . '--]', $value, $newstempstr);
    }
    //固定变量
    $newstempstr = str_replace('[!--id--]', $add[id], $newstempstr);
    $newstempstr = str_replace('[!--classid--]', $add[classid], $newstempstr);
    $newstempstr = str_replace('[!--class.name--]', $class_r[$add[classid]][classname], $newstempstr);
    $newstempstr = str_replace('[!--ttid--]', $add[ttid], $newstempstr);
    $newstempstr = str_replace('[!--tt.name--]', $class_tr[$add[ttid]][tname], $newstempstr);
    $newstempstr = str_replace('[!--tt.url--]', sys_ReturnBqInfoTypeUrl($add['ttid']), $newstempstr);
    $newstempstr = str_replace('[!--onclick--]', $add[onclick], $newstempstr);
    $newstempstr = str_replace('[!--userfen--]', $add[userfen], $newstempstr);
    $newstempstr = str_replace('[!--username--]', $add[username], $newstempstr);
    //带链接的用户名
    if ($add[ismember] == 1 && $add[userid]) {
        $newstempstr = str_replace('[!--linkusername--]', "<a href='" . $public_r[newsurl] . "e/space/?userid=" . $add[userid] . "' target=_blank>" . $add[username] . "</a>", $newstempstr);
    } else {
        $newstempstr = str_replace('[!--linkusername--]', $add[username], $newstempstr);
    }
    $newstempstr = str_replace('[!--userid--]', $add[userid], $newstempstr);
    $newstempstr = str_replace('[!--other.link--]', $keyboardtext, $newstempstr);
    $newstempstr = str_replace('[!--news.url--]', $public_r[newsurl], $newstempstr);
    $newstempstr = str_replace('[!--plnum--]', $add[plnum], $newstempstr);
    $newstempstr = str_replace('[!--totaldown--]', $add[totaldown], $newstempstr);
    $newstempstr = str_replace('[!--keyboard--]', $add[keyboard], $newstempstr);
    //链接
    $titleurl = sys_ReturnBqTitleLink($add);
    $newstempstr = str_replace('[!--titleurl--]', $titleurl, $newstempstr);
    $newstempstr = str_replace('[!--page.stats--]', '', $newstempstr);
    $classurl = sys_ReturnBqClassname($add, 9);
    $newstempstr = str_replace('[!--class.url--]', $classurl, $newstempstr);
    //下一篇
    if (strstr($newstemptext, '[!--info.next--]')) {
        $next_r = $empire->fetch1("select isurl,titleurl,classid,id,title from {$dbtbpre}ecms_" . $class_r[$add[classid]][tbname] . " where id>{$add['id']} and classid='{$add['classid']}' order by id limit 1");
        if (empty($next_r[id])) {
            $infonext = "<a href='" . $classurl . "'>" . $fun_r['HaveNoNextLink'] . "</a>";
        } else {
            //链接
            $nexttitleurl = sys_ReturnBqTitleLink($next_r);
            $infonext = "<a href='" . $nexttitleurl . "'>" . $next_r[title] . "</a>";
        }
        $newstempstr = str_replace('[!--info.next--]', $infonext, $newstempstr);
    }
    //上一篇
    if (strstr($newstemptext, '[!--info.pre--]')) {
        $next_r = $empire->fetch1("select isurl,titleurl,classid,id,title from {$dbtbpre}ecms_" . $class_r[$add[classid]][tbname] . " where id<{$add['id']} and classid='{$add['classid']}' order by id desc limit 1");
        if (empty($next_r[id])) {
            $infonext = "<a href='" . $classurl . "'>" . $fun_r['HaveNoNextLink'] . "</a>";
        } else {
            //链接
            $nexttitleurl = sys_ReturnBqTitleLink($next_r);
            $infonext = "<a href='" . $nexttitleurl . "'>" . $next_r[title] . "</a>";
        }
        $newstempstr = str_replace('[!--info.pre--]', $infonext, $newstempstr);
    }
    //投票
    if (strstr($newstemptext, '[!--info.vote--]')) {
        $myvotetext = sys_GetInfoVote($add[classid], $add[id]);
        $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;
}
Beispiel #3
0
if (empty($mid)) {
    printerror("ErrorUrl", "history.go(-1)", 1);
}
$ttr = $empire->fetch1("select typeid,tname,mid,yhid,tnum,listtempid,tpath,ttype,maxnum,reorder,tid,tbname,timg,intro,pagekey,listdt,repagenum from {$dbtbpre}enewsinfotype where typeid='{$ttid}'");
$tbname = $ttr['tbname'];
if (empty($ttr['typeid']) || empty($tbname) || InfoIsInTable($tbname)) {
    printerror("ErrorUrl", "history.go(-1)", 1);
}
//moreport
if (Moreport_ReturnMustDt()) {
    $ttr['listdt'] = 1;
    $ttr['repagenum'] = 0;
}
//是否支持动态页
if (empty($ttr['listdt']) && !$ttr['repagenum']) {
    $tturl = sys_ReturnBqInfoTypeUrl($ttid);
    Header("Location:{$tturl}");
    exit;
}
$GLOBALS['navclassid'] = $ttid;
$url = ReturnInfoTypeLink($ttid);
$pagetitle = $ttr['tname'];
$pagekey = $ttr['pagekey'];
$pagedes = $ttr['intro'];
$classimg = $ttr['timg'] ? $ttr['timg'] : $public_r[newsurl] . 'e/data/images/notimg.gif';
$add = "ttid='{$ttid}'";
$have_class = 1;
//排序
if (empty($ttr['reorder'])) {
    $addorder = "newstime desc";
} else {
Beispiel #4
0
}
//标题分类
$truettid = 0;
$ttid = $_GET['ttid'];
if ($ttid) {
    $ttid = RepPostVar($ttid);
    if (strstr($ttid, ',')) {
        $son_r = sys_ReturnMoreTT($ttid);
        $truettid = $son_r[0];
        $add .= ' and (' . $son_r[1] . ')';
    } else {
        $truettid = intval($ttid);
        $add .= " and ttid='{$truettid}'";
        if ($pageecms == 1) {
            $pagetitle = $class_tr[$truettid]['tname'];
            $pageurl = sys_ReturnBqInfoTypeUrl($truettid);
            $pageclassid = $truettid;
        }
    }
    $ttmid = $class_tr[$truettid]['mid'];
    if (empty($ttmid)) {
        printerror('ErrorUrl', '', 1);
    }
    if (empty($tbname)) {
        $tbname = $emod_r[$ttmid]['tbname'];
        $mid = $ttmid;
        $yhid = $class_tr[$truettid][yhid];
    }
}
//默认表
if (empty($tbname)) {
Beispiel #5
0
function ReplaceListVars($no, $listtemp, $subnews, $subtitle, $formatdate, $url, $haveclass = 0, $r, $field, $docode = 0)
{
    global $empire, $public_r, $class_r, $class_zr, $fun_r, $dbtbpre, $emod_r, $class_tr, $level_r, $navclassid, $etable_r;
    if ($haveclass) {
        $add = sys_ReturnBqClassname($r, $haveclass);
    }
    if (empty($r[oldtitle])) {
        $r[oldtitle] = $r[title];
    }
    if ($docode == 1) {
        $listtemp = stripSlashes($listtemp);
        eval($listtemp);
    }
    $ylisttemp = $listtemp;
    $mid = $field['mid'];
    $fr = $field['fr'];
    $fcount = $field['fcount'];
    for ($i = 1; $i < $fcount; $i++) {
        $f = $fr[$i];
        $value = $r[$f];
        $spf = 0;
        if ($f == 'title') {
            if (!empty($subtitle)) {
                $value = sub($value, 0, $subtitle, false);
            }
            $value = DoTitleFont($r[titlefont], $value);
            $spf = 1;
        } elseif ($f == 'newstime') {
            //$value=date($formatdate,$value);
            $value = format_datetime($value, $formatdate);
            $spf = 1;
        } elseif ($f == 'titlepic') {
            if (empty($value)) {
                $value = $public_r[newsurl] . 'e/data/images/notimg.gif';
            }
            $spf = 1;
        } elseif (strstr($emod_r[$mid]['smalltextf'], ',' . $f . ',')) {
            if (!empty($subnews)) {
                $value = sub($value, 0, $subnews, false);
            }
        } elseif ($f == 'befrom') {
            $spf = 1;
        } elseif ($f == 'writer') {
            $spf = 1;
        }
        if ($spf == 0 && !strstr($emod_r[$mid]['editorf'], ',' . $f . ',')) {
            if (strstr($emod_r[$mid]['tobrf'], ',' . $f . ',')) {
                $value = nl2br($value);
            }
            if (!strstr($emod_r[$mid]['dohtmlf'], ',' . $f . ',')) {
                $value = RepFieldtextNbsp(ehtmlspecialchars($value));
            }
        }
        $listtemp = str_replace('[!--' . $f . '--]', $value, $listtemp);
    }
    $titleurl = sys_ReturnBqTitleLink($r);
    //链接
    $listtemp = str_replace('[!--id--]', $r[id], $listtemp);
    $listtemp = str_replace('[!--classid--]', $r[classid], $listtemp);
    $listtemp = str_replace('[!--class.name--]', $add, $listtemp);
    $listtemp = str_replace('[!--ttid--]', $r[ttid], $listtemp);
    $listtemp = str_replace('[!--tt.name--]', $class_tr[$r[ttid]][tname], $listtemp);
    $listtemp = str_replace('[!--tt.url--]', sys_ReturnBqInfoTypeUrl($r['ttid']), $listtemp);
    $listtemp = str_replace('[!--userfen--]', $r[userfen], $listtemp);
    $listtemp = str_replace('[!--titleurl--]', $titleurl, $listtemp);
    $listtemp = str_replace('[!--no.num--]', $no, $listtemp);
    $listtemp = str_replace('[!--plnum--]', $r[plnum], $listtemp);
    $listtemp = str_replace('[!--userid--]', $r[userid], $listtemp);
    $listtemp = str_replace('[!--username--]', $r[username], $listtemp);
    $listtemp = str_replace('[!--onclick--]', $r[onclick], $listtemp);
    $listtemp = str_replace('[!--oldtitle--]', $r[oldtitle], $listtemp);
    $listtemp = str_replace('[!--totaldown--]', $r[totaldown], $listtemp);
    //栏目链接
    if (strstr($ylisttemp, '[!--this.classlink--]')) {
        $thisclasslink = sys_ReturnBqClassname($r, 9);
        $listtemp = str_replace('[!--this.classlink--]', $thisclasslink, $listtemp);
    }
    $thisclassname = $class_r[$r[classid]][bname] ? $class_r[$r[classid]][bname] : $class_r[$r[classid]][classname];
    $listtemp = str_replace('[!--this.classname--]', $thisclassname, $listtemp);
    return $listtemp;
}