The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Scan New Posts For Hide Tags
Im using a hide hack on my forum & its hard to make members use it, especially new members.
So is there anychance a coder could knock up a quick lil script, that scans a members post for [HIDE] tags when they click 'Submit New Thread'. If there's no hide tags in the message area, the member gets a error saying 'You must use hide tags in your message' & their post does not get submitted. I've just found another site that uses something like this, check the attached screen. Thanks |
#2
|
||||
|
||||
OMG why would you force someone to use HIDE tags if they don't want to? If you don't want non-members viewing threads you can set the permissions to keep them out.
|
#3
|
|||
|
|||
Thats the rules on my site. You hide a part of the thread, members reply & then can see the unhidden content.
Anyway all thats sorted my hide hack works perfectly, i just need a script that checks if the member has used them & gives a error if they havent. Like i stated in the first post^^^ Would that be somthing you could take a look at BirdOPrey5 |
#4
|
||||
|
||||
I could code the part where it would look for the "[HIDE]" tag no problem, but getting it to return an error instead of post is still beyond me at the moment...
|
#5
|
|||
|
|||
OK Try this:
1. Create a phrase for your error message text and for Phrase Type choose "Error Messages". Let's say the varname is must_use_hide (or if you use something else, also change it in the code below). 2. Create a plugin using the newpost_process hook with this code: PHP Code:
|
#6
|
||||
|
||||
I'm sure your method is more efficient, I was just going to search for the closing tag because if they use that they probably use the opening too but your implementation is better.
|
#7
|
|||
|
|||
Thanks guys for taking a look...
kh99 that works great m8 , but how do you add more of these: ''|\[HIDE].+\[/HIDE]|',' Because right now i have to use the hide in caps like in the code above. Is it possible to add: [hide] [hiDE] One last thing, how can i use it only in a certain set of forums, not every forum. Thanks again m8, gud stuff... |
#8
|
|||
|
|||
For the hide, HiDe, etc issue, you just need to add an 'i' at the end of the pattern. You have access to the $foruminfo, so if you want to do it only for certain forums you can check $foruminfo['forumid']. There was one other problem in the above: newpost_process is actually called for all posts and not just new threads, so there needs to be a check for that.
PHP Code:
|
#9
|
|||
|
|||
Thanks a million kh99, that worked perfect m8...
That'll save me & my mods a lot of time editing posts... |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|