Hizen
Member
I recently upgraded my forum (https://forum.blackout-ro.net) to the latest version (from the version before it).
We have another site (https://cp.blackout-ro.net) which fetches the RSS from https://forum.blackout-ro.net/forums/announcements/index.rss, however, the code on that other site stopped working. It's strange because we can get fetch the RSS fine from our main website (https://blackout-ro.net).
This is the function that was being used. It worked perfectly until the upgrade and it hasn't been changed. The value $channels no longer returns anything (e.g. count($channels) would equal 0).
I know this message is a long shot since there is technically nothing wrong with XenForo, but I'm stuck. I've tried everything. Hoping someone can help me out.
We have another site (https://cp.blackout-ro.net) which fetches the RSS from https://forum.blackout-ro.net/forums/announcements/index.rss, however, the code on that other site stopped working. It's strange because we can get fetch the RSS fine from our main website (https://blackout-ro.net).
This is the function that was being used. It worked perfectly until the upgrade and it hasn't been changed. The value $channels no longer returns anything (e.g. count($channels) would equal 0).
I know this message is a long shot since there is technically nothing wrong with XenForo, but I'm stuck. I've tried everything. Hoping someone can help me out.
Code:
function RSS_Display($url, $feed_items)
{
$feed_file = FLUX_DATA_DIR.'/tmp/Feed_.php';
if (file_exists($feed_file) && time_check('+5 minutes', $feed_file)) {
return unserialize(file_get_contents($feed_file, null, null, 28));
} else {
global $RSS_Content;
foreach ($url as $cat => $url_) {
foreach($url_['links'] as $url1) {
$doc = new DOMDocument();
$url1 = "https://forum.blackout-ro.net/forums/announcements/index.rss?&order=post_date";
$doc->load(trim($url1));
$titles = [];
$channels = $doc->getElementsByTagName("channel");
foreach ($channels as $channel) {
$items_ = $channel->getElementsByTagName('item');
foreach($items_ as $item1) {
$tnl = $item1->getElementsByTagName("title");
$tnl = $tnl->item(0);
$title = $tnl->firstChild->textContent;
$titles[] = $title;
}
}
}
}
return serialize_cache($feed_file, array_slice($RSS_Content, 0, $feed_items));
}
}