Пример #1
0
} elseif (!empty($c) && (!empty($_GET['from']) || !empty($_GET['until']))) {
    if (!$articles->setWorkContainer($c)) {
        show_error($articles->last_error);
    } elseif (($articles_list = $articles->getStat('time')) === false) {
        show_error($articles->last_error);
    } else {
        $containers = $articles->getContainers();
        $from = @$_GET['from'];
        $until = @$_GET['until'];
        $result = '';
        $system->config['pagename'] = __('Search results');
        foreach ($articles_list as $id => $time) {
            $id = explode('.', $id);
            if ((!$from || $time >= $from) && (!$until || $time <= $until)) {
                if ((($cat_data = $articles->getCategory($id[0], false)) !== false || $c == '#root') && ($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']), 'linkurl' => '?module=' . $module . '&amp;c=' . str_replace('#', '%23', $c) . '&amp;b=' . $article['catid'] . '&amp;a=' . $article['id'], 'cat_data' => @$cat_data));
                }
            }
        }
        $title = '<a class="winheader" href="?module=' . $module . '">' . __('Sections') . '</a> &rarr; ' . '<a class="winheader" href="?module=' . $module . '&amp;c=' . str_replace('#', '%23', $c) . '">' . $containers[$c] . '</a> &rarr; ' . __('Search results');
        show_window($title, $result);
    }
} elseif (!empty($_GET['from']) || !empty($_GET['until'])) {
    $result = '';
    foreach ($articles->getContainers(0) as $c => $null) {
        if (!$articles->setWorkContainer($c)) {
            show_error($articles->last_error);
        } elseif (($articles_list = $articles->getStat('time')) === false) {
            show_error($articles->last_error);
        } else {
            $containers = $articles->getContainers();
Пример #2
0
                    $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&amp;c=' . $news_container . '&amp;b=' . $id[0], 'linkurl' => '?module=articles&amp;c=' . $news_container . '&amp;b=' . $id[0] . '&amp;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])) {
    $my_module = $module;