hello, i tried that but unsuccessful
add_action( 'bb_insert_post', 'edit_post_attributes_save',8);
add_action('post_form','edit_post_attributes_form',8);
function edit_post_attributes_save() {
global $edit_post_attributes;
global $bbdb, $bb_cache; $fields=array(); $topic_fields=array();
$bb_post=bb_get_post($post_id);
if (!empty($_POST['poster_login'])) {
$poster_login=sanitize_user($_POST['poster_login']);
$poster_id = intval($bbdb->get_var( $bbdb->prepare("SELECT ID FROM $bbdb->users WHERE user_login = %s", $poster_login ) ) );
if (!empty($poster_id) && $poster_id!=$bb_post->poster_id) {$fields[]="poster_id";}
}
if (!empty($fields)) {
$bbdb->insert( $bbdb->posts, compact( $fields ), compact( 'post_id' ) );
}
}
what it is doing inserting an two post in database one with the uid i entered,i know the part in bold should be something else,can you help on it
i have made a mod for mybb forum software for a same feature i needed in mybb
$plugins->add_hook('datahandler_post_insert_post', 'admin_newreply');
function admin_newreply(&$insert_data)
{
$insert_data->post_insert_data['uid'] = $fakeuid;
$insert_data->post_insert_data['username'] = $fakeusername;
}
in mybb i am just attaching my values to the default data handler by using hooks
can you guide me, how can i pass my values to bbpress datahandler