function ecmsShowInfoTop($query, $where, $field, $topnum, $day) { global $empire, $dbtbpre, $class_r; if ($day) { $and = $where ? ' and ' : ' where '; $query .= $and . "newstime>=" . time() . "-" . $day * 24 * 3600; } if ($field == 'plnum') { $word = '评论数'; } elseif ($field == 'totaldown') { $word = '下载数'; } elseif ($field == 'onclick') { $word = '点击数'; } $query .= " order by " . $field . " desc limit " . $topnum; echo "<table width='100%' border='0' cellpadding='3' cellspacing='1' class='tableborder'><tr><td width='85%'>标题</td><td width='15%'>{$word}</td></tr>"; $sql = $empire->query($query); while ($r = $empire->fetch($sql)) { $classurl = sys_ReturnBqClassname($r, 9); $titleurl = sys_ReturnBqTitleLink($r); echo "<tr bgcolor='#ffffff' height='23'><td>[<a href='" . $classurl . "' target='_blank'>" . $class_r[$r[classid]][classname] . "</a>] <a href='{$titleurl}' target='_blank' title='发布时间:" . date("Y-m-d H:i:s", $r[newstime]) . "'>" . stripSlashes($r[title]) . "</a></td><td>" . $r[$field] . "</td></tr>"; } echo "</table>"; }
} else { $copyclassidshowiframe = ''; $copyclassids = '<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5"> <tr> <td>同时发布到以下栏目:</td> </tr> <tr> <td height="25" bgcolor="#FFFFFF" id="copyinfoshowclassnav">本信息已同步发布到其他栏目,信息ID:<br>' . $r[copyids] . '</td> </tr> </table>'; } //表单文件 $modfile = "../data/html/" . $modid . ".php"; //栏目链接 $getcurlr['classid'] = $classid; $classurl = sys_ReturnBqClassname($getcurlr, 9); //当前使用的模板组 $thegid = GetDoTempGid(); $phpmyself = urlencode($_SERVER['PHP_SELF'] . "?" . $_SERVER["QUERY_STRING"]); ?> <html> <head> <title><?php echo $word; ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" href="adminstyle/<?php echo $loginadminstyleid; ?> /adminstyle.css" type="text/css">
require "../../data/dbcache/class.php"; $link = db_connect(); $empire = new mysqlquery(); $editor = 1; //验证用户 $lur = is_login(); $logininid = $lur['userid']; $loginin = $lur['username']; $loginrnd = $lur['rnd']; $loginlevel = $lur['groupid']; $loginadminstyleid = $lur['adminstyleid']; //ehash $ecms_hashur = hReturnEcmsHashStrAll(); $classid = (int) $_GET['classid']; $r['classid'] = $classid; $url = sys_ReturnBqClassname($r, 9); $jspath = $public_r['newsurl'] . 'd/js/class/class' . $classid . '_'; ?> <link href="../adminstyle/<?php echo $loginadminstyleid; ?> /adminstyle.css" rel="stylesheet" type="text/css"> <title>调用地址</title><table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableborder"> <tr class=header> <td height="25"> </td> <td height="25">调用地址</td> <td height="25"> <div align="center">预览</div></td> </tr> <tr bgcolor="#FFFFFF"> <td width="22%" height="25">栏目地址:</td>
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; }
$cr = $empire->fetch1("select classid,classpagekey,intro,classimg,cgroupid,islist,classtempid,listdt,bdinfoid,repagenum,islast,infos from {$dbtbpre}enewsclass where classid='{$classid}'"); if (empty($cr['classid'])) { printerror("ErrorUrl", "history.go(-1)", 1); } if ($class_r[$classid][islast] && $cr['bdinfoid']) { printerror("ErrorUrl", "history.go(-1)", 1); } //moreport if (Moreport_ReturnMustDt()) { $class_r[$classid]['listdt'] = 1; $cr['repagenum'] = 0; $cr['listdt'] = 1; } //是否支持动态页 if (empty($class_r[$classid]['listdt']) && !$cr['repagenum']) { $classurl = sys_ReturnBqClassname($cr, 9); Header("Location:{$classurl}"); exit; } //权限 if ($cr['cgroupid']) { $mgroupid = (int) getcvar('mlgroupid'); if (!strstr($cr[cgroupid], ',' . $mgroupid . ',')) { printerror('NotLevelToClass', 'history.go(-1)', 1); } } $GLOBALS['navclassid'] = $classid; $url = ReturnClassLink($classid); $pagetitle = $class_r[$classid]['classname']; $pagekey = $cr['classpagekey']; $pagedes = $cr['intro'];
function espace_eloop_sp($r) { global $class_r; $sr['titleurl'] = sys_ReturnBqTitleLink($r); $sr['classname'] = $class_r[$r[classid]][bname] ? $class_r[$r[classid]][bname] : $class_r[$r[classid]][classname]; $sr['classurl'] = sys_ReturnBqClassname($r, 9); return $sr; }
function ReplaceShowClassVars($no, $listtemp, $r, $num, $ecms = 0, $subnews = 0) { global $public_r, $class_r; //栏目链接 if ($ecms == 1) { $classurl = sys_ReturnBqZtname($r); $r['classname'] = $r['ztname']; $r['classid'] = $r['ztid']; $r['classimg'] = $r['ztimg']; } else { $classurl = sys_ReturnBqClassname($r, 9); } if ($subnews) { $r[intro] = sub($r[intro], 0, $subnews, false); } $listtemp = str_replace("[!--classurl--]", $classurl, $listtemp); //栏目名称 $listtemp = str_replace("[!--classname--]", $r[classname], $listtemp); //栏目id $listtemp = str_replace("[!--classid--]", $r[classid], $listtemp); //栏目图片 if (empty($r[classimg])) { $r[classimg] = $public_r[newsurl] . "e/data/images/notimg.gif"; } $listtemp = str_replace("[!--classimg--]", $r[classimg], $listtemp); //栏目简介 $listtemp = str_replace("[!--intro--]", nl2br($r[intro]), $listtemp); //记录数 $listtemp = str_replace("[!--num--]", $num, $listtemp); //序号 $listtemp = str_replace("[!--no--]", $no, $listtemp); return $listtemp; }
$classid = RepPostVar($classid); if (strstr($classid, ',')) { $son_r = sys_ReturnMoreClass($classid, 1); $trueclassid = $son_r[0]; $add .= ' and (' . $son_r[1] . ')'; } else { $trueclassid = intval($classid); if ($class_r[$trueclassid][islast]) { $add .= " and classid='{$trueclassid}'"; } else { $add .= ' and ' . ReturnClass($class_r[$trueclassid][sonclass]); } //页面标题 $pagetitle = $class_r[$trueclassid]['classname']; $this_r['classid'] = $trueclassid; $pageurl = sys_ReturnBqClassname($this_r, 9); $pageecms = 0; $pageclassid = $trueclassid; } if (empty($class_r[$trueclassid]['tbname'])) { exit; } if (empty($tbname)) { $tbname = $class_r[$trueclassid][tbname]; $mid = $class_r[$trueclassid][modid]; $yhid = $class_r[$trueclassid][yhid]; } } //标题分类 $truettid = 0; $ttid = $_GET['ttid'];
function GetHtml($add, $fields, $doall = 0) { global $public_r, $class_r, $class_zr, $fun_r, $empire, $dbtbpre, $emod_r, $class_tr, $level_r, $etable_r; if (empty($doall)) { if ($add['titleurl'] || $add['checked'] == 0 || $class_r[$add[classid]][showdt] == 2 || strstr($public_r['nreinfo'], ',' . $add['classid'] . ',')) { return ''; } } $mid = $class_r[$add[classid]]['modid']; $tbname = $class_r[$add[classid]][tbname]; //副表 if ($emod_r[$mid]['tbdataf'] && $emod_r[$mid]['tbdataf'] != ',') { $selectdataf = substr($emod_r[$mid]['tbdataf'], 1, -1); $addr = $empire->fetch1("select " . $selectdataf . " from {$dbtbpre}ecms_" . $tbname . "_data_" . $add[stb] . " where id='{$add['id']}'"); $add = array_merge($add, $addr); } $iclasspath = ReturnSaveInfoPath($add[classid], $add[id]); $doclasspath = ECMS_PATH . $iclasspath; $createinfopath = $doclasspath; //建立日期目录 $newspath = ''; if ($add[newspath]) { $createpath = $doclasspath . $add[newspath]; if (!file_exists($createpath)) { $r[newspath] = FormatPath($add[classid], $add[newspath], 1); } $createinfopath .= $add[newspath] . '/'; $newspath = $add[newspath] . '/'; } //新建存放目录 if ($class_r[$add[classid]][filename] == 3) { $createinfopath .= ReturnInfoSPath($add['filename']); DoMkdir($createinfopath); $fn3 = 1; } //存文本 if ($emod_r[$mid]['savetxtf']) { $stf = $emod_r[$mid]['savetxtf']; if ($add[$stf]) { $add[$stf] = GetTxtFieldText($add[$stf]); } } $GLOBALS['navclassid'] = $add[classid]; $GLOBALS['navinfor'] = $add; //取得内容模板 $add[newstempid] = $add[newstempid] ? $add[newstempid] : $class_r[$add[classid]][newstempid]; $newstemp_r = GetNewsTemp($add[newstempid]); $newstemptext = $newstemp_r[temptext]; $formatdate = $newstemp_r[showdate]; //页面 $pagetitle = htmlspecialchars($add[title]); $url = ReturnClassLink($add[classid]); //导航 $newstemptext = Info_ReplaceSvars($newstemptext, $url, $add[classid], $pagetitle, $add[keyboard], $pagetitle); //文件类型/权限 if ($add[groupid] || $class_r[$add[classid]]['cgtoinfo']) { if (empty($add[newspath])) { $include = ''; } else { $pr = explode('/', $add[newspath]); for ($i = 0; $i < count($pr); $i++) { $include .= '../'; } } if ($fn3 == 1) { $include .= '../'; } $pr = explode('/', $iclasspath); $pcount = count($pr); for ($i = 0; $i < $pcount - 1; $i++) { $include .= '../'; } $include1 = $include; $include .= 'e/class/CheckLevel.php'; $filetype = '.php'; $addlevel = "<?php\r\n\t\tdefine('empirecms','wm_chief');\r\n\t\t\$check_tbname='" . $class_r[$add[classid]][tbname] . "';\r\n\t\t\$check_infoid=" . $add[id] . ";\r\n\t\t\$check_classid=" . $add[classid] . ";\r\n\t\t\$check_path=\"" . $include1 . "\";\r\n\t\trequire(\"" . $include . "\");\r\n\t\t?>"; } else { $filetype = $class_r[$add[classid]][filetype]; $addlevel = ''; } //取得本目录链接 if ($class_r[$add[classid]][classurl] && $class_r[$add[classid]][ipath] == '') { $dolink = $class_r[$add[classid]][classurl] . '/' . $newspath; } else { $dolink = $public_r[newsurl] . $iclasspath . $newspath; } //相关信息 if (strstr($newstemptext, '[!--other.link--]')) { $keyboardtext = GetKeyboard($add[keyboard], $add[keyid], $add[classid], $add[id], $class_r[$add[classid]][link_num]); } $onclick = "<script src='" . $public_r[newsurl] . "e/public/onclick?enews=donews&classid={$add['classid']}&id=" . $add[id] . "'></script>"; //返回替换验证字符 $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]); } if ($public_r['opencopytext']) { $add[newstext] = AddNotCopyRndStr($add[newstext]); //随机复制字符 } } //分页字段 $expage = '[!--empirenews.page--]'; //分页符 $pf = $emod_r[$mid]['pagef']; //变量 $tempf = $emod_r[$mid]['tempf']; if ($pf && strstr($add[$pf], $expage)) { $tempf = str_replace(',' . $pf . ',', ',', $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(htmlspecialchars($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('[!--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--]', $onclick, $newstempstr); $classurl = sys_ReturnBqClassname($add, 9); $newstempstr = str_replace('[!--class.url--]', $classurl, $newstempstr); //下一篇 if (strstr($newstemptext, '[!--info.next--]')) { $next_r = $empire->fetch1("select titleurl,groupid,classid,newspath,filename,id,title from {$dbtbpre}ecms_" . $class_r[$add[classid]][tbname] . " where id>{$add['id']} and classid='{$add['classid']}' and checked=1 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 titleurl,groupid,classid,newspath,filename,id,title from {$dbtbpre}ecms_" . $class_r[$add[classid]][tbname] . " where id<{$add['id']} and classid='{$add['classid']}' and checked=1 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); } if ($pf && strstr($add[$pf], $expage)) { $n_r = explode($expage, $add[$pf]); $thispagenum = count($n_r); //取得分页 $thefun = $public_r['textpagefun'] ? $public_r['textpagefun'] : 'sys_ShowTextPage'; //下拉式分页 if (strstr($newstemptext, '[!--title.select--]')) { $dotitleselect = sys_ShowTextPageSelect($thispagenum, $dolink, $add, $filetype, $n_r); } for ($j = 1; $j <= $thispagenum; $j++) { $string = $newstempstr; //模板 $truepage = ''; $titleselect = ''; //下一页链接 if ($thispagenum == $j) { $thisnextlink = $dolink . $add[filename] . $filetype; } else { $thisj = $j + 1; $thisnextlink = $dolink . $add[filename] . '_' . $thisj . $filetype; } $k = $j - 1; if ($j == 1) { $file = $doclasspath . $newspath . $add[filename] . $filetype; $ptitle = $add[title]; } else { $file = $doclasspath . $newspath . $add[filename] . '_' . $j . $filetype; $ti_r = explode('[/!--empirenews.page--]', $n_r[$k]); if (count($ti_r) >= 2) { $ptitle = $ti_r[0]; $n_r[$k] = $ti_r[1]; } else { $ptitle = $add[title] . '(' . $j . ')'; } } //取得当前页 if ($thispagenum != 1) { $truepage = $thefun($thispagenum, $j, $dolink, $add, $filetype, ''); $titleselect = str_replace("?" . $j . "\">", "?" . $j . "\" selected>", $dotitleselect); } //替换变量 $newstext = $n_r[$k]; if (!strstr($emod_r[$mid]['editorf'], ',' . $pf . ',')) { if (strstr($emod_r[$mid]['tobrf'], ',' . $pf . ',')) { $newstext = nl2br($newstext); } if (!strstr($emod_r[$mid]['dohtmlf'], ',' . $pf . ',')) { $newstext = htmlspecialchars($newstext); $newstext = RepFieldtextNbsp($newstext); } } $string = str_replace('[!--' . $pf . '--]', $newstext, $string); $string = str_replace('[!--p.title--]', $ptitle, $string); $string = str_replace('[!--next.page--]', $thisnextlink, $string); $string = str_replace('[!--page.url--]', $truepage, $string); $string = str_replace('[!--title.select--]', $titleselect, $string); //写文件 WriteFiletext($file, $addlevel . $string); } } else { $file = $doclasspath . $newspath . $add[filename] . $filetype; $string = $newstempstr; //模板 //替换变量 $string = str_replace('[!--p.title--]', $add[title], $string); $string = str_replace('[!--next.page--]', '', $string); $string = str_replace('[!--page.url--]', '', $string); $string = str_replace('[!--title.select--]', '', $string); //写文件 WriteFiletext($file, $addlevel . $string); } //设为已生成 if (empty($add['havehtml'])) { $empire->query("update {$dbtbpre}ecms_" . $class_r[$add[classid]][tbname] . " set havehtml=1 where id='{$add['id']}' limit 1"); } }
function DoInfoSendNotice($userid, $username, $to_userid, $to_username, $causetext, $infor, $ecms = 0) { global $empire, $dbtbpre, $class_r; if (!$infor['ismember']) { return ''; } //操作者 $user_r = $empire->fetch1("select truename from {$dbtbpre}enewsuser where userid='{$userid}'"); $dousername = $user_r['truename'] ? $user_r['truename'] : $username; //操作类型 if ($ecms == 1) { $doing = '删除'; $title = '您的信息被删除'; } elseif ($ecms == 2) { $doing = '审核通过'; $title = '您的信息已审核通过'; } elseif ($ecms == 3) { $doing = '取消审核'; $title = '您的信息被取消审核'; } elseif ($ecms == 4) { $doing = '转移'; $title = '您的信息被转移'; } //操作信息 $title = RepPostStr($title); $causetext = RepPostStr($causetext); $dotime = date("Y-m-d H:i:s"); //信息内容 $titleurl = sys_ReturnBqTitleLink($infor); $infotitle = $infor['title']; $infotime = date("Y-m-d H:i:s", $infor[truetime]); $classname = $class_r[$infor[classid]]['classname']; $classurl = sys_ReturnBqClassname($infor, 9); $isadmin = $infor['ismember'] == 1 ? 0 : 1; $msgtext = "您发布的信息被 <strong>{$dousername}</strong> 执行 <strong>{$doing}</strong> 操作<br>\n<br>\n<strong>信息标题:</strong><a href='" . $titleurl . "'>" . $infotitle . "</a><br>\n<strong>发布时间:</strong>" . $infotime . "<br>\n<strong>所在栏目:</strong><a href='" . $classurl . "'>" . $classname . "</a><br>\n<strong>操作时间:</strong>{$dotime}<br>\n<strong>操作理由:</strong>" . $causetext . "<br>"; eSendMsg(addslashes($title), addslashes($msgtext), $to_username, 0, '', 1, 1, $isadmin); }
else { $checked='√'; $titleurl=sys_ReturnBqTitleLink($r);//链接 } $plnum=$r[plnum];//评论个数 //标题图片 $showtitlepic=""; if($r[titlepic]) {$showtitlepic="<a href='".$r[titlepic]."' title='预览标题图片' target=_blank><img src='../data/images/showimg.gif' border=0></a>";} //栏目 $classname=$class_r[$r[classid]][classname]; $classurl=sys_ReturnBqClassname($r,9); $bclassid=$class_r[$r[classid]][bclassid]; $br['classid']=$bclassid; $bclassurl=sys_ReturnBqClassname($br,9); $bclassname=$class_r[$bclassid][classname]; //评论地址 $pagefunr=eReturnRewritePlUrl($r['classid'],$r['id'],'doinfo',0,0,1); $eplurl=$pagefunr['pageurl']; ?> <tr bgcolor="#FFFFFF" id=news<?php echo $r[id]; ?> > <td height="25"> <div align="left"> <?php echo $st; ?> <?php echo $showtitlepic;
function GetInfoNewsBq($classid, $newstemp_r, $ecms_gr, $docheckrep) { global $empire, $dbtbpre, $public_r, $emod_r, $class_r, $class_zr, $fun_r, $navclassid, $navinfor, $class_tr, $level_r, $etable_r; if (!defined('EmpireCMSAdmin')) { $_GET['reallinfotime'] = 0; } if ($_GET['reallinfotime']) { $file = ECMS_PATH . DASHBOARD . '/data/tmp/tempnews' . $newstemp_r['tempid'] . '_all.php'; } else { $file = ECMS_PATH . DASHBOARD . '/data/tmp/tempnews' . $newstemp_r['tempid'] . '.php'; } //变量处理 $grurl = ReturnClassLink($ecms_gr['classid']); //导航 $grpagetitle = ehtmlspecialchars($ecms_gr['title']); $grbclassid = $class_r[$ecms_gr['classid']]['bclassid']; $grtitleurl = sys_ReturnBqTitleLink($ecms_gr); $grclassurl = sys_ReturnBqClassname($ecms_gr, 9); if ($_GET['reallinfotime'] && file_exists($file)) { $filetime = filemtime($file); if ($_GET['reallinfotime'] <= $filetime) { ob_start(); include $file; $string = ob_get_contents(); ob_end_clean(); $string = RepExeCode($string); //解析代码 return $string; } } $formatdate = $newstemp_r['showdate']; $newstemp_r['temptext'] = stripSlashes($newstemp_r['temptext']); $newstemp_r['temptext'] = ReplaceTempvar($newstemp_r['temptext']); //替换全局模板变量 //替换标签 $newstemp_r['temptext'] = DoRepEcmsLoopBq($newstemp_r['temptext']); $newstemp_r['temptext'] = RepBq($newstemp_r['temptext']); //替换变量 $indextext = GetHtmlRepVar($newstemp_r, $ecms_gr['classid']); //写文件 WriteFiletext($file, AddCheckViewTempCode() . $indextext); //读取文件内容 ob_start(); include $file; $string = ob_get_contents(); ob_end_clean(); $string = RepExeCode($string); //解析代码 return $string; }
function ShowClass_ListInfoClass($bclassid, $exp) { global $empire, $class_r, $fun_r, $dbtbpre, $ecms_hashur; //缩 if (getcvar('displayinfoclass', 1)) { $display = " style=display=none"; } if (empty($bclassid)) { $bclassid = 0; $exp = ""; } else { $exp = " " . $exp; } $sql = $empire->query("select * from {$dbtbpre}enewsinfoclass where bclassid='{$bclassid}' order by classid desc"); $returnstr = ""; while ($r = $empire->fetch($sql)) { //采集页面 $pager = explode("\r\n", $r[infourl]); $infourl = $pager[0]; $divonclick = ""; $start_tbody = ""; $end_tbody = ""; $img = "../data/images/dir.gif"; if (empty($r[bclassid])) { $bgcolor = "#DBEAF5"; $divonclick = " language=JScript onMouseUp='turnit(classdiv" . $r[classid] . ");' style='CURSOR: hand' title='open'"; $start_tbody = "<tbody id='classdiv" . $r[classid] . "'" . $display . ">"; $end_tbody = "</tbody>"; } else { $bgcolor = "#ffffff"; } if ($r[newsclassid]) { $lastcjtime = !$r['lasttime'] ? '从未采集' : date("Y-m-d H:i:s", $r['lasttime']); $cj = "<a href='DoCj.php?enews=CjUrl&classid[]=" . $r[classid] . $ecms_hashur['href'] . "' title='最后采集时间:" . $lastcjtime . "'><u>" . $fun_r['StartCj'] . "</u></a>"; $emptydb = " [<a href=ListInfoClass.php?enews=EmptyCj&classid={$r['classid']}" . $ecms_hashur['href'] . " onclick=\"return confirm('" . $fun_r['CheckEmptyCjRecord'] . "');\">" . $fun_r['EmptyCjRecord'] . "</a>]"; $loadoutcj = " [<a href=ecmscj.php?enews=LoadOutCj&classid={$r['classid']}" . $ecms_hashur['href'] . " onclick=\"return confirm('确认要导出?');\">导出</a>]"; $checkbox = "<input type=checkbox name=classid[] value={$r['classid']}>"; } else { $cj = $fun_r['StartCj']; $emptydb = ""; $loadoutcj = ""; $checkbox = ""; } //栏目链接 $getcurlr['classid'] = $r[newsclassid]; $classurl = sys_ReturnBqClassname($getcurlr, 9); $returnstr .= "<tr bgcolor=" . $bgcolor . ">\n\t<td height=25 align='center'>" . $checkbox . "</td>\n <td height=25" . $divonclick . ">" . $exp . "<img src=" . $img . " width=19 height=15></td>\n <td height=25><div align=center>" . $cj . "</div></td>\n <td height=25><a href='" . $infourl . "' target=_blank>" . $r[classname] . "</a></td>\n <td height=25><div align=center><a href=ecmscj.php?enews=ViewCjList&classid=" . $r[classid] . $ecms_hashur['href'] . " target=_blank>" . $fun_r['view'] . "</a></div></td>\n <td height=25><div align=center><a href='" . $classurl . "' target=_blank>" . $class_r[$r[newsclassid]][classname] . "</a></div></td>\n <td height=25><div align=center><a href=CheckCj.php?classid=" . $r[classid] . $ecms_hashur['ehref'] . ">" . $fun_r['CheckCj'] . "</a></div></td>\n <td height=25><div align=center>[<a href=AddInfoClass.php?enews=AddInfoClass&docopy=1&classid=" . $r[classid] . "&newsclassid=" . $r[newsclassid] . $ecms_hashur['ehref'] . ">" . $fun_r['Copy'] . "</a>] [<a href=AddInfoClass.php?enews=EditInfoClass&classid=" . $r[classid] . $ecms_hashur['ehref'] . ">" . $fun_r['edit'] . "</a>] [<a href=ListInfoClass.php?enews=DelInfoClass&classid=" . $r[classid] . $ecms_hashur['href'] . " onclick=\"return confirm('" . $fun_r['CheckDelCj'] . "');\">" . $fun_r['del'] . "</a>]" . $emptydb . $loadoutcj . "</div></td>\n </tr>"; //取得子节点 $returnstr .= $start_tbody . ShowClass_ListInfoClass($r[classid], $exp) . $end_tbody; } return $returnstr; }
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; }