Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
prekill
Worker
Worker



Joined: Oct 22, 2005
Posts: 201

PostPosted: Sat May 03, 2008 11:56 pm Reply with quote

Hey guys,

I have just noticed something on my phpnuke site.

When I access my site the page is loading but noting will show until the whole web site is loaded (accept the background image) and just then it will show all at once.

When I access raven for example the header will show first and just then the whole site...

Is this happening due to something is the code? or maybe the theme?

How can I make the site show the loaded parts and not wait for the whole page to be loaded?
 
View user's profile Send private message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Sun May 04, 2008 3:13 am Reply with quote

It's probably theme related, what theme are you using?
 
View user's profile Send private message
prekill







PostPosted: Sun May 04, 2008 6:04 am Reply with quote

umm a custom one that I have made:

here is the theme.php file:
Code:
<?php


/************************************************************/
/* Theme Name: Preflight                                    */
/* Version 1.0                                              */
/************************************************************/

/************************************************************/
/* Theme Colors Definition                                  */
/*                                                          */
/* Define colors for your web site. $bgcolor2 is generaly   */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the  */
/* other two bgcolor variables follows the same criteria.   */
/* $texcolor1 and 2 are for tables internal texts           */
/************************************************************/

$bgcolor1 = "#F1F1EC";
$bgcolor2 = "#D1D1D1";
$bgcolor3 = "#E6D9BA";
$bgcolor4 = "#E6D9BA";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#000000";

include("themes/Preflight/tables.php");

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader() {
    global $index, $user, $userinfo, $cookie, $prefix, $user_prefix, $db, $name ,$total_time, $start_time, $dbi, $sitekey;
    getusrinfo($user);
    cookiedecode($user);
    mt_srand ((double)microtime()*1000000);
    $maxran = 1000000;
    $random_num = mt_rand(0, $maxran);
    $datekey = date("F j");
    $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
    $code = substr($rcode, 2, 6);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }
    echo "<body style=\"body; margin-left: 10em top: 10em;\" text=\"#000000\">";
    if ($banners == 0) {
    include("banners.php");
    }
/* Start Log-in block top left */    
    $uresult = $db->sql_query("select user_id from ".$user_prefix."_users where username='$username'");
    list($uid) = $db->sql_fetchrow($uresult);
    $presult = $db->sql_query("SELECT privmsgs_to_userid FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')");
    $pnumrow = $db->sql_numrows($presult);
   
        $priv_msgs = "<a href=\"messages.html\"><font color=\"red\"><b>$pnumrow</b></font> äåãòåú çãùåú</a>";

        if ($username == "Anonymous") {
   $theuser = "<form action=\"account.html\" method=\"post\"><b>ùí îùúîù:</b><br><input class=\"headerinputtext\" type=\"text\" name=\"username\" value=\"ùí îùúîù\" onFocus=\"if(this.value=='ùí îùúîù')this.value='';\" style=\"width:100;height:16;border:1px solid blue;\"><br><b>ñéñîà:</b><br><input class=\"headerinputtext\" type=\"password\" name=\"user_password\" value=\"password\" onFocus=\"if(this.value=='password')this.value='';\" value style=\"width:100;height:16;border:1px solid blue;\"><input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><input type=\"hidden\" class=headertextinput name=\"gfx_check\" value=\"$code\"><input type=\"hidden\" name=\"op\" value=\"login\"><br><input type=\"image\" value=\"login\" src=\"themes/Preflight/images/login.gif\" class=\"inputimage\">&nbsp;&nbsp;<a href=\"account-new_user.html\"><img src=\"themes/Preflight/images/register.gif\" border=\"0\" alt=\"äéøùí\"></a></form>";
    } else {
        $theuser = "<center><font color=\"blue\"><b>áøåê äáà!</b></font><br><b>$username</b></center><hr>$priv_msgs<br><a href=\"forum-editprofile.html\">ùéðåé äâãøåú ôøåôéì</a><br><a href=\"account-logout.html\">äúðú÷</a>\n";
    }
