Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 06-26-2004, 03:17 AM
K33nny K33nny is offline
 
Join Date: May 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with coding.

I'm in the process of taking on a large scale project that is hopefully going to help several fantasy wrestling hubs & hosts together. I got the idea for it after seeing iNet take over websites like Yaxay and so forth. They use a bar that links each website in their expansive network.

In fantasy wrestling there are several communities, some that have been around since prodigy some that have been around for 7-8 years, and ones like mine that have been around 2-4 years but are the most popular in the hobby. There are alot of divides between the major hubs, so in order to get rid of the gaps that exist most of the owners of these websites have agreed to partake in something similar. I started beta testing a bar but I quickly found out that it was slowing the forums down (both vBulletin & InvisionPB) as well as messing with the forums sessions.

I will list the code below that is being used to call the bar, what is the PHP file, and waht the content of the include file is. If you could possibly help me figure out why it' s slowing websites down and messing with forum sessions it would be appreciated.

What I mean by messing with the sessions, it rarely shows if someone is browsing anything past the Main Index (on vBulletin & InvisionPB). When I remove the call code for the bar things go back to normal so I know it's a problem with the bar.

Keep in mind the bar is being called from a different domain on a completely different server. This is how it has to be because there are several websites involved that aren't on the same server, such is life. It would be so much easier if we were all on the same server but that will never happen.

Code calling the neXus bar
This is the easiest way for me to distribute the bar across several platforms. Not everyones website is made using PHP so I had to come up with a decent solution. COuld the javascript be causing the problem maybe? ID is a variable that represents the website the bar is being called from. IN the future statistics will be collected for each website.
HTML Code:
<!-- BEGIN EWNEXUS.COM NETWORK BAR -->
<script language="JavaScript1.2" type="text/javascript">
<!--
document.write ("<" + "script language='JavaScript' type='text/javascript' src='http://www.ewnexus.com/x-files/bar.php?id=ewp'><" + "/script>");
// -->
</script>
<!-- END EWNEXUS.COM NETWORK BAR -->
bar.php
Script calling the bar HTML and outputting it
PHP Code:
<?

// Variables

$bar = file_get_contents("http://www.ewnexus.com/x-files/bar.inc", "r");

// Functions

function encode ($str, $limit = 60) {
 $str = str_replace("\r", '', $str);
 
 print "var ewnexus = '';\n\n";

 while (strlen($str) > 0) {
  $line = substr ($str, 0, $limit);
  $str  = substr ($str, $limit);

  $line = str_replace('\\', "\\\\", $line);
  $line = str_replace('\'', "\\'", $line);
  $line = str_replace("\r", '', $line);
  $line = str_replace("\n", "\\n", $line);
  $line = str_replace("\t", "\\t", $line);
  $line = str_replace('<', "<'+'", $line);
  print "ewnexus += '$line';\n";
 }
 print "\ndocument.write(ewnexus);\n";
}

if ($_GET['id'] == "") {
echo "Restricted access.  Contact [email]info@ewnexus.com[/email] for information.";
}
elseif ($_GET['id'] == "ewp") {
header("Content-type: application/x-javascript");
encode($bar);
}
elseif ($_GET['id'] == "ptc") {
header("Content-type: application/x-javascript");
encode($bar);
}
elseif ($_GET['id'] == "rwn") {
header("Content-type: application/x-javascript");
encode($bar);
}
else { 
echo "Restricted access.  Contact [email]info@ewnexus.com[/email] for information.";
}

?>
bar.inc
Include file that bar.php grabs. A basic template file for the bar HTML.
HTML Code:
<link rel="stylesheet" type="text/css" href="http://www.ewnexus.com/x-files/bar.css">
<table width="100%" height="32" cellpadding="0" cellspacing="0" background="http://www.ewnexus.com/x-imgs/bar/bg.gif">
 <tr valign="middle">
  <td><img src="http://www.ewnexus.com/x-imgs/bar/logo.gif"" width="147" height="32"></td>
  <td align="right">
   <table cellpadding="0" cellspacing="0">
    <tr>
     <td><img src="http://www.ewnexus.com/x-imgs/bar/divider.gif" width="5" height="32" hspace="0" vspace="0"></td>
     <td class="xmenu">
     <form name="menu">
     <select name="bar"" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO" class="xdestination">
      <option selected class="xtitle">-- Hubs</option>
      <option value="http://www.ewplanet.com" class="xsite">eWPlanet</option>
      <option value="http://www.primetimecentral.com" class="xsite">Primetime Central</option>
     </select>
     <form/>
     </td>
     <td><img src="http://www.ewnexus.com/x-imgs/bar/divider.gif" width="5" height="32" hspace="0" vspace="0"></td>
     <td class="xmenu">
     <form name="menu">
     <select name="bar"" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO" class="xdestination">
      <option selected class="xtitle">-- Hosts</option>
      <option value="http://www.ewplanet.com" class="xsite">TPNHosting.com</option>
      <option value="http://www.primetimecentral.com" class="xsite">eWrestle.net</option>
     </select>
     <form/>
     </td>
    </tr>
   </table>
  <td></td>
 </tr>
 <tr>
  <td height="1" bgcolor="#000000"><img src="" height="1"></td>
 </tr>
</table>
:tired:
Reply With Quote
  #2  
Old 06-26-2004, 11:21 AM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I took a good look at your problem and I couldn't find the issue. After looking over all of the code, line by line, I did not see how it could mess with the sessions of two separate applications on different servers.

I then tested to see what the response speed was like from the bar host. Pretty fast; nothing slow about it. Then I put it in a web page and it loaded up just as quickly.

Next I put the bar into a sample forum skin to see it live... worked like a charm. Nothing slowed down and who's online was still displaying the proper location. You can see it here:

http://www.vbmechanic.com/skins/index.php?styleid=7

Sorry, but I don't see how it is slow or affecting sessions at all. Granted, the board only has 9 people on it at the moment, but it shouldn't make that much difference.
Reply With Quote
  #3  
Old 06-26-2004, 05:39 PM
K33nny K33nny is offline
 
Join Date: May 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You probably won't notice a slow down with high speed access but I noticed a slow down on a dialup connection.

The one thing the bar is doing is effecting the who's online bit for some reason. It keeps people stuck on "View index"
Reply With Quote
  #4  
Old 06-26-2004, 11:44 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I couldn't get the bar to affect the who's online on my forum. I still have it in the style-- you can test it yourself using two browsers. I put myself into a thread in one browser and went to view who's online in another, and it worked without hassle.

Also-- seeing a speed problem with dialup would indicate that you have a poor connection between you and the bar. Wouldn't you think that with a high speed connection, I would notice the delay more? If the rest of the page loaded fast, but the bar was slowing things down, I think I would see it.

Not doubting you on anything, just doing some testing for you-- you can see on my unrelated site that the bar is working as planned. Looking over the code, it works like I'd expect.. can't imagine how it would affect sessions on distinct servers.
Reply With Quote
  #5  
Old 06-26-2004, 11:46 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Screenshot of me using who's online w/ the bar and viewing a thread..
Attached Images
File Type: gif demo_bar2gif.gif (36.8 KB, 0 views)
Reply With Quote
  #6  
Old 06-27-2004, 02:50 AM
K33nny K33nny is offline
 
Join Date: May 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't seem to effect everyone. I'm not sure what the problem is but I'm going to rethink the process and start over. Thanks for your help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05382 seconds
  • Memory Usage 2,244KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete