$total = $system->config['perpage']; $end = $total + $start; if ($end > sizeof($list)) { $end = sizeof($list); } } else { $pages = 1; $page = 0; $start = 0; $total = sizeof($list); } $keys = array_keys($list); for ($a = $start; $a < $end; $a++) { $time =& $list[$keys[$a]]; $id = explode('.', $keys[$a]); if (($category = $articles->getCategory($id[0], true)) !== false && ($article = $articles->getArticle($id[0], $id[1], true, true, false, false)) !== false) { $result .= rcms_parse_module_template('art-article.tpl', $article + array('showtitle' => true, 'linktext' => $articles->linktextArticle($article['text_nonempty'], $article['comcnt'], $article['views']), 'iconurl' => '?module=articles&c=' . $news_container . '&b=' . $id[0], 'linkurl' => '?module=articles&c=' . $news_container . '&b=' . $id[0] . '&a=' . $article['id'], 'cat_data' => $category)); } } $title = isset($category['title']) ? $category['title'] : __(file_get_contents(ARTICLES_PATH . $news_container . '/title')); if (!empty($list)) { $result .= '<div align="right">' . rcms_pagination(sizeof($list), $system->config['perpage'], $page + 1, '?module=' . $module) . '</div>'; } else { $result = __('Nothing founded'); } } show_window($title, $result); } $system->config['pagename'] = __('Latest news'); } } elseif ($system->config['index_module'] != 'empty' && !empty($system->modules['main'][$module])) {
//////////////////////////////////////////////////////////////////////////////// // Copyright (C) ReloadCMS Development Team // // http://reloadcms.com // // This product released under GNU General Public License v2 // //////////////////////////////////////////////////////////////////////////////// $articles = new articles(); $c = empty($_GET['c']) || $_GET['c'] == '#hidden' ? null : $_GET['c']; $b = empty($_GET['b']) ? null : (int) $_GET['b']; $a = empty($_GET['a']) ? null : (int) $_GET['a']; if (!empty($a) && (!empty($b) && !empty($c) || $c == '#root')) { if (!$articles->setWorkContainer($c)) { show_error($articles->last_error); } elseif (!($article = $articles->getArticle($b, $a, true, true, true, true))) { show_error($articles->last_error); } elseif ($c !== '#root' && !($category = $articles->getCategory($b, false))) { show_error($articles->last_error); } else { if (!empty($category)) { $article['cat_data'] = $category; } $containers = $articles->getContainers(); $com_text = ''; /* If user posting a comment */ if (!empty($_POST['comtext']) && $article['comments'] == 'yes') { if (isset($system->config['article-guest']) and !LOGGED_IN) { show_error(__('You are not logined!')); } else { if (isset($_POST['antispam']) and isset($_POST['captcheckout'])) { $defcatp = substr(md5($_POST['antispam']), 0, 5); $intcapt = $_POST['captcheckout'];
//////////////////////////////////////////////////////////////////////////////// if (!empty($_POST['new'])) { $frm = new InputForm('', 'post', '<<< ' . __('Back')); $frm->hidden('c', $_POST['c']); $frm->show(); $frm = new InputForm('', 'post', __('Submit'), '', '', 'multipart/form-data', 'mainfrm'); $frm->addbreak(__('Create new category')); $frm->hidden('newsave', '1'); $frm->hidden('c', $_POST['c']); $frm->addrow(__('Title'), $frm->text_box('ctitle', ''), 'top'); $frm->addrow(rcms_show_bbcode_panel('mainfrm.cdesc')); $frm->addrow(__('Description'), $frm->textarea('cdesc', '', 70, 5), 'top'); $frm->addrow(__('Minimum access level'), $frm->text_box('caccess', '0'), 'top'); $frm->addrow(__('Icon for category'), $frm->file('cicon'), 'top'); $frm->show(); } elseif (!empty($_POST['b']) && !empty($_POST['c']) && $articles->setWorkContainer($_POST['c']) && ($category = $articles->getCategory($_POST['b'], false))) { $frm = new InputForm('', 'post', '<<< ' . __('Back')); $frm->hidden('c', $_POST['c']); $frm->show(); $frm = new InputForm('', 'post', __('Submit'), '', '', 'multipart/form-data', 'mainfrm'); $frm->addbreak(__('Edit category')); $frm->hidden('save', '1'); $frm->hidden('b', $_POST['b']); $frm->hidden('c', $_POST['c']); $frm->addrow(__('Title'), $frm->text_box('ctitle', $category['title']), 'top'); $frm->addrow(rcms_show_bbcode_panel('mainfrm.cdesc')); $frm->addrow(__('Description'), $frm->textarea('cdesc', $category['description'], 70, 5), 'top'); $frm->addrow(__('Minimum access level'), $frm->text_box('caccess', $category['accesslevel']), 'top'); if (!$category['icon']) { $frm->addrow(__('Icon for category'), $frm->file('cicon')); } else {