/* End Log-in block top left */

/* Start Menu Who is online  */
cookiedecode($user);
if (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; }
if (is_user($user))
{
   $uname = $cookie[1];
   $guest = 0;
}
else
{
   if (!empty($ip)) {
      $uname = $ip;
   } else {
      $uname = '';
   }
   $guest = 1;
}

$guest_online_sql = 'SELECT * FROM '.$prefix.'_session WHERE guest=1';
$guest_online_query = $db->sql_query($guest_online_sql);
$guest_online_num = $db->sql_numrows($guest_online_query);

$member_online_sql = 'SELECT * FROM '.$prefix.'_session WHERE guest=0';
$member_online_query = $db->sql_query($member_online_sql);
$member_online_num = $db->sql_numrows($member_online_query);

$who_online_num = $guest_online_num + $member_online_num;
/* End Menu Who is online  */

/* Start Home Page & Favorite */
$homepage = "<a href=\"#\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.preflight.us');\"><img src=\"themes/Preflight/images/homepage.gif\" border=\"0\" alt=\"ìçõ ëàï òì îðú ìäôåê àú ôøéôìééè ìòîåã äáéú\"></a>";
$favorite = "<a href=\"#\" onclick=\"window.external.addfavorite('http://www.preflight.us/','ôøéôìééè - àúø äñéîåìèåøéí îñôø 1 áéùøàì!');\"><img src=\"themes/Preflight/images/favorite.gif\" border=\"0\" alt=\"ìçõ ëàï ìäåñéó àú ôøéôìééè ìîåòãôéí\"></a>";
/* End Home Page & Favorite */

    $public_msg = public_message();
    $tmpl_file = "themes/Preflight/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;

echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
      ."<tr valign=\"top\">\n"
      ."<td width=\"165\">\n";
if ($name=='Forums' || $name=='My_eGallery' || $name=='Community' || $name=='youtube') {
    /* Don't display it. */
   }
   else {
    blocks(left);
   }
    echo "</td>\n";
    if ($index == 1) {
   echo "<td valign=\"top\">\n";
   blocks(center);
   echo "</td>\n";
    }
       echo "<td width=\"100%\">\n";
}

/************************************************************/
/* Function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks(right);       */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the Homepage or */
/* and internal one.                                        */
/************************************************************/

function themefooter() {
    global $foot1, $foot2, $foot3, $foot4, $copyright, $totaltime, $footer_message;   
    $tmpl_file = "themes/Preflight/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    echo "<center>\n";
    $footer_message = footmsg();
    echo "</center>\n";
}
/************************************************************/
/* Function themeindex()                                    */
/*                                                          */
/* This function format the stories on the Homepage         */
/************************************************************/

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b>$notes\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   $content = "$thetext$notes\n";
    } else {
   if($informant != "") {
       $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
   } else {
       $content = "$anonymous ";
   }
   $content .= ""._WRITES." \"$thetext\"$notes\n";
    }
    $posted .= " $time $timezone";
    $viewed .="($counter "._READS.")";
    $tmpl_file = "themes/Preflight/story_home.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    }

/************************************************************/
/* Function themearticle()                                  */
/*                                                          */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home        */
/************************************************************/

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    $posted = ""._POSTEDON." $datetime "._BY." ";
    $posted .= get_author($aid);
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   $content = "$thetext$notes\n";
    } else {
   if($informant != "") {
       $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
   } else {
       $content = "$anonymous ";
   }
   $content .= ""._WRITES." \"$thetext\"$notes\n";
    }
    $tmpl_file = "themes/Preflight/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themesidebox()                                  */
/*                                                          */
/* Control look of your blocks. Just simple.                */
/************************************************************/

