The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Default Prefix (Without Dropdown menu)
Something my users are complaining about is the extra step on Prefixes while creating a Thread
What if only 1 Prefix is available and it is Required.. They still have to click on dropdown and choose. Is there to bypass this timewaste extra step? |
#2
|
||||
|
||||
There is no default method to bypass this. I suppose you may be able to write a plugin that checks to see if there is a prefix selected and if not then use prefix xxxxx . It just doesn't sound like a scenario that would happen though - why only have one prefix in a forum?
|
#3
|
|||
|
|||
Only 1 for the purpose of having an overview, example in the Request section [REQ] only. It would be a timesaver to have at default set. So that the Thread would look like "[REQ]Diary of Mr. Shntzekn poem" as example.
I really wish there would be such a default function in the feature as Im sure alot of people would want it aswell |
#4
|
||||
|
||||
Why use a prefix for that? Why not just write a plugin for all thread titles in that forum to add "[REQ] " at the beginning?
|
#5
|
|||
|
|||
Lynne has a good point, but I thought I'd look at it anyway. Here's the code for a plugin using hook newthread_form_complete that changes the prefix dropdown to a hidden field if there's only one option and a prefix is required:
PHP Code:
|
#6
|
|||
|
|||
Thank you very much kh99 and Lynne for answering my questions and helping out! ,
I mean its also usefull even if its not only 1 Prefix, but I mean it is also usefull to have 1 default one set while making a thread, instead of showing "choose a prefix". I just see the code kh99 but I am unsure how I implement it into my forum? As I would really love to use the plugin you wrote... Do I need to setup an xml file first for it? |
#7
|
|||
|
|||
Quote:
- Choose newthread_form_complete from the hook location drop-down - Enter a title so that later you'll remember what it does - Paste the code in the large box - Click the "Yes" radio button and hit save BTW, if you want to have the prefix selected instead of hiding the prefix, you can use this: Code:
if ($foruminfo['options'] & $vbulletin->bf_misc_forumoptions['prefixrequired']) { if (preg_match_all('#<option value="([A-Za-z0-9_]+)"#', $prefix_options, $matches) == 1) { $prefix_options = preg_replace('#<option value="([A-Za-z0-9_]+)"#', '\\0 selected="selected"', $prefix_options); } } That only selects one if there's only one and it's required, but you could modify it of course. |
#8
|
|||
|
|||
Thanks it worked like a charm! I really apreciate your help!
, may I ask how I can disable my new plugin? as it is not listed on the manage Products |
#9
|
|||
|
|||
If you visit the "Plugin Manager" you can disable plugins individually.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|