The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Auto-assign thread prefix when posting a new thread
Evening all,
I was wondering if there's a method of automatically assigning a thread prefix to a new thread when it is submitted. I don't want the user to select a prefix, I want a default one to be assigned. Reason: I'm creating a forum with 3 prefixes. Accepted, Rejected and Pending. I want "Pending" to be appended onto any thread that is submitted in that forum so I can sort through the pending/accepted/rejected by sorting the prefixes. I am guessing it would be possible on the newthread_complete hook; however any help is greatly appreciated. Thanks. |
#2
|
||||
|
||||
Yeah, I'd use a hook and add it in there. I would use newthead_post_complete hook as you suggested since it is after the prefix would be defined for the thread (so you can over-ride what is entered) and before the post is saved. You can read the code right before that hook to see how to set it.
|
#3
|
|||
|
|||
Hello again,
I have the following code: PHP Code:
Line 443 is: PHP Code:
The hook I am using is line 271 and the $newpost['prefixid'] is defined on line 170: PHP Code:
Thanks again. EDIT: I have made sure that the prefix is assigned to that forum, so the issue isn't that the prefix isn't there. |
#4
|
||||
|
||||
Whoops... I just took another look and the post is actually guild on line 213 (how did I miss that?), so you need to set it prior to that line, so I guess newthread_post_start instead.
|
#5
|
|||
|
|||
Thanks for your reply Lynne. I still have the issue of the prefix not appending though. Using the same above code.
There doesn't seem to be a variable for the prefix before line 143 (the hook)? Except in the phrasegroups. I will have another look around, thanks for anything you can dig up though. |
#6
|
||||
|
||||
If you use newthread_post_start, then you actually will have to do something like this so it doesn't get overwritten (add your condition):
PHP Code:
|
#7
|
|||
|
|||
Thanks Lynne!
I do have another issue however: If I have set regular users not able to use prefixes in that forum, it doesn't append a prefix. Any way around this? |
#8
|
||||
|
||||
Try this (with your condition around it)...
PHP Code:
This way, the prefixid gets set here, and then it can be rewritten later on if they have privs. If they don't have privs, it doesn't get set in that other line, but you made sure it was set here anyway. Hopefully that works. |
#9
|
|||
|
|||
Thanks Lynne! You're truly a star
|
#10
|
||||
|
||||
Glad you got it working!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|