PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
prekill
Regular
Regular


Joined: Oct 22, 2005
Posts: 97

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

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
Moderator


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

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

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


Joined: Oct 22, 2005
Posts: 97

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

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=\"modules.php?name=Your_Account\" 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
View user's profile Send private message
montego
Site Admin


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

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

prekill, how about a link to your site so that we can see the behavior. Thanks.
View user's profile Send private message Visit poster's website
prekill
Regular
Regular


Joined: Oct 22, 2005
Posts: 97

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

here you go:
Only registered users can see links on this board!
Get registered or login to the forums!


p.s I have just noticed it is happening only on main page for some reason.. (other pages are flying).. Rolling Eyes
View user's profile Send private message
prekill
Regular
Regular


Joined: Oct 22, 2005
Posts: 97

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

umm I have 88 SQL queries on index.php

is this alot? how can I reduce this number?
View user's profile Send private message
montego
Site Admin


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

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

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
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4624

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

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 )
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 4557
Location: Poland

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

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 Visit poster's website
prekill
Regular
Regular


Joined: Oct 22, 2005
Posts: 97

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

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:
Only registered users can see links on this board!
Get registered or login to the forums!
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.
View user's profile Send private message
montego
Site Admin


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

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

Yeah, does load much faster now. Interesting. Thanks guys!
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 4557
Location: Poland

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

Wow, that is a huge improvement, good effort!!
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum