2003-05-23 04:29:51 -04:00
< div class = " wrap " >
2003-05-22 08:12:53 -04:00
< ? php
2003-06-01 10:49:30 -04:00
function selected ( $selected , $current ) {
if ( $selected == $current ) echo ' selected="selected"' ;
}
2003-05-22 08:12:53 -04:00
switch ( $action ) {
2003-05-23 04:29:51 -04:00
case 'post' :
$submitbutton_text = 'Blog this!' ;
$toprow_title = 'New Post' ;
$form_action = 'post' ;
$form_extra = '' ;
2003-05-22 08:12:53 -04:00
if ( $use_pingback ) {
2003-06-12 18:47:21 -04:00
$form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" ' ;
if ( $post_pingback ) $form_pingback .= 'checked="checked" ' ;
2003-08-12 19:07:38 -04:00
$form_pingback .= 'tabindex="7" id="pingback" /> <label for="pingback"><strong>PingBack</strong> the <acronym title="Uniform Resource Locators">URL</acronym>s in this post</label> <a href="http://wordpress.org/docs/reference/post/#pingback" title="Help on Pingbacks">?</a><br />' ;
2003-05-22 08:12:53 -04:00
} else {
$form_pingback = '' ;
}
if ( $use_trackback ) {
2003-08-12 19:07:38 -04:00
$form_trackback = ' < p >< label for = " trackback " >< a href = " http://wordpress.org/docs/reference/post/#trackback " title = " Help on trackbacks " >< strong > TrackBack </ strong > an < acronym title = " Uniform Resource Locator " > URL </ acronym ></ a >:</ label > ( Separate multiple < acronym title = " Uniform Resource Locator " > URL </ acronym > s with commas . ) < br />
2003-06-11 02:09:28 -04:00
< input type = " text " name = " trackback_url " style = " width: 415px " id = " trackback " tabindex = " 7 " /></ p > ' ;
2003-05-22 08:12:53 -04:00
} else {
$form_trackback = '' ;
}
$colspan = 3 ;
break ;
case " edit " :
2003-05-23 04:29:51 -04:00
$submitbutton_text = 'Edit this!' ;
2003-06-10 15:28:03 -04:00
$toprow_title = 'Editing Post #' . $postdata [ 'ID' ];
2003-05-23 04:29:51 -04:00
$form_action = 'editpost' ;
$form_extra = " ' /> \n <input type='hidden' name='post_ID' value=' $post " ;
2003-05-22 08:12:53 -04:00
$colspan = 2 ;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />' ;
2003-06-06 19:21:45 -04:00
$form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post_status . '" />' ;
2003-05-22 08:12:53 -04:00
$form_trackback = '' ;
break ;
case " editcomment " :
2003-05-23 04:29:51 -04:00
$submitbutton_text = 'Edit this!' ;
2003-06-10 15:28:03 -04:00
$toprow_title = 'Editing Comment # ' . $commentdata [ 'comment_ID' ];
2003-05-23 04:29:51 -04:00
$form_action = 'editedcomment' ;
$form_extra = " ' /> \n <input type='hidden' name='comment_ID' value=' $comment ' /> \n <input type='hidden' name='comment_post_ID' value=' " . $commentdata [ " comment_post_ID " ];
2003-05-22 08:12:53 -04:00
$colspan = 3 ;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />' ;
$form_trackback = '' ;
break ;
}
?>
2003-06-11 02:09:28 -04:00
< form name = " post " action = " b2edit.php " method = " post " id = " post " >
2003-05-22 08:12:53 -04:00
< input type = " hidden " name = " user_ID " value = " <?php echo $user_ID ?> " />
2003-05-23 04:29:51 -04:00
< input type = " hidden " name = " action " value = '<?php echo $form_action . $form_extra ?>' />
2003-05-22 08:12:53 -04:00
< ? php if ( $action != " editcomment " ) {
// this is for everything but comment editing
2003-05-23 04:29:51 -04:00
?>
2003-06-11 02:09:28 -04:00
< script type = " text/javascript " >
function focusit () {
// focus on first input field
document . post . title . focus ();
}
window . onload = focusit ;
</ script >
2003-08-15 11:12:25 -04:00
< div id = " titlediv " >
2003-08-12 19:07:38 -04:00
< label for = " title " >< a href = " http://wordpress.org/docs/reference/post/#title " title = " Help on titles " > Title </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< input type = " text " name = " post_title " size = " 25 " tabindex = " 1 " style = " width: 190px; " value = " <?php echo $edited_post_title ; ?> " id = " title " />
2003-08-15 11:12:25 -04:00
</ div >
< div id = " categorydiv " >
2003-08-12 19:07:38 -04:00
< label for = " category " >< a href = " http://wordpress.org/docs/reference/post/#category " title = " Help on categories " > Category </ a >:</ label >
< br />
2003-06-12 18:47:21 -04:00
< ? php dropdown_categories ( $blog_ID , $default_post_cat ); ?>
2003-08-15 11:12:25 -04:00
</ div >
< div id = " poststatusdiv " >
2003-08-12 19:07:38 -04:00
< label for = " post_status " >< a href = " http://wordpress.org/docs/reference/post/#post_status " title = " Help on post status " > Post
Status </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< select name = " post_status " id = " post_status " >
< option value = " publish " < ? php selected ( $post_status , 'publish' ); ?> >Publish</option>
< option value = " draft " < ? php selected ( $post_status , 'draft' ); ?> >Draft</option>
< option value = " private " < ? php selected ( $post_status , 'private' ); ?> >Private</option>
</ select >
2003-08-15 11:12:25 -04:00
</ div >
< div id = " commentstatusdiv " >
2003-08-12 19:07:38 -04:00
< label for = " comment_status " >< a href = " http://wordpress.org/docs/reference/post/#comments " title = " Help on comment status " > Comments </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< select name = " comment_status " id = " comment_status " >
< option value = " open " < ? php selected ( $comment_status , 'open' ); ?> >Open</option>
< option value = " closed " < ? php selected ( $comment_status , 'closed' ); ?> >Closed</option>
</ select >
2003-08-15 11:12:25 -04:00
</ div >
< div id = " pingstatusdiv " >
2003-08-12 19:07:38 -04:00
< label for = " ping_status " >< a href = " http://wordpress.org/docs/reference/post/#pings " title = " Help on ping status " > Pings </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< select name = " ping_status " id = " ping_status " >
< option value = " open " < ? php selected ( $ping_status , 'open' ); ?> >Open</option>
2003-06-12 18:47:21 -04:00
< option value = " closed " < ? php selected ( $ping_status , 'closed' ); ?> >Closed</option>
2003-06-10 15:28:03 -04:00
</ select >
2003-08-15 11:12:25 -04:00
</ div >
< div id = " postpassworddiv " >
2003-08-12 19:07:38 -04:00
< label for = " post_password " >< a href = " http://wordpress.org/docs/reference/post/#post_password " title = " Help on post password " > Post
Password </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< input name = " post_password " type = " text " id = " post_password " value = " <?php echo $post_password ?> " />
2003-08-15 11:12:25 -04:00
</ div >
< br clear = " all " />
2003-06-10 15:28:03 -04:00
< ? php
2003-05-22 08:12:53 -04:00
} else {
// this is for comment editing
2003-05-23 04:29:51 -04:00
?>
2003-06-11 02:09:28 -04:00
< script type = " text/javascript " >
function focusit () {
// focus on first input field
document . post . name . focus ();
}
window . onload = focusit ;
</ script >
2003-05-23 04:29:51 -04:00
< table >
< tr >
2003-05-22 08:12:53 -04:00
< td >
2003-06-10 15:28:03 -04:00
< label for = " name " > Name :</ label >< br />
< input type = " text " name = " newcomment_author " size = " 22 " value = " <?php echo format_to_edit( $commentdata['comment_author'] ) ?> " tabindex = " 1 " id = " name " /></ td >
2003-05-22 08:12:53 -04:00
< td >
2003-06-10 15:28:03 -04:00
< label for = " email " > E - mail :</ label >< br />
< input type = " text " name = " newcomment_author_email " size = " 30 " value = " <?php echo format_to_edit( $commentdata['comment_author_email'] ) ?> " tabindex = " 2 " id = " email " />
</ td >
2003-05-22 08:12:53 -04:00
< td >
2003-06-10 15:28:03 -04:00
< label for = " URL " > URL :</ label >< br />
< input type = " text " name = " newcomment_author_url " size = " 35 " value = " <?php echo format_to_edit( $commentdata['comment_author_url'] ) ?> " tabindex = " 3 " id = " URL " />
</ td >
2003-05-23 04:29:51 -04:00
</ tr >
</ table >
2003-06-10 15:28:03 -04:00
< ? php
2003-05-22 08:12:53 -04:00
} // end else comment editing
2003-06-10 15:28:03 -04:00
?>
2003-05-23 04:29:51 -04:00
2003-05-22 08:12:53 -04:00
< ? php
if ( $action != 'editcomment' ) {
?>
2003-08-12 19:07:38 -04:00
< p >< label for = " excerpt " >< a href = " http://wordpress.org/docs/reference/post/#excerpt " title = " Help with excerpts " > Excerpt </ a >:</ label >
< br />
2003-06-10 15:28:03 -04:00
< textarea rows = " 3 " cols = " 40 " style = " width:100% " name = " excerpt " tabindex = " 4 " wrap = " virtual " id = " excerpt " >< ? php echo $excerpt ?> </textarea></p>
2003-05-22 08:12:53 -04:00
2003-05-23 04:29:51 -04:00
< ? php
} // if not a comment
?>
< table width = " 100% " >
< tr >
< td >
2003-05-22 08:12:53 -04:00
< ? php
if ( $action != 'editcomment' ) {
2003-08-12 19:07:38 -04:00
echo '<label for="content"><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a>:</label>' ;
2003-05-22 08:12:53 -04:00
} else {
2003-06-10 15:28:03 -04:00
echo '<label for="content">Comment:</label>' ;
2003-05-22 08:12:53 -04:00
}
?>
2003-05-23 04:29:51 -04:00
</ td >
2003-08-15 12:23:04 -04:00
< td id = " quicktags " >
2003-08-14 19:11:01 -04:00
< ? php
if ( $use_quicktags ) {
2003-08-12 19:07:38 -04:00
echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: ' ;
2003-08-15 11:15:37 -04:00
include ( 'wp-quicktags.php' );
2003-08-14 19:11:01 -04:00
}
2003-05-23 04:29:51 -04:00
?>
</ td >
</ tr >
2003-05-22 08:12:53 -04:00
</ table >
2003-08-03 19:45:11 -04:00
< ? php
$rows = get_settings ( 'default_post_edit_rows' );
if (( $rows < 3 ) || ( $rows > 100 )) {
$rows = 9 ;
}
?>
< textarea rows = " <?php echo $rows ; ?> " cols = " 40 " style = " width:100% " name = " content " tabindex = " 4 " wrap = " virtual " id = " content " >< ? php echo $content ?> </textarea><br />
2003-08-05 18:44:38 -04:00
< ? php
2003-08-14 19:11:01 -04:00
if ( $use_quicktags ) {
?>
< script language = " JavaScript " >
<!--
edCanvas = document . getElementById ( 'content' );
//-->
</ script >
< ? php
}
if ( get_settings ( 'use_geo_positions' )) {
2003-08-05 18:44:38 -04:00
?>
2003-08-12 19:07:38 -04:00
< label for = " post_latf " > Latitude :</ label >< input size = " 8 " type = " text " value = " <?php echo $edited_lat ; ?> " name = " post_latf " >& nbsp ;
2003-08-15 12:23:04 -04:00
< label for = " post_lonf " > Longitude :</ label >< input size = " 8 " type = " text " value = " <?php echo $edited_lon ; ?> " name = " post_lonf " >& nbsp ; < a href = " http://www.geourl.org/resources.html " rel = " external " > click for Geo Info </ a >
2003-08-05 18:44:38 -04:00
< br >
< ?
2003-08-14 19:11:01 -04:00
}
2003-08-05 18:44:38 -04:00
?>
2003-05-22 08:12:53 -04:00
< ? php echo $form_pingback ?>
2003-06-06 19:21:45 -04:00
< ? php echo $form_prevstatus ?>
2003-05-22 08:12:53 -04:00
2003-06-11 02:09:28 -04:00
< p >< input type = " submit " name = " submit " value = " <?php echo $submitbutton_text ?> " class = " search " style = " font-weight: bold; " tabindex = " 6 " /></ p >
2003-05-22 08:12:53 -04:00
< ? php if ( ( $use_fileupload ) && ( $user_level >= $fileupload_minlevel ) && (( ereg ( " " . $user_login . " " , $fileupload_allowedusers )) || ( trim ( $fileupload_allowedusers ) == " " )) ) { ?>
< input type = " button " value = " upload a file/image " onclick = " launchupload(); " class = " search " tabindex = " 10 " />
< ? php }
echo $form_trackback ;
// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
2003-05-23 04:29:51 -04:00
// if (($user_level > 4) && ($action != "post"))
2003-05-22 08:12:53 -04:00
if ( $user_level > 4 ) {
2003-05-23 04:29:51 -04:00
touch_time (( $action == 'edit' ));
2003-05-22 08:12:53 -04:00
}
2003-06-01 10:49:30 -04:00
if ( 'edit' == $action ) echo "
< p >< a href = 'b2edit.php?action=delete&post=$post' onclick = \ " return confirm('You are about to delete this post \ ' " . $edited_post_title . " \ ' \\ n \ 'Cancel \ ' to stop, \ 'OK \ ' to delete.') \" >Delete this post</a></p> " ;
2003-05-22 08:12:53 -04:00
?>
</ form >
2003-05-23 04:29:51 -04:00
</ div >