The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Validation PHP Code in Setting
This is driving me nuts.
Does anyone know how to use the Validation PHP Code box in a product setting? I have a setting field as positive integer which I want to check if the size is in between 32 and 100. If this returns false, I want to set a default value to be used in the product. Would I have to initiate a plugin for this or is there an easy way to validate its size? Example: PHP Code:
|
#2
|
||||
|
||||
The variable $data is used. As the verification is done through AJAX and only a true/false response is sent, I do not think there's a way (with the default vBulletin system) to override a setting through the verification system.
|
#3
|
|||
|
|||
Enter
Code:
return ($data >= 32 AND $data <= 100); |
#4
|
||||
|
||||
Quote:
yet it still allows saving and returning the $data. Ive also tried hooking the admin_options_processing to attempt to check the value and return default if not 32><100 but I must be missing something. Would using the admins_options_processing enable me to rewrite the $data value before its saved to the database or would I have to write my own query? |
#5
|
||||
|
||||
As you've said yourself, you will need to intercept the value before it is saved into the database.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|