Again, sorry, my knowledge of PHP is limited….. here’s the code I tried to use and it obviously is wrong since I got White Screen of Death til I reverted ??
// The event edit form for the manage events admin page
function wp_events_edit_form($mode='add', $event_id=false)
{
global $wpdb,$users_entries;
$data = false;
if ( $event_id !== false ) {
if ( intval($event_id) != $event_id ) {
echo "<div class=\"error\"><p>".__('Bad event ID','spiffy-calendar')."</p></div>";
return;
} else {
$wpdb->get_results("SELECT * FROM " . WP_SPIFFYCAL_TABLE . " WHERE event_id='" . $event_id . "' LIMIT 1");
if ( empty($data) ) {
echo "<div class=\"error\"><p>".__("An event with that ID couldn't be found",'spiffy-calendar')."</p></div>";
return;
}
$data = $data[0];
}
// Recover users entries if they exist; in other words if editing an event went wrong
if (!empty($users_entries)) {
$data = $users_entries;
}
} else {
// Deal with possibility that form was submitted but not saved due to error - recover user's entries here
$data = $users_entries;
}