コード例 #1
0
ファイル: ajax.php プロジェクト: nerdling/gregarius
function __exp__getFeedContent($cid)
{
    $cid = sanitize($cid, RSS_SANITIZER_NUMERIC);
    ob_start();
    rss_require('cls/items.php');
    $readItems = new ItemList();
    $readItems->populate(" not(i.unread & " . RSS_MODE_UNREAD_STATE . ") and i.cid= {$cid}", "", 0, 2, ITEM_SORT_HINT_READ);
    $readItems->setTitle(__('Recent items'));
    $readItems->setRenderOptions(IL_TITLE_NO_ESCAPE);
    foreach ($readItems->feeds[0]->items as $item) {
        $item->render();
    }
    $c = ob_get_contents();
    ob_end_clean();
    return "{$cid}|@|{$c}";
}
コード例 #2
0
ファイル: author.php プロジェクト: jphpsf/gregarius
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
# http://www.gnu.org/licenses/gpl.html
#
###############################################################################
# E-mail:	   mbonetti at gmail dot com
# Web page:	   http://gregarius.net/
#
###############################################################################
require_once 'init.php';
$a = trim(sanitize($_REQUEST['author'], RSS_SANITIZER_WORDS));
$sql = "select distinct(author) from " . getTable('item') . " where author  like '%{$a}'";
list($ra) = rss_fetch_row(rss_query($sql));
if (!$ra) {
    rss_404();
    exit;
}
$t = ucfirst(__('items')) . " " . __(' by ') . " " . $ra;
$GLOBALS['rss']->header = new Header($t);
$GLOBALS['rss']->feedList = new FeedList(false);
$authorItems = new ItemList();
$sqlWhere = " i.author like '%{$a}' ";
$numItems = getConfig('rss.output.frontpage.numitems');
$authorItems->populate($sqlWhere, "", 0, $numItems);
$authorItems->setTitle($t);
$authorItems->setRenderOptions(IL_NO_COLLAPSE | IL_TITLE_NO_ESCAPE);
$GLOBALS['rss']->appendContentObject($authorItems);
$GLOBALS['rss']->renderWithTemplate('index.php', 'items');