vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - lazy load, load your page faster & save bandwidth (https://vborg.vbsupport.ru/showthread.php?t=259302)

dinodonk 02-22-2011 10:00 PM

lazy load, load your page faster & save bandwidth
 
1 Attachment(s)
this mod is using jquery lazy load by Mika Tuupola. you can see demo at his site here

Lazy Load will delay the loading of images outside of viewpoint to make the page load faster. That is, images in the visible part of the web page are only loaded and remaining images are loaded when visitor scrolls down the page, at some times it can even helps to save bandwidth.

in template headinclude, add this code at the bottom

Code:

 
<vb:if condition="THIS_SCRIPT == 'showthread'">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/jquery.lazyload.mini.js"></script>
  <script type="text/javascript" charset="utf-8">
      $(function() {
          $(".postbody img").lazyload({placeholder : "{vb:raw vboptions.bburl}/clear.gif", effect: "fadeIn"});
      });
  </script>
</vb:if>

copy jquery.lazyload.mini.js to your <vb root>/clientscript/ folder


done!!!

pls click install if you like this modification :D


Thanks to OldSchoolDSL for this suggestion

Juggernaut 02-23-2011 05:57 AM

tagged :D

WEBDosser 02-23-2011 06:12 AM

ditto

Plus 02-23-2011 06:53 AM

Can not save headinclude.

Edit and save headinclude
Quote:

vBulletin Message
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
[Continue]
Quote:

Edit Conflict
This template was changed by someone else while you were editing it. Your changes have not been saved. Please merge your changes from the lower editor into the current version in the upper editor. When you save this page, only what is in the upper editor will be saved.

vB 4.1.2 bug?

dinodonk 02-23-2011 07:23 AM

Quote:

Originally Posted by Plus (Post 2165699)
Can not save headinclude.

Edit and save headinclude

[Continue]



vB 4.1.2 bug?


sorry.. typo in if condition. fixed.

Cadellin 02-23-2011 07:48 AM

Tagged

The link to the lazyload website is broken by the way.

dinodonk 02-23-2011 08:34 AM

mm... link fixed

Danasy 02-24-2011 12:47 AM

:up: Installed on 4.1.0 ,
works good.
5 stars for you bro.
Thanks for the mod.

CMSTemplateZ 02-24-2011 04:33 AM

Cheers, Great addition for VB4 boards, will try this soon.

Thanks

OldSchoolDSL 02-24-2011 05:09 AM

Installed, although as the original author stated on his site...

http://www.appelsiini.net/projects/lazyload/

He does not believe this will completely work with more modern browser.

Also I would recommended the following....

1) Change the JQuery version number from:
PHP Code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script

To 1.5.0 for a faster load time and improved browser support.

PHP Code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript" charset="utf-8"></script

2) If your community already does load JQuery.... There is no reason to load it more then 1x. So you can be safe to edit it out (remove) JQuery in the authors code.


All times are GMT. The time now is 03:25 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.01026 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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