Closed cxtal closed 8 years ago
I like this but have one suggestion and one request. First, you assign a value to $newsChannelTtl
in both admin.php and feedData.php without first checking to see if the value has been assigned in the $ini_array
. I don't think it can be assumed that a $ttl
value will be set for each news feed in the ini file. If not, then you need the default, otherwise you will proliferate unassigned index notices in the error log.
The "request" is that once this has been merged, perphaps you can update the plugin page with the new documentation.
Hello!
You are probably right: I do not know the plugin's internals very well so most likely the $ini_array
has to be checked as you say. Would you like me to create a new pull request for that?
I can definitely update the plugin page. :-)
Regards, Eva
At line 245 of admin.php and 59 of newsfeed,php:
Sorry closed by mistake
$newsChannelTtl = isset($ini_array[$which]['ttl']) ?
$ini_array[$which]['ttl']: $this->getConf('ttl');
Also, I see a bug at line 251. You have $his
instead of $this
in admin.php.
Got it - new pull request?
Sounds good.
Closing #12
I've merged your additions from the command line as a single commit; otherwise I would have had to merge in two steps, which included the $this/$his
error. I cited your github page in the changelog. I made the bare minimum additions to the plugin page; please feel free to update as you see fit. Thanks.
There is a problem in newsfeed.php, line: 59 in commit #12 :
$newsChannelTtl = isset($ini_array[$which]['ttl']) ? $ini_array[$which]['ttl'] : $this->getConf('ttl');
$this
should not be there but I do not know a way around it - $ini_array[$which]['ttl']
is fine though.
It has been so long since I looked at the plugin that I forgot that the script is external to the plugin proper and doesn't have access to $this
. I've added a fix but have temporarily created a new branch for it: https://github.com/turnermm/news/archive/temp.zip.
To see what I've done: https://github.com/turnermm/news/compare/temp?expand=1
If this works for you, I will merge it into the master.
You need this check, because you can't count on all subfeeds having a ttl set in the ini file.
I created a new pull request: https://github.com/turnermm/news/pull/13 with these changes.
Hello!
The following patch adds a per-feed optional TTL setting [1] that will add the optional RSS TTL key to the generated XML files. This change will help issues with the XML files being cached as well as instruct automatic RSS updates when to refresh a feed.
After applying this patch the file "newsfeed.ini" can be configured with an extra TTL key, for instance:
The being that the resulting XML will have the TTL key in the "channel" section as per the specification:
If useful, please apply! :-)
Kind Regards, Eva
[1] TTL optional parameter, http://www.rssboard.org/rss-specification