post_status == 'draft') {
// the dropdown categories need $post_id to be set, and it is
// never set on this screen, so we set it then unset
// it again to stay safe.
$checked_categories = wp_get_post_categories($post->ID);
// echor($checked_categories);
// set up some js for each category section to have a trigger
?>
';
echo ' \n";
echo '
\n";
echo '
'."\n";
echo '
ID '.$post->ID."
\n";
if (get_post_meta($post->ID, 'syndication_source_uri'))
echo "\t".'
\n";
echo '
Posted by: '.get_author_name($post->post_author)."
\n";
echo '
Categories: ';
foreach (wp_get_post_categories($post->ID) as $categories => $category) {
echo '';echo get_cat_name($category);echo ", \n";
}
echo '';the_date(); echo " - ";the_time();echo "
\n";
echo "
\n";
if ($_GET['post_status'] == 'draft') {
the_content();
} else {
gv_display_manual_excerpt_admin();
}
echo '
';
// }
}
}
// add a management function only when we are in the admin.
if (is_admin()) {
add_action('init', 'gv_manage_posts');
}
function gv_manage_posts() {
global $wpdb;
//echor($_POST);
if ($_POST['gv_manage_post_id']) :
$old_post = get_post($_POST['gv_manage_post_id']);
$guid = $old_post->guid;
$id = $old_post->ID;
$postarr = array();
$postarr['ID'] = $_POST['gv_manage_post_id'];
if ($_POST['post_category'])
$postarr['post_category'] = $_POST['post_category'];
if ($_POST['gv_publish_post']) :
$postarr['post_status'] = 'publish';
$postarr['post_date'] = current_time('mysql');
endif;
if ($_POST['gv_reject_post']) :
$postarr['post_status'] = 'pending';
$postarr['post_date'] = 0;
endif;
wp_update_post($postarr);
// reset the guid to hte old one so FWP doesn't get confooooosad.
$result = $wpdb->query("
UPDATE $wpdb->posts
SET guid='$guid'
WHERE ID='$id'
");
endif; // end if gv_manage_post_id
}
// some temporary css definitions
add_action('admin_head', 'gv_temp_admin_css');
function gv_temp_admin_css() {
?>
post_content);
$excerpt = substr($excerpt,0,$length).'...';
echo $excerpt;
}
?>