//把图片描述去掉 $content = preg_replace("/ alt=([^ >]+)/is", "", $content); foreach ($keyList as $key => $value) { //$content=str_replace($key,"<a href=$value style=text-decoration:underline;font-size:14px;color:{$webdb[ShowKeywordColor]}; target=_blank>$key</a>",$content); //$keyword = $value['title']; if ($value['replacenum'] == 0) { $content = str_replace($value['title'], '<a href=' . $value['linkurl'] . ' target=_blank>' . $value['title'] . '</a>', $content); } else { $content = preg_replace('/' . $value['title'] . '/is', '<a href=' . $value['linkurl'] . ' target=_blank>' . $value['title'] . '</a>', $content, $value['replacenum']); } } return $content; } $timeNow = time(); $keyWhere = "(starttime < {$timeNow} or starttime = NUll or starttime = 0) and (endtime > {$timeNow} or endtime = NUll or endtime = 0)"; $keyList = $keys->GetList(array('id', 'linkurl', 'title', 'orders', 'replacenum'), '', '', $keyWhere, 'orders desc,id desc'); $info['content'] = show_keyword($info['content'], $keyList); //========================================= // $time = time(); $templatefile = 'articles_show.tpl.php'; if ($config['customtemplatemode'] == 1) { //==========个性化模版检测20111208=============== $custom_templates = ''; $custom_templates = $c . '_' . $a . '_classid_' . $info['classid'] . '.tpl.php'; if (is_file(WEB_TPL . 'custom_templates/' . $custom_templates)) { $templatefile = 'custom_templates/' . $custom_templates; } //==========个性化模版检测20120305=============== $custom_templates_s = ''; $custom_templates_s = $c . '_' . $a . '_id_' . $info['id'] . '.tpl.php';
//基本部分 require 'checkpower.inc.php'; //功能部分 include WEB_MOD . 'keys.class.php'; $keys = new Keys(); switch ($a) { case 'list': default: //list $pageListNum = 12; //每页显示 $totalPage = 0; //总页数 $page = isset($page) ? (int) $page : 1; $start = ($page - 1) * $pageListNum; $List = $keys->GetList(array('id', 'title', 'linkurl', 'orders', 'replacenum'), $start, $pageListNum, ''); include WEB_INC . "page.class.php"; $sqlNum = "select id from `{tablepre}keys`"; $db->Execute($sqlNum); $pageNum = $db->GetRsNum(); $totalPage = ceil($pageNum / $pageListNum); //总页数 $pages = new PageClass($page, $totalPage); $showpage = $pages->showPage(); $templatefile = 'keys_list.tpl.php'; break; case 'edit': // if (isset($submit)) { $info = array(); $time = time();