function _News_list() { $page = param_num("page", 1); $newslist = listNews(&$pages, &$page); for ($i = 0; $i < count($newslist); $i++) { $newslist[$i]['content'] = formatTextData($newslist[$i]['content']); if ($newslist[$i]['comments'] == 0) { $newslist[$i]['commenttitle'] = "keine Kommentare vorhanden"; } elseif ($newslist[$i]['comments'] == 1) { $newslist[$i]['commenttitle'] = "1 Kommentar"; $newslist[$i]['blink'] = "_blink"; } else { $newslist[$i]['commenttitle'] = $newslist[$i]['comments'] . " Kommentare"; $newslist[$i]['blink'] = "_blink"; } } if ($this->userdata['rights']['news']) { $this->forms['newslist']['canedit'] = 1; } $this->forms['newslist']['pages'] = showPageBar($page, $pages, "index.php", "page", "menu"); $this->template->assign('page', $page); $this->template->assign('newslist', $newslist); $this->template->assign('title', 'Nachrichten'); $this->show('news_list', 'Nachrichten'); }
public function showDetail() { $id = I("get.id/d", null, "addslashes_modified"); if (null === $id || !is_numeric($id)) { $this->error("文章索引有误。"); } $news = array(M("news")->find($id)); load("@.listshow"); listNews($news, false); $this->assign("news", $news); $this->display("Index:showList"); }