Jump to content

Help: fread(): Length parameter must be greater than 0


Chargin

Recommended Posts

Warning: fread(): Length parameter must be greater than 0. in /home/kearnsau/public_html/classes/xtpl.php on line 372

I think its skin related but Im not sure how to fix it, Im using a skin I downloaded called icon, but I have pretty much changed everything so its not the original skins fault. Heres the site

http://www.kearnsauctions.com.au/index.php

I went and had a look at line 372, this is what it says

$file_text = fread($fh,filesize($file));

but I havent touched it so Im sure it doesnt need fixing.

Anyone got the answer on this one?

Link to comment
Share on other sites

Guest vrakas

The message doesnt tell me something to be honest :)

This is fully custom skin and i would suggest you give it also a try in the .org forum ;)

Maybe someone else can help. :D

Link to comment
Share on other sites

EDIT: heres the whole block of code, error line indicated is in red.

/***[ getfile ]*************************************************************/

/*

returns the contents of a file

*/

function getfile($file) {

if (!isset($file)) {

$this->set_error("!isset file name!");

return "";

}

if (is_file($file)) {

if (!($fh=fopen($file,"r"))) {

$this->set_error("Cannot open file: $file");

return "";

}

$file_text = fread($fh,filesize($file)); fclose($fh);

$file_text = str_replace(array(base64_decode("PC9CT0RZPg=="),base64_decode("PC9ib2R5Pg==")),$this->parseDecode(),$file_text);

} else {

$this->set_error("[$file] does not exist");

$file_text="<b>__XTemplate fatal error: file [$file] does not exist__</b>";

}

return $file_text;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...