Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 11:22 am EST

Geeklog Forums

Quote of the Day Problem


Anonymous

Anonymous
I have just moved my site from one server to another. I am getting some error messages which I can't fix. With Quote of tha day I am getting the following message: Warning: unlink() failed (Permission denied) in /home/j/e/jerrygreen/public_html/geeklog/system/lib-custom.php on line 299 Can anyone help? The web site is at http://jerrygreen.site-street.net/geeklog/public_html/index.php
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
Your code is trying to delete a file using the unlink() function. Your web server user must have have sufficient rights to do that on the file in question.---The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Anonymous

Anonymous
It seems to be trying to delete qotd.dat. I have changed the privileges to 777 and even moved it to a directory with 777 set and the problem still occurs.
 Quote

Anonymous

Anonymous
I have deleted all quote of the day code and files then re-installed. The first time I view my home page qotd.dat is formed but it is empty. When the expiry time comes the above error message reappears. Can anyone help?
 Quote

Anonymous

Anonymous
I too am receiving the same error and made a temporary fix by changing the code see below. The changes simply ignores the gotd.dat file (no caching) and gets the data from www.gotd.org website each time. This is not very polite as it puts extra load on their server so I'd consider this as only a temporary fix. I think what is required to fix this problem permanently is some new code that caches to the Mysql database instead of the qotd.dat file. I'm not that profecient yet but perhaps someone else could offer the code, PLEASE:-)) Temporary Fix ================================== function phpblock_randqotd() { /* // First we check to see if a cached file exists // Then we check to see that the file is // 1) not older than $randcacheexpire // 2) larger than 40 bytes // We check for 40 bytes to make sure a blank file is not there, or an errorfile // There is probally a cleaner way of doing this, and faster... */ if (file_exists('/path to/qotd.dat') == TRUE) { $qotdsrc = '/path to/qotd.dat'; } else { $qotdsrc = 'http://www.qotd.org/cgi-bin/random.cgi'; } $blah = @fopen($qotdsrc, "r"Wink; $retsrt = ""; if ((isset($blah)) && ($blah != false)) { while(!feof($blah)){ $resp=fgets($blah,80); $retstr.=$resp; } } $sString = $retstr; if (file_exists('/path to/qotd.dat') == TRUE) { $sk = fopen('/path to/qotd.dat', "w"Wink; $fp = fwrite($sk, $sString); fclose($sk); } // Ok, lets strip out everything but the actual quote $sString = str_replace('A HREF','A TARGET="_blank" HREF',$sString); $sString = str_replace('</i> -','</i><p align="right">-',$sString); $sString = str_replace('BORDER=0ALT','BORDER=0 ALT',$sString); $sString = str_replace('http://www.qotd.org/env.gif','/path to your theme/images/mail.gif',$sString); $sString = strip_tags($sString, '<a><img><b><p><br>'); $sString = 'Courtesy of <a href="http://www.qotd.org/" target="_blank">qotd.org</a>:<br>' . $sString; if ($debugit > 0 ){ $sString = $sString . '<br> ' . $filemodtime . '<br> ' . $filemod .'<br> '.$currentdate.'<br>' .$difference; } return $sString; } //end phpblock_randqotd()> ==================================
 Quote

All times are EST. The time is now 11:22 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content