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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 11:32 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.07122 seconds
  • Memory Usage 2,273KB
  • 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
  • (1)bbcode_html
  • (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_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_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