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($_POST['post_time']) && $_POST['post_time']!=$bb_post->post_time) {$post_time=trim($_POST['post_time']); $fields[]="post_time";} if (!empty($_POST['post_position']) && $_POST['post_position']!=$bb_post->post_position) {$post_position=intval($_POST['post_position']); $fields[]="post_position";} if (!empty($fields)) { $bbdb->update( $bbdb->posts, compact( $fields ), compact( 'post_id' ) ); $topic_id=$bb_post->topic_id; $fields=array_flip($fields); // faster to check this way $first_post = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE topic_id = $topic_id AND post_status = 0 ORDER BY post_time ASC LIMIT 1"); $first_user = $bbdb->get_var( $bbdb->prepare( "SELECT user_login FROM $bbdb->users WHERE ID = %d", $first_post->poster_id ) ); $last_post = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE topic_id = $topic_id AND post_status = 0 ORDER BY post_time DESC LIMIT 1"); $last_user = $bbdb->get_var( $bbdb->prepare( "SELECT user_login FROM $bbdb->users WHERE ID = %d", $last_post->poster_id ) ); $topic_poster=$first_post->poster_id; $topic_fields[]="topic_poster"; $topic_poster_name=$first_user; $topic_fields[]="topic_poster_name"; $topic_start_time=$first_post->post_time; $topic_fields[]="topic_start_time"; $topic_last_poster=$last_post->poster_id; $topic_fields[]="topic_last_poster"; $topic_last_poster_name=$last_user; $topic_fields[]="topic_last_poster_name"; $topic_time=$last_post->post_time; $topic_fields[]="topic_time"; if (!empty($topic_fields)) { $bbdb->update( $bbdb->topics, compact( $topic_fields ), compact( 'topic_id' ) ); $bb_cache->flush_one( 'topic', $topic_id ); do_action( 'bb_update_topic', $topic_id ); } } } function edit_post_attributes_form() { global $edit_post_attributes; if (!bb_current_user_can($edit_post_attributes['role'])) {return;} global $bb_post; $user=bb_get_user($bb_post->poster_id); print <<Edit Post Attributes
EPAF; } ?>