PDA

View Full Version : Locked Flash Avatar + Modified User Menu (Legacy) 1.3


Freesteyelz
07 Feb 2006, 11:42
Brief Description:
Flash enabled avatars using a Custom Profile Field. It may work in other vB versions (untested) though this mod is created for 3.5.3. A simple mod (for "Legacy" view).

Thank you(s) to: Luggruff (early beta user); masterross (for transparent value)

Support: I'll try to support it the best I can.



Browsers Tested:
Internet Explorer (5 - 6); Firefox (1.0.4 - latest)

**Remember to Disable users from uploading their own Flash avatars. Allow only the Flash avatars from people you can trust...Never by strangers. Flash may contain codes that can harm your site/forum so be cautious.



Templates Modified:
postbit_legacy

Installation Instructions (6 easy steps):
In Admin CP:

1. Create new User Profile Field by going to User Profile Fields --> Add New User Profile Field and create a Single-Line Text Box. In the Title add "CUSTOM AVATAR (FLASH)". Conditions:

"Field Required": No
"Field Editable by User": No (IMPORTANT!)
"Private Field": No
"Field Searchable on Members List": No
"Show on Members List": No
"Which page displays this option?": Options: Other

*For security reasons set to no "Field Editable by User" so that only the CP Admin(s) can upload the .swf files.

*Remember the Field number you've just created. You may need to change the "20". For this mod I used "field20".

2. Press "Save".

3. Then go to Styles & Templates --> Style Manager --> All Style Options --> Edit Templates --> Postbit Templates --> postbit_legacy and look for this code:


<if condition="$show['avatar']">
<div class="smallfont">
&nbsp;<br /><a href="member.php?$session[sessionurl]u=$post"><img src="$post[avatarurl]" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>


and replace it with:


<!-- _______ CUSTOM AVATAR (FLASH) _______ -->
<if condition="$post['field20']">
<!-- Flash Avatar -->
<if condition="$post['field20']">
<div>
<br />
<object width="128px" height="128px">
<param name="movie" value="$post[field20]"> <param name="quality" value="high"> <param name="wmode" value="transparent">
<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$post[avatarurl]" width="128px" height="128px" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
</if>
<!-- End -->
</if>
<!-- _______ END _______ -->


*Change the "width" and "height" variables in the "embed" tag to the size you want the Flash avatar displayed. Again, change "field20" to the number of the new field you've just created. *If you want to remove "width" and "height" of vB's default avatar (NOT the Flash avatar), go ahead.

4. Press "Save".

*The "object" and "embed" codes are the minimal to play Flash in the browser. If you have the plugin it should work. Tested in Internet Explorer (5 - 6) and FireFox (1.0.4 to latest).

5. Now go to the User's Profile you want to add the Flash avatar and enter the .swf file URL in the "CUSTOM AVATAR (FLASH)" text area. It should be in the "User Profile Fields" section.

*It is recommended that you upload the avatar to your server to prevent users from editing it.

6. Press "Save" and Done!

*To use non-.swf avatars use vB's default Avatar option "Change Avatar".

*You will need to have Flash enabled in your browser.

**Remember to Disable users from uploading their own Flash avatars. Allow only the Flash avatars from people you can trust...Never by strangers. Flash may contain codes that can harm your site/forum so be cautious.


7. Click https://www.vbulletin.org/forum/ (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=107364) if you use it. Thanks! :)


****************************************


********************
********************
[U]OPTIONAL code to display the popup menu horizontally with Flash Avatars:

Conditional: 1. If you're using vB's default avatar this code will display the default "post $post[postid] popup menu". 2. If you're using a Flash Avatar the modified popup menu will override the default's, whether or not you've entered both avatar types.

Code below:
********************
********************

Installation Instructions (2 steps):
In Admin CP:

1. Then go to Styles & Templates --> Style Manager --> All Style Options --> Edit Templates --> Postbit Templates --> postbit_legacy and look for this code:


<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->


And Replace it with:


