Пример #1
0
            $result = '';
            $result .= '<div align="right">' . rcms_pagination($cnt, $system->config['perpage'], $page + 1, '?module=' . $module . '&amp;c=' . str_replace('#', '%23', $c) . '&amp;b=' . $b . '&amp;a=' . $a) . '</div>';
            for ($id = $start; $id < $total + $start; $id++) {
                $comment =& $comments[$id];
                if (!empty($comment)) {
                    $result .= rcms_parse_module_template('comment.tpl', $comment);
                }
            }
            $result .= '<div align="left">' . rcms_pagination($cnt, $system->config['perpage'], $page + 1, '?module=' . $module . '&amp;c=' . str_replace('#', '%23', $c) . '&amp;b=' . $b . '&amp;a=' . $a) . '</div>';
            show_window(__('Comments'), $result);
        }
    }
} 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));
                }
            }
        }
Пример #2
0
$current_year = rcms_format_time('Y', rcms_get_time());
$current_month = rcms_format_time('n', rcms_get_time());
if (!empty($_POST['cal-year']) && $_POST['cal-year'] >= $current_year - 6 && $_POST['cal-year'] <= $current_year) {
    $selected_year = $_POST['cal-year'];
} else {
    $selected_year = $current_year;
}
if (!empty($_POST['cal-month']) && $_POST['cal-month'] >= 1 && $_POST['cal-month'] <= 12) {
    $selected_month = $_POST['cal-month'];
} else {
    $selected_month = $current_month;
}
$calendar = new calendar($selected_month, $selected_year);
foreach ($articles->getContainers(0) as $container => $null) {
    $articles->setWorkContainer($container);
    if ($list = $articles->getStat('time')) {
        foreach ($list as $id => $time) {
            $id = explode('.', $id);
            if (rcms_format_time('n', $time) == $selected_month && rcms_format_time('Y', $time) == $selected_year) {
                $calendar->assignEvent(rcms_format_time('d', $time), '?module=articles&amp;from=' . mktime(0, 0, 0, $selected_month, rcms_format_time('d', $time), $selected_year) . '&amp;until=' . mktime(23, 59, 59, $selected_month, rcms_format_time('d', $time), $selected_year));
            }
        }
    }
}
$calendar->highlightDay(rcms_format_time('d', time()));
$date_pick = '<form action="" method="post" style="text-align: center">
               <select name="cal-month">';
foreach (array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December') as $num => $month) {
    $date_pick .= '<option value="' . ($num + 1) . '"' . ($num == $selected_month - 1 ? ' selected="selected"' : '') . '>' . $lang['datetime'][$month] . '</option>';
}
$date_pick .= '</select>
Пример #3
0
        } else {
            show_window('', __('Module not found'), 'center');
        }
    }
    $system->setCurrentPoint('index-main');
    $module = $c_module;
}
if (empty($system->config['index_module']) || $system->config['index_module'] == 'news' || $system->config['index_module'] == 'default') {
    if (class_exists('articles')) {
        $articles = new articles();
        $news_container = !empty($articles->config['news']) ? $articles->config['news'] : 'news';
        if (!$articles->setWorkContainer($news_container)) {
            show_error($articles->last_error);
        } else {
            $result = '';
            if (($list = $articles->getStat('time')) !== false) {
                if (!empty($system->config['perpage'])) {
                    $pages = ceil(sizeof($list) / $system->config['perpage']);
                    if (!empty($_GET['page']) && (int) $_GET['page'] > 0) {
                        $page = (int) $_GET['page'] - 1;
                    } else {
                        $page = 0;
                    }
                    $start = $page * $system->config['perpage'];
                    $total = $system->config['perpage'];
                    $end = $total + $start;
                    if ($end > sizeof($list)) {
                        $end = sizeof($list);
                    }
                } else {
                    $pages = 1;