function themesidebox($title, $content) {
    $tmpl_file = "themes/Preflight/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

?>


something wrong here maybe? Rolling Eyes
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun May 04, 2008 7:51 am Reply with quote

prekill, how about a link to your site so that we can see the behavior. Thanks.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
prekill







PostPosted: Sun May 04, 2008 10:30 am Reply with quote

here you go:

http://www.preflight.us/

p.s I have just noticed it is happening only on main page for some reason.. (other pages are flying).. Rolling Eyes
 
prekill







PostPosted: Wed May 07, 2008 9:29 am Reply with quote

umm I have 88 SQL queries on index.php

is this alot? how can I reduce this number?
 
montego







PostPosted: Wed May 07, 2008 5:23 pm Reply with quote

prekill, my apologies... I was taking a look at your site yesterday using the YSlow addin to FF and it kept bombing out FF... I think it might have been an interaction with my Web Developer plugin. I'll send this home to remind me to take a look at this. Sorry about forgetting to come back to this. Embarassed
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Wed May 07, 2008 8:09 pm Reply with quote

I wonder if it's related to RTL. It displays in parts for me, but seems to take a while before finishing - maybe due to extra JS, but definitely because it's having trouble loading offsite stuff (something from blogiy.com.cc )

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed May 07, 2008 8:13 pm Reply with quote

Your site is doing too many look ups.
It is looking for data for google ads
ads from blogy.co.cc
data from youtube
data from vineo.com

Every time you pull external data there is a risk, if that site is busy, it will cause yours to slow down. Because of the way nuke themes are coded, left blocks are pulled with the header and right blocks are pulled with the footer - so if you are using external data in a block and that data retrieval is slow, it can actually cause the whole site to 'hang'.

You also have a relatively number of images on the front page with file sizes primarily from your Gallery because it is using javascript to pre-fetch the images to avoid delays when they are clicked on.

Your bandwidth useage uncached is;
50.3K 2 HTML/Texts
18.5K 5 IFrames
92.3K 2 Flash Objects
49.6K 11 JavaScript Files
4.9K 1 Stylesheet File
15.3K 9 CSS Images
1164.5K 41 Images
1395.7K Total size
71 HTTP requests

Cached is;
50.3K 2 HTML/Texts
8.5K 5 IFrames
0.0K 2 Flash Objects
0.0K 11 JavaScript Files
0.0K 1 Stylesheet File
0.0K 9 CSS Images
19.4K 39 Images
78.3K Total size
69 HTTP requests

Your whole front page is around 15Kb in size which, although it could be better, is not the end of the world, so I'm inclined to think it is your external data that is doing the most damage - this is of course with the BIG assuption that your host has not oversold accounts on the server and it is not bogging down because it simply cannot cope with the load.
 
View user's profile Send private message Send e-mail
prekill







PostPosted: Thu May 08, 2008 2:22 am Reply with quote

montego NP man.

kguske, I looked into all new JS I add to the site and found out the following which is making the problem:

I lately add a pagination script from codezwiz.com (link: http://www.codezwiz.com/ftopicp-57218-news-page-number-want-the-new-codezwiz-version-please.html#57218) like montego new pagination in the new RV news module it is using a selectbox (drop down menu with the page numbers) but it seems including its JS file with the onchange="jumpto(this) function slowing the hole page.

I doubled checked this by restoring the original news module.. and the site did loaded normal. I have just posted a messege reporting this at codezwiz.com.

maybe there is a way to bypass including this java scrript file without killing the selectbox.

Guardian2003 I am chaching all my blocks accept of the random image one and last forum posts. I am considering of chaching the news module after fixing this pagination problem.

EDIT: look how fast it loads now.
 
montego







PostPosted: Thu May 08, 2008 5:01 am Reply with quote

Yeah, does load much faster now. Interesting. Thanks guys!
 
Guardian2003







PostPosted: Thu May 08, 2008 5:27 am Reply with quote

Wow, that is a huge improvement, good effort!!
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

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 ©