PDA

View Full Version : [TIP] Bandwidth savings tip


ironlogik
16 Dec 2004, 23:37
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
22 Dec 2004, 05:22
Very cool

Infopro
22 Dec 2004, 15:13
Nice. Thanks.

In my postbit if I add the </if> where you suggest it hides all data on left.
Adding the </if> just after;
[snipped here].........vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
It works great.

deathemperor
29 Dec 2004, 06:05
and if you have avatar categories, make all the images hosted in other servers so that the main forum is faster and lighter

abdobasha2004
05 Sep 2009, 05:51
u can just wrap the code in <if condition="$show['member']"></if>

to be :
<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 Sep 2009, 00:10
I even developed a better looking and band width saving one :
Find and replace :
<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 :

<!-- 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?