Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes
Author Message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sat Feb 04, 2006 4:51 pm Reply with quote

I was trying to test the page generation time for my "Theme Without Tables"
http://www.ravenphpscripts.com/postt7990.html

when I came across what seems to be a bug in the page generation time in certain themes. These are themes such as NukeNews which display their own footer message instead of using the footmsg function of footer.php.

Basically, I believe that the $totaltime (footer.php uses $total_time but what's a little consistency?) in these themes is never calculated so it doesn't show up in the footer. For my own theme I just changed the themefooter() code to call footmsg() instead of calculating and outputting the footer in the theme. But it seemed to me that it would be problematic for Nukenews since it outputs $footmsg inside of a table in a html file. So I copied to code to calculate $total_time over from footer.php and it now works.

The revised code for NukeNews themefooter thus becomes:

Code:
function themefooter() {

    global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time;
    if (defined('INDEX_FILE')) {
   $tmpl_file = "themes/NukeNews/center_right.html";
   $thefile = implode("", file($tmpl_file));
   $thefile = addslashes($thefile);
   $thefile = "\$r_file=\"".$thefile."\";";
   eval($thefile);
   print $r_file;
   blocks("r");
    }
    $mtime = microtime();
    $mtime = explode(" ",$mtime);
    $mtime = $mtime[1] + $mtime[0];
    $end_time = $mtime;
    $total_time = ($end_time - $start_time);
    $total_time = _PAGEGENERATION." ".substr($total_time,0,4)." "._SECONDS;
    $footer_message = "$foot1<br>$foot2<br>$foot3<br>$copyright<br>$total_time";
    $tmpl_file = "themes/NukeNews/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}


I suspect that any theme that uses the NukeNews approach probably has the same "bug" but I haven't really tested for that ... I don't have a lot of themes on my system.

This is Nuke 7.6 with Patch 3.1.
 
View user's profile Send private message Visit poster's website
sting
Involved
Involved



Joined: Sep 23, 2003
Posts: 456
Location: Somewhere out there...

PostPosted: Tue Feb 07, 2006 9:41 pm Reply with quote

Thanks for posting this..

-sting

_________________
You see - I told you I wasn't paranoid. They were really out to get me. 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©