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-07-2006, 12:44 AM
lightnb lightnb is offline
 
Join Date: Dec 2005
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Java script navbar doesn't work, and causes entire site to 'freak out'

In my 'mast_head' template, after the main forum graphics, I have:

PHP Code:
$main_navbar 
Which is attached to a plugin, hooked at global_start, and contains the code:

PHP Code:
ob_start();
include(
'http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/navbar_code.html');
$main_navbar ob_get_contents();
ob_end_clean(); 
Which should include my navbar, which is contained in the file 'navbar_code.html'

The contents of 'navbar_code.html' are:

HTML Code:
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
</head>

<body onload="MM_preloadImages('http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_over_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_down.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_over_down.jpg')">
<table border="0" cellpadding="0" cellspacing="0" background="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/main_navbar.jpg">
     <tr>
	 
	 
	 <td><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/main_navbar_left_end.jpg" /></td>
          
		  
		  
		  <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','home','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_down.jpg',1)" onmouseover="MM_nbGroup('over','home','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/home.jpg" alt="Home" name="home" width="61" height="24" border="0" id="home" onload="" /></a></td>
		  
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','articles','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_down.jpg',1)" onmouseover="MM_nbGroup('over','articles','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/articles.jpg" alt="Articles" name="articles" width="76" height="24" border="0" id="articles" onload="" /></a></td>
		  
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','Tutorials','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_down.jpg',1)" onmouseover="MM_nbGroup('over','Tutorials','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tutorials.jpg" alt="Tutorials" name="Tutorials" width="86" height="24" border="0" id="Tutorials" onload="" /></a></td>
		  
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','forums','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_down.jpg',1)" onmouseover="MM_nbGroup('over','forums','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/forums.jpg" alt="Forums" name="forums" width="70" height="24" border="0" id="forums" onload="" /></a></td>
		  
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','gallery','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_down.jpg',1)" onmouseover="MM_nbGroup('over','gallery','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/gallery.jpg" alt="Gallery" name="gallery" width="76" height="24" border="0" id="gallery" onload="" /></a></td>
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','people','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_down.jpg',1)" onmouseover="MM_nbGroup('over','people','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/people.jpg" alt="People" name="people" width="69" height="24" border="0" id="people" onload="" /></a></td>
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','equipment','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_down.jpg',1)" onmouseover="MM_nbGroup('over','equipment','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/equipment.jpg" alt="Equipment" name="equipment" width="88" height="24" border="0" id="equipment" onload="" /></a></td>
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','tools','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_down.jpg',1)" onmouseover="MM_nbGroup('over','tools','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/tools.jpg" alt="Tools" name="tools" width="62" height="24" border="0" id="tools" onload="" /></a></td>
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','database','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_down.jpg',1)" onmouseover="MM_nbGroup('over','database','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/database.jpg" alt="Database" name="database" width="81" height="24" border="0" id="database" onload="" /></a></td>
		  
		  
		  
          <td><a href="#" target="_top" onclick="MM_nbGroup('down','group1','help','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_down.jpg',1)" onmouseover="MM_nbGroup('over','help','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_over.jpg','http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help_over_down.jpg',1)" onmouseout="MM_nbGroup('out')"><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/buttons/help.jpg" alt="Help" name="help" width="56" height="24" border="0" id="help" onload="" /></a></td>
		  
		  <td><img src="http://www.rahlentertainment.com/livexchange/forums/images/trapazoid/main_navbar_right_end.jpg" /></td>
		  
		  
     </tr>
</table>

</body>
</html>

If I paste the HTML code directly into the template, I get the same result. The code works fine though in a dreamweaver preview.


Since my forum technically isn't open yet, I'll leave this live, so you can see what it's doing.

If anyone has any sugguestions on what to try, it would be greatly appreciated.

thanks,

Nick


P.S.

If it helps, the following code actually displays on the page:

HTML Code:
0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 2) { if ((img = MM_findObj(args[2])) != null && !img.MM_init) { img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src; if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array(); nbArr[nbArr.length] = img; for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = img.MM_dn = args[i+1]; nbArr[nbArr.length] = img; } } } else if (event == "over") { document.MM_nbOver = nbArr = new Array(); for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up); nbArr[nbArr.length] = img; } } else if (event == "out" ) { for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; } } else if (event == "down") { nbArr = document[grpName]; if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; } document[grpName] = nbArr = new Array(); for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up; nbArr[nbArr.length] = img; } } } //-->
Reply With Quote
  #2  
Old 06-13-2006, 09:15 AM
lightnb lightnb is offline
 
Join Date: Dec 2005
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's now working correctly, with one exception:

The down images don't stick, they keep resetting when the new page loads
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 09:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03639 seconds
  • Memory Usage 2,213KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete