Something like this:
<?php
class hidden_post_check {
function process_event($event, $userid, $handle, $cookieid, $params) {
switch ($event) {
// when a new question, answer or comment is created. The $params array contains full information about the new post, including its ID in $params['postid'] and textual content in $params['text'].
case 'q_post':
$this->hide_post('Q',$params);
break;
case 'a_post':
$this->hide_post('A',$params);
break;
case 'c_post':
$this->hide_post('C',$params);
break;
}
}
function hide_post($type,$params) {
$type = $type.'_HIDDEN';
qa_db_query_sub(
'UPDATE ^posts SET type=$ WHERE postid=#',
$type,$params['postid']
);
}
}