friend01
06-29-2008, 10:00 PM
Add Video or audio player to you Avatar V1.1
vBB: 3.6x-3.7x
Code: V1.1
Author : Friend01
date: juni.29.2008
demo:
Video avatar (http://thuytinh.name/forums/test-forums/11622-test-video-avatar.html#post16978)
mp3 Avatar (http://thuytinh.name/forums/test-forums/11623-test-mp3-avatar.html#post16979)
Install: Easy < 10 min
Templates chance: 1 and/or 2
postbit and/or postbit_legacy
STEP1.
1. Upload the contents of the "upload" folder to you root forums.
2. Goto ACP >>User Profile Fields >>Add New User Profile Field
Profile Field Type: Single-Line Text Box
click: Continue
---------------------------------------------------------------------
Title: TT-AV-Avatar
Description:
Paste the youtube video link or you mp3 link in the box below.<br />
Example:
youtube link ( http://de.youtube.com/watch?v=yeCEOLan1h4 ).<br />
or you link to you mp3 file ( http://www.Examler.com/music/file.mp3 )<br />
leave this Box blank to show you normal Avatar.
Max length of allowed user input: 500
Field Length: 50
Field Editable by User: yes
Private Field: no
Which page displays this option?: Edit Your Details
click Save.
----------------------------------------------------------------------------
Goto ACP >>User Profile Fields>>User Profile Field Manager
Take notice of the field number next to your new profile field. In the sample below it's
TT-AV-Avatar >>>>>>> Name : field5 (field5 is on my forum).
IMPORTANT! Replace all [field5] with the your forums field number!
And Replace all link in Green color to you link!
////////////////////////////////////////////////
STEP2.
TEMPLATE CHANGES:
Goto ACP >>Styles & Templates>>Style Manager
selec you skin >> Edit Templates
In template: postbit
Find:
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
Replace with:
<if condition="$bbuserinfo['usergroupid'] != 1">
<if condition="in_array($post['usergroupid'], array(2,5,6,7,9,12,14)) AND $post[field5]">
<td class="alt2">
<embed
src="http://www.examle.com/forum/tt-av-avatar-v1.0/mediaplayer.swf"
width="150"
height="124"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=124&width=150&file=$post[field5]&image=$post[avatarurl]&showstop=true&enablejs=true"
/>
</td>
</if>
<else />
<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>
</if>
------------------------------------------------------------------------------
Click Save.
------------------------------------------------------------------------------
In template: postbit_legacy
Find:
<if condition="$show['avatar']">
<div class="smallfont">
<br /><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>
</div>
</if>
Delete this.
-----------------------------------------------------
Find:
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername"
Add befor:
<if condition="$bbuserinfo['usergroupid'] != 1">
<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14)) AND $post[field5]">
<div class="smallfont">
<embed
src="http://www.examle.com/forum/tt-av-avatar-v1.0/mediaplayer.swf"
width="150"
height="124"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=124&width=150&file=$post[field5]&image=$post[avatarurl]&showstop=true&enablejs=true"
/>
</div>
</if>
<else />
<if condition="$show['avatar']">
<div class="smallfont">
<br /><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>
</div>
</if>
</if>
----------------------------------------------------------------------------------
Click Save
----------------------------------------------------------------------------------
Final:
Goto >> User CP>>>Edit Your Details to Add video link or mp3 link
----------------------End-------------------------
:D
Update 6.1.2008 : Hide TT-AV-Avatar from Guests
The following template modifications will prevent guests (unregistered / not logged in) from seeing TT-AV-Avatar.
in templastes postbit and/or postbit_legacy
Find:
<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14)) AND $post[field5]">
Add before:
<if condition="$bbuserinfo['usergroupid'] != 1">
Find:
so.addVariable('searchbar','false');
so.write('player');
</script>
</div>
Add after:
</if>
[U]Update: (6.3.2008)
- Complete code With Hide TT-AV-Avatar from Guests.
- Fix Error in IE
-Fix probleme wen click drop down member menu on postbit_legacy.:)
-----END-----
:cool:
vBB: 3.6x-3.7x
Code: V1.1
Author : Friend01
date: juni.29.2008
demo:
Video avatar (http://thuytinh.name/forums/test-forums/11622-test-video-avatar.html#post16978)
mp3 Avatar (http://thuytinh.name/forums/test-forums/11623-test-mp3-avatar.html#post16979)
Install: Easy < 10 min
Templates chance: 1 and/or 2
postbit and/or postbit_legacy
STEP1.
1. Upload the contents of the "upload" folder to you root forums.
2. Goto ACP >>User Profile Fields >>Add New User Profile Field
Profile Field Type: Single-Line Text Box
click: Continue
---------------------------------------------------------------------
Title: TT-AV-Avatar
Description:
Paste the youtube video link or you mp3 link in the box below.<br />
Example:
youtube link ( http://de.youtube.com/watch?v=yeCEOLan1h4 ).<br />
or you link to you mp3 file ( http://www.Examler.com/music/file.mp3 )<br />
leave this Box blank to show you normal Avatar.
Max length of allowed user input: 500
Field Length: 50
Field Editable by User: yes
Private Field: no
Which page displays this option?: Edit Your Details
click Save.
----------------------------------------------------------------------------
Goto ACP >>User Profile Fields>>User Profile Field Manager
Take notice of the field number next to your new profile field. In the sample below it's
TT-AV-Avatar >>>>>>> Name : field5 (field5 is on my forum).
IMPORTANT! Replace all [field5] with the your forums field number!
And Replace all link in Green color to you link!
////////////////////////////////////////////////
STEP2.
TEMPLATE CHANGES:
Goto ACP >>Styles & Templates>>Style Manager
selec you skin >> Edit Templates
In template: postbit
Find:
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
Replace with:
<if condition="$bbuserinfo['usergroupid'] != 1">
<if condition="in_array($post['usergroupid'], array(2,5,6,7,9,12,14)) AND $post[field5]">
<td class="alt2">
<embed
src="http://www.examle.com/forum/tt-av-avatar-v1.0/mediaplayer.swf"
width="150"
height="124"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=124&width=150&file=$post[field5]&image=$post[avatarurl]&showstop=true&enablejs=true"
/>
</td>
</if>
<else />
<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>
</if>
------------------------------------------------------------------------------
Click Save.
------------------------------------------------------------------------------
In template: postbit_legacy
Find:
<if condition="$show['avatar']">
<div class="smallfont">
<br /><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>
</div>
</if>
Delete this.
-----------------------------------------------------
Find:
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername"
Add befor:
<if condition="$bbuserinfo['usergroupid'] != 1">
<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14)) AND $post[field5]">
<div class="smallfont">
<embed
src="http://www.examle.com/forum/tt-av-avatar-v1.0/mediaplayer.swf"
width="150"
height="124"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=124&width=150&file=$post[field5]&image=$post[avatarurl]&showstop=true&enablejs=true"
/>
</div>
</if>
<else />
<if condition="$show['avatar']">
<div class="smallfont">
<br /><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>
</div>
</if>
</if>
----------------------------------------------------------------------------------
Click Save
----------------------------------------------------------------------------------
Final:
Goto >> User CP>>>Edit Your Details to Add video link or mp3 link
----------------------End-------------------------
:D
Update 6.1.2008 : Hide TT-AV-Avatar from Guests
The following template modifications will prevent guests (unregistered / not logged in) from seeing TT-AV-Avatar.
in templastes postbit and/or postbit_legacy
Find:
<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14)) AND $post[field5]">
Add before:
<if condition="$bbuserinfo['usergroupid'] != 1">
Find:
so.addVariable('searchbar','false');
so.write('player');
</script>
</div>
Add after:
</if>
[U]Update: (6.3.2008)
- Complete code With Hide TT-AV-Avatar from Guests.
- Fix Error in IE
-Fix probleme wen click drop down member menu on postbit_legacy.:)
-----END-----
:cool: