[ Index ]

WordPress Source Cross Reference

title

Body

[close]

/wp-admin/ -> post-new.php (source)

   1  <?php
   2  require_once ('admin.php');
   3  $title = __('Create New Post');
   4  $parent_file = 'post-new.php';
   5  $editing = true;
   6  require_once  ('./admin-header.php');
   7  
   8  if ( ! current_user_can('edit_posts') ) { ?>
   9  <div class="wrap">
  10  <p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
  11  You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
  12  When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_settings('admin_email')); ?>
  13  </p>
  14  </div>
  15  <?php
  16      include ('admin-footer.php');
  17      exit();
  18  }
  19  
  20  if ( isset($_GET['posted']) ) : ?>
  21  <div id="message" class="updated fade"><p><?php printf(__('Post saved. <a href="%s">View site &raquo;</a>'), get_bloginfo('home') . '/'); ?></p></div>
  22  <?php
  23  endif;
  24  
  25  if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
  26  <div class="wrap">
  27  <p><strong><?php _e('Your Drafts:') ?></strong>
  28  <?php
  29  // Show drafts.

  30      $num_drafts = count($drafts);
  31      if ( $num_drafts > 15 ) $num_drafts = 15;
  32      for ( $i = 0; $i < $num_drafts; $i++ ) {
  33          $draft = $drafts[$i];
  34          if ( 0 != $i )
  35              echo ', ';
  36          if ( empty($draft->post_title) )
  37              $draft->post_title = sprintf(__('Post # %s'), $draft->ID);
  38          echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
  39      }
  40  
  41      if ( 15 < count($drafts) ) { ?>
  42          , <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> &raquo;</a>
  43      <?php } ?>
  44  .</p>
  45  </div>
  46  <?php
  47  }
  48  
  49  // Show post form.

  50  $post = get_default_post_to_edit();
  51  include ('edit-form-advanced.php');
  52  ?>
  53  
  54  <?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
  55  <div class="wrap">
  56  <h3><?php _e('WordPress bookmarklet'); ?></h3>
  57  <p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
  58  <p>
  59  
  60  <?php
  61  if ($is_NS4 || $is_gecko) {
  62  ?>
  63  <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_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> 
  64  <?php
  65  } else if ($is_winIE) {
  66  ?>
  67  <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
  68  <script type="text/javascript">
  69  <!--
  70  function oneclickbookmarklet(blah) {
  71  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");
  72  }
  73  // -->

  74  </script>
  75  <br />
  76  <br />
  77  <?php _e('One-click bookmarklet:') ?><br />
  78  <a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> 
  79  <?php
  80  } else if ($is_opera) {
  81  ?>
  82  <a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
  83  <?php
  84  } else if ($is_macIE) {
  85  ?>
  86  <a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> 
  87  <?php
  88  }
  89  ?>
  90  </p>
  91  </div>
  92  <?php } ?>
  93  
  94  <?php include ('admin-footer.php'); ?>

Your comment here...

Name: Location:
Comments:


List: Classes | Functions | Variables | Constants | Tables

Generated: Sat Jul 15 11:57:04 2006 Courtesy of Taragana