Îmi cer scuze pentru întârziere!
Probabil serverele voastre au fost actualizate, motiv pentru care MODificarea nu mai funcţionează.
Mai exact, este o problemă ce ţine de serverele voastre, nu de MODificare.
Unele servere dezactivează fişierele care deţin URL-uri (linkuri) ce accesează şi solicită răspuns din afara forumului. Această măsură este una de securitate.
În concluzie asta fac serverele voastre.
Am început să lucrez la o versiune ce va rezolva această problemă pe serverele mai "speciale".
Pentru moment, pentru a nu dezinstala MODificarea (dar dacă doriţi o puteţi dezinstala..), faceţi în felul următor: deschideţi fişierul
functions_announcement_feed.php
din directorul
includes
, ştergeţi tot din el şi puneţi în locul vechiului cod, acest cod:
Cod: Selectaţi tot
<?php
/**
*
* phpBB.ro Announcements Feed
*
* MOD to parse the RSS/ATOM Feed from the phpBB.ro Announcements forum, allowing
* news and announcements to be accessed via the phpBB ACP.
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
class announcement_feed
{
var $server = 'www.phpbb.ro';
var $feed_path = '/feed.php?f=14';
var $feed;
function __construct()
{
global $template;
$this->feed = $this->get_feed();
if (!$this->feed)
{
$template->assign_var('S_NEWS_CONNECT_FAIL', true);
}
$news_array = $this->parse_feed();
if (!$news_array)
{
return false;
}
$this->set_template_variables($news_array);
}
/*
Return is either false (on failure) or the feed content
*/
function get_feed()
{
global $phpbb_root_path, $phpEx;
if (!function_exists('get_remote_file'))
{
include("{$phpbb_root_path}includes/functions_admin.$phpEx");
}
$index_file = "index.$phpEx";
$err_str = '';
$errno = 0;
$feed = get_remote_file($this->server, $this->feed_path, $index_file, $err_str, $errno);
if (!$feed)
{
return false;
}
return $feed;
}
/*
Parse the feed for reading in the ACP.
The single parameter is optional, and if set, it will override $this->feed.
This will return false if it fails at any point
It will return an array of the items like so:
[0] => array(
'title' => 'Announcement Title',
'author' => 'Author name',
'link' => 'http://...',
'pubDate' => $timestamp,
'description' => $text, // NOTE: Truncated for a short description, off by default
);
*/
function parse_feed($feed = '')
{
// First make sure $feed is not set. If it is, use it no matter what. However, put it in $this->feed so that that is used
// If neither are set, return false
// Otherwise, just skip this step and use the contents of $this->feed
if (!empty($feed))
{
$this->feed = $feed;
}
else if (empty($feed) && empty($this->feed))
{
return false;
}
// Put the contents of <item></item> into an array, do it for all of them
preg_match_all("'<item>(.*?)</item>'si", $this->feed, $matches);
if (!sizeof($matches))
{
return false;
}
$matches = array_unique($matches);
$items = array();
$num = 0;
foreach($matches[0] as $item)
{
// now split it up. We need a preg_match for each of the child tags:
// author, title, pubDate, link, description
preg_match("'<title>(.*?)</title>'si", $item, $title);
$items[$num]['title'] = $title[1];
preg_match("'<author>(.*?)</author>'si", $item, $author);
$items[$num]['author'] = $author[1];
preg_match("'<pubDate>(.*?)</pubDate>'si", $item, $pubDate);
$items[$num]['pubDate'] = strtotime($pubDate[1]);
preg_match("'<link>(.*?)</link>'si", $item, $link);
$items[$num]['link'] = $link[1];
preg_match("'<description>(.*?)</description>'si", $item, $description);
$items[$num]['description'] = $description[1];
// Increment the counter
$num++;
}
return $items;
}
function set_template_variables(array $input_array)
{
global $template, $user;
if (!sizeof($input_array))
{
return false;
}
foreach($input_array as $news)
{
$template->assign_block_vars('news_feed', array(
'TITLE' => $sub->title,
'DATE' => $sub->update,
'U_NEWS' => $sub->link,
'AUTHOR' => $sub->author,
'DESCRIPTION' => $sub->description,
'U_AUTHOR' => 'http://www.phpbb.ro/memberlist.php?mode=viewprofile&un=' . $sub->author,
));
}
return true;
}
}
În P.A. nu vor apărea anunţurile, dar este o alternativă pentru a nu dezinstala MODificarea şi pentru a putea accesa Panoul administratorului.
P.S. nu garantez că va funcţiona deoarece nu am testat soluţia. În caz că nu funcţionează, dezinstalaţi MODificarea până voi lansa versiunea cea nouă.