<!-- _______ Popup Menu Modified _______ -->
<if condition="$post['field20']">
<!-- Flash Avatar DHTML Popup Menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none;margin-top:-39px">
<table cellpadding="4 cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]
</td>
<if condition="$show['profile']">
<td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a>
</if>
<if condition="$show['pmlink']"><td class="vbmenu_option">
<a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">Send PM</phrase></a></td>
</if>
<if condition="$show['emaillink']"><td class="vbmenu_option">
<a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">Send E-Mail</phrase></a></td>
</if>
<if condition="$show['homepage']"><td class="vbmenu_option">
<a href="$post[homepage]"><phrase 1="$post[username]">Visit Homepage</phrase></a>
</if>
<if condition="$show['search']"><td class="vbmenu_option">
<a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">Find More Posts</phrase></a></td>
</if>
<if condition="$post['userid'] AND $show['member']"><td class="vbmenu_option">
<a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">Add To Buddy List</phrase></a></td>
</if>
</td></tr>
</table>
</div>
<!-- End -->
<else />
<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->
</if>
<!-- _______ End _______ -->


2. Press "Save" and You're Done.

3. Click https://www.vbulletin.org/forum/ (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=107364) if you use it. Thanks! :)

*Now the username drop down menu will display horizontally with the Flash avatar. View image attachment below for an example:

********************
********************

*If you've installed this hack please click the "Install" button. :)

Holidazed
07 Feb 2006, 13:42
Can we see a demo of a .swf avatar in action?

Snake
07 Feb 2006, 14:12
Yeah I was gonna ask the same thing. :)

VaaKo
07 Feb 2006, 14:44
yes a demo please

Gripemaster
07 Feb 2006, 15:04
Now if someone would just come up with a way to do Flash (.swf) headers on a forum, I'd be a real happy camper. I have searched the world and this site over but no one seems to have an answer to that.

COBRAws
07 Feb 2006, 17:15
Now if someone would just come up with a way to do Flash (.swf) headers on a forum, I'd be a real happy camper. I have searched the world and this site over but no one seems to have an answer to that.

why dont u just place the swf code in the header themplate?

Master Miyagi
07 Feb 2006, 17:53
For some reason, I can't seem to get it to work. I did everything on the dot, but once I wrote the URL to the swf flash inside the CUSTOM AVATAR field, my avatar didn't change. The avatar remained as the original. I tried again to change it to the swf on the avatar setting, and still, it didn't work.

In need of more clarification if possible. Thanks.

Master Miyagi
07 Feb 2006, 18:27
Update: I finally got it to work. However, I've decide to uninstall it. The flash avatar turned out to be on the bottom of the default avatar, which made my postbit space too big. How about making the default avatar swf compatible?

At any rate, good work!

IrPr
07 Feb 2006, 18:30
yes a demo please

me too

Freesteyelz
07 Feb 2006, 19:31
Update: I finally got it to work. However, I've decide to uninstall it. The flash avatar turned out to be on the bottom of the default avatar, which made my postbit space too big. How about making the default avatar swf compatible?


That would require code hacking. I believe MarcoH64 will import his Flash Avatar hack to 3.5.3 when he can.

*The Flash avatar won't replace vB's default avatar unless you add another conditional in postbit_legacy. My assumption is that only one avatar will be used at a time.

Freesteyelz
07 Feb 2006, 19:33
Update

I've made a few additional instructions and comments to the original post. The link to a working demo has also been included. :)

Freesteyelz
08 Feb 2006, 00:41
Updated:

Resolved Username drop down menu displaying in the background of the Flash avatar. View image attachment for the results.

hiiped
08 Feb 2006, 06:15
Updated:

Resolved Username drop down menu displaying in the background of the Flash avatar. View image attachment for the results.

good work


< clicks invisible thank you button >

Luggruff
08 Feb 2006, 07:32
so why did you set regular avartars to 128x128?
Hmm, now somethings happened with my db too, works like 30% of the pageloades.. and I can't change the template anymore -_-

Did exactly as you wrote.

Freesteyelz
08 Feb 2006, 07:42
The modifications doesn't touch vB's database. The Flash codes are client side and should be safe. Forcing the graphics to 128x128px should not slow down your forum in any way since the file sizes remain the same.

*You can change the dimensions to any size you want (as specified in the instructions) or simply remove the "width" and "height" for vB's default avatar from the code. I've always preferred avatars at 128x128px.

Luggruff
08 Feb 2006, 07:50
The modifications doesn't touch vB's database. The Flash codes are client side and should be safe. Forcing the graphics to 128x128px should not slow down your forum in any way since the file sizes remain the same.

*You can change the dimensions to any size you want (as specified in the instructions) or simply remove the "width" and "height" for vB's default avatar from the code. I've always preferred avatars at 128x128px.

