vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do i check if the user is part of a group (https://vborg.vbsupport.ru/showthread.php?t=210134)

iadmirevb 04-02-2009 02:52 PM

How do i check if the user is part of a group
 
Hello,
I've created a forum and inside the description i added a html code that embed a flash palyer. The code works great!

<div style="border:0px solid red;margin-top:5px;">
<embed
src="/flv_mediaplayer44/player.swf"
width="350"
height="20"
bgcolor="#E1E4F2"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=/media/fileoftheweek_indi.mp3"
/>
</div>

I want to take it one step higher and i want to add a code that checks if the user is part of the registered group. If he is, then i show the code for the flash player.

Is this feasable?

Thanks
Marco

Lynne 04-02-2009 03:15 PM

Well, the code for checking for usergroups would be either:
In a template:
HTML Code:

<if condition="is_member_of($bbuserinfo, x,y,z)">
In php:
PHP Code:

if (is_member_of($vbulletin->userinfox,y,z)) 


I have no idea if that will work in your description. If not, you'll have to edit your templates to use the condition.

TigerC10 04-02-2009 03:16 PM

You did this in a template?

You could always stick that code in a template conditional...

Code:

<if condition="$bbuserinfo[userid] != 0">
<div style="border:0px solid red;margin-top:5px;">
<embed src="/flv_mediaplayer44/player.swf"
    width="350"
    height="20"
    bgcolor="#E1E4F2"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="file=/media/fileoftheweek_indi.mp3" />
</div>
<else />
You must register to view the video.
</if>

If you want to make it a specific group, or set of groups, it'll get a little more complicated... Just a tiny bit.

iadmirevb 04-02-2009 04:26 PM

1 Attachment(s)
no, not on a template... directly on my forum description (check image)... it's working perfectly and the users are very happy....

i think condition don't work in forum descriptions...i'm not sure about php , if i only know how to put php in html.... any ideas?

i'll keep doing some research. If nothing comes out, i guess i'll have to modified the template...

thanks again

Lynne 04-02-2009 05:32 PM

If the condition doesn't work in the description (and I would guess it doesn't), then you will have to do some sort of template edit or maybe a plugin.


All times are GMT. The time now is 05: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.01139 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete