View Single Post
  #1  
Old 03-03-2011, 11:15 AM
Thr33's Avatar
Thr33 Thr33 is offline
 
Join Date: Sep 2008
Location: Manchester, UK
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using HTML in vBulletin script

Me and a friend have created a bar that runs across the bottom of the browser. For my site this is perfect for advertising our shoutcast station, social networks and any further notices. Here is a demo of this:
http://lazyrecords.net/ajaxbar/test.html

We have added all the pages to the FTP, now we are having trouble placing the javascript data into the style coding. This is the coding for the <head>
HTML Code:
<head>
	<title>TEST PAGE</title>
	<style type="text/css">
 
		html,
		body {
			margin: 0px 0px 0px 0px ;
			padding: 0px 0px 0px 0px ;
			}
 
		#site-body-container {}
		
		#left { float: left;} 
		#right { float: right;}
 
		#site-body-content {
			padding: 15px 15px 15px 15px ;
			}
 
		#site-bottom-bar {
			background-color: #F0F0F0 ;
			background-image : url(div.png);
			background-position : top;
			background-repeat : repeat-x;
			border-top: 2px solid #941617 ;
			bottom: 0px ;
			font-family: tahoma, verdana ;
			font-size: 11px ;
			height: 30px ;
			position: fixed ;
			width: 100% ;
			z-index: 1000 ;
			}
 
		#site-bottom-bar-frame {
			height: 30px ;
			margin: 0px 10px 0px 10px ;
			position: relative ;
			}
 
		#site-bottom-bar-content {
			padding: 3px 0px 0px 0px ;
			}
 
		#menu-root {
			background-color: #E8E8E8 ;
			border: 1px solid #D0D0D0 ;
			color: #000000 ;
			display: block ;
			height: 22px ;
			line-height: 22px ;
			text-align: center ;
			text-decoration: none ;
			width: 105px ;
			}
 
		#menu-root:hover {
			background-color: #666666 ;
			border-color: #000000 ;
			color: #FFFFFF ;
			}
 
		#menu {
			background-color: #E8E8E8 ;
			border: 1px solid #666666 ;
			bottom: 32px ;
			display: none ;
			left: 0px ;
			padding: 5px 5px 1px 5px ;
			position: absolute ;
			width: 200px ;
			}
 
		#menu a {
			background-color: #E8E8E8 ;
			border: 1px solid #FFFFFF ;
			color: #000000 ;
			display: block ;
			margin-bottom: 4px ;
			padding: 5px 0px 5px 5px ;
			text-decoration: none ;
			}
 
		#menu a:hover {
			background-color: #666666 ;
			border-color: #000000 ;
			color: #FFFFFF ;
			}
 
		/* -------------------------------------------------- */
		/* -- IE 6 FIXED POSITION HACK ---------------------- */
		/* -------------------------------------------------- */
 
		html,
		body,
		#site-body-container {
			_height: 100% ;
			_overflow: hidden ;
			_width: 100% ;
			}
 
		#site-body-container {
			_overflow-y: scroll ;
			_overflow-x: hidden ;
			_position: relative ;
			}
 
		/* To make up for scroll-bar. */
		#site-bottom-bar {
			_bottom: -1px ;
			_position: absolute ;
			_right: 16px ;
			}
 
		/* To make up for overflow left. */
		#site-bottom-bar-frame {
			_margin-left: 26px ;
			}
 
		/* To fix IE6 display bugs. */
		#menu a {
			_display: inline-block ;
			_width: 99% ;
			}
 
	</style>
	<script type="text/javascript" src="jquery-1.3.2.js"></script>
	<script type="text/javascript">
 
		jQuery(function( $ ){
			var menuRoot = $( "#menu-root" );
			var menu = $( "#menu" );
 
			// Hook up menu root click event.
			menuRoot
				.attr( "href", "javascript:void( 0 )" )
				.click(
					function(){
						// Toggle the menu display.
						menu.toggle();
 
						// Blur the link to remove focus.
						menuRoot.blur();
 
						// Cancel event (and its bubbling).
						return( false );
					}
				)
			;
 
			// Hook up a click handler on the document so that
			// we can hide the menu if it is not the target of
			// the mouse click.
			$( document ).click(
				function( event ){
					// Check to see if this came from the menu.
					if (
						menu.is( ":visible" ) &&
						!$( event.target ).closest( "#menu" ).size()
						){
 
						// The click came outside the menu, so
						// close the menu.
						menu.hide();
 
					}
				}
			);
 
		});
 
	</script>
    <script type="text/javascript">
function loadXmlHttp(url, id) {
 var f = this;
 if (loadXmlHttp.xmlHttp){
  f.xmlHttp = loadXmlHttp.xmlHttp();
  f.el = document.getElementById(id);
  f.xmlHttp.open("GET", url, true);
  f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
  f.xmlHttp.send(null);
 }
 else alert('Your browser does not support AJAX!'); // substitute your desired request object unsupported code here
}

loadXmlHttp.xmlHttp = null; loadXmlHttp.re = /^http/.test(window.location.href);
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {loadXmlHttp.ie = window.ActiveXObject}catch(e){};
@end @*/
if (window.XMLHttpRequest && (!loadXmlHttp.ie || loadXmlHttp.re))
 loadXmlHttp.xmlHttp = function(){return new XMLHttpRequest();}; // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
 loadXmlHttp.xmlHttp = createRequest; // ICEBrowser, perhaps others
else {
 loadXmlHttp.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@if(@_jscript_version >= 5)
try{loadXmlHttp.xmlHttp = function(){return new ActiveXObject("Msxml2.XMLHTTP");};}
 catch(e){try{loadXmlHttp.xmlHttp = function(){return new ActiveXObject("Microsoft.XMLHTTP");};}catch(e){}}
@end @*/
}

loadXmlHttp.prototype.stateChanged = function(){
 if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !loadXmlHttp.re)){
  this.el.innerHTML = this.xmlHttp.responseText;
  if(this.success){
   this.success();
  }
  }
}
</script>
</head>
When i attempted to paste this into the headerinclude template it wouldnt allow me to save. Im thinking im going to need to add the CSS data into a new CSS template, but even without the CSS data the headerinclude would still not save the remaining the data. Any help?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,800KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)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)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete