Settings'; array_unshift($links, $settings_link); return $links; } // ///////////////////////////////////// // //////// DEFINE FUNCTIONS ///////// // ///////////////////////////////////// // build messages function auth_discuss_get_messages(){ $authdiscuss_cap = get_option('author_discussion_capability'); $page_message_limit = get_option('author_discussion_msg_limit'); global $wpdb; $table_name = $wpdb->prefix . "authordiscuss"; $messages = "SELECT * FROM $table_name ORDER BY id DESC LIMIT $page_message_limit"; $messages = $wpdb->get_results($messages); foreach($messages as $row){ //get author info here $auth_name = get_userdata($row->userid); $auth_name = $auth_name->display_name; $time = strtotime($row->time); $time = date('M j, Y g:i A', $time); $message = stripslashes($row->text); $message = apply_filters('the_content', $message); echo '
' . $message; // show delete link echo '
' . $auth_name . '
' . $time; if($row->userid == get_current_user_id()){ echo ' [X]'; } echo '
'; } } // retrieve capability titles function auth_discuss_capability(){ $authdiscuss_cap = get_option('author_discussion_capability'); if($authdiscuss_cap == 'manage_options'){ $authdiscuss_cap = 'Administrator'; }elseif($authdiscuss_cap == 'moderate_comments'){ $authdiscuss_cap = 'Editor and Higher'; }elseif($authdiscuss_cap == 'publish_posts'){ $authdiscuss_cap = 'Author and Higher'; } return $authdiscuss_cap; } // build rightcol function auth_discuss_rightcol(){ echo '

Welcome to the Author Discussion page. This is a public page for anyone granted access. Right now ' . auth_discuss_capability() . ' is granted access to this system.

What\'s new in 0.1.4?

There are future plans to do the following:

These will come as soon as possible. Thanks for your patience!

'; } // build footer function auth_discuss_footer(){ echo ''; } // build input form function auth_discuss_form(){ // settings $editor_settings = array( 'media_buttons' => false, 'textarea_rows' => 6, 'tinymce' => array( 'theme_advanced_buttons1' => 'bold,italic,underline,|,' . 'bullist,blockquote,|,justifyleft,justifycenter' . ',justifyright,justifyfull,|,link,unlink', 'theme_advanced_buttons2' => ''), 'quicktags' => false ); // build form echo '
'; wp_editor('','author_message', $editor_settings); submit_button('Send Message'); echo '
'; }