Ok thanks !
And ..Strange ..as the postbit_legacy is the only template I can't edit now.. o_0

Fatal error: Maximum execution time of 30 seconds exceeded in /home/virtual/hlforum.net/public_html/includes/functions_misc.php on line 411

EDIT: Hmm.. seemed to fix itself. Clicks install !

Freesteyelz
08 Feb 2006, 07:58
Assuming that the codes were properly placed, it may be that you need to extend the timeout behavior in PHP's server configuration. Check the code entries once more just in case.

Freesteyelz
08 Feb 2006, 08:07
Ok thanks !

EDIT: Hmm.. seemed to fix itself. Clicks install !

It may have been a server issue. I'm glad you got it to work. Enjoy! :)

Luggruff
08 Feb 2006, 09:55
Hmm, about the workaround with the usergroup dropdown menu..

Isn't it possible to like.. force your menu to activate itself.. ONLY when flash avvie is showing??

Even if you use a flash avvie AND a regular one??

Freesteyelz
08 Feb 2006, 20:56
Yes! :)

I've updated the instructions to version 1.2. If you've installed a previous version make sure to update it.

*Changes made (version 1.2):

1. Conditionals are set in which if you're using a Flash Avatar it will override the default; else it will use vB's default avatar.

2. Conditionals are set in which if you're using a Flash Avatar the User popup menu will display horizontally; else it will use vB's default vertical menu.

Luggruff
08 Feb 2006, 21:19
sweet <3

Freesteyelz
08 Feb 2006, 21:22
I'm glad you like it. Thanks for helping me test it to 1.2. :)

ChurchMedia
09 Feb 2006, 01:03
Why is this conditional here first:

<if condition="$post['field16']">

??

Freesteyelz
09 Feb 2006, 01:20
Careless on my part. I use 16 for the live board and 20 for the testing board...It should read "field20" for both parts of the instruction. I've updated the codes.

Thanks for the heads-up, ChurchMedia. :)

Kuimera
09 Feb 2006, 04:44
Nice one, one question, cant this be done for the users who use postbit insteed of postbit_legacy ?

Freesteyelz
09 Feb 2006, 05:14
Definitely. Just glancing over the "posbit" code it's all similar except for the avatar section. I'll try it now and post back soon...

Freesteyelz
09 Feb 2006, 05:45
While I didn't change the location of the avatar, username and user info (e.g., Join Date, Posts, Title...) the modification works. Here's the instructions:

In postbit template:
1. Look for this (or something similar to):


<if condition="$show['avatar']"><td class="alt2"><a 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>
<td nowrap="nowrap">


and replace it with:


<!-- _______ CUSTOM AVATAR (FLASH) _______ -->
<if condition="$post['field20']">
<!-- Flash Avatar -->
<if condition="$post['field20"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]">
<object width="128px" height="128px">
<param name="movie" value="$post[field20]">
<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object></a>
</td></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']"><td class="alt2"><a 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>
<!-- End -->
</if>
<!-- _______ END _______ -->
<td nowrap="nowrap" valign="top">


2. Click "Save" and you're done.

*All of the other instructions remain the same. It's just with "postbit" template and not "legacy".

**While I'm not crazed with the other look (e.g., Username and user's info at the right of the avatar) that can be modified easily by replacing the <td> tags. If you need help with it let me know. :)

masterross
09 Feb 2006, 17:52
great thanks Freesteyelz !!!

i've been searched for this hack long time ago!

it works great!
also i did some modification to be use tnansparent flashes:
<!-- _______ CUSTOM AVATAR (FLASH) _______ -->
<if condition="$post['field20']">
<!-- Flash Avatar -->
<if condition="$post['field20']">
<div>
<br />
<object width="128px" height="128px">
<param name="movie" value="$post[field20]">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$post[avatarurl]" width="128px" height="128px" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
</if>
<!-- End -->
</if>
<!-- _______ END _______ -->


also why i should use this step?

Installation Instructions (2 steps):
In Admin CP:

1. Then go to Styles & Templates --> Style Manager --> All Style Options --> Edit Templates --> Postbit Templates --> postbit_legacy
it works perfect without this! And i dont want to view horizontal popup menu

BR,
Ross

Freesteyelz
09 Feb 2006, 20:53
For people who use the Legacy view the Flash displays in the foreground, overshadowing the User popup menu. In order for the menu to be seen I positioned it horizontally so that it avoids the Flash avatar entirely. The image attachment shows an example of what (Step 2) does. Anyone who uses a non-Flash avatar will have the popup menu positioned vertically. :)

Anyway, I'm happy that you like it and thanks for clicking install. :)

masterross
09 Feb 2006, 22:06
yes indeed flash will be ot top layer...
but if you do like in my way -> wmode="transparent" all will be "normal" ;)
check it ;)

thank ones again for great hack :)

BR,
Ross

Freesteyelz
09 Feb 2006, 22:12
yes indeed flash will be ot top layer...
but if you do like in my way -> wmode="transparent" all will be "normal" ;)
check it ;)

thank ones again for great hack :)

BR,
Ross


NP at all. :)

For some reason it didn't work for me. Ahh well. I've included the "transparent" value into the mod. :D

masterross
09 Feb 2006, 22:27
ohh
and 1 suggestion - flash avatar can be shown in MEMBERINFO too couse now when flash is used nothing is shown :)
this will be nice :)

regards,
Ross

masterross
09 Feb 2006, 22:38
and the problem that not works for u is because u forgot to add wmode="transparent" here: ;)


<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>


without this transparent wont work neither popup menu will show correctly

Ross

Freesteyelz
09 Feb 2006, 22:44
ohh
and 1 suggestion - flash avatar can be shown in MEMBERINFO too couse now when flash is used nothing is shown :)
this will be nice :)

regards,
Ross

Since I don't display avatars I didn't initially consider it into the mod. LOL. Though it is a good suggestion and it shouldn't be difficult to do. All is needed is to copy and paste the Flash avatar code in Step 1 to the Memberslist template or even Public Profile template.

I'll place it on the "list to do". :)

Freesteyelz
09 Feb 2006, 22:51
and the problem that not works for u is because u forgot to add wmode="transparent" here: ;)


<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>


Ross

Ohh geez...That's right. Thank you. :) I've added it into the mod and updated the version and text.

Luggruff
10 Feb 2006, 12:20
great thanks Freesteyelz !!!

i've been searched for this hack long time ago!

it works great!
also i did some modification to be use tnansparent flashes:
<!-- _______ CUSTOM AVATAR (FLASH) _______ -->
<if condition="$post['field20']">
<!-- Flash Avatar -->
<if condition="$post['field20']">
<div>
<br />
<object width="128px" height="128px">
<param name="movie" value="$post[field20]">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="$post[field20]" width="128px" height="128px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$post[avatarurl]" width="128px" height="128px" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
</if>
<!-- End -->
</if>
<!-- _______ END _______ -->


also why i should use this step?

Installation Instructions (2 steps):
In Admin CP:

1. Then go to Styles & Templates --> Style Manager --> All Style Options --> Edit Templates --> Postbit Templates --> postbit_legacy
it works perfect without this! And i dont want to view horizontal popup menu

BR,
Ross

Does this work with shockwave too?

masterross
10 Feb 2006, 13:09
addition mod:
if you want to see flash avatar in "Public Profile"
in MEMBERINFO
go to Styles & Templates --> Style Manager --> All Style Options --> Edit Templates --> Member Info Templates --> MEMBERINFO

find:
<if condition="$show['avatar']">
<td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
<else />
<td>&nbsp;</td>
</if>

and replace with:

<!-- _______ CUSTOM AVATAR (FLASH) _______ -->
<if condition="$userinfo['field5']">
<!-- Flash Avatar -->
<if condition="$userinfo['field5']">
<div>
<br />
<object width="100px" height="100px">
<param name="movie" value="$userinfo[field5]">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="$userinfo[field5]" width="100px" height="100px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$userinfo[avatarurl]" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
</if>
<!-- End -->
</if>
<!-- _______ END _______ -->


then enjoy :)

BR,
Ross

vyas1980
17 Apr 2006, 17:48
I managed to upload it but its still showing default avtar.. Please help!!!1

