ID); /* if not yet saved */ if ($status == 'auto-draft') { echo '
You must save a draft first.
'; } else if ($status == "publish") { $url = urlencode(get_permalink($post->ID)); } else { $url = urlencode(apply_filters('preview_post_link', add_query_arg('arkayne_preview', $post->ID, add_query_arg('preview', 'true', get_permalink($post->ID))))); } if ($url) { /* Grep the token for the current post */ list($temp_num, $temp_string) = split('-', arkayne_token($post->ID), 2); $seo_token = $temp_num . '-' . md5($temp_string); if (get_option('arkayne_show_seo') == 'TRUE') { echo ''; } } } function add_arkayne_seo_box() { if (get_option('arkayne_show_seo') == 'TRUE') { add_meta_box('arkayne-seo-box', 'BlogGlue Toolbox', 'show_arkayne_meta_box', 'post', 'side', 'high'); add_meta_box('arkayne-seo-box', 'BlogGlue Toolbox', 'show_arkayne_meta_box', 'page', 'side', 'high'); } } if (is_admin()) add_action('admin_menu', 'add_arkayne_seo_box'); /* Handle Preview Draft Issue */ class Arkayne_Preview { var $id; function Arkayne_Preview() { if (!is_admin()) add_action('init', array(&$this, 'show_arkayne_preview')); } function arkayne_publish($posts) { $posts[0]->post_status = 'publish'; return $posts; } function show_arkayne_preview() { if (!is_admin() && isset($_GET['preview']) && isset($_GET['arkayne_preview']) ) { $this->id = (int) $_GET['arkayne_preview']; add_filter('posts_results', array(&$this, 'arkayne_publish')); } } } $arkayne_preview = new Arkayne_Preview(); ?>