Read more...

9
urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), 'message' => 1 ), get_edit_post_link( $post_ID, 'url' ) ); else { if ( isset( $_POST['publish'] ) ) { if ( 'pending' == get_post_status( $post_ID ) ) $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); else $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); } else { $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) ); } } } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) { $location = add_query_arg( 'message', 3, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; } elseif (! empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; $location = remove_query_arg('_wp_original_http_referer', $location); if ( false !== strpos($location, 'edit.php') || false !== strpos($location, 'edit-post- drafts.php') ) $location = add_query_arg('posted', $post_ID, $location); elseif ( false !== strpos($location, 'wp-admin') ) $location = "post- new.php?posted=$post_ID"; } elseif ( isset($_POST['publish']) ) { $location = "post-new.php?posted=$post_ID"; } elseif ($action == 'editattachment') { $location = 'attachments.php'; } elseif ( 'post- quickpress-save-cont' == $_POST['action'] ) { $location = "post.php? action=edit&post=$post_ID&message=7"; } else { $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) ); } wp_redirect( $location ); } if ( isset( $_POST['deletepost'] ) ) $action = 'delete'; elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] ) $action = 'preview'; switch($action) { case 'postajaxpost': case 'post': case 'post-quickpress-publish': case 'post- quickpress-save': check_admin_referer('add-post'); if ( 'post-quickpress- publish' == $action ) $_POST['publish'] = 'publish'; // tell write_post() to publish if ( 'post-quickpress-publish' == $action || 'post-quickpress- save' == $action ) { $_POST['comment_status'] = get_option('default_comment_status'); $_POST['ping_status'] = get_option('default_ping_status'); } if ( ! empty( $_POST['quickpress_post_ID'] ) ) { $_POST['post_ID'] = (int) $_POST['quickpress_post_ID']; $post_ID = edit_post(); } else { $post_ID = 'postajaxpost' == $action ? edit_post() : write_post(); } if ( 0 === strpos( $action, 'post-quickpress' ) ) { $_POST['post_ID'] = $post_ID; // output the quickpress dashboard widget require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); wp_dashboard_quick_press(); exit; } redirect_post($post_ID); exit(); break; case 'edit': $editing = true; if ( empty( $_GET['post'] ) ) { wp_redirect("post.php"); exit(); } $post_ID

Transcript of Read more...

Page 1: Read more...

urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), 'message' => 1 ), get_edit_post_link( $post_ID, 'url' ) ); else { if ( isset( $_POST['publish'] ) ) { if ( 'pending' == get_post_status( $post_ID ) ) $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) ); else $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) ); } else { $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) ); } } } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) { $location = add_query_arg( 'message', 3, wp_get_referer() ); $location = explode('#', $location); $location = $location[0] . '#postcustom'; } elseif (!empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; $location = remove_query_arg('_wp_original_http_referer', $location); if ( false !== strpos($location, 'edit.php') || false !== strpos($location, 'edit-post-drafts.php') ) $location = add_query_arg('posted', $post_ID, $location); elseif ( false !== strpos($location, 'wp-admin') ) $location = "post-new.php?posted=$post_ID"; } elseif ( isset($_POST['publish']) ) { $location = "post-new.php?posted=$post_ID"; } elseif ($action == 'editattachment') { $location = 'attachments.php'; } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) { $location = "post.php?action=edit&post=$post_ID&message=7"; } else { $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) ); } wp_redirect( $location ); } if ( isset( $_POST['deletepost'] ) ) $action = 'delete'; elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] ) $action = 'preview'; switch($action) { case 'postajaxpost': case 'post': case 'post-quickpress-publish': case 'post-quickpress-save': check_admin_referer('add-post'); if ( 'post-quickpress-publish' == $action ) $_POST['publish'] = 'publish'; // tell write_post() to publish if ( 'post-quickpress-publish' == $action || 'post-quickpress-save' == $action ) { $_POST['comment_status'] = get_option('default_comment_status'); $_POST['ping_status'] = get_option('default_ping_status'); } if ( !empty( $_POST['quickpress_post_ID'] ) ) { $_POST['post_ID'] = (int) $_POST['quickpress_post_ID']; $post_ID = edit_post(); } else { $post_ID = 'postajaxpost' == $action ? edit_post() : write_post(); } if ( 0 === strpos( $action, 'post-quickpress' ) ) { $_POST['post_ID'] = $post_ID; // output the quickpress dashboard widget require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); wp_dashboard_quick_press(); exit; } redirect_post($post_ID); exit(); break; case 'edit': $editing = true; if ( empty( $_GET['post'] ) ) { wp_redirect("post.php"); exit(); } $post_ID = $p = (int) $_GET['post']; $post = get_post($post_ID); if ( empty($post->ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") ); if ( 'post' != $post->post_type ) { wp_redirect( get_edit_post_link( $post->ID, 'url' ) ); exit(); } wp_enqueue_script('post'); if ( user_can_richedit() ) wp_enqueue_script('editor'); add_thickbox(); wp_enqueue_script('media-upload'); wp_enqueue_script('word-count'); wp_enqueue_script( 'admin-comments' ); enqueue_comment_hotkeys_js(); if ( current_user_can('edit_post', $post_ID) ) { if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); $message = sprintf( __( 'Warning: %s is currently editing this post' ), wp_specialchars( $last_user_name ) ); $message = str_replace( "'", "\'", "

$message

" ); add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else { wp_set_post_lock( $post->ID ); wp_enqueue_script('autosave'); } } $title = __('Edit Post'); if ( !current_user_can('edit_post', $post_ID) ) die ( __('You are not allowed to edit this post.') ); $post = get_post_to_edit($post_ID); include('edit-form-advanced.php'); break; case 'editattachment': $post_id = (int) $_POST['post_ID']; check_admin_referer('update-attachment_' . $post_id); // Don't let these be changed unset($_POST['guid']); $_POST['post_type'] = 'attachment'; // Update the thumbnail filename $newmeta = wp_get_attachment_metadata( $post_id, true ); $newmeta['thumb'] = $_POST['thumb']; wp_update_attachment_metadata( $post_id, $newmeta ); case 'editpost': $post_ID = (int) $_POST['post_ID']; check_admin_referer('update-post_' . $post_ID); $post_ID = edit_post(); redirect_post($post_ID); // Send user on their way while we keep working exit(); break; case 'delete': $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-post_' . $post_id); $post = & get_post($post_id); if ( !current_user_can('delete_post', $post_id) ) wp_die( __('You are not allowed to delete this post.') ); if ( $post->post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id) ) wp_die( __('Error in deleting...') ); } $sendback =

Page 2: Read more...

wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?deleted=1'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); else $sendback = add_query_arg('deleted', 1, $sendback); wp_redirect($sendback); exit(); break; case 'preview': check_admin_referer( 'autosave', 'autosavenonce' ); $url = post_preview(); wp_redirect($url); exit(); break; default: wp_redirect('edit.php'); exit(); break; } // end switch include('admin-footer.php'); ?> /* 0 - 200 =================================== */ td.available-theme { text-align: right; } #current-theme img { float: right; margin-right: 0; margin-left: 1em; } .quicktags, .search { font-family: Tahoma, "Times New Roman"; } /* 200 - 500 =================================== */ #save-post { float: right; } .preview { float: left; } #sticky-span { margin-left: 0; margin-right: 18px; } #post-body .misc-pub-section { border-right-width: 0; border-left-width: 1; border-right-style: none; border-left-style: solid; float: right; } #post-body .misc-pub-section-last { border-left: 0; } #delete-action { text-align: right; float: right; } #publishing-action { text-align: left; float: left; } .side-info ul { padding-left: 0; padding-right: 18px; } .submit input, .button, .button-primary, .button-secondary, .button-highlighted, #postcustomstuff .submit input { font-family: Tahoma, "Times New Roman"; } #wpcontent select { font-family: Tahoma, "Times New Roman"; } #quicktags { background-position: right top; } /* 500 - 700 =================================== */ #template div { margin-right: 0; margin-left: 190px; } * html #template div { margin-left: 0; } #your-profile legend { font-family: "Times New Roman", Tahoma; } #ajax-response.alignleft { margin-left: 0; margin-right: 2em; } .page-numbers { margin-right: 0; margin-left: 1px; } .column-author img, .column-username img { float: right; margin-right: 0; margin-left: 10px; } .tablenav a.button-secondary { margin: 8px 0 0 8px; } .tablenav .tablenav-pages { float: left; } .tablenav .displaying-num { margin-right: 0; margin-left: 10px; font-family: Tahoma, "Times New Roman"; } #postcustomstuff table input, #postcustomstuff table select, #postcustomstuff table textarea { margin: 8px 8px 8px 0; } /* 700 - 1000 =================================== */ #pass-strength-result { float: right; margin: 12px 1px 5px 5px; } /* Admin Header */ #user_info { float: left; } #header-logo { float: right; margin: 7px 15px 0 0; } #wphead h1 { font-family: "Times New Roman", Tahoma; float: right; } #wphead h1.long-title { font-family: "Times New Roman", Tahoma; } #adminmenu .wp-submenu a { padding-left: 0; padding-right: 12px; border-width: 0 0 0 1px; border-style: none none none solid; font-family: Tahoma, "Times New Roman"; } #adminmenu a.menu-top, #adminmenu .wp-submenu-head { font-family: Tahoma, "Times New Roman"; } #adminmenu img.wp-menu-image { float: right; } .folded #adminmenu img.wp-menu-image { padding: 7px 6px 0 0; } #adminmenu .wp-submenu .wp-submenu-head { padding: 6px 10px 6px 4px; } .folded #adminmenu .wp-submenu { margin: -1px 28px 0 0; } .folded #adminmenu .wp-submenu a { padding-left: 0; padding-right: 10px; } .folded #adminmenu a.wp-has-submenu { margin-left: 0; margin-right: 40px; } #adminmenu .wp-menu-toggle { float: left; padding: 1px 0 0 2px; clear: left; } #adminmenu div.wp-menu-image { float: right; } #wphead-info { margin: 0 15px 0 0; padding-right:0; padding-left: 15px; } /* end side admin menu */ /* 1000 - 1300 =================================== */ #adminmenu #awaiting-mod, #adminmenu span.update-plugins, #sidemenu li a span.update-plugins { font-family: tahoma; margin-left: 0; margin-right: 2px; } #adminmenu li #awaiting-mod span, #adminmenu li span.update-plugins span, #sidemenu li a span.update-plugins span { float: right; } .post-com-count-wrapper { font-family: tahoma; } .column-response .post-com-count { float: right; margin-right: 0; margin-left: 5px; } /* Tables used on comment.php and option/setting pages */ .form-table th, #wpbody-content .describe th { text-align: right; } .form-table input.tog { margin-right: 0; margin-left: 2px; float: right; } .form-table table.color-palette { float: right; } #profile-page .form-table #rich_editing { margin-right: 0; margin-left: 5px; } /* Post Screen */ /* 1300 - 1500 =================================== */ #normal-sortables .postbox .submit { float: left; } #post-body #tagsdiv #newtag { margin-right: 0; margin-left: 5px; } #post-status-info { padding: 0 7px 0 15px; } #comment-status-radio input { margin: 2px 0 5px 3px; } #tagchecklist { margin-left: 0; margin-right: 10px; } #tagchecklist strong { margin-left: 0; margin-right: -8px; } #tagchecklist span { float: right; } #tagchecklist span a { margin: 6px -9px 0 0; float: right; } .ac_results li { text-align: right; } #poststuff h2 { clear: right; } .setting-description, .form-wrap p { font-family: Tahoma, Arial; } /* 1500 - 1800 =================================== */ .meta-box-sortables .postbox .handlediv { float: left; } .howto { font-family: Tahoma, Arial; } .postarea h3 label { float: right; } .postarea #add-media-button { float: left; right: auto; left: 10px; } .wp_themeSkin tr.mceFirst td.mceToolbar { background-position: right top; } #poststuff #edButtonPreview, #poststuff #edButtonHTML { margin: 5px 0 0 5px; float: left; } #poststuff #edButtonHTML { margin-right: 0; margin-left: 15px; } #media-buttons a

Page 3: Read more...

{ padding: 0 10px 5px 0; } .submitbox .submit { text-align: right; } .inside-submitbox #post_status { margin: 2px -2px 2px 0; } .submitbox .submit input { margin-right: 0; margin-left: 4px; } /* Categories */ #category-adder { margin-left: 0; margin-right: 120px; } #post-body ul#category-tabs li.ui-tabs-selected { -moz-border-radius: 0 3px 3px 0; -webkit-border-top-left-radius: 0; -webkit-border-top-right-radius: 3px; -webkit-border-bottom-left-radius: 0; -webkit-border-bottom-right-radius: 3px; border-top-left-radius: 0; border-top-right-radius: 3px; border-bottom-left-radius: 0; border-bottom-right-radius: 3px; } #post-body ul#category-tabs { float: right; text-align: left; margin: 0 0 0 -120px; } #post-body #categorydiv div.ui-tabs-panel, #post-body #linkcategorydiv div.ui-tabs-panel { margin: 0 120px 0 5px; } /* 1800 - 2000 =================================== */ #side-info-column #category-tabs li { padding-right: 0; padding-left: 8px; } #categorydiv ul.categorychecklist ul, #linkcategorydiv ul.categorychecklist ul { margin-left: 0; margin-right: 18px; } /* positioning etc. */ p.search-box { float: left; } #posts-filter fieldset { float: right; margin: 0 0 1em 1.5ex; } #posts-filter fieldset legend { padding: 0 1px .2em 0; } .view-switch { float: left; } .filter { float: right; margin: -5px 10px 0 0; } #the-comment-list td.comment p.comment-author { margin-right: 0; } #the-comment-list p.comment-author img { float: right; margin-right: 0; margin-left: 8px; } .tablenav .delete { margin-right: 0; margin-left: 20px; } td.action-links, th.action-links { text-align: left; } /* 2000 - 2300 =================================== */ .filter .subsubsub { margin-left: 0; margin-right: -10px; } #wp-word-count { margin-right: 10px; } .tool-box .title { font-family: "Times New Roman", Tahoma; } .settings-toggle { text-align: left; margin: 5px 0 15px 7px; } .curtime #timestamp { background-position: right top; padding-left: 0; padding-right: 18px; } /* media popup 0819 */ #sidemenu { margin: -30px 315px 0 15px; float: left; padding-left: 0; padding-right: 10px; } #sidemenu a { float: right; } #replysubmit .button { margin-right: 0; margin-left: 5px; } /* 2300 - 2500 =================================== */ #edithead .inside { float: right; margin: 3px 5px 2px 0; } #replyrow #ed_reply_toolbar input { margin: 1px 1px 1px 2px; } /* show/hide settings */ #screen-meta-links { margin: 0 0 0 9px; } #screen-options-link-wrap, #contextual-help-link-wrap { float: left; font-family: Tahoma, "Times New Roman"; margin: 0 0 0 6px; } .metabox-prefs label { padding-right: 0; padding-left: 15px; } .metabox-prefs label input { margin: 0 2px 0 5px; } .inline-editor .save, .inline-editor .cancel { margin-right: 0; margin-left: 5px; } /* 2500 - 2700 =================================== */ #bulk-titles div a { float: right; margin: 3px -2px 0 3px; } #wpbody-content .filename { margin-left: 0; margin-right: 10px; } #wpbody-content .inline-edit-row fieldset { float: right; } #wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inliThe file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

"); // Check if wp-config.php exists above the root directory if (file_exists('../../wp-config.php') && ! file_exists('../../wp-load.php')) wp_die("

The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

"); if (isset($_GET['step'])) $step = $_GET['step']; else $step = 0; /** * Display setup wp-config.php file header. * * @ignore * @since 2.3.0 * @package WordPress * @subpackage Installer_WP_Config */ function display_header() { header( 'Content-Type: text/html; charset=utf-8' ); ?>

Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.

1. Database name 2. Database username 3. Database password 4. Database host 5. Table prefix (if you want to run more than one WordPress in a single database)

Page 4: Read more...

If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…

Let’s go!

Below you should enter your database connection details. If you're not sure about these, contact your host.

Database Name

The name of the database you want to run WP in.

User Name Your MySQL username

Password ...and MySQL password.

Database Host

99% chance you won't need to change this value.

Table PrefixIf you want to run multiple WordPress installations in a single database, change this.

error) ) wp_die($wpdb->error->get_error_message()); $handle = fopen('../wp-config.php', 'w'); foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": fwrite($handle, str_replace("putyourdbnamehere", $dbname, $line)); break; case "define('DB_USER'": fwrite($handle, str_replace("'usernamehere'", "'$uname'", $line)); break; case "define('DB_PASSW": fwrite($handle, str_replace("'yourpasswordhere'", "'$passwrd'", $line)); break; case "define('DB_HOST'": fwrite($handle, str_replace("localhost", $dbhost, $line)); break; case '$table_prefix =': fwrite($handle, str_replace('wp_', $prefix, $line)); break; default: fwrite($handle, $line); } } fclose($handle); chmod('../wp-config.php', 0666); display_header(); ?>

All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…

Run the install

' . __('Post published.') . '

'; elseif ( 'c' == $_GET['a'] ) echo '

' . __('Post saved.') . '

'; ?>

Submit

Page 5: Read more...

'.__('You do not have sufficient permissions to edit templates for this blog.').'

'); $newcontent = stripslashes($_POST['newcontent']); $theme = urlencode($theme); if (is_writeable($real_file)) { //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable $f = fopen($real_file, 'w+'); if ($f !== FALSE) { fwrite($f, $newcontent); fclose($f); $location = "theme-editor.php?file=$file&theme=$theme&a=te"; } else { $location = "theme-editor.php?file=$file&theme=$theme"; } } else { $location = "theme-editor.php?file=$file&theme=$theme"; } $location = wp_kses_no_null($location); $strip = array('%0d', '%0a'); $location = str_replace($strip, '', $location); header("Location: $location"); exit(); break; default: if ( !current_user_can('edit_themes') ) wp_die('

'.__('You do not have sufficient permissions to edit themes for this blog.').'

'); require_once('admin-header.php'); update_recently_edited($file); if (!is_file($real_file)) $error = 1; if (!$error && filesize($real_file) > 0) { $f = fopen($real_file, 'r'); $content = fread($f, filesize($real_file)); $content = htmlspecialchars($content); } ?>

$description (%s)" : "%s"; ?>

($template_show)" : "$description"; $filedesc = ( $template_file == $file ) ? "$description ($template_show)" : $filedesc; // If we have two files of the same name prefer the one in the Template Directory // This means that we display the correct files for child themes which overload Templates as well as Styles if( array_key_exists($description, $template_mapping ) ) { if ( false !== strpos( $template_file, $template_dir ) ) { $template_mapping[ $description ] = array( $template_file, $filedesc ); } } else { $template_mapping[ $description ] = array( $template_file, $filedesc ); } } ksort( $template_mapping ); while ( list( $t

<?php _e('Save as Draft'); ?> <?php _e('Publish') ?>

<?php _e('Select') ?>