![]() |
Conditionals. To Display something from a usergroup
Hi All
Thanks for reading i'm no programmer, so i really need anyone's help in this
I hope i won't be redirected to the plugin page cos i'm sure with the many experts here, will be able to provide a useable conditional for this purpose thanks! |
In a thread, if you have a post getting displayed and you only want to display something in that post if the poster is in a certain usergroup:
HTML Code:
<if condition="is_member_of($post, x,y,z)"> |
hi Lynne
thanks! i did use that on the threadbit template but it wouldn't display Code:
<tr> in case if you're wondering what $avatar is, its the plugin that displays posters' avatars in the threadbit thanks! --------------- Added [DATE]1234286343[/DATE] at [TIME]1234286343[/TIME] --------------- this is the plugin code Code:
require_once('./includes/functions_user.php'); |
Where are you trying to show this? The condition I wrote was for posts in the showthread.php page. What page are you trying to modify? (Probably trying $userinfo instead of $post will work.)
|
hi lynne
it is for the threadbit i wish to display the avatars beside the threads in forumdisplay |
I want to show a small GIF image in the upper right hand corner of each post (right above the Join Date), for any user who is a member of a certain user group.
Should I use a modified version of what you recommended above Lynne? If so, should I add this conditional statement in the Postbit template? And how could I then make this image clickable, and send the clicker to a specific link? Thanks in advance as always. :) |
Quote:
PHP Code:
Quote:
|
Quote:
https://vborg.vbsupport.ru/showthread.php?t=204907 |
hi Lynne
thanks again but it still doesn't work. no avatars are displayed at all when i used these: $usergroupid = $thread['usergroupid']; $usergroupid = $usergroup['usergroupid']; $usergroupid = $forum['usergroupid']; here's my plugin code. is there anything wrong with it? Code:
require_once('./includes/functions_user.php'); |
You're grabbing the avatar URL, but not using it? :confused:
|
Hi Dismounted
thanks for the rpely i'm not really sure what you're saying but, the plugin works just fine. it's just that i want to display only avatars from paid subscribers(through their usergroup) but the contionals just doesn't work, i've also added into the plugin, but to no avail. maybe i'm doing it wrongly? |
I could be that the usergroupid is not available at the place you are trying to use it. Or, it has a different name. I didn't go look through the code to find out. Go look and see where $thread is defined and see if the usergroupid was grabbed at the same time in the query. If not, you may have to write a query to grab it based on $thread['userid']
|
Got it.
Would you know of any other plugin or mods residing in the forumdisplay or threadbit which requires the need to grab usergroups? It would help me learn the codes from there As for writing queries, can you point me in the right direction to do so? i'd really love to get the plugin working for my purpose any help is much appreciated! Thanks! Tom |
This is on the forumdisplay.php page, right? You are wanting to put the thread starters avatar next to the thread on the page? But, you only want to display the avatar if the thread starter is a paid subscriber - it has nothing to do with the user *viewing* the page, right?
The query that grabs the thread info is around line 878 of forumdisplay. There is a hook right above it for you to grab the user.usergroupid. You will have to add a join as well as the field. The hook location is 'forumdisplay_query'. |
hi lynne
thanks for the advice! |
I like to know the same thing, any solution?
|
All times are GMT. The time now is 02:01 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|