I have been looking at datamanagers and trying to write a custom one based upon Alan@CIT's
article .
I have been looking at the simplest datamanager in vbulletin which seems to be class_dm_announcement.php and have the following question which i hope to have answered by someone as the following issue makes no sense to me...
In looking at the class file, the $validfields array is as follows:
PHP Code:
var $validfields = array(
'announcementid' => array(TYPE_UINT, REQ_INCR, 'return ($data > 0);'),
'forumid' => array(TYPE_INT, REQ_YES, VF_METHOD),
'userid' => array(TYPE_UINT, REQ_YES, VF_METHOD),
'title' => array(TYPE_STR, REQ_YES, 'return ($data != \'\');'),
'pagetext' => array(TYPE_STR, REQ_YES, 'return ($data != \'\');'),
'startdate' => array(TYPE_UNIXTIME, REQ_YES),
'enddate' => array(TYPE_UNIXTIME, REQ_YES),
'views' => array(TYPE_UINT, REQ_NO),
'allowhtml' => array(TYPE_BOOL, REQ_NO),
'allowbbcode' => array(TYPE_BOOL, REQ_NO),
'allowsmilies' => array(TYPE_BOOL, REQ_NO),
'announcementoptions' => array(TYPE_UINT, REQ_NO)
);
The table which is declared is
PHP Code:
var $table = 'announcement';
And the fields in the table `announcement` are as follows:
Code:
announcementid
title
userid
startdate
enddate
pagetext
forumid
views
announcementoptions
Now, the thing that is confusing me is the following...
Since the class needs considers 'allowhtml', 'allowbbcode', and 'allowsmilies' valid fields, but since the fields do not exist within the announcement table, how does the class use these fields to get the data into the post table?
Also, how does the class know to utilize any other table than announcement?