Freesteyelz
18 Apr 2006, 00:00
For the Custom Profile Field that you created for the Flash avatar, what is the ID (#)? Can you also provide me your postbit code so that I can help you. :)

hypnoticpimp
24 Apr 2006, 23:22
wow, good job! 1 thing is, i have a avatar gallery, default avatar gallery from vbulletin , is there anyway admins can upload flash avatars to the default gallery, and members can select and view the flash avatar in there usercpanel by selecting edit avatar, etc

Freesteyelz
25 Apr 2006, 01:52
Not without file edits or additions. I didn't pursue it because the hack you're requesting has already been created by MarcoH64 for vB 3.0.x versions. Up to this point there is no word whether or not he'll port it to 3.5+.

hypnoticpimp
25 Apr 2006, 16:56
he said he wont port ir for 3.5. can u ask him permission to do it for him

Freesteyelz
26 Apr 2006, 03:57
First, I'll need to see if I can tackle it or not. I did it with UBB but vB's routines is a totally different breed. No promises, however.

hypnoticpimp
03 May 2006, 00:06
everytime i try to add a avatar, flash. it says invalid file type

Freesteyelz
03 May 2006, 04:47
If you're uploading the avatar you need to use FTP (only if you're hosting the avatars). Using the Admin CP won't work. Any directory is fine as long as the .swf file is pointing to it correctly.

If you're adding the Flash avatar's URL, it has to be in the Custom Profile Field that you created in Steps 1 and 2. Using vB's avatar field won't work.

If you're presented with a different problem let me know and I'll try to help you work it through. :)

hypnoticpimp
03 May 2006, 12:22
ok i did that. but now flash avatar aint working, just a blank avatar, even when u right click the area. doesnt show those flash tools.. just as a reular picture

Freesteyelz
04 May 2006, 00:44
What is the Field # of the Custom Profile Field you created?

vishalsachar
11 Jul 2006, 06:19
Absoluely flawless! Excellent simple hack, took 5 minutes and works superbly!

*clicks install*

Freesteyelz
11 Jul 2006, 10:36
Thanks. :)

MaTraX
01 Sep 2006, 07:06
Thank you for this modification. I would like to publish it a bit later with some changes :)

Freesteyelz
01 Sep 2006, 09:19
/me wonders what is meant by "pubish it"?

Baudman
13 Jan 2007, 16:38
sweet hack thanks.

domokun
14 Jan 2007, 15:43
Hmm, I created the Profile Field and altered the Template. But the default avatar is showing and not the flash. Have I missed something?

Profile Field 11 (I also changed Field20 to Field11 to match the profile field that was created)

Thanks,

~ Domokun

Freesteyelz
17 Jan 2007, 03:29
I apologize for the late reply, Domokun; been quite busy...

Please post your entire code in Step #3. :)

domokun
20 Jan 2007, 17:25
Ah, sorry for the late reply. Ironically, been swamped with work.

Ok, here's the code you requested ;)

Thanks for the help

~ Domokun

<!-- post #$post[postid] -->
<if condition="$show['spacer']">
$spacer_open
<div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>



<br />
<!-- top category table setup -->
<table width="100%" class="tcat" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="88" height="26" align="left" valign="top"><img src="$stylevar[imgdir_misc]/tren_z_front_top_table_ls.gif" width="88" height="26" alt=" " border="0" /></td>
<td width="100%" valign="middle"><div class="smallfont" align="center">$post[icon] <strong>$post[title]</strong></div></td>
<td width="88" height="26" align="right" valign="top"><img src="$stylevar[imgdir_misc]/tren_z_front_top_table_rs.gif" width="88" height="26" alt=" " border="0" /></td>
</tr>
</table>
<!-- End top category table setup -->

<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="1" border="0" width="100%" align="center">
<tr>
<if condition="$show['announcement']">
<td class="thead" style="font-weight:normal" colspan="2">
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" />
<phrase 1="$post[startdate]" 2="$post[enddate]">$vbphrase[x_until_y]</phrase>
</td>
<else />
<td class="thead" style="font-weight:normal" $post[scrolltothis]>
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" /></a>
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</td>
<td class="thead" style="font-weight:normal" align="$stylevar[right]">
&nbsp;
<if condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a></if>
<if condition="$show['inlinemod']">
<input type="checkbox" name="plist[$postid]" id="plist_$postid" style="vertical-align:middle; padding:0px; margin:0px 0px 0px 5px" value="$post[checkbox_value]" onclick="inlineMod.toggle(this)" />
</if>
</td>
</if>
</tr>
<tr valign="top">
<td class="alt2" width="175">

