vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Using HTML in vBulletin script (https://vborg.vbsupport.ru/showthread.php?t=259783)

Thr33 03-03-2011 11:15 AM

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?


All times are GMT. The time now is 07:54 AM.

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.01459 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete