Log in

View Full Version : validfields problem


Steve123
07-05-2006, 09:58 AM
Hi People,

I am in the process of making a hack for my forums and im trying to do the whole thing using hooks.

I have added a new field to the admincp > edit/add new forums...

I want to do some checking on this feild so i have added the following to the forumdata_start plugin

function verify_event_date(&$event_date)
{
$event_date = "03-03-2006";
return true;
}

$this->validfields['event_date'] = array(TYPE_NOCLEAN, REQ_NO, 'return verify_event_date($event_date);');


In the above funtion i just wanted to see if i can override the value.. so i hard coded "03-03-2006". This is for testing purposes.

For some reason it will not set the new value.

As far as i can see this should work, They even have an example in the vbb manaual that shows it should work.

http://www.vbulletin.com/docs/html/main/data_manager_advanced

Ideas anyone?

THANKS!

NOTE: if i code this into class_dm_forum.php it works so im not to sure where im going wrong.

Steve123
07-06-2006, 10:28 PM
FYI: Seems to work if i use &$data

akanevsky
07-06-2006, 10:30 PM
You should use $data in verify function:

$this->validfields['event_date'] = array(TYPE_NOCLEAN, REQ_NO, 'return verify_event_date($data);');

Steve123
07-06-2006, 10:35 PM
You should use $data in verify function:

$this->validfields['event_date'] = array(TYPE_NOCLEAN, REQ_NO, 'return verify_event_date($data);');


Sure.. I was looking at how it was doing it in the php files.. which is obviously a bit different for hooks :)

thanks

akanevsky
07-06-2006, 10:37 PM
No, it is no different for hooks.