'; // The actual fields for data entry echo '' . __("Select Input", 'myplugin_textdomain' ) . ' '; ?> Select get_results( "SELECT * FROM $ntable_name" ); foreach ($awardrows as $awardrows) { if($aw == $awardrows->blog_ID){ ?> blog_shortname; ?> blog_shortname; ?> '; } /* Prints the edit form for pre-WordPress 2.5 post/page */ function myplugin_old_custom_box() { echo '' . "\n"; echo '' . "\n"; echo '' . __( 'Select Input', 'myplugin_textdomain' ) . ""; echo ''; // output editing form myplugin_inner_custom_box(); // end wrapper echo "\n"; } /* When the post is saved, saves our custom data */ function myplugin_save_postdata( $post_id ) { // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename(__FILE__) )) { return $post_id; } // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want // to do anything if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; // Check permissions if ( 'post' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_post', $post_id ) ) return $post_id; } // OK, we're authenticated: we need to find and save the data $mydata = $_POST['awname']; if(get_post_meta($post_id, '_award') == "") add_post_meta($post_id, '_award', $mydata, true); elseif($mydata != get_post_meta($post_id, 'award', true)) update_post_meta($post_id, '_award', $mydata); elseif($mydata == "") delete_post_meta($post_id, '_award', get_post_meta($post_id, '_award', true)); // Do something with $mydata // probably using add_post_meta(), update_post_meta(), or // a custom table (see Further Reading section below) return $mydata; } ?>