<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
<if condition="$post['isstaffrank']">
<div class="smallfont">
<if condition="$post['staffrank_opentag']">$post[staffrank_opentag]</if>
<if condition="$post['staffrank']">$post[staffrank]</if>
<if condition="$post['staffrank_closetag']">$post[staffrank_closetag]</if>
</div>
</if>

<!-- _______ Flash Avatar _______ -->
<if condition="$post['field11']">
<!-- Flash Avatar -->
<if condition="$post['field11']">
<div>
<br />
<object width="150px" height="150px">
<param name="movie" value="$post[field11]"> <param name="quality" value="high"> <param name="wmode" value="transparent">
<embed src="$post[field11]" width="150px" height="150px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$post[avatarurl]" width="150px" height="150px" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
</if>
<!-- End -->
</if>
<!-- _______ END _______ -->

<div class="smallfont">
&nbsp;<br />
<div class="info">$post[musername] is $post[onlinestatus] </div>
<if condition="$post['joindate']"><div class="info">$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$post['field2']"><div class="info">$vbphrase[location_perm]: $post[field2]</div></if>
<if condition="$post['age']"><div class="info">$vbphrase[age]: $post[age]</div></if>
<div class="info">$vbphrase[posts]: $post[posts]</div>
<if condition="$show['reputation']"><div class="info">Rep: $post[reputationdisplay]</div></if>
<if condition="$show['reppower']"><div class="info">$vbphrase[reppower]: $post[reppower] </div></if>
<if condition="$post[icqicon] or $post[aimicon] or $post[msnicon] or $post[yahooicon] or $post[gticon] or $post[skypeicon]"><div class="info">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[gticon] $post[skypeicon]</div></if>
</div>

</td>
<if condition="$show['moderated']">
<td class="alt2" id="td_post_$post[postid]">
<else />
<td class="alt1" id="td_post_$post[postid]">
</if>

<if condition="$show['messageicon'] OR $post['title']">
<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
</if>

<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div>
<!-- / message -->

<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

<if condition="$show['thumbnailattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_thumbnails]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[thumbnailattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[imageattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachmentlink']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[imageattachmentlinks]
</table>
</fieldset>
</if>

<if condition="$show['otherattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_files]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[otherattachments]
</table>
</fieldset>
</if>

<if condition="$show['moderatedattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attachments_pending_approval]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[moderatedattachments]
</table>
</fieldset>
</if>

</div>
<!-- / attachments -->
</if>

<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

<if condition="$show['postedited']">
<!-- edit note -->
<div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<em>
<phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>.
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>
</em>
</div>
<!-- / edit note -->
</if>

</td>
</tr>
<tr>
<td class="alt2">
<if condition="$show['reputationlink']"><a href="reputation.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/reputation.gif" border="0" alt="<phrase 1="$post[username]">$vbphrase[add_to_xs_reputation]</phrase>" /></a></if>
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a></if>
$post[iplogged]
&nbsp;
</td>
<if condition="$show['moderated']">
<td class="alt2" align="$stylevar[right]">
<else />
<td class="alt1" align="$stylevar[right]">
</if>
<!-- controls -->
<if condition="$post['editlink']">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$post['replylink']">
<a href="$post[replylink]" rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />quote</if>.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if>
<if condition="$show['quickreply'] AND !$show['threadedmode']">
<a href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
<if condition="$show['moderated']">
<img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
</if>
<!-- / controls -->
</td>
</tr>
</table>

<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['links']">
<tr><td class="vbmenu_option"><a href="$post[links]"><phrase 1="$post[username]">$vbphrase[visit_xs_links]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->

<!-- bottom table setup -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="60" align="left" valign="top"><img src="$stylevar[imgdir_misc]/tren_z_front_btm_table_ls.gif" width="60" height="14" alt=" " border="0" /></td>
<td width="100%" style="background-image:url($stylevar[imgdir_misc]/tren_z_front_btm_table_back.gif)"><img src="$stylevar[imgdir_misc]/clear.gif" width="100%" height="14" alt=" " border="0" /></td>
<td width="60" align="right" valign="top"><img src="$stylevar[imgdir_misc]/tren_z_front_btm_table_rs.gif" width="60" height="14" alt=" " border="0" /></td>
</tr>
</table>
<!-- End bottom table setup -->


<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->

