Ejemplo n.º 1
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$articles = new articles();
$container = empty($articles->config['cpop']) ? 'articles' : $articles->config['cpop'];
if (!$articles->setWorkContainer($container)) {
    return show_window(__('Most commented articles'), __('Error occurred') . ':<br />' . $articles->last_error);
}
if ($list = $articles->getLimitedStat('ccnt', $system->config['num_of_latest'], true)) {
    $result = '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
    $i = 2;
    foreach ($list as $id => $time) {
        $id = explode('.', $id);
        if (($article = $articles->getArticle($id[0], $id[1], false, false, false, false)) !== false) {
            $result .= '<tr><td class="row' . $i . '"><a href="index.php?module=articles&amp;c=' . $container . '&amp;b=' . $id[0] . '&amp;a=' . $id[1] . '"><abbr title="' . $article['author_nick'] . ', ' . rcms_format_time('d.m.Y H:i:s', $article['time']) . '">' . $article['title'] . ' (' . $article['comcnt'] . ')</abbr></a></td></tr>';
            $i++;
            if ($i > 3) {
                $i = 2;
            }
        }
    }
    $result .= '</table>';
    show_window(__('Most commented articles'), $result);
}
Ejemplo n.º 2
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$articles = new articles();
list($module, $c) = explode('@', $module);
if ($articles->setWorkContainer($c)) {
    if (($list = $articles->getLimitedStat('time', $system->config['num_of_latest'], true)) !== false) {
        foreach ($list as $id => $time) {
            $id = explode('.', $id);
            if (($article = $articles->getArticle($id[0], $id[1], true, true, false, false)) !== false) {
                $feed->addItem($article['title'] . ' [' . $article['author_name'] . ']', htmlspecialchars($article['desc']), 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'] . basename($_SERVER['SCRIPT_NAME'])) . '/' . '?module=' . $module . '&amp;c=' . $c . '&amp;b=' . $id[0] . '&amp;a=' . $id[1], $article['time']);
            }
        }
    }
}