11
toppa
Re: Headlines module not functioning
  • 2004/8/12 19:41

  • toppa

  • Just popping in

  • Posts: 1

  • Since: 2004/8/12


I just found this thread, as I was having the same problem. My hosting provider also has fopen() disabled for security reasons (from what I've been reading, fopen() can be dangerous). But they have curl available. Use phpinfo() to see if curl is available on your server. If so, go into modules/xoopsheadline/class/headlinerender.php and change updateCache() like so:

-----
function updateCache()
{
# comment out the fopen stuff...
#if (!$fp = fopen($this->_hl->getVar('headline_rssurl'), 'r')) {
#$this->_setErrors('Could not open file: '.$this->_hl->getVar('headline_rssurl'));
#return false;
#}
#$data = '';
#while (!feof ($fp)) {
#$data .= fgets($fp, 4096);
#}
#fclose ($fp);

# replace with curl
$fp = curl_init($this->_hl->getVar('headline_rssurl'));
curl_setopt ($fp, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($fp, CURLOPT_HEADER, 0);
$data = curl_exec($fp);
curl_close ($fp);

if (empty($data)) {
$this->_setErrors('Could not open file: '.$this->_hl->getVar('headline_rssurl'));
return false;
}
-----
And don't change the rest of the function...

I got the code for this right the first time I wrote it, but I didn't know it, as I forgot to force updateCache() to run, so I thought it wasn't working. To test, set $force_update = TRUE as the first line inside renderFeed(), and don't forget to remove it when you're done (otherwise you'll probably get banned from the rss services you're using!).

12
mlavwilson
Re: Headlines module not functioning
  • 2006/5/22 13:38

  • mlavwilson

  • Just popping in

  • Posts: 5

  • Since: 2006/4/10


I can not get this working! Has anyone got this working on godaddy?

http://help.godaddy.com/article.php?article_id=288&topic_id=&&

Login

Who's Online

269 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 269


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits