Quote:
Originally Posted by Antivirus
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? 
|
Those kinds of options are stored in a single bit field (announcement options)
in pseudo code:
PHP Code:
for each key, val in bitfield_type_of_option in array
$forum_manager->set_bitfield('announcement',key, val)
try starting with this...
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),
'announcementoptions' => array(
'allowhtml' => 0,
'allowbbcode' => 1,
'allowsmilies' => 0,
)
);