2 require_once('admin.php');
3 $title = __('Create New Post');
4 $parent_file = 'post-new.php';
6 wp_enqueue_script('prototype');
7 wp_enqueue_script('interface');
8 wp_enqueue_script('autosave');
9 require_once ('./admin-header.php');
11 if ( ! current_user_can('edit_posts') ) { ?>
13 <p><?php printf(__('Since you’re a newcomer, you’ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br />
14 You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
15 When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?>
19 include('admin-footer.php');
23 if ( isset($_GET['posted']) && $_GET['posted'] ) : ?>
24 <div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post »'); ?></a></p></div>
31 $my_drafts = get_users_drafts($user_ID);
32 $pending = get_others_pending($user_ID);
33 $others_drafts = get_others_drafts($user_ID);
35 $nag_posts_limit = (int) apply_filters('nag_posts_limit', 3);
41 'edit.php?post_status=draft&author=' . $user_ID,
45 __('Pending Review:'),
46 'edit.php?post_status=pending',
50 __('Others’ Drafts:'),
51 'edit.php?post_status=draft&author=-' . $user_ID,
52 count($others_drafts))
55 if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) {
56 echo '<div class="wrap" id="draft-nag">';
58 foreach ( $nag_posts as $nag ) {
60 echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> ';
62 foreach ( ${$nag[0]} as $post ) {
64 if ( $i > $nag_posts_limit )
66 echo '<a href="post.php?action=edit&post=' . $post->ID . '">';
67 ( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title();
69 if ( $i < min($nag[3], $nag_posts_limit) )
72 if ( $nag[3] > $nag_posts_limit )
73 printf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit);
84 $post = get_default_post_to_edit();
85 include('edit-form-advanced.php');
88 <?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
89 <div id="wp-bookmarklet" class="wrap">
90 <h3><?php _e('WordPress Bookmarklet'); ?></h3>
91 <p><?php _e('Right click on the following link and choose “Bookmark This Link...” or “Add to Favorites...” to create a posting shortcut.'); ?></p>
95 if ($is_NS4 || $is_gecko) {
97 <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), get_bloginfo('name', 'display')); ?></a>
99 } else if ($is_winIE) {
101 <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_bloginfo('name', 'display')); ?></a>
102 <script type="text/javascript">
104 function oneclickbookmarklet(blah) {
105 window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");
111 <?php _e('One-click bookmarklet:') ?><br />
112 <a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a>
114 } else if ($is_opera) {
116 <a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
118 } else if ($is_macIE) {
120 <a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
128 <?php include('admin-footer.php'); ?>