Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #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
Reply


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 01:59 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.03320 seconds
  • Memory Usage 2,247KB
  • Queries Executed 12 (?)
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
  • (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
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • 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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete