The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Check usergroup of thread starters in threadbit
I'm looking for an if condition that can check for the usergroup of the thread starter for each thread in the thread list via the threadbit template.
In posts I show certain content in the postbit_legacy template that only shows if the thread starter is in a certain usergroup. For that I use the following condition (where 60 would be the usergroup id) Code:
<vb:if condition="is_member_of($post, 60)"> Show content here </vb:if> Just edited this, I just need a thread starter conditional for the threadbit template. |
#2
|
|||
|
|||
Anyone?
|
#3
|
|||
|
|||
Try using $thread['usergroupid']. I don't know how it gets there, but it looks like it's there.
|
#4
|
|||
|
|||
That's actually pulling the usergroup ID of the last post... for some reason. Instead of the thread starter.
|
#6
|
|||
|
|||
Hmm that makes sense. Unfortunately all I know for php and vb coding is if-else conditions lol, learning though. Can you give me some guidance on how to accomplish the usergroup check via a bulletin, so i can use a condition in the threadbit template for it?
|
#7
|
||||
|
||||
Try this everywhere in threadbit template: <vb:if condition="$thread['usergroupid'] == 60">Your text here</vb:if>
|
#8
|
|||
|
|||
We already tried that suggestion (via a post above), unfortunately that checks the usergroup of the last poster, not the thread starter.
|
#9
|
||||
|
||||
Unfortunately, looking at the query shows me the there is a JOIN with the user table based on the lastposterid, not the postuserid. This means you would need to write a query to find out the usergroup. That is one query per thread listed. It's a simple query which will probably be just fine on a non-busy site or one that is not on an overloaded shared server, but it's something you should think about.
|
#10
|
|||
|
|||
I'm not a php guru dude at all, I just have a vague understanding of the basics and can only write the most basic of code (like I'll go back and forth from dreamweaver to php.net copy/pasting etc ) but i do understand what you mean.
There is not ANY data available in threadbit besides the username of the threadstarter? Wouldn't it be simple enough just to add each username to an array, then check all the usernames in the array and and assign their usergroups with one query, before each individual thread is loaded? Like I said I don't know too much about PHP and wouldn't know how to create such a function, but since the username is available and there are no duplicate usernames in the db couldn't it be done by creating one array and executing one query with it? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|