vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Add-On Releases - Add Video Or Mp3 To Play On Your Avatar (https://vborg.vbsupport.ru/showthread.php?t=183931)

friend01 06-29-2008 10:00 PM

Add Video Or Mp3 To Play On Your Avatar
 
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

mp3 Avatar

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:

Code:

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


Replace with:

Code:

<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:

Code:

<if condition="$show['avatar']">
                <div class="smallfont">
                    &nbsp;<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:
Code:

<div id="postmenu_$post[postid]">
                <if condition="$show['profile']">
                <a class="bigusername"

Add befor:
Code:

<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">
&nbsp;<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:

Code:

<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14)) AND $post[field5]">
Add before:
Code:

<if condition="$bbuserinfo['usergroupid'] != 1">
Find:
Code:

so.addVariable('searchbar','false');
so.write('player');
</script>
</div>

Add after:
Code:

</if>
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:

ShawneyJ 06-30-2008 02:14 AM

i cant use this but its really cool man congrats.

dvbusuario 06-30-2008 02:27 AM

Very, Very Good Install!!! an Nominate

Alfa1 06-30-2008 02:30 AM

Is it possible to define which usergroups can use this?

TimberFloorAu 06-30-2008 02:36 AM

Seems like a good idea.

How could we limit this to certain user groups. or those with post count over say 1000

Problem I forsee, is the page load speed, on a busy forum.

Seems like a great idea, but can only imagine the page speed is going to be sooooo slow... your page took 17 seconds to load, for the mp3 Slightly less for the youtube vid.

The mp3, presumably.. is constructed from either ( hosted or hotlinked files ) which again.. could take for ever to load.

Any stats please?

Barakat 06-30-2008 03:22 AM

realy nice idea ,,,, installleddddddddddddd

friend01 06-30-2008 08:20 AM

Quote:

Originally Posted by Alfa1 (Post 1562623)
Is it possible to define which usergroups can use this?

You can limit for group in Red color number!
Examle: array(5,6,7) this only for Group Mod,Admin and Smod

Code:

<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14))

Hornstar 06-30-2008 10:59 AM

Looks great. Lets just hope this doesnt lag the page load too much. (It shouldnt as it doesnt load until you click on it)

Alfa1 06-30-2008 11:27 AM

Quote:

Originally Posted by friend01 (Post 1562800)
You can limit for group in Red color number!
Examle: array(5,6,7) this only for Group Mod,Admin and Smod

Code:

<if condition="in_array($post['usergroupid'], array(2,5,6,7,12,14))

Does that not limit the usergroups that can view it, instead of limit the usergroups that can use it?

rooban12 06-30-2008 12:19 PM

really nice
thanks for the hack


All times are GMT. The time now is 11:03 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.01054 seconds
  • Memory Usage 1,761KB
  • 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
  • (11)bbcode_code_printable
  • (2)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