case 'show': // $where = ''; if (isset($id) && !empty($id)) { $where = ' id = ' . $id . ' '; } if (isset($filename) && !empty($filename)) { $where = " `filename` = '" . $filename . "' "; } if (empty($where)) { $errorInfo = '变量错误'; errorinfo($errorInfo, ''); } //echo $where; $info = array(); $info = $articles->GetInfo(array('id', 'classid', 'title', 'seotitle', 'seokeyword', 'seointro', 'filename', 'fromlinkurl', 'fromtitle', 'content', 'author', 'addtime', 'clicks', 'linkurl', 'isplay', 'thumb', 'titlecolor', 'intro'), $where); if (empty($info)) { $errorInfo = '变量错误'; errorinfo($errorInfo, ''); } $classid = $info['classid']; $classinfo = $articles_class->GetInfo(array('id', 'title', 'filename', 'linkurl', 'rootid'), " id = {$classid} "); //上一条 下一条信息 $preinfo = array(); $nextinfo = array(); $sql = " select * from {tablepre}articles where classid = {$classid} and id < " . $info['id'] . " order by id desc limit 0,1 "; //echo $sql; $db->Execute($sql); $t_r = $db->GetArray(); //print_r($t_r); if ($t_r) {
//总页数 $pages = new PageClass($page, $totalPage); $showpage = $pages->showPage(); $templatefile = 'articles_list.tpl.php'; break; case 'edit': // if (isset($submit)) { $info = array(); $time = time(); if (isset($id)) { $id = intval($id); if ($id <= 0) { errorinfo('变量错误', ''); } $infoold = $articles->GetInfo('', ' id = ' . $id); } //20120719 checkClassPower('articles', $classid); if (!empty($addtime)) { $addtime = strtotime($addtime); } else { $addtime = $addtime; } if (!empty($authortime)) { $authortime = $authortime; } else { $authortime = $authortime; } if (!empty($filename) && (isset($id) && $filename != $infoold['filename'])) { $namea = $articles->GetInfo('', " `filename` = '" . $filename . "' ");