vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Miscellaneous Hacks - Pre-Load Forum (https://vborg.vbsupport.ru/showthread.php?t=229381)

ViciousCode 12-02-2009 10:00 PM

Pre-Load Forum
 
1 Attachment(s)
This little mod pre-loads the forum before even actual showing you the forum, it loads all the contents such as images, css, etc before showing you the forum.

put this code at the bottom of your forums headinclude template

Code:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function loadImages() {
if (document.getElementById) {  // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) {  // Netscape 4
document.hidepage.visibility = 'hidden';
}
else {  // IE 4
document.all.hidepage.style.visibility = 'hidden';
      }
  }
}
//  End -->
</script>
</head>
<BODY OnLoad="loadImages()" style="overflow-x: hidden;">
<div id="hidepage" style="position: absolute; left:0px; top:0px; background-color: #FFFFFF; layer-background-color: #FFFFFF; height: 100%; width: 100%;"><table width="100%" height="100%"><tr><td valign="middle" align="center">Forum Content Loading... Please wait.</td></tr></table></div>

Save it and you are done! :)

Note: This hack works with all versions of vBulletin, except VB4!

mandingo 12-02-2009 10:52 PM

*tries it*
might even set the text as random quotes so my users have something to read quick when my server is being slow lol.
*likes it*

ViciousCode 12-02-2009 11:14 PM

good idea, just a loading animation image with a random quote below!

for some reason, this doesnt work on VB4, i dont know why

TheLastSuperman 12-02-2009 11:23 PM

Maybe body onload code.. I have had problems with toooooo many mods or custom third party scripts all using the body onload part of the code ;) just a thought.

ViciousCode 12-03-2009 01:08 AM

Quote:

Originally Posted by TheLastSuperman (Post 1924407)
Maybe body onload code.. I have had problems with toooooo many mods or custom third party scripts all using the body onload part of the code ;) just a thought.

anyway around it?

rainyleaves 12-03-2009 04:40 AM

Great!! Thanks.

tlwwolfseye 12-03-2009 06:57 AM

Could someone maybe make a loading animation for that usage so its not only simple text ?

pein87 12-03-2009 07:49 AM

try this.

Add this to the headinclude template

HTML Code:

<script type="text/javascript">

<!-- Begin
function loadImages() {
if (document.getElementById) {  // DOM2 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) {  // Netscape 4
document.hidepage.visibility = 'hidden';
}
else {  // IE 4
document.all.hidepage.style.visibility = 'hidden';
      }
  }
}
//  End -->

window.onload = function() { loadImages(); }
// or try this window.onload = loadImages;
</script>

then open your style in styles&template select the all options in the dropdown and in the body extra css box add

HTML Code:

overflow-x:auto;
then add this to additional css

HTML Code:

#hidepage {position: absolute; left:0px; top:0px; background-color:#FFF;layer-background-color:#FFF;height: 100%; width: 100%; }
#hidepage table {height:100%; width:100%;}
#hidepage table td { vertical-align:middle; text-align:center;}
#loaderText {color:#000;}/*change to your own color for loading text*/

and then add this to the top of the head template

HTML Code:

<div id="hidepage" ><table>
  <tr>
      <td><img src="your/path/here/image.gif" alt="loading icon" /><br /><span id="loaderText">Forum Content Loading... Please wait.</span>
      </td>
  </tr>
</table></div>

You can create your own loading icons at this site http://www.ajaxload.info/ enjoy I would have made some but I dont know which ones users would like this way you can make your own for your own style and taste.

trying to make it semi validate since layer-background-color: is for netscape only and I can't see why you would use legacy netscape code because I doubt anyone uses netscape anymore or IE6 let alone IE4. Also its DOM 2 not 3 as most browsers dont even support DOM 3. Should work I cant test my self my domain is being transferred and I can't access the site until friday.

xorex 12-03-2009 03:54 PM

google chrome dont working :(

ViciousCode 12-03-2009 05:32 PM

well the thing is i found a code like this on google, and it works very well!


All times are GMT. The time now is 10:02 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.00988 seconds
  • Memory Usage 1,737KB
  • 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_code_printable
  • (4)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete