vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   [TIP] Bandwidth savings tip (https://vborg.vbsupport.ru/showthread.php?t=72981)

ironlogik 12-15-2004 10:00 PM

[TIP] Bandwidth savings tip
 
For those of us with big boards, and with avatars enabled, here is a small piece of code I added to my postbit (in my case postbit_legacy) template, which makes it so that guests do not see avatars.

FIND:
------
<if condition="$show['avatar']">

ABOVE ADD:
------------
<if condition="is_member_of($bbuserinfo, 1)">
&nbsp;
<else />

THEN FIND (couple lines down):
-------------------------------
</div>
</if>

BELOW ADD:
-------------
</if>

thats it... simple yet effective.

BamaStangGuy 12-22-2004 03:22 AM

Very cool

Infopro 12-22-2004 01:13 PM

Nice. Thanks.

In my postbit if I add the </if> where you suggest it hides all data on left.
Adding the </if> just after;
PHP Code:

[snipped here].........vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if> 

It works great.

deathemperor 12-29-2004 04:05 AM

and if you have avatar categories, make all the images hosted in other servers so that the main forum is faster and lighter

abdobasha2004 09-05-2009 03:51 AM

u can just wrap the code in <if condition="$show['member']"></if>

to be :
Code:

<if condition="$show['member']">
                        <if condition="$show['avatar']"><td class="alt2"><a rel="nofollow" href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
</if>


abdobasha2004 09-08-2009 10:10 PM

I even developed a better looking and band width saving one :
Find and replace :
Code:

<if condition="$show['avatar']"><td class="alt2"><a rel="nofollow" href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
with :
Code:

<!-- 100fm6.com BW save  -->
<if condition="$show['member']">
                        <if condition="$show['avatar']"><td class="alt2"><a rel="nofollow" href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
<else />

<if condition="!$GLOBALS['FIRSTPOSTID']">
<if condition="$show['avatar']"><td class="alt2"><a rel="nofollow" href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
</if>
<!-- /100fm6.com BW save  -->

this will :
1- for members show avatars as normal
2- for visitors show avatars in first post only

like it?


All times are GMT. The time now is 05:27 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.00945 seconds
  • Memory Usage 1,723KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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