vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Show Thread Enhancements - YouTube Video Avatars for specified usergroups (https://vborg.vbsupport.ru/showthread.php?t=150574)

4x4 Mecca 06-24-2007 10:00 PM

YouTube Video Avatars for specified usergroups
 
Hello, what this mod does is allows users to have a "Video Avatar" if they are a member of the usergroup you specify.

Installation instructions are attached. See screen shots below to get an idea of what it looks like.

UPDATE! I recorded a video of me installing it on a blank board. The video should help anyone having trouble. There are a couple extra things like me closing my password manager that you should ignore, but the video will show you what to do.

Installation Video Instructions

You can change the height and width of the video by changing the attributes in the code.

It requires one template edit, 2 if you use both postbit styles.
It requires one profile field.

I am new to the modding still, and my instructions here aren't great, but you can see it in action here.

UPDATE!
To Display them in your user profiles
open the memberinfo template
find
Code:

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

Replace with
Code:

<if condition="in_array($post['usergroupid'], array(5,6,7,12,14)) AND $post[fieldXX]">
<td>
<object width="150" height="123.5"><param name="movie" value="http://www.youtube.com/v/$post[fieldXX]"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$post[fieldXX]" type="application/x-shockwave-flash" wmode="transparent" width="150" height="123.5"></embed></object>
</td>
<else />       
                        <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>
                        </if>
</if>

Be sure you replace all fieldXX with your actual field number!

Click installed!
Nominate for MOTM!

rjmjr69 06-25-2007 02:05 AM

Friggen awesome idea. Installing now and I'll leave feedback thanks

4x4 Mecca 06-25-2007 02:10 AM

Let me know how it goes, and if anyone can make this a plugin or product, feel free to.

PoetJA-1975 06-25-2007 05:28 AM

WOW - very nice!
Thanx for the sharing ;)

Jacquii.

4x4 Mecca 06-25-2007 05:54 AM

Thanks! I'm eager to see this working on other peoples forums. If anyone installs this, let me know how the instructions are and maybe a link to your forum. Thanks :)

PoetJA-1975 06-25-2007 06:46 AM

Instructions are good - but It's not showing correctly on regular postbit :(
Of course JPiC postbit is heavily modified - but looking at the code - I'm not sure exactly how to make it show... Test thread at http://jpicforum.info/recycle-bin/te...html#post21003

I also have installed the Staff Badges so Postbit code looks like:
Quote:

<if condition="$show['avatar']">
<!-- check for staff -->
<if condition="in_array($post[usergroupid], array(5,6,7))">
<!-- I am staff so do this -->
<td class="alt2">

<table cellpadding="4" cellspacing="0" border="0" width="190" height="120" align="center" background="images/$post[username]_avatar.gif" nowrap="nowrap" no-repeat>
<tr>
<td width="46%">&nbsp;</td>
<td><img src="$post[avatarurl]" height="70" width="70" align="center"></td>
</tr>
</table>
</td>
<else />
<!-- I am not staff so do this -->

<!-- Video Avatar Code -->
<if condition="in_array($post['usergroupid'], array(9,10)) AND $post[field12]">
<div class="smallfont">
<object width="150" height="123.5"><param name="movie" value="http://www.youtube.com/v/$post[field12]"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$post[field12]" type="application/x-shockwave-flash" wmode="transparent" width="150" height="123.5"></embed></object>
</div>
</if>
<else />
<!-- End Video Avatar Code -->
Help appreciated AND thanx for sharing ;)

Jacquii.

PoetJA-1975 06-25-2007 07:42 AM

Anyway - I've taken screenshots in flock and in opera
seems the vid avatar is not aligned with the rest...
I'm sure it's a simple html issue - just don't wanna fool with it now...
Thanx for the sharing anyway - ALSO will appreciate any help getting it aligned right ;)

Jacquii.

4x4 Mecca 06-25-2007 03:33 PM

Quote:

<!-- Video Avatar Code -->
<if condition="in_array($post['usergroupid'], array(9,10)) AND $post[field12]">
<div class="smallfont">
<object width="150" height="123.5"><param name="movie" value="http://www.youtube.com/v/$post[field12]"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$post[field12]" type="application/x-shockwave-flash" wmode="transparent" width="150" height="123.5"></embed></object>
</div>
<else />
<!-- End Video Avatar Code -->
<if condition="$show['avatar']">
<!-- check for staff -->
<if condition="in_array($post[usergroupid], array(5,6,7))">
<!-- I am staff so do this -->
<td class="alt2">

<table cellpadding="4" cellspacing="0" border="0" width="190" height="120" align="center" background="images/$post[username]_avatar.gif" nowrap="nowrap" no-repeat>
<tr>
<td width="46%">&nbsp;</td>
<td><img src="$post[avatarurl]" height="70" width="70" align="center"></td>
</tr>
</table>
</td>
<else />
<!-- I am not staff so do this -->
That is the start, I'll need a few more lines to see where to put the other </if> code :)

rjmjr69 06-25-2007 05:07 PM

IT says updated but what was updated? I can't get it to work at all

TheBlackPoet 06-25-2007 07:55 PM

yes! it worked perfectly!! i love it....!!! i love it a lot... i think the only problem will be something out the hands of the coder of this wonderful hack.....

when the publisher of the youtube video decides to pull the vid... you have to go hunt for another....

but this is an awesome addition and option for forum members to have and better express their personalities.....

thanks for the work...

4x4 Mecca 06-25-2007 10:30 PM

Glad it works for you TheBlackPoet. If the people who are having trouble could post their postbit file, I can see why it's not working.

Silvio 06-26-2007 12:28 AM

gorgeous:P
I will install it right now


ty for sharing this good idea/work

rjmjr69 06-26-2007 01:45 AM

Anyone here?

4x4 Mecca 06-26-2007 01:54 AM

Did you see my reply. I asked you to post your postbit template.

PoetJA-1975 06-26-2007 08:00 AM

Postbit below 4x4 Mecca - thanx very much
Question: Would make a difference in the code if you have default avatar selected to show?
Thanx again -

Jacquii.

Quote:

<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="$show['avatar']">
<!-- check for staff -->
<if condition="in_array($post[usergroupid], array(5,6,7))">
<!-- I am staff so do this -->
<td class="alt2">

<table cellpadding="4" cellspacing="0" border="0" width="190" height="120" align="center" background="images/$post[username]_avatar.gif" nowrap="nowrap" no-repeat>
<tr>
<td width="46%">&nbsp;</td>
<td><img src="$post[avatarurl]" height="70" width="70" align="center"></td>
</tr>
</table>
</td>
<else />
<!-- I am not staff so do this -->
<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>
<td nowrap="nowrap">
<fieldset class="fieldset">
<legend><font face="Arial Black">Member Information</font></legend>
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
$post[onlinestatus]
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>
<if condition="$post[field9] != ''"><div class="smallfont">
Real Name: <strong>$post[field9]</strong>
</div></if>
<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont" align="center">$post[rank]</div></if>
<if condition="!empty($post[mood])">
<div class="smallfont" align="center">
$vbphrase[my_mood]: <img src="images/mood/$post[mood].gif" border="0" />
</if></div>

<if condition="$thread[postusername]==$post[username]"><div class="smallfont" align="center">
<img src="$stylevar[imgdir_misc]/tstarter.gif" alt="This Member Is The Original Thread Starter" border="0" /></div>
</if></fieldset>
</td>
<td width="100%">&nbsp;</td>
<td valign="top" nowrap="nowrap">
<div class="smallfont">
$post[crowns]$post[champtext]
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$show['last_seen_online']"><div>$vbphrase[last_seen_online]: $post[lastseen_date] $post[lastseen_time]</div></if>
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>

<!-- Local Date and Time in Post -->
<if condition="$post[userid]">
<div class="smallfont" align="left">
$vbphrase[bf2_local_time]: $post[localtime]
</div>
</if>
<!-- Local Date and Time in Post -->

<div>
$vbphrase[posts]: <a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow">$post[posts]</a> $vbphrase[threads]: <a href="search.php?$session[sessionurl]do=process&amp;showposts=0&amp;starteronly=1&amp;e xactname=1&amp;searchuser=$post[username]" rel="nofollow">$post[threads]</a>
</div>
<div class="smallfont">
<if condition="$post['age']">$vbphrase[age]: <if condition="$show[member]">$post[age]<else />$vbphrase[peterska2_private]</if></if> </if> <if condition="$post['zodiac_sign']">$post[zodiac_sign]</if><if condition="$post[field8]">$vbphrase[gender] <img src="$stylevar[imgdir_misc]/$post[field8].gif" alt="$post[field8]" />
<if condition="$post[field6] != ''">
Country: <img src="images/flags/$post[field6].gif" title="$post[field6]" align="center">
</div></if>
<div class="smallfont">
<if condition="$show['reppower']">
<div>$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower] @ $post[reputation]</span></div>
</if>
<if condition="$show['reputation']">
<div style="padding-bottom:2px"><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div>
</if>
</div>
<div><if condition="$show[member]">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon] <if condition="$show['homepage']"><a href="$post[homepage]" target="_blank" dir="ltr"><img src="images/misc/userhome.gif" alt="Member's Website" border="0" /></a></if><if condition="$post[field11]">
<!-- Myspace button -->
<a href="http://www.myspace.com/$post[field11]" target="_blank">
<img src="images/misc/myspace.png" border="0" title="View My MySpace"></a>
<!-- / Myspace button -->
</if><else />$vbphrase[peterska2_im_is_private]</if>

</if></div>
<!-- show awards -->
<if condition="$post[showuserawards]">
<fieldset><legend><a href="member.php?u=$post[userid]#award" title="$vbphrase[more_awards]">$vbphrase[award_showcase]</a></legend>
<div>
$post[userawards]
<br>
<a href="member.php?u=$post[userid]#award" title="$vbphrase[more_awards]">$vbphrase[total_awards]</a>: $post[num_awards]
</div>
<if condition="$show['iprof_rating']">
<div>
<if condition="$show['who_rated_member']"><a href="#" onclick="who_rated_member($post[userid]); return false;">$vbphrase[iprof_rating]</a><else />$vbphrase[iprof_rating]</if>:
<a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$post[userid]&amp;nojs=1#goto_memberrating" title="<phrase 1="$post[iprof_votenum]" 2="$post[iprof_voteavg]">$vbphrase[iprof_user_rating_x_votes_y_average]</phrase>"><if condition="$post['iprof_rating']"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$post[iprof_rating].gif" border="0" alt="<phrase 1="$post[iprof_votenum]" 2="$post[iprof_voteavg]">$vbphrase[iprof_user_rating_x_votes_y_average]</phrase>" /><else />$vbphrase[iprof_not_rated]</if></a>
</div>
</if>

</fieldset>
</if>
<!-- /show awards -->


<if condition="$show['infraction']">
<div class="smallfont" padding-top:2px">
$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div>
</div>
</if>
</td>
</tr>
</table>
<!-- / user info -->

tipoboy 06-26-2007 10:30 AM

i got it working thanks for a great mod!!

1 problem i change the array values for a custom usergroup called video avatars (field 13) i only want this usergroup to have video avatars.

the problem i get is when i add myself as a secondary user to that group the video avatar doesnt work is there some special priviledges you need to use when making the usergroup?? i just based it on the registered users group!!

do you follow what i am saying?
your help would be appreciated
dave

tipoboy 06-26-2007 11:05 AM

also any way of making the video avatars show on all the sections where the avatar's arefo example vbadvanced ortal user cp etc etc

so if you are in the usergroup for video avatars all instances of your avatar become the video avatar not just the postbit/postbit_legacy

thanks again
dave

Rickeo 06-26-2007 11:16 AM

AMAZING :D thank you so much

GuaRRand 06-26-2007 11:19 AM

am i the only one who cant get it to work?

I did what the instructions said, editted both postbit's and made the extra profile field, but i dont see it in my UserCP -> edit options or edit avatar...

GuaRRand 06-26-2007 11:23 AM

nvm, got it

4x4 Mecca 06-26-2007 05:19 PM

Thanks Jacquii, I'll work on that today or tomorrow, I have family in town, so I'm pretty busy.

4x4 Mecca 06-26-2007 05:24 PM

Dave, what are you making the video avatar user groups for. I mean what decides who gets put in it. If it's something like length of time or posts, I could probably work something. I don't user secondary user groups so I'm not sure how they work.

tipoboy 06-26-2007 09:20 PM

Quote:

Originally Posted by 4x4 Mecca (Post 1277085)
Dave, what are you making the video avatar user groups for. I mean what decides who gets put in it. If it's something like length of time or posts, I could probably work something. I don't user secondary user groups so I'm not sure how they work.

in your user manager there is an option to allow additional usergroups

i made a video avatar usergroup and added it to me as a aditional user group but this didnt work(see Screen Shot)

would i have to make up another user group for video avatars enabled for each group i want it to be effective on eg 1 for admin 1 for moderators 1 for registered users or could i do it using this method with alterations in the template change??

i hope this is clear as i love this mod and want to restrict the use to people in the video avatars group only

hope u understand and can achieve this
thanks for the help
dave

tipoboy 06-26-2007 09:25 PM

better screen shot for u

4x4 Mecca 06-26-2007 10:38 PM

Thanks dave, I understand what 2ndary user groups are, i just didn't get how you were going to choose who went in there. I will see if I can do it that way.. keep an eye on this thread.

TheBlackPoet 06-26-2007 10:55 PM

this is my working version.... see what you can do with this..

4x4 Mecca 06-26-2007 11:29 PM

Quote:

Originally Posted by tipoboy (Post 1277261)
better screen shot for u

Dave, change
Quote:

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

Quote:

<if condition="$post['membergroupids'] == 9 AND $post[field6]">

Where 9 is the additional usergroup ID and 6 is your field number. That will work :)

4x4 Mecca 06-26-2007 11:39 PM

jacquii, let me know if this works.

replace this
Quote:

<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="$show['avatar']">
<!-- check for staff -->
<if condition="in_array($post[usergroupid], array(5,6,7))">
<!-- I am staff so do this -->
<td class="alt2">

<table cellpadding="4" cellspacing="0" border="0" width="190" height="120" align="center" background="images/$post[username]_avatar.gif" nowrap="nowrap" no-repeat>
<tr>
<td width="46%">&nbsp;</td>
<td><img src="$post[avatarurl]" height="70" width="70" align="center"></td>
</tr>
</table>
</td>
<else />
<!-- I am not staff so do this -->
<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>

with this

Quote:

<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="in_array($post['usergroupid'], array(5,6,7,12,14)) AND $post[fieldXX]">
<div class="smallfont">
<object width="150" height="123.5"><param name="movie" value="http://www.youtube.com/v/$post[fieldXX]"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$post[fieldXX]" type="application/x-shockwave-flash" wmode="transparent" width="150" height="123.5"></embed></object>
</div>
<else />
<if condition="$show['avatar']">
<!-- check for staff -->
<if condition="in_array($post[usergroupid], array(5,6,7))">
<!-- I am staff so do this -->
<td class="alt2">

<table cellpadding="4" cellspacing="0" border="0" width="190" height="120" align="center" background="images/$post[username]_avatar.gif" nowrap="nowrap" no-repeat>
<tr>
<td width="46%">&nbsp;</td>
<td><img src="$post[avatarurl]" height="70" width="70" align="center"></td>
</tr>
</table>
</td>
<else />
<!-- I am not staff so do this -->
<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>
</if>
but edit the field number and user groups to match your site.

tipoboy 06-27-2007 01:46 PM

Quote:

Originally Posted by 4x4 Mecca (Post 1277332)
Dave, change


to




Where 9 is the additional usergroup ID and 6 is your field number. That will work :)

worked a treat thanks muchly for the quick help and reply!!!!!!!!!!

**tipoboy clicks nominate**

ThaSuper 06-27-2007 02:29 PM

great mod installed with no problems.
I have one question though...
Is there a way to restrict Video Avatars to only users with a certain number of post or greater?
Example: User1 reaches 100 post then Video Avatars show. User2 with less than 100 post his video avatar does not show.

Let me know if this is possible?

Thanks.

tipoboy 06-27-2007 04:16 PM

couldnt you do this with usergroups??

add a new promotion and set it so that after the user posts 100 times then they're upgraded to a new usergroup then edit the template postbit + postbit_legacy

see here

https://vborg.vbsupport.ru/showpost....2&postcount=27

ThaSuper 06-27-2007 05:47 PM

Thanks tipoboy that worked perfect!

tekstylez 06-28-2007 02:15 PM

followed the directions, but the video is not showing in postbit. I just get a blank area.

tipoboy 06-28-2007 02:54 PM

Quote:

Originally Posted by tekstylez (Post 1278463)
followed the directions, but the video is not showing in postbit. I just get a blank area.

did you create the profile field and change the template edit field to corresponde with the profile field you just made?

did you type in just the end part of the youtube address in the profile fied of your forum not the whole address to the video?

for example if the address is:
http://www.youtube.com/watch?v=XVT8rhtlj6w

only enter

XVT8rhtlj6w

if you've done all this and still doesnt work then follow the instructions given again it took me 3 attempts to get it working lol

tekstylez 06-28-2007 02:56 PM

i got it thanks... i edited only postbit and not legacy

tipoboy 06-28-2007 03:00 PM

TO 4X4 MECCA:

is there any way of allowing this to show in all instances of your avatar and not just the postbit and postbit_legacy?

also is there any way of putting the video avatar selection box in to the "profile.php?do=editavatar" section of the usercp??

this would be great if it could be done thanks
dave

eNforce 06-28-2007 08:27 PM

Thanks for this mod Mecca, you can see your mod being used on my forum here:

http://www.areyouserios.com/new-feat...09.html?t=1709

I second the Edit Avatar UserCP idea

ChU v2 06-28-2007 08:47 PM

I'm new to installing mods, in fact this my second. I put both sets of code in both postbit and postbit_legacy, edited the FieldXX... I'm not getting the option in my User CP.

Only used the last part of the video URL after the "="

I don't know what I'm doing wrong. :(

tipoboy 06-28-2007 08:55 PM

it should be right t the bottom of the profile editor page

if its not there double check that you created the new profile field correctly.

if this is all done and still doesnt work post back here:)

ChU v2 06-28-2007 09:23 PM

I got it to work. Thank you. Looks awesome.

Just a few things. The avatar isn't centered. It's fine if you have a YouTube video, but my user's avatar are left-aligned. It looks like crap. Anyway to fix that?

And its not viewable in your profile or the homepage, only in threads. Not that big of a deal.


All times are GMT. The time now is 02:32 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.01618 seconds
  • Memory Usage 1,886KB
  • 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
  • (2)bbcode_code_printable
  • (11)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
  • (40)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