If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
ERROR: Warning: fread(): Length parameter  XML
Forum Index » Advanced Guestbook Forum
Author Message
NewtonLoops
Beginner

Joined: 17/09/2005 17:48:07
Messages: 12
Offline

Hi Everybody,

I had the good idea to go in and edit out the "Add Homepage" form field on the AGB signing page to deter spammers. Seems all the really want to do is leave link backs. I did some other minor things and all is workiing except I now have this error code at the top of the AGB index / first page. I found the file and the line but need help with the fix.

Can anybody help?
Thanks
nl
-------------------------------------------------
Here's error and the code. I bolded it for reading.

Warning: fread(): Length parameter must be greater than 0. in /home/MYNAME/public_html/guestbook/lib/template.class.php on line 53


}

function get_template($tpl) {
if (!isset($this->template[$tpl])) {
$filename = "$this->root_dir/templates/$tpl";
if (file_exists("$filename")) {
$fd = fopen ($filename, "r");
$this->template[$tpl] = fread ($fd, filesize ($filename));
fclose ($fd);
$this->template[$tpl] = ereg_replace("\"", "\\\"", $this->template[$tpl]);
}
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

it means one of your templates is either missing or blank and the AG template code does not like that. Just put a space in the empty file.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
NewtonLoops
Beginner

Joined: 17/09/2005 17:48:07
Messages: 12
Offline

Carbon,
I don't savvy php so well. Can you tell me where / what to do?

Much appreciated.

NL
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

When you were making your changes you must of edited one of the template files and left it blank. I couldn't say which file but possibly url.php or form_url.php in templates folder.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
NewtonLoops
Beginner

Joined: 17/09/2005 17:48:07
Messages: 12
Offline

Yes, that is what I was doing. The idea was to remove the message homepage url link fields so people couldn't post fake messages just so they could leave a link back to their site or some other junk site.

I think it's a good fix to the spam problem. Maybe you can make a patch for anybody wanting to try it that way.

Ok, I'll go back and look for the problem.

Thanks for the info.

NL
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Well I assume you just removed


from form.php

then just remove $URL from entry.php and

$gb_post->url = (isset($_POST["gb_url"])) ? $_POST["gb_url"] : '';

from addentry.php

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
NewtonLoops
Beginner

Joined: 17/09/2005 17:48:07
Messages: 12
Offline

Carbon,
I was looking at the guestbook you use and saw you have removed the add homepage field form the sign the guestbook page . This is what I was going for when I deleted the wrong code.

Do you have a howto up anywhere to do it like you did?

Also, curiosity has me wondering why you are not using Lazarius on this site?

NL
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

I use Lazarus which is a fork of the Advanced Guestbook where removing the homepage is an option.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum