http://img.plici.ro/images/2014/11/03/Untitlede2838.png
functions_announcement_feed.php
Cod: Selectaţi tot
<?php
/**
*
* phpBB.ro Announcements 1.0.1
* MOD to parse the RSS/ATOM Feed from the phpBB Announcements forums, allowing
* news and announcements to be accessed via the phpBB ACP.
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
function announcement_feed($limit = 10)
{
global $template, $user;
$news_array = simplexml_load_file('http://www.phpbb.lumeaparanormalului.ro/anunturi.rss');
if(!$news_array)
{
$template->assign_var('S_NEWS_CONNECT_FAIL', true);
}
$current = 0;
$children = $news_array->children();
foreach($children as $child)
{
foreach($child as $sub)
{
if($sub->title != 'Latest phpBB.ro announcements' && !empty($sub->title))
{
if($current < $limit)
{
$template->assign_block_vars('news_feed', array(
'TITLE' => $sub->title,
'DATE' => $sub->pubDate,
'U_NEWS' => $sub->link,
'AUTHOR' => $sub->author,
'DESCRIPTION' => $sub->description,
'U_AUTHOR' => 'http://www.phpbb.ro/memberlist.php?mode=viewprofile&un=' . $sub->author,
));
$current++;
}
}
}
}
}