The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Thread title only alphanumeric and space
hi...
could someone help me to make the thread title in every new thread can only use "alphanumeric and space" ? i dont want any special character in the thread title. thanks alot |
#2
|
|||
|
|||
Create a new plugin using hook location newpost_process and this code:
PHP Code:
|
#3
|
|||
|
|||
thank you very2 much
|
#4
|
|||
|
|||
Quote:
OR code should be modified to PHP Code:
Because the present code will check for new reply also. and generally new reply title are like this Code:
Re: //title |
#5
|
|||
|
|||
Quote:
Checking for $type == 'thread' will allow any characters in reply titles, but the OP does specifically say "thread titles", so maybe that's OK. Gripi, sorry for any problems this may have caused on your forum. Edit: I also figured out that it only quotes the title with "Re:" if you have set the "Automatically Quote Post / Thread Title" to true, otherwise title is blank by default (which also caused a problem since the pattern didn't allow blank titles). So I have the following suggestion (using newpost_process): PHP Code:
|
#6
|
|||
|
|||
Quote:
PHP Code:
For newthread_post_start hook we need to modify the code to this PHP Code:
|
#7
|
|||
|
|||
once again thanks, i'm thinking to put the code in the beta forum this monday, i will let you know if the code works or not.
|
#8
|
|||
|
|||
Hi again...
could you please tell me how to automaticly remove any character beside alphanumeric and space in the title when someone post a new thread or a new post? i dont want any warning error msg, just submit the post / thread to database, and remove any ilegal character. thanks --------------- Added [DATE]1319275153[/DATE] at [TIME]1319275153[/TIME] --------------- and is it possible to make the plugin to work like this: not just allowing alphanumeric and space, but remove character that i choose. |
#9
|
|||
|
|||
If you want to replace any non-alphanumeric or space chars you can use preg_replace() like:
PHP Code:
$replace is a space in that example, you can make it a null string if you want to delete the char instead. If you want to only eliminate one or a set of chars you could change $pattern to a list of the chars to delete, like: PHP Code:
|
Благодарность от: | ||
Simon Lloyd |
#10
|
|||
|
|||
thank you
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|