i believe where it reads
$newsbit1=fopen($this->tpl_dir."newsbit.tpl","r");
$newsbit2=fread($get1,filesize($this->tpl_dir."newsbit.tpl"));
it should be
$newsbit1=fopen($this->tpl_dir."newsbit.tpl","r");
$newsbit2=fread($newsbit1,filesize($this->tpl_dir."newsbit.tpl"));
also where it reads
$get3=str_replace("{head}",$head2,$get2);
and replace it with
I believe it should be
$get3=str_replace("{head}",$head2,$get3);
be careful with consecutive replaces. I think the best is just to take a template and replace it with
and replace always the same variable to avoid mistakes (in your script, that would mean replace every $get3 with $get2)
another advice... instead of doing consecutive uses of fopen(), fread(), filesize ()and fclose(), it's easier just to use file() and join(), fopen is necessary only when using advanced read/write functions.
you could use it like this:
$newsbit2=join('',file($this->tpl_dir."newsbit.tpl"));
edit:
I've noticed your database interaction is all wrong. you should take off the entire
if(mysql_num_rows($sql_query)) {
$row = mysql_fetch_assoc($sql_query);
foreach ($row as $db => $value) {
$get3=str_replace("{newstitle}",$db['title'],$get3);
$get3=str_replace("{newsdate}",$db['date'],$get3);
$get3=str_replace("{newscontent}",$db['content'],$get3);
}
and replace with
if(mysql_num_rows($sql_query)) {
$db = mysql_fetch_assoc($sql_query);
$search = array ("{newstitle}","{newsdate}","{newscontent}");
$replacement = array ($db['title'],$db['date'],$db['content']);
$get3=str_replace($search,$replacement,$get3);
}