Freesteyelz
20 Jan 2007, 22:00
From what I see the code above is correct. You've mentioned that your Profile Field is 11; when you enter the .swf file into that field it should override the default Flash and display in the Postbit. You've also modified the postbit_legacy; the template that you're currently using on your site, so that's correct.

In your Profile Field 11 ("CUSTOM AVATAR (FLASH" text area), can you please post an example URL of the .swf avatar?

domokun
20 Jan 2007, 23:26
Ok, I used this test link for my .swf avatar:

http://anime.scanlover.com/forum/flash/desudesu.swf

I uploaded it directly to my site so that I wouldn't have to worry about the link changing. My site also uses a default avatar if none is selected.

Hope this helps.

~ Domokun

Freesteyelz
21 Jan 2007, 02:59
Anytime you're able to link internally, do so. You should be able to strike out the domain name and just use:

/forum/flash/desudesu.swf

Now if that URL is posted in the Profile 11 Field it should display in place of any other avatar. I also use a default avatar (if none were chosen) that I made using a custom template and plugin; so the Flash code on my own forum is slightly different than this mod.

I'm curious, how are you doing the default avatar?

domokun
21 Jan 2007, 03:12
Hmm, good question. It's been a long time since I've installed the default avatar... It should be an installed plugin if I remember correctly.

if (!$this->post['avatarurl'])
{
$this->post['avatarurl'] = "customavatars/SLoverDefault.png";
}
if ($this->registry->userinfo['showavatars'])
{
$show['avatar'] = true;
}

This is what I have in my Plugin Manager for default avatars - Product : vBulletin, Hook location : postbit_display_complete

~ Domokun

Freesteyelz
21 Jan 2007, 22:40
I don't know for sure but there may be a conflict with that plugin code and my mod. So try this: Disable that plugin. Does the Flash avatar work now? If yes, then follow these additional steps (if you want to have the default avatar) below.

1)
Add new plugin.
Product: vBulletin
Hook: postbit_display_start
Title: avatardefault
Plugin PHP code:

eval('$avatardefault = "' . fetch_template('avatardefault') . '";');

Active: Yes
Save

2)
Add new template.
Title: avatardefault
Template:

<img src="/forum/images/avatar/default_avatar.jpg" alt="Default Avatar" />

Change the "src" (to the path of your default avatar) and "alt".
Save

3)
Uploade your default avatar to the path you specified.

4)
Replace your Flash code with this one:

<!-- _______ Flash Avatar _______ -->
<if condition="$post['field11']">
<!-- Flash Avatar -->
<if condition="$post['field11']">
<div>
<br />
<object width="150px" height="150px">
<param name="movie" value="$post[field11]"> <param name="quality" value="high"> <param name="wmode" value="transparent">
<embed src="$post[field11]" width="150px" height="150px" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false" quality="high" wmode="transparent" scale="default">
</embed>
</object>
</div></if>
<!-- End -->
<else />
<!-- vB Avatar -->
<if condition="$show['avatar']">
<div class="smallfont">
<br /><img src="$post[avatarurl]" width="150px" height="150px" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
</div>
<!-- End -->
<else />
<!-- Alternative -->
<div class="smallfont">
$avatardefault
</div>
</if>
<!-- End -->
</if>
<!-- _______ END Flash Avatar _______ -->


5)
Hopefully, by doing these steps you'll now be able to use the Flash avatar and have a default avatar if no avatar was chosen. *These are similar codes I did on my forum.

domokun
23 Jan 2007, 00:01
Quick question, when you mentioned to change the 'alt', does that mean I change it to the link as well?

~ Domokun

Freesteyelz
23 Jan 2007, 03:10
Nope. Just as with any alt attribute, enter whatever text you want (e.g., Default Avatar). :)

sidewinder1965
09 Apr 2007, 01:08
I've tried several times to install and use this mod, with no luck.

I've double checked my edits, and they seem fine.

I've gone over my custom profile and it's settings, and they seem good as well.

I've checked the url in the users profile, and tried several different ways of adding it.

I've read this thread so many times I think I know it by heart--->lol

The only thing I can find different, is that I'm trying to install it on 3.5.1, is that an issue?

Or do you have any other ideas that might help? The flash avatar does'nt show at all, I keep getting the users uploaded avatar instead, and I thought it was supposed to be overwritten?

Maybe I missed something here--->sure hope so, it looks like a great mod!!

Thanks for any help.