The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Add methode to class in constructor?
Hello,
I'd like to extend the forum dm. It's easy to add new fields within the "forumdata_start" hook, but I also want to include a verify method. When I add "function verify_fieldname" and "$this->validfields['fieldname'] = array(TYPE_STR, REQ_NO, VF_METHOD);" to "forumdata_start", I get an error, that "verify_fieldname" wasn't found... Any hint? |
#2
|
||||
|
||||
I don't think you can use vfmethod for custom fields added to datamanagers unless a function already exists. I get around this problem by checking validation using php like follows:
PHP Code:
|
#3
|
|||
|
|||
Your solution doesn't work for me.
To check the data, I need to access some DM ressources |
#4
|
|||
|
|||
Are you sure? Make sure you changed it appropriately. If you want to do a more complicated check you could define a function outside the class using another Plugin then use that function in the custom check field.
PHP Code:
|
#5
|
|||
|
|||
That's working - that's what Antivirus said and what I also tried.
But the problem is, that "mycustom_check" can't access class ressources. If the check will fail, I cannot use "$this->error()" for example. |
#6
|
|||
|
|||
Well then but the contents of mycustom_check directly inside the string instead, does that not work?
like: PHP Code:
Or: PHP Code:
What are you checking for/validating for? Is there not already a validation method in the Base Datamanager? |
#7
|
|||
|
|||
Thanks. Nice idea.
In the actual case, that will solve my problem. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|