]> scripts.mit.edu Git - autoinstalls/wordpress.git/commitdiff
Wordpress 2.3.2 wordpress-2.3.2
authorEdward Z. Yang <ezyang@mit.edu>
Fri, 20 Nov 2009 23:56:08 +0000 (18:56 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Fri, 20 Nov 2009 23:56:08 +0000 (18:56 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
376 files changed:
index.php
readme.html
wp-admin/admin-ajax.php [new file with mode: 0644]
wp-admin/admin-db.php [deleted file]
wp-admin/admin-footer.php
wp-admin/admin-functions.php
wp-admin/admin-header.php
wp-admin/admin.php
wp-admin/bookmarklet.php
wp-admin/cat-js.php [deleted file]
wp-admin/categories.php
wp-admin/comment.php [new file with mode: 0644]
wp-admin/css/install-rtl.css [new file with mode: 0644]
wp-admin/css/install.css [new file with mode: 0644]
wp-admin/css/upload-rtl.css [new file with mode: 0644]
wp-admin/css/upload.css [new file with mode: 0644]
wp-admin/css/widgets-rtl.css [new file with mode: 0644]
wp-admin/css/widgets.css [new file with mode: 0644]
wp-admin/custom-header.php [new file with mode: 0644]
wp-admin/edit-category-form.php [new file with mode: 0644]
wp-admin/edit-comments.php
wp-admin/edit-form-advanced.php
wp-admin/edit-form-ajax-cat.php [deleted file]
wp-admin/edit-form-comment.php
wp-admin/edit-form.php
wp-admin/edit-link-categories.php [new file with mode: 0644]
wp-admin/edit-link-category-form.php [new file with mode: 0644]
wp-admin/edit-link-form.php
wp-admin/edit-page-form.php
wp-admin/edit-pages.php
wp-admin/edit-post-rows.php [new file with mode: 0644]
wp-admin/edit.php
wp-admin/execute-pings.php [deleted file]
wp-admin/export.php [new file with mode: 0644]
wp-admin/images/heading-bg.gif [new file with mode: 0644]
wp-admin/images/login-bkg-bottom.gif [new file with mode: 0644]
wp-admin/images/login-bkg-tile.gif [new file with mode: 0644]
wp-admin/images/logo-ghost.png [new file with mode: 0644]
wp-admin/import.php
wp-admin/import/b2.php [deleted file]
wp-admin/import/blogger.php
wp-admin/import/blogware.php [new file with mode: 0644]
wp-admin/import/btt.php [new file with mode: 0644]
wp-admin/import/dotclear.php
wp-admin/import/greymatter.php
wp-admin/import/jkw.php [new file with mode: 0644]
wp-admin/import/livejournal.php
wp-admin/import/mt.php
wp-admin/import/rss.php
wp-admin/import/stp.php [new file with mode: 0644]
wp-admin/import/textpattern.php
wp-admin/import/utw.php [new file with mode: 0644]
wp-admin/import/wordpress.php [new file with mode: 0644]
wp-admin/import/wp-cat2tag.php [new file with mode: 0644]
wp-admin/includes/admin.php [new file with mode: 0644]
wp-admin/includes/bookmark.php [new file with mode: 0644]
wp-admin/includes/comment.php [new file with mode: 0644]
wp-admin/includes/file.php [new file with mode: 0644]
wp-admin/includes/image.php [new file with mode: 0644]
wp-admin/includes/import.php [new file with mode: 0644]
wp-admin/includes/misc.php [new file with mode: 0644]
wp-admin/includes/plugin.php [new file with mode: 0644]
wp-admin/includes/post.php [new file with mode: 0644]
wp-admin/includes/schema.php [moved from wp-admin/upgrade-schema.php with 77% similarity]
wp-admin/includes/taxonomy.php [new file with mode: 0644]
wp-admin/includes/template.php [new file with mode: 0644]
wp-admin/includes/theme.php [new file with mode: 0644]
wp-admin/includes/update.php [new file with mode: 0644]
wp-admin/includes/upgrade.php [new file with mode: 0644]
wp-admin/includes/upload.php [new file with mode: 0644]
wp-admin/includes/user.php [new file with mode: 0644]
wp-admin/index-extra.php [new file with mode: 0644]
wp-admin/index.php
wp-admin/inline-uploading.php [deleted file]
wp-admin/install-helper.php
wp-admin/install.php
wp-admin/js/cat.js [new file with mode: 0644]
wp-admin/js/categories.js [new file with mode: 0644]
wp-admin/js/custom-fields.js [new file with mode: 0644]
wp-admin/js/dbx-admin-key.js [new file with mode: 0644]
wp-admin/js/edit-comments.js [new file with mode: 0644]
wp-admin/js/link-cat.js [new file with mode: 0644]
wp-admin/js/upload.js [new file with mode: 0644]
wp-admin/js/users.js [new file with mode: 0644]
wp-admin/js/xfn.js [moved from wp-admin/xfn.js with 85% similarity]
wp-admin/link-add.php
wp-admin/link-categories.php [deleted file]
wp-admin/link-category.php [new file with mode: 0644]
wp-admin/link-import.php
wp-admin/link-manager.php
wp-admin/link-parse-opml.php
wp-admin/link.php [new file with mode: 0644]
wp-admin/list-manipulation.js [deleted file]
wp-admin/list-manipulation.php [deleted file]
wp-admin/menu-header.php
wp-admin/menu.php
wp-admin/moderation.php
wp-admin/options-discussion.php
wp-admin/options-general.php
wp-admin/options-head.php
wp-admin/options-misc.php
wp-admin/options-permalink.php
wp-admin/options-privacy.php [new file with mode: 0644]
wp-admin/options-reading.php
wp-admin/options-writing.php
wp-admin/options.php
wp-admin/page-new.php
wp-admin/page.php [new file with mode: 0644]
wp-admin/plugin-editor.php
wp-admin/plugins.php
wp-admin/post-new.php [new file with mode: 0644]
wp-admin/post.php
wp-admin/profile-update.php
wp-admin/profile.php
wp-admin/rtl.css [new file with mode: 0644]
wp-admin/setup-config.php
wp-admin/sidebar.php
wp-admin/templates.php
wp-admin/theme-editor.php
wp-admin/themes.php
wp-admin/update-links.php
wp-admin/upgrade-functions.php
wp-admin/upgrade.php
wp-admin/upload.php [new file with mode: 0644]
wp-admin/user-edit.php
wp-admin/users.php
wp-admin/widgets.php [new file with mode: 0644]
wp-admin/wp-admin.css
wp-app.php [new file with mode: 0644]
wp-atom.php
wp-blog-header.php
wp-comments-post.php
wp-commentsrss2.php
wp-config-sample.php
wp-content/index.php
wp-content/plugins/akismet/akismet.php
wp-content/plugins/hello.php
wp-content/plugins/wp-db-backup.php [deleted file]
wp-content/themes/classic/comments-popup.php
wp-content/themes/classic/comments.php
wp-content/themes/classic/functions.php [new file with mode: 0644]
wp-content/themes/classic/header.php
wp-content/themes/classic/index.php
wp-content/themes/classic/rtl.css [new file with mode: 0644]
wp-content/themes/classic/sidebar.php
wp-content/themes/classic/style.css
wp-content/themes/default/archive.php
wp-content/themes/default/archives.php
wp-content/themes/default/attachment.php
wp-content/themes/default/comments-popup.php
wp-content/themes/default/comments.php
wp-content/themes/default/footer.php
wp-content/themes/default/functions.php
wp-content/themes/default/header.php
wp-content/themes/default/images/header-img.php
wp-content/themes/default/images/kubrickbg-ltr.jpg [moved from wp-content/themes/default/images/kubrickbg.jpg with 100% similarity]
wp-content/themes/default/images/kubrickbg-rtl.jpg [new file with mode: 0644]
wp-content/themes/default/index.php
wp-content/themes/default/page.php
wp-content/themes/default/rtl.css [new file with mode: 0644]
wp-content/themes/default/search.php
wp-content/themes/default/searchform.php
wp-content/themes/default/sidebar.php
wp-content/themes/default/single.php
wp-content/themes/default/style.css
wp-cron.php [new file with mode: 0644]
wp-feed.php
wp-includes/atomlib.php [new file with mode: 0644]
wp-includes/author-template.php [new file with mode: 0644]
wp-includes/bookmark-template.php [new file with mode: 0644]
wp-includes/bookmark.php [new file with mode: 0644]
wp-includes/cache.php
wp-includes/canonical.php [new file with mode: 0644]
wp-includes/capabilities.php
wp-includes/category-template.php [new file with mode: 0644]
wp-includes/category.php [new file with mode: 0644]
wp-includes/class-IXR.php
wp-includes/class-phpmailer.php [new file with mode: 0644]
wp-includes/class-pop3.php
wp-includes/class-smtp.php [new file with mode: 0644]
wp-includes/class-snoopy.php
wp-includes/classes.php
wp-includes/comment-functions.php [deleted file]
wp-includes/comment-template.php [new file with mode: 0644]
wp-includes/comment.php [new file with mode: 0644]
wp-includes/compat.php [new file with mode: 0644]
wp-includes/cron.php [new file with mode: 0644]
wp-includes/default-filters.php
wp-includes/deprecated.php [new file with mode: 0644]
wp-includes/feed-atom-comments.php [new file with mode: 0644]
wp-includes/feed-atom.php [new file with mode: 0644]
wp-includes/feed-functions.php [deleted file]
wp-includes/feed-rdf.php [new file with mode: 0644]
wp-includes/feed-rss.php [new file with mode: 0644]
wp-includes/feed-rss2-comments.php [new file with mode: 0644]
wp-includes/feed-rss2.php [new file with mode: 0644]
wp-includes/feed.php [new file with mode: 0644]
wp-includes/formatting.php [moved from wp-includes/functions-formatting.php with 71% similarity]
wp-includes/functions-compat.php [deleted file]
wp-includes/functions-post.php [deleted file]
wp-includes/functions.php
wp-includes/general-template.php [new file with mode: 0644]
wp-includes/gettext.php
wp-includes/images/rss.png [new file with mode: 0644]
wp-includes/images/wlw/WpComments.png [new file with mode: 0644]
wp-includes/images/wlw/WpIcon.png [new file with mode: 0644]
wp-includes/images/wlw/WpWatermark.png [new file with mode: 0644]
wp-includes/images/wlw/wp-comments.png [new file with mode: 0644]
wp-includes/images/wlw/wp-icon.png [new file with mode: 0644]
wp-includes/images/wlw/wp-watermark.png [new file with mode: 0644]
wp-includes/js/autosave.js [new file with mode: 0644]
wp-includes/js/colorpicker.js
wp-includes/js/crop/cropper.css [new file with mode: 0644]
wp-includes/js/crop/cropper.js [new file with mode: 0644]
wp-includes/js/crop/marqueeHoriz.gif [new file with mode: 0644]
wp-includes/js/crop/marqueeVert.gif [new file with mode: 0644]
wp-includes/js/dbx-key.js [deleted file]
wp-includes/js/dbx.js
wp-includes/js/fat.js
wp-includes/js/jquery/interface.js [new file with mode: 0644]
wp-includes/js/jquery/jquery.form.js [new file with mode: 0644]
wp-includes/js/jquery/jquery.js [new file with mode: 0644]
wp-includes/js/list-manipulation.js [new file with mode: 0644]
wp-includes/js/prototype.js [new file with mode: 0644]
wp-includes/js/quicktags.js
wp-includes/js/scriptaculous/MIT-LICENSE [new file with mode: 0644]
wp-includes/js/scriptaculous/builder.js [new file with mode: 0644]
wp-includes/js/scriptaculous/controls.js [new file with mode: 0644]
wp-includes/js/scriptaculous/dragdrop.js [new file with mode: 0644]
wp-includes/js/scriptaculous/effects.js [new file with mode: 0644]
wp-includes/js/scriptaculous/prototype.js [new file with mode: 0644]
wp-includes/js/scriptaculous/scriptaculous.js [new file with mode: 0644]
wp-includes/js/scriptaculous/slider.js [new file with mode: 0644]
wp-includes/js/scriptaculous/sound.js [new file with mode: 0644]
wp-includes/js/scriptaculous/unittest.js [new file with mode: 0644]
wp-includes/js/scriptaculous/wp-scriptaculous.js [new file with mode: 0644]
wp-includes/js/tinymce/langs/en.js
wp-includes/js/tinymce/license.html [deleted file]
wp-includes/js/tinymce/license.txt
wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js
wp-includes/js/tinymce/plugins/autosave/langs/cs.js [deleted file]
wp-includes/js/tinymce/plugins/autosave/langs/en.js
wp-includes/js/tinymce/plugins/autosave/langs/sv.js [deleted file]
wp-includes/js/tinymce/plugins/directionality/editor_plugin.js
wp-includes/js/tinymce/plugins/directionality/langs/en.js
wp-includes/js/tinymce/plugins/inlinepopups/css/inlinepopup.css
wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js [new file with mode: 0644]
wp-includes/js/tinymce/plugins/inlinepopups/jscripts/mcwindows.js
wp-includes/js/tinymce/plugins/paste/blank.htm [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/css/blank.css [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/css/pasteword.css [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/editor_plugin.js [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/images/pastetext.gif [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/images/pasteword.gif [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/images/selectall.gif [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/jscripts/pastetext.js [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/jscripts/pasteword.js [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/langs/en.js [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/pastetext.htm [new file with mode: 0644]
wp-includes/js/tinymce/plugins/paste/pasteword.htm [new file with mode: 0644]
wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/config.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/css/content.css [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/images/spellchecker.gif [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/images/wline.gif [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/langs/en.js [new file with mode: 0755]
wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php [new file with mode: 0755]
wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
wp-includes/js/tinymce/plugins/wordpress/images/help.gif
wp-includes/js/tinymce/plugins/wordpress/images/toolbars.gif [new file with mode: 0755]
wp-includes/js/tinymce/plugins/wordpress/langs/en.js
wp-includes/js/tinymce/plugins/wordpress/popups.css [new file with mode: 0644]
wp-includes/js/tinymce/plugins/wordpress/wordpress.css
wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js
wp-includes/js/tinymce/plugins/wphelp/langs/en.js
wp-includes/js/tinymce/themes/advanced/about.htm
wp-includes/js/tinymce/themes/advanced/anchor.htm
wp-includes/js/tinymce/themes/advanced/charmap.htm
wp-includes/js/tinymce/themes/advanced/color_picker.htm
wp-includes/js/tinymce/themes/advanced/css/colorpicker.css [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/css/editor_content.css
wp-includes/js/tinymce/themes/advanced/css/editor_popup.css
wp-includes/js/tinymce/themes/advanced/css/editor_ui.css
wp-includes/js/tinymce/themes/advanced/editor_template.js
wp-includes/js/tinymce/themes/advanced/editor_template_src.js [deleted file]
wp-includes/js/tinymce/themes/advanced/image.htm
wp-includes/js/tinymce/themes/advanced/images/backcolor.gif
wp-includes/js/tinymce/themes/advanced/images/bold_es.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/bold_tw.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/button_menu.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/buttons.gif
wp-includes/js/tinymce/themes/advanced/images/colors.jpg [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/forecolor.gif
wp-includes/js/tinymce/themes/advanced/images/help.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/italic_es.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/italic_tw.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/justifycenter.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/justifyfull.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/justifyleft.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/justifyright.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/menu_check.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/opacity.png [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/separator.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/underline_es.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/images/underline_tw.gif [new file with mode: 0644]
wp-includes/js/tinymce/themes/advanced/jscripts/about.js
wp-includes/js/tinymce/themes/advanced/jscripts/anchor.js
wp-includes/js/tinymce/themes/advanced/jscripts/charmap.js
wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js
wp-includes/js/tinymce/themes/advanced/jscripts/image.js
wp-includes/js/tinymce/themes/advanced/jscripts/link.js
wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js
wp-includes/js/tinymce/themes/advanced/langs/en.js
wp-includes/js/tinymce/themes/advanced/link.htm
wp-includes/js/tinymce/themes/advanced/source_editor.htm
wp-includes/js/tinymce/tiny_mce.js
wp-includes/js/tinymce/tiny_mce_config.php [new file with mode: 0644]
wp-includes/js/tinymce/tiny_mce_gzip.php
wp-includes/js/tinymce/tiny_mce_popup.js
wp-includes/js/tinymce/utils/editable_selects.js [new file with mode: 0644]
wp-includes/js/tinymce/utils/form_utils.js
wp-includes/js/tinymce/utils/mclayer.js [new file with mode: 0644]
wp-includes/js/tinymce/utils/mctabs.js
wp-includes/js/tinymce/utils/validate.js
wp-includes/js/tinymce/wp-mce-help.php
wp-includes/js/tw-sack.js
wp-includes/js/wp-ajax.js [new file with mode: 0644]
wp-includes/kses.php
wp-includes/l10n.php [moved from wp-includes/wp-l10n.php with 63% similarity]
wp-includes/link-template.php [new file with mode: 0644]
wp-includes/links.php [deleted file]
wp-includes/locale.php
wp-includes/pluggable.php [moved from wp-includes/pluggable-functions.php with 61% similarity]
wp-includes/plugin.php [new file with mode: 0644]
wp-includes/post-template.php [new file with mode: 0644]
wp-includes/post.php [new file with mode: 0644]
wp-includes/query.php [new file with mode: 0644]
wp-includes/registration-functions.php
wp-includes/registration.php [new file with mode: 0644]
wp-includes/rewrite.php [new file with mode: 0644]
wp-includes/rss-functions.php
wp-includes/rss.php [new file with mode: 0644]
wp-includes/script-loader.php [new file with mode: 0644]
wp-includes/streams.php
wp-includes/taxonomy.php [new file with mode: 0644]
wp-includes/template-functions-author.php [deleted file]
wp-includes/template-functions-category.php [deleted file]
wp-includes/template-functions-general.php [deleted file]
wp-includes/template-functions-links.php [deleted file]
wp-includes/template-functions-post.php [deleted file]
wp-includes/template-loader.php
wp-includes/theme.php [new file with mode: 0644]
wp-includes/update.php [new file with mode: 0644]
wp-includes/user.php [new file with mode: 0644]
wp-includes/vars.php
wp-includes/version.php
wp-includes/widgets.php [new file with mode: 0644]
wp-includes/wlwmanifest.xml [new file with mode: 0644]
wp-includes/wp-db.php
wp-links-opml.php
wp-login.php
wp-mail.php
wp-pass.php
wp-rdf.php
wp-register.php
wp-rss.php
wp-rss2.php
wp-settings.php
wp-trackback.php
xmlrpc.php

index 3e3db402e006200ab05dc725509a60864d87104d..b1c655cd5206a392562d94d6f8dbd7a0da2cafbe 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,4 +1,4 @@
-<?php 
+<?php
 /* Short and sweet */
 define('WP_USE_THEMES', true);
 require('./wp-blog-header.php');
index ae746367d6a73f0f1400a7b4055eee6e791b13cc..636def83e297f4de24839d8b017efe4eb5befb67 100644 (file)
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<title>WordPress &rsaquo; ReadMe</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<style type="text/css" media="screen">
-       <!--
-       html {
-               background: #eee;
-       }
-       body {
-               background: #fff;
-               color: #000;
-               font-family: Georgia, "Times New Roman", Times, serif;
-               margin-left: 25%;
-               margin-right: 25%;
-               padding: .2em 2em;
-       }
-       
-       h1 {
-               color: #006;
-               font-size: 18px;
-               font-weight: lighter;
-       }
-       
-       h2 {
-               font-size: 16px;
-       }
-       
-       p, li, dt {
-               line-height: 140%;
-               padding-bottom: 2px;
-       }
-
-       ul, ol {
-               padding: 5px 5px 5px 20px;
-       }
-       -->
-       </style>
+       <title>WordPress &rsaquo; ReadMe</title>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <link rel="stylesheet" href="wp-admin/css/install.css" type="text/css" />
 </head>
 <body>
-<h1 style="text-align: center"><img alt="WordPress" src="http://wordpress.org/images/wordpress.gif" /> <br />
-       Version 2.0</h1>
-<p style="text-align: center"> Semantic Personal Publishing Platform </p>
+<h1 id="logo" style="text-align: center">
+       <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
+       <br /> Version 2.3
+</h1>
+<p style="text-align: center">Semantic Personal Publishing Platform</p>
+
 <h1>First Things First</h1>
 <p>Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I'm proud to be a part of. Thousands of hours have gone into WordPress, and we're dedicated to making it better every day. Thank you for making it part of your world.</p>
-<p style="text-align: right;">&#8212; Matt Mullenweg </p>
+<p style="text-align: right;">&#8212; Matt Mullenweg</p>
 
-<h1 id="installation">Installation: Famous 5-minute install</h1>
+<h1>Installation: Famous 5-minute install</h1>
 <ol>
-       <li>Unzip the package in an empty directory</li>
-       <li>Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details</li>
-       <li>Save the file as <code>wp-config.php</code> </li>
+       <li>Unzip the package in an empty directory.</li>
+       <li>Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details.</li>
+       <li>Save the file as <code>wp-config.php</code></li>
        <li>Upload everything.</li>
-       <li>Open <span class="file"><a href="wp-admin/install.php">/wp-admin/install.php</a></span> in your browser. This should setup the tables needed for your blog. If there is an error, double check your <span class="file">wp-config.php</span> file, and try again. If it fails again, please go to the <a href="http://wordpress.org/support/">support forums</a> with as much data as you can gather. </li>
+       <li>Open <span class="file"><a href="wp-admin/install.php">/wp-admin/install.php</a></span> in your browser. This should setup the tables needed for your blog. If there is an error, double check your <span class="file">wp-config.php</span> file, and try again. If it fails again, please go to the <a href="http://wordpress.org/support/">support forums</a> with as much data as you can gather.</li>
        <li><strong>Note the password given to you.</strong></li>
        <li> The install script should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username <code>admin</code> and the password generated during the installation. You can then click on 'Profile' to change the password.</li>
 </ol>
 
 <h1>Upgrading</h1>
 <p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
-<h2>Upgrading from any previous WordPress to 2.0:</h2>
+<h2>Upgrading from any previous WordPress to 2.3:</h2>
 <ol>
-       <li>Delete your old WP files, saving ones you've modified </li>
-       <li>Upload the new files</li>
-       <li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a></span></li>
+       <li>Delete your old WP files, saving ones you've modified.</li>
+       <li>Upload the new files.</li>
+       <li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
        <li>You wanted more, perhaps? That's it!</li>
 </ol>
 <h2>Template Changes</h2>
 <p>If you have customized your templates you will probably have to make some changes to them. If you're converting your 1.2 or earlier templates, <a href="http://codex.wordpress.org/Upgrade_1.2_to_1.5">we've created a special guide for you</a>. </p>
+
 <h1>Online Resources</h1>
 <p>If you have any questions that aren't addressed in this document, please take advantage of WordPress' numerous online resources:</p>
 <dl>
        <dt><a href="http://codex.wordpress.org/">The WordPress Codex </a></dt>
-       <dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available. </dd>
+               <dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.</dd>
        <dt><a href="http://wordpress.org/development/">The Development Blog</a></dt>
-       <dd>This is where you'll find the latest updates and news related to WordPress. Bookmark and check often. </dd>
+               <dd>This is where you'll find the latest updates and news related to WordPress. Bookmark and check often.</dd>
        <dt><a href="http://planet.wordpress.org/">WordPress Planet </a></dt>
-       <dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web. </dd>
+               <dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.</dd>
        <dt><a href="http://wordpress.org/support/">WordPress Support Forums</a></dt>
-       <dd>If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible. </dd>
+               <dd>If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</dd>
        <dt><a href="http://codex.wordpress.org/IRC">WordPress IRC Channel</a></dt>
-       <dd>Finally, there is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.freenode.net #wordpress) </dd>
+               <dd>Finally, there is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (<a href="irc://irc.freenode.net/wordpress">irc.freenode.net #wordpress</a>)</dd>
 </dl>
 
-<h1 id="requirements">System Recommendations</h1>
+<h1>System Recommendations</h1>
 <ul>
-       <li>PHP version <strong>4.1</strong> or higher</li>
-       <li>MySQL version <strong>3.23.23</strong> or higher</li>
+       <li>PHP version <strong>4.2</strong> or higher.</li>
+       <li>MySQL version <strong>4.0</strong> or higher.</li>
        <li>... and a link to <a href="http://wordpress.org/">http://wordpress.org</a> on your site.</li>
 </ul>
-<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/caf&eacute;log</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/">donating</a>. </p>
+<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/caf&eacute;log</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/">donating</a>.</p>
 
 <h1>Upgrading from another system</h1>
-<p>WordPress can <a href="http://codex.wordpress.org/Importing_from_other_blogging_software">import from a number of systems</a>. First you need to get WordPress installed and working as described above.</p>
+<p>WordPress can <a href="http://codex.wordpress.org/Importing_Content">import from a number of systems</a>. First you need to get WordPress installed and working as described above.</p>
 
-<h1 id="templates">XML-RPC Interface</h1>
-<p>You can now post to your WordPress blog with tools like <a href="http://ecto.kung-foo.tv/">Ecto</a>, <a href="http://blogbuddy.sourceforge.net">BlogBuddy</a>, <a href="http://bloggar.com/">Bloggar</a>, <a href="http://www.ubique.ch/wapblogger/">WapBlogger</a> (post from your Wap cellphone!), <a href="http://radio.userland.com">Radio Userland</a> (which means you can use Radio's email-to-blog feature), <a href="http://www.zempt.com/">Zempt</a>, <a href="http://www.newzcrawler.com/">NewzCrawler</a>, and other tools that support the Blogging APIs! :) You can read more about <a href="http://codex.wordpress.org/XML-RPC_Support">XML-RPC support on the Codex</a>.</p>
+<h1>XML-RPC and Atom Interface</h1>
+<p>You can now post to your WordPress blog with tools like <a href="http://windowslivewriter.spaces.live.com/">Windows Live Writer</a>, <a href="http://ecto.kung-foo.tv/">Ecto</a>, <a href="http://bloggar.com/">Bloggar</a>, <a href="http://radio.userland.com">Radio Userland</a> (which means you can use Radio's email-to-blog feature), <a href="http://www.newzcrawler.com/">NewzCrawler</a>, and other tools that support the Blogging APIs! :) You can read more about <a href="http://codex.wordpress.org/XML-RPC_Support">XML-RPC support on the Codex</a>.</p>
 
 <h1>Post via Email</h1>
-<p>You can post from an email client! To set this up go to your &quot;Writing&quot; options screen and fill in the connection details for your secret POP3 account. Then you need to set up <code>wp-mail.php</code> to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your <code>wp-mail.php</code> URL. </p>
-<p> Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address dicrete. The script will <i>delete</i> emails that are successfully posted. </p>
-<h1 id="roles">User Roles </h1>
+<p>You can post from an email client! To set this up go to your &quot;Writing&quot; options screen and fill in the connection details for your secret POP3 account. Then you need to set up <code>wp-mail.php</code> to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your <code>wp-mail.php</code> URL.</p>
+<p>Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address dicrete. The script will <i>delete</i> emails that are successfully posted.</p>
 
+<h1>User Roles</h1>
 <p>We've eliminated user levels in order to make way for the much more flexible roles system introduced in 2.0. You can <a href="http://codex.wordpress.org/Roles_and_Capabilities">read more about Roles and Capabilities on the Codex</a>.</p>
 
 <h1> Final notes</h1>
 <ul>
-       <li>If you have any suggestions, ideas, comments, or if you (gasp!) found a bug, join us in the <a href="http://wordpress.org/support/">Support Forums</a></li>
+       <li>If you have any suggestions, ideas, comments, or if you (gasp!) found a bug, join us in the <a href="http://wordpress.org/support/">Support Forums</a>.</li>
        <li>WordPress now has a robust plugin API that makes extending the code easy. If you are a developer interested in utilizing this see the <a href="http://codex.wordpress.org/Plugin_API">plugin documentation in the Codex</a>. In most all cases you shouldn't modify any of the core code.</li>
 </ul>
 
 <p>WordPress is released under the <abbr title="GNU Public License">GPL</abbr> (see <a href="license.txt">license.txt</a>).</p>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php
new file mode 100644 (file)
index 0000000..013e375
--- /dev/null
@@ -0,0 +1,320 @@
+<?php
+require_once('../wp-config.php');
+require_once('includes/admin.php');
+
+define('DOING_AJAX', true);
+
+check_ajax_referer();
+if ( !is_user_logged_in() )
+       die('-1');
+
+function get_out_now() { exit; }
+add_action( 'shutdown', 'get_out_now', -1 );
+
+function wp_ajax_meta_row( $pid, $mid, $key, $value ) {
+       $value = attribute_escape($value);
+       $key_js = addslashes(wp_specialchars($key, 'double'));
+       $key = attribute_escape($key);
+       $r .= "<tr id='meta-$mid'><td valign='top'>";
+       $r .= "<input name='meta[$mid][key]' tabindex='6' onkeypress='return killSubmit(\"theList.ajaxUpdater(&#039;meta&#039;,&#039;meta-$mid&#039;);\",event);' type='text' size='20' value='$key' />";
+       $r .= "</td><td><textarea name='meta[$mid][value]' tabindex='6' rows='2' cols='30'>$value</textarea></td><td align='center'>";
+       $r .= "<input name='updatemeta' type='button' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' onclick='return theList.ajaxUpdater(&#039;meta&#039;,&#039;meta-$mid&#039;);' /><br />";
+       $r .= "<input name='deletemeta[$mid]' type='submit' onclick=\"return deleteSomething( 'meta', $mid, '";
+       $r .= js_escape(sprintf(__("You are about to delete the '%s' custom field on this post.\n'OK' to delete, 'Cancel' to stop."), $key_js));
+       $r .= "' );\" class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td></tr>";
+       return $r;
+}
+
+$id = (int) $_POST['id'];
+switch ( $_POST['action'] ) :
+case 'delete-comment' :
+       if ( !$comment = get_comment( $id ) )
+               die('0');
+       if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
+               die('-1');
+
+       if ( wp_delete_comment( $comment->comment_ID ) )
+               die('1');
+       else    die('0');
+       break;
+case 'delete-comment-as-spam' :
+       if ( !$comment = get_comment( $id ) )
+               die('0');
+       if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
+               die('-1');
+
+       if ( wp_set_comment_status( $comment->comment_ID, 'spam' ) )
+               die('1');
+       else    die('0');
+       break;
+case 'delete-cat' :
+       if ( !current_user_can( 'manage_categories' ) )
+               die('-1');
+
+       if ( wp_delete_category( $id ) )
+               die('1');
+       else    die('0');
+       break;
+case 'delete-link' :
+       if ( !current_user_can( 'manage_links' ) )
+               die('-1');
+
+       if ( wp_delete_link( $id ) )
+               die('1');
+       else    die('0');
+       break;
+case 'delete-meta' :
+       if ( !$meta = get_post_meta_by_id( $id ) )
+               die('0');
+       if ( !current_user_can( 'edit_post', $meta->post_id ) )
+               die('-1');
+       if ( delete_meta( $meta->meta_id ) )
+               die('1');
+       die('0');
+       break;
+case 'delete-post' :
+       if ( !current_user_can( 'delete_post', $id ) )
+               die('-1');
+
+       if ( wp_delete_post( $id ) )
+               die('1');
+       else    die('0');
+       break;
+case 'delete-page' :
+       if ( !current_user_can( 'delete_page', $id ) )
+               die('-1');
+
+       if ( wp_delete_post( $id ) )
+               die('1');
+       else    die('0');
+       break;
+case 'dim-comment' :
+       if ( !$comment = get_comment( $id ) )
+               die('0');
+       if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
+               die('-1');
+       if ( !current_user_can( 'moderate_comments' ) )
+               die('-1');
+
+       if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) {
+               if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) )
+                       die('1');
+       } else {
+               if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) )
+                       die('1');
+       }
+       die('0');
+       break;
+case 'add-category' : // On the Fly
+       if ( !current_user_can( 'manage_categories' ) )
+               die('-1');
+       $names = explode(',', $_POST['newcat']);
+       $x = new WP_Ajax_Response();
+       foreach ( $names as $cat_name ) {
+               $cat_name = trim($cat_name);
+               if ( !$category_nicename = sanitize_title($cat_name) )
+                       die('0');
+               if ( !$cat_id = category_exists( $cat_name ) )
+                       $cat_id = wp_create_category( $cat_name );
+               $cat_name = wp_specialchars(stripslashes($cat_name));
+               $x->add( array(
+                       'what' => 'category',
+                       'id' => $cat_id,
+                       'data' => "<li id='category-$cat_id'><label for='in-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='post_category[]' id='in-category-$cat_id'/> $cat_name</label></li>"
+               ) );
+       }
+       $x->send();
+       break;
+case 'add-link-category' : // On the Fly
+       if ( !current_user_can( 'manage_categories' ) )
+               die('-1');
+       $names = explode(',', $_POST['newcat']);
+       $x = new WP_Ajax_Response();
+       foreach ( $names as $cat_name ) {
+               $cat_name = trim($cat_name);
+               if ( !$slug = sanitize_title($cat_name) )
+                       die('0');
+               if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) {
+                       $cat_id = wp_insert_term( $cat_name, 'link_category' );
+                       $cat_id = $cat_id['term_id'];
+               }
+               $cat_name = wp_specialchars(stripslashes($cat_name));
+               $x->add( array(
+                       'what' => 'link-category',
+                       'id' => $cat_id,
+                       'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>"
+               ) );
+       }
+       $x->send();
+       break;
+case 'add-cat' : // From Manage->Categories
+       if ( !current_user_can( 'manage_categories' ) )
+               die('-1');
+       if ( !$cat = wp_insert_category( $_POST ) )
+               die('0');
+       if ( !$cat = get_category( $cat ) )
+               die('0');
+       $level = 0;
+       $cat_full_name = $cat->cat_name;
+       $_cat = $cat;
+       while ( $_cat->category_parent ) {
+               $_cat = get_category( $_cat->category_parent );
+               $cat_full_name = $_cat->cat_name . ' &#8212; ' . $cat_full_name;
+               $level++;
+       }
+       $cat_full_name = attribute_escape($cat_full_name);
+
+       $x = new WP_Ajax_Response( array(
+               'what' => 'cat',
+               'id' => $cat->cat_ID,
+               'data' => _cat_row( $cat, $level, $cat_full_name ),
+               'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category <a href="#%s">%s</a> added' ), "cat-$cat->cat_ID", $cat_full_name))
+       ) );
+       $x->send();
+       break;
+case 'add-comment' :
+       if ( !current_user_can( 'edit_post', $id ) )
+               die('-1');
+       $search = isset($_POST['s']) ? $_POST['s'] : false;
+       $start = isset($_POST['page']) ? intval($_POST['page']) * 25 : 25;
+
+       list($comments, $total) = _wp_get_comment_list( $search, $start, 1 );
+
+       if ( !$comments )
+               die('1');
+       $x = new WP_Ajax_Response();
+       foreach ( (array) $comments as $comment ) {
+               get_comment( $comment );
+               ob_start();
+                       _wp_comment_list_item( $comment->comment_ID );
+                       $comment_list_item = ob_get_contents();
+               ob_end_clean();
+               $x->add( array(
+                       'what' => 'comment',
+                       'id' => $comment->comment_ID,
+                       'data' => $comment_list_item
+               ) );
+       }
+       $x->send();
+       break;
+case 'add-meta' :
+       if ( !current_user_can( 'edit_post', $id ) )
+               die('-1');
+       if ( $id < 0 ) {
+               $now = current_time('timestamp', 1);
+               if ( $pid = wp_insert_post( array(
+                       'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
+               ) ) ) {
+                       if ( is_wp_error( $pid ) )
+                               return $pid;
+                       $mid = add_meta( $pid );
+               }
+               else
+                       die('0');
+       } else if ( !$mid = add_meta( $id ) ) {
+               die('0');
+       }
+
+       $meta = get_post_meta_by_id( $mid );
+       $key = $meta->meta_key;
+       $value = $meta->meta_value;
+       $pid = (int) $meta->post_id;
+
+       $x = new WP_Ajax_Response( array(
+               'what' => 'meta',
+               'id' => $mid,
+               'data' => wp_ajax_meta_row( $pid, $mid, $key, $value ),
+               'supplemental' => array('postid' => $pid)
+       ) );
+       $x->send();
+       break;
+case 'update-meta' :
+       $mid = (int) array_pop(array_keys($_POST['meta']));
+       $key = $_POST['meta'][$mid]['key'];
+       $value = $_POST['meta'][$mid]['value'];
+       if ( !$meta = get_post_meta_by_id( $mid ) )
+               die('0'); // if meta doesn't exist
+       if ( !current_user_can( 'edit_post', $meta->post_id ) )
+               die('-1');
+       if ( $u = update_meta( $mid, $key, $value ) ) {
+               $key = stripslashes($key);
+               $value = stripslashes($value);
+               $x = new WP_Ajax_Response( array(
+                       'what' => 'meta',
+                       'id' => $mid,
+                       'data' => wp_ajax_meta_row( $meta->post_id, $mid, $key, $value ),
+                       'supplemental' => array('postid' => $meta->post_id)
+               ) );
+               $x->send();
+       }
+       die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
+       break;
+case 'add-user' :
+       if ( !current_user_can('edit_users') )
+               die('-1');
+       require_once(ABSPATH . WPINC . '/registration.php');
+       if ( !$user_id = add_user() )
+               die('0');
+       elseif ( is_wp_error( $user_id ) ) {
+               foreach( $user_id->get_error_messages() as $message )
+                       echo "<p>$message<p>";
+               exit;
+       }
+       $user_object = new WP_User( $user_id );
+       $x = new WP_Ajax_Response( array(
+               'what' => 'user',
+               'id' => $user_id,
+               'data' => user_row( $user_object ),
+               'supplemental' => array('show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login))
+       ) );
+       $x->send();
+       break;
+case 'autosave' : // The name of this action is hardcoded in edit_post()
+       $_POST['post_content'] = $_POST['content'];
+       $_POST['post_excerpt'] = $_POST['excerpt'];
+       $_POST['post_status'] = 'draft';
+       $_POST['post_category'] = explode(",", $_POST['catslist']);
+       if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
+               unset($_POST['post_category']);
+
+       if($_POST['post_ID'] < 0) {
+               $_POST['temp_ID'] = $_POST['post_ID'];
+               $id = wp_write_post();
+               if( is_wp_error($id) )
+                       die($id->get_error_message());
+               else
+                       die("$id");
+       } else {
+               $post_ID = (int) $_POST['post_ID'];
+               $_POST['ID'] = $post_ID;
+               $post = get_post($post_ID);
+               if ( 'page' == $post->post_type ) {
+                       if ( !current_user_can('edit_page', $post_ID) )
+                               die(__('You are not allowed to edit this page.'));
+               } else {
+                       if ( !current_user_can('edit_post', $post_ID) )
+                               die(__('You are not allowed to edit this post.'));
+               }
+               wp_update_post($_POST);
+       }
+       die('0');
+break;
+case 'autosave-generate-nonces' :
+       $ID = (int) $_POST['post_ID'];
+       if($_POST['post_type'] == 'post') {
+               if(current_user_can('edit_post', $ID))
+                       die(wp_create_nonce('update-post_' . $ID));
+       }
+       if($_POST['post_type'] == 'page') {
+               if(current_user_can('edit_page', $ID)) {
+                       die(wp_create_nonce('update-page_' . $ID));
+               }
+       }
+       die('0');
+break;
+default :
+       do_action( 'wp_ajax_' . $_POST['action'] );
+       die('0');
+       break;
+endswitch;
+?>
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php
deleted file mode 100644 (file)
index d909ee6..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-<?php
-
-function get_users_drafts( $user_id ) {
-       global $wpdb;
-       $user_id = (int) $user_id;
-       $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC";
-       $query = apply_filters('get_users_drafts', $query);
-       return $wpdb->get_results( $query );
-}
-
-function get_others_drafts( $user_id ) {
-       global $wpdb;
-       $user = get_userdata( $user_id );
-       $level_key = $wpdb->prefix . 'user_level';
-
-       $editable = get_editable_user_ids( $user_id );
-       
-       if( !$editable ) {
-               $other_drafts = '';
-       } else {
-               $editable = join(',', $editable);
-               $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' ");
-       }
-
-       return apply_filters('get_others_drafts', $other_drafts);
-}
-
-function get_editable_authors( $user_id ) {
-       global $wpdb;
-
-       $editable = get_editable_user_ids( $user_id );
-
-       if( !$editable ) {
-               return false;
-       } else {
-               $editable = join(',', $editable);
-               $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
-       }
-
-       return apply_filters('get_editable_authors', $authors);
-}
-
-function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
-       global $wpdb;
-       
-       $user = new WP_User( $user_id );
-       
-       if ( ! $user->has_cap('edit_others_posts') ) {
-               if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
-                       return array($user->id);
-               else 
-                       return false;
-       }
-
-       $level_key = $wpdb->prefix . 'user_level';
-
-       $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
-       if ( $exclude_zeros )
-               $query .= " AND meta_value != '0'";
-               
-       return $wpdb->get_col( $query );
-}
-
-function get_author_user_ids() {
-       global $wpdb;
-       $level_key = $wpdb->prefix . 'user_level';
-
-       $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value != '0'";
-
-       return $wpdb->get_col( $query );
-}
-
-function get_nonauthor_user_ids() {
-       global $wpdb;
-       $level_key = $wpdb->prefix . 'user_level';
-
-       $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value = '0'";
-
-       return $wpdb->get_col( $query );
-}
-
-function wp_insert_category($catarr) {
-       global $wpdb;
-
-       extract($catarr);
-
-       $cat_ID = (int) $cat_ID;
-
-       // Are we updating or creating?
-       if (!empty ($cat_ID))
-               $update = true;
-       else
-               $update = false;
-
-       $cat_name = apply_filters('pre_category_name', $cat_name);
-       
-       if (empty ($category_nicename))
-               $category_nicename = sanitize_title($cat_name);
-       else
-               $category_nicename = sanitize_title($category_nicename);
-       $category_nicename = apply_filters('pre_category_nicename', $category_nicename);
-
-       if (empty ($category_description))
-               $category_description = '';
-       $category_description = apply_filters('pre_category_description', $category_description);
-
-       $category_parent = (int) $category_parent;
-       if (empty ($category_parent))
-               $category_parent = 0;
-
-       if (!$update) {
-               $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent')");
-               $cat_ID = (int) $wpdb->insert_id;
-       } else {
-               $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'");
-       }
-       
-       if ( $category_nicename == '' ) {
-               $category_nicename = sanitize_title($cat_name, $cat_ID );
-               $wpdb->query( "UPDATE $wpdb->categories SET category_nicename = '$category_nicename' WHERE cat_ID = '$cat_ID'" );
-       }
-
-       wp_cache_delete($cat_ID, 'category');
-
-       if ($update) {
-               do_action('edit_category', $cat_ID);
-       } else {
-               wp_cache_delete('all_category_ids', 'category');
-               do_action('create_category', $cat_ID);
-               do_action('add_category', $cat_ID);
-       }
-
-       return $cat_ID;
-}
-
-function wp_update_category($catarr) {
-       global $wpdb;
-
-       $cat_ID = (int) $catarr['cat_ID'];
-
-       // First, get all of the original fields
-       $category = get_category($cat_ID, ARRAY_A);
-
-       // Escape data pulled from DB.
-       $category = add_magic_quotes($category);
-
-       // Merge old and new fields with new fields overwriting old ones.
-       $catarr = array_merge($category, $catarr);
-
-       return wp_insert_category($catarr);
-}
-
-function wp_delete_category($cat_ID) {
-       global $wpdb;
-
-       $cat_ID = (int) $cat_ID;
-
-       // Don't delete the default cat.
-       if ($cat_ID == get_option('default_category'))
-               return 0;
-
-       $category = get_category($cat_ID);
-
-       $parent = $category->category_parent;
-
-       // Delete the category.
-       $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
-
-       // Update children to point to new parent.
-       $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$parent' WHERE category_parent = '$cat_ID'");
-
-       // TODO: Only set categories to general if they're not in another category already
-       $default_cat = get_option('default_category');
-       $wpdb->query("UPDATE $wpdb->post2cat SET category_id='$default_cat' WHERE category_id='$cat_ID'");
-
-       wp_cache_delete($cat_ID, 'category');
-       wp_cache_delete('all_category_ids', 'category');
-
-       do_action('delete_category', $cat_ID);
-
-       return 1;
-}
-
-function wp_create_category($cat_name) {
-       $cat_array = compact('cat_name');
-       return wp_insert_category($cat_array);
-}
-
-function wp_create_categories($categories, $post_id = '') {
-       $cat_ids = array ();
-       foreach ($categories as $category) {
-               if ($id = category_exists($category))
-                       $cat_ids[] = $id;
-               else
-                       if ($id = wp_create_category($category))
-                               $cat_ids[] = $id;
-       }
-
-       if ($post_id)
-               wp_set_post_cats('', $post_id, $cat_ids);
-
-       return $cat_ids;
-}
-
-function category_exists($cat_name) {
-       global $wpdb;
-       if (!$category_nicename = sanitize_title($cat_name))
-               return 0;
-
-       return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
-}
-
-function wp_delete_user($id, $reassign = 'novalue') {
-       global $wpdb;
-
-       $id = (int) $id;
-       $user = get_userdata($id);
-
-       if ($reassign == 'novalue') {
-               $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id");
-
-               if ($post_ids) {
-                       foreach ($post_ids as $post_id)
-                               wp_delete_post($post_id);
-               }
-
-               // Clean links
-               $wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id");
-       } else {
-               $reassign = (int) $reassign;
-               $wpdb->query("UPDATE $wpdb->posts SET post_author = {$reassign} WHERE post_author = {$id}");
-               $wpdb->query("UPDATE $wpdb->links SET link_owner = {$reassign} WHERE link_owner = {$id}");
-       }
-
-       // FINALLY, delete user
-       $wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
-       $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$id'");
-
-       wp_cache_delete($id, 'users');
-       wp_cache_delete($user->user_login, 'userlogins');
-
-       do_action('delete_user', $id);
-
-       return true;
-}
-
-function get_link($link_id, $output = OBJECT) {
-       global $wpdb;
-       
-       $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'");
-
-       if ( $output == OBJECT ) {
-               return $link;
-       } elseif ( $output == ARRAY_A ) {
-               return get_object_vars($link);
-       } elseif ( $output == ARRAY_N ) {
-               return array_values(get_object_vars($link));
-       } else {
-               return $link;
-       }
-}
-
-function wp_insert_link($linkdata) {
-       global $wpdb, $current_user;
-       
-       extract($linkdata);
-
-       $update = false;
-
-       if ( !empty($link_id) )
-               $update = true;
-
-       $link_id = (int) $link_id;
-
-       if( trim( $link_name ) == '' )
-               return 0;
-       $link_name = apply_filters('pre_link_name', $link_name);
-
-       if( trim( $link_url ) == '' )
-               return 0;
-       $link_url = apply_filters('pre_link_url', $link_url);
-
-       if ( empty($link_rating) )
-               $link_rating = 0;       
-       else
-               $link_rating = (int) $link_rating;
-
-       if ( empty($link_image) )
-               $link_image = '';
-       $link_image = apply_filters('pre_link_image', $link_image);
-
-       if ( empty($link_target) )
-               $link_target = '';      
-       $link_target = apply_filters('pre_link_target', $link_target);
-
-       if ( empty($link_visible) )
-               $link_visible = 'Y';
-       $link_visibile = preg_replace('/[^YNyn]/', '', $link_visible);
-
-       if ( empty($link_owner) )
-               $link_owner = $current_user->id;
-       else
-               $link_owner = (int) $link_owner;
-
-       if ( empty($link_notes) )
-               $link_notes = '';
-       $link_notes = apply_filters('pre_link_notes', $link_notes);
-
-       if ( empty($link_description) )
-               $link_description = '';
-       $link_description = apply_filters('pre_link_description', $link_description);
-
-       if ( empty($link_rss) )
-               $link_rss = '';
-       $link_rss = apply_filters('pre_link_rss', $link_rss);
-
-       if ( empty($link_rel) )
-               $link_rel = '';
-       $link_rel = apply_filters('pre_link_rel', $link_rel);
-
-       if ( $update ) {
-               $wpdb->query("UPDATE $wpdb->links SET link_url='$link_url',
-                       link_name='$link_name', link_image='$link_image',
-                       link_target='$link_target', link_category='$link_category',
-                       link_visible='$link_visible', link_description='$link_description',
-                       link_rating='$link_rating', link_rel='$link_rel',
-                       link_notes='$link_notes', link_rss = '$link_rss'
-                       WHERE link_id='$link_id'");
-       } else {
-               $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_category', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
-               $link_id = (int) $wpdb->insert_id;
-       }
-       
-       if ( $update )
-               do_action('edit_link', $link_id);
-       else
-               do_action('add_link', $link_id);
-
-       return $link_id;
-}
-
-function wp_update_link($linkdata) {
-       global $wpdb;
-
-       $link_id = (int) $linkdata['link_id'];
-       
-       $link = get_link($link_id, ARRAY_A);
-       
-       // Escape data pulled from DB.
-       $link = add_magic_quotes($link);
-       
-       // Merge old and new fields with new fields overwriting old ones.
-       $linkdata = array_merge($link, $linkdata);
-
-       return wp_insert_link($linkdata);
-}
-
-function wp_delete_link($link_id) {
-       global $wpdb;
-
-       do_action('delete_link', $link_id);
-       return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");     
-}
-
-function post_exists($title, $content = '', $post_date = '') {
-       global $wpdb;
-
-       if (!empty ($post_date))
-               $post_date = "AND post_date = '$post_date'";
-
-       if (!empty ($title))
-               return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' $post_date");
-       else
-               if (!empty ($content))
-                       return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_content = '$content' $post_date");
-
-       return 0;
-}
-
-function comment_exists($comment_author, $comment_date) {
-       global $wpdb;
-
-       return $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments
-                       WHERE comment_author = '$comment_author' AND comment_date = '$comment_date'");
-}
-
-?>
index 88e69ae4838e4ca68ab50bd56ec08404dc59e5ed..a96770b53166df92ab03cde6a17bb097dae4f45a 100644 (file)
@@ -1,19 +1,13 @@
 
-<div id="footer"><p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
-<p>
-<a href="http://codex.wordpress.org/"><?php _e('Documentation'); ?></a> &#8212; <a href="http://wordpress.org/support/"><?php _e('Support Forums'); ?></a> <br />
-<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?>
-</p>
+<div id="footer">
+<p><?php
 
+$upgrade = apply_filters( 'update_footer', '' );
+echo __('Thank you for creating with <a href="http://wordpress.org/">WordPress</a>').' | '.__('<a href="http://codex.wordpress.org/">Documentation</a>').' | '.__('<a href="http://wordpress.org/support/forum/4">Feedback</a>').' '.$upgrade;
+
+?></p>
 </div>
 <?php do_action('admin_footer', ''); ?>
 <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
-
-<?php
-if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) {
-       echo '<iframe id="pingcheck" src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>';
-}
-?>
-
 </body>
 </html>
index 641ed1e2274ff48ed0a614b6f697031eed61b1ee..04b1b364f196b550a231df33a184f25b6f14f8c4 100644 (file)
 <?php
-
-// Creates a new post from the "Write Post" form using $_POST information.
-function write_post() {
-       global $user_ID;
-
-       if (!current_user_can('edit_posts'))
-               die(__('You are not allowed to create posts or drafts on this blog.'));
-
-       // Rename.
-       $_POST['post_content'] = $_POST['content'];
-       $_POST['post_excerpt'] = $_POST['excerpt'];
-       $_POST['post_parent'] = $_POST['parent_id'];
-       $_POST['to_ping'] = $_POST['trackback_url'];
-
-       if (!empty ($_POST['post_author_override'])) {
-               $_POST['post_author'] = (int) $_POST['post_author_override'];
-       } else
-               if (!empty ($_POST['post_author'])) {
-                       $_POST['post_author'] = (int) $_POST['post_author'];
-               } else {
-                       $_POST['post_author'] = (int) $_POST['user_ID'];
-               }
-
-       if (($_POST['post_author'] != $_POST['user_ID']) && !current_user_can('edit_others_posts'))
-               die(__('You cannot post as this user.'));
-
-       // What to do based on which button they pressed
-       if ('' != $_POST['saveasdraft'])
-               $_POST['post_status'] = 'draft';
-       if ('' != $_POST['saveasprivate'])
-               $_POST['post_status'] = 'private';
-       if ('' != $_POST['publish'])
-               $_POST['post_status'] = 'publish';
-       if ('' != $_POST['advanced'])
-               $_POST['post_status'] = 'draft';
-       if ('' != $_POST['savepage'])
-               $_POST['post_status'] = 'static';
-
-       if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts'))
-               $_POST['post_status'] = 'draft';
-
-       if ('static' == $_POST['post_status'] && !current_user_can('edit_pages'))
-               die(__('This user cannot edit pages.'));
-
-       if (!isset ($_POST['comment_status']))
-               $_POST['comment_status'] = 'closed';
-
-       if (!isset ($_POST['ping_status']))
-               $_POST['ping_status'] = 'closed';
-
-       if (!empty ($_POST['edit_date'])) {
-               $aa = $_POST['aa'];
-               $mm = $_POST['mm'];
-               $jj = $_POST['jj'];
-               $hh = $_POST['hh'];
-               $mn = $_POST['mn'];
-               $ss = $_POST['ss'];
-               $jj = ($jj > 31) ? 31 : $jj;
-               $hh = ($hh > 23) ? $hh -24 : $hh;
-               $mn = ($mn > 59) ? $mn -60 : $mn;
-               $ss = ($ss > 59) ? $ss -60 : $ss;
-               $_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
-               $_POST['post_date_gmt'] = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss");
-       }
-
-       // Create the post.
-       $post_ID = wp_insert_post($_POST);
-       add_meta($post_ID);
-
-       // Reunite any orphaned attachments with their parent
-       if ( $_POST['temp_ID'] )
-               relocate_children($_POST['temp_ID'], $post_ID);
-
-       // Now that we have an ID we can fix any attachment anchor hrefs
-       fix_attachment_links($post_ID);
-
-       return $post_ID;
-}
-
-// Move child posts to a new parent
-function relocate_children($old_ID, $new_ID) {
-       global $wpdb;
-       $old_ID = (int) $old_ID;
-       $new_ID = (int) $new_ID;
-       return $wpdb->query("UPDATE $wpdb->posts SET post_parent = $new_ID WHERE post_parent = $old_ID");
-}
-
-// Replace hrefs of attachment anchors with up-to-date permalinks.
-function fix_attachment_links($post_ID) {
-       global $wp_rewrite;
-
-       $post = & get_post($post_ID, ARRAY_A);
-
-       $search = "#<a[^>]+rel=('|\")[^'\"]*attachment[^>]*>#ie";
-
-       // See if we have any rel="attachment" links
-       if ( 0 == preg_match_all($search, $post['post_content'], $anchor_matches, PREG_PATTERN_ORDER) )
-               return;
-
-       $i = 0;
-       $search = "# id=(\"|')p(\d+)\\1#i";
-       foreach ( $anchor_matches[0] as $anchor ) {
-               if ( 0 == preg_match($search, $anchor, $id_matches) )
-                       continue;
-
-               $id = $id_matches[2];
-
-               // While we have the attachment ID, let's adopt any orphans.
-               $attachment = & get_post($id, ARRAY_A);
-               if ( ! empty($attachment) && ! is_object(get_post($attachment['post_parent'])) ) {
-                       $attachment['post_parent'] = $post_ID;
-                       // Escape data pulled from DB.
-                       $attachment = add_magic_quotes($attachment);
-                       wp_update_post($attachment);
-               }
-
-               $post_search[$i] = $anchor;
-               $post_replace[$i] = preg_replace("#href=(\"|')[^'\"]*\\1#e", "stripslashes('href=\\1').get_attachment_link($id).stripslashes('\\1')", $anchor);
-               ++$i;
-       }
-
-       $post['post_content'] = str_replace($post_search, $post_replace, $post['post_content']);
-
-       // Escape data pulled from DB.
-       $post = add_magic_quotes($post);
-
-       return wp_update_post($post);
-}
-
-// Update an existing post with values provided in $_POST.
-function edit_post() {
-       global $user_ID;
-
-       $post_ID = (int) $_POST['post_ID'];
-
-       if (!current_user_can('edit_post', $post_ID))
-               die(__('You are not allowed to edit this post.'));
-
-       // Rename.
-       $_POST['ID'] = (int) $_POST['post_ID'];
-       $_POST['post_content'] = $_POST['content'];
-       $_POST['post_excerpt'] = $_POST['excerpt'];
-       $_POST['post_parent'] = $_POST['parent_id'];
-       $_POST['to_ping'] = $_POST['trackback_url'];
-
-       if (!empty ($_POST['post_author_override'])) {
-               $_POST['post_author'] = (int) $_POST['post_author_override'];
-       } else
-               if (!empty ($_POST['post_author'])) {
-                       $_POST['post_author'] = (int) $_POST['post_author'];
-               } else {
-                       $_POST['post_author'] = (int) $_POST['user_ID'];
-               }
-
-       if (($_POST['post_author'] != $_POST['user_ID']) && !current_user_can('edit_others_posts'))
-               die(__('You cannot post as this user.'));
-
-       // What to do based on which button they pressed
-       if ('' != $_POST['saveasdraft'])
-               $_POST['post_status'] = 'draft';
-       if ('' != $_POST['saveasprivate'])
-               $_POST['post_status'] = 'private';
-       if ('' != $_POST['publish'])
-               $_POST['post_status'] = 'publish';
-       if ('' != $_POST['advanced'])
-               $_POST['post_status'] = 'draft';
-       if ('' != $_POST['savepage'])
-               $_POST['post_status'] = 'static';
-
-       if ('publish' == $_POST['post_status'] && !current_user_can('publish_posts'))
-               $_POST['post_status'] = 'draft';
-
-       if ('static' == $_POST['post_status'] && !current_user_can('edit_pages'))
-               die(__('This user cannot edit pages.'));
-
-       if (!isset ($_POST['comment_status']))
-               $_POST['comment_status'] = 'closed';
-
-       if (!isset ($_POST['ping_status']))
-               $_POST['ping_status'] = 'closed';
-
-       if (!empty ($_POST['edit_date'])) {
-               $aa = $_POST['aa'];
-               $mm = $_POST['mm'];
-               $jj = $_POST['jj'];
-               $hh = $_POST['hh'];
-               $mn = $_POST['mn'];
-               $ss = $_POST['ss'];
-               $jj = ($jj > 31) ? 31 : $jj;
-               $hh = ($hh > 23) ? $hh -24 : $hh;
-               $mn = ($mn > 59) ? $mn -60 : $mn;
-               $ss = ($ss > 59) ? $ss -60 : $ss;
-               $_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
-               $_POST['post_date_gmt'] = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss");
-       }
-
-       // Meta Stuff
-       if ($_POST['meta']) {
-               foreach ($_POST['meta'] as $key => $value)
-                       update_meta($key, $value['key'], $value['value']);
-       }
-       
-       if ($_POST['deletemeta']) {
-               foreach ($_POST['deletemeta'] as $key => $value)
-                       delete_meta($key);
-       }
-
-       add_meta($post_ID);
-
-       wp_update_post($_POST);
-
-       // Now that we have an ID we can fix any attachment anchor hrefs
-       fix_attachment_links($post_ID);
-
-       return $post_ID;
-}
-
-function edit_comment() {
-       global $user_ID;
-
-       $comment_ID = (int) $_POST['comment_ID'];
-       $comment_post_ID = (int) $_POST['comment_post_ID'];
-
-       if (!current_user_can('edit_post', $comment_post_ID))
-               die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.'));
-
-       $_POST['comment_author'] = $_POST['newcomment_author'];
-       $_POST['comment_author_email'] = $_POST['newcomment_author_email'];
-       $_POST['comment_author_url'] = $_POST['newcomment_author_url'];
-       $_POST['comment_approved'] = $_POST['comment_status'];
-       $_POST['comment_content'] = $_POST['content'];
-       $_POST['comment_ID'] = (int) $_POST['comment_ID'];
-
-       if (!empty ($_POST['edit_date'])) {
-               $aa = $_POST['aa'];
-               $mm = $_POST['mm'];
-               $jj = $_POST['jj'];
-               $hh = $_POST['hh'];
-               $mn = $_POST['mn'];
-               $ss = $_POST['ss'];
-               $jj = ($jj > 31) ? 31 : $jj;
-               $hh = ($hh > 23) ? $hh -24 : $hh;
-               $mn = ($mn > 59) ? $mn -60 : $mn;
-               $ss = ($ss > 59) ? $ss -60 : $ss;
-               $_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
-       }
-
-       wp_update_comment($_POST);
-}
-
-// Get an existing post and format it for editing.
-function get_post_to_edit($id) {
-       global $richedit;
-       $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;
-
-       $post = get_post($id);
-
-       $post->post_content = format_to_edit($post->post_content, $richedit);
-       $post->post_content = apply_filters('content_edit_pre', $post->post_content);
-
-       $post->post_excerpt = format_to_edit($post->post_excerpt);
-       $post->post_excerpt = apply_filters('excerpt_edit_pre', $post->post_excerpt);
-
-       $post->post_title = format_to_edit($post->post_title);
-       $post->post_title = apply_filters('title_edit_pre', $post->post_title);
-
-    $post->post_password = format_to_edit($post->post_password); 
-
-       if ($post->post_status == 'static')
-               $post->page_template = get_post_meta($id, '_wp_page_template', true);
-
-       return $post;
-}
-
-// Default post information to use when populating the "Write Post" form.
-function get_default_post_to_edit() {
-       if ( !empty($_REQUEST['post_title']) )
-               $post_title = wp_specialchars(stripslashes($_REQUEST['post_title']));
-       else if ( !empty($_REQUEST['popuptitle']) ) {
-               $post_title = wp_specialchars(stripslashes($_REQUEST['popuptitle']));
-               $post_title = funky_javascript_fix($post_title);
-       } else {
-               $post_title = '';
-       }
-
-       if ( !empty($_REQUEST['content']) )
-               $post_content = wp_specialchars(stripslashes($_REQUEST['content']));
-       else if ( !empty($post_title) ) {
-               $text       = wp_specialchars(stripslashes(urldecode($_REQUEST['text'])));
-               $text       = funky_javascript_fix($text);
-               $popupurl   = clean_url(stripslashes($_REQUEST['popupurl']));
-        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
-    }
-
-       if ( !empty($_REQUEST['excerpt']) )
-               $post_excerpt = wp_specialchars(stripslashes($_REQUEST['excerpt']));
-       else
-               $post_excerpt = '';
-
-       $post->post_status = 'draft';
-       $post->comment_status = get_settings('default_comment_status');
-       $post->ping_status = get_settings('default_ping_status');
-       $post->post_pingback = get_settings('default_pingback_flag');
-       $post->post_category = get_settings('default_category');
-       $post->post_content = apply_filters('default_content', $post_content);
-       $post->post_title = apply_filters('default_title', $post_title);
-       $post->post_excerpt = apply_filters('default_excerpt', $post_excerpt);
-       $post->page_template = 'default';
-       $post->post_parent = 0;
-       $post->menu_order = 0;
-
-       return $post;
-}
-
-function get_comment_to_edit($id) {
-       global $richedit;
-       $richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;
-
-       $comment = get_comment($id);
-
-       $comment->comment_ID = (int) $comment->comment_ID;
-       $comment->comment_post_ID = (int) $comment->comment_post_ID;
-
-       $comment->comment_content = format_to_edit($comment->comment_content);
-       $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content);
-
-       $comment->comment_author = format_to_edit($comment->comment_author);
-       $comment->comment_author_email = format_to_edit($comment->comment_author_email);
-       $comment->comment_author_url = clean_url($comment->comment_author_url);
-       $comment->comment_author_url = format_to_edit($comment->comment_author_url);
-
-       return $comment;
-}
-
-function get_category_to_edit($id) {
-       $category = get_category($id);
-
-       return $category;
-}
-
-function get_user_to_edit($user_id) {
-       $user = new WP_User($user_id);
-       $user->user_login   = attribute_escape($user->user_login);
-       $user->user_email   = attribute_escape($user->user_email);
-       $user->user_url     = clean_url($user->user_url);
-       $user->first_name   = attribute_escape($user->first_name);
-       $user->last_name    = attribute_escape($user->last_name);
-       $user->display_name = attribute_escape($user->display_name);
-       $user->nickname     = attribute_escape($user->nickname);
-       $user->aim          = attribute_escape($user->aim);
-       $user->yim          = attribute_escape($user->yim);
-       $user->jabber       = attribute_escape($user->jabber);
-       $user->description  =  wp_specialchars($user->description);
-
-       return $user;
-}
-
-// Creates a new user from the "Users" form using $_POST information.
-
-function add_user() {
-       return edit_user();
-}
-
-function edit_user($user_id = 0) {
-       global $current_user, $wp_roles, $wpdb;
-
-       if ($user_id != 0) {
-               $update = true;
-               $user->ID = (int) $user_id;
-               $userdata = get_userdata($user_id);
-               $user->user_login = $wpdb->escape($userdata->user_login);
-       } else {
-               $update = false;
-               $user = '';
-       }
-
-       if (isset ($_POST['user_login']))
-               $user->user_login = wp_specialchars(trim($_POST['user_login']));
-
-       $pass1 = $pass2 = '';
-       if (isset ($_POST['pass1']))
-               $pass1 = $_POST['pass1'];
-       if (isset ($_POST['pass2']))
-               $pass2 = $_POST['pass2'];
-
-       if (isset ($_POST['role']) && current_user_can('edit_users')) {
-               if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users'))
-                       $user->role = $_POST['role'];
-       }
-
-       if (isset ($_POST['email']))
-               $user->user_email = wp_specialchars(trim($_POST['email']));
-       if (isset ($_POST['url'])) {
-               $user->user_url = clean_url(trim($_POST['url']));
-               $user->user_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
-       }
-       if (isset ($_POST['first_name']))
-               $user->first_name = wp_specialchars(trim($_POST['first_name']));
-       if (isset ($_POST['last_name']))
-               $user->last_name = wp_specialchars(trim($_POST['last_name']));
-       if (isset ($_POST['nickname']))
-               $user->nickname = wp_specialchars(trim($_POST['nickname']));
-       if (isset ($_POST['display_name']))
-               $user->display_name = wp_specialchars(trim($_POST['display_name']));
-       if (isset ($_POST['description']))
-               $user->description = trim($_POST['description']);
-       if (isset ($_POST['jabber']))
-               $user->jabber = wp_specialchars(trim($_POST['jabber']));
-       if (isset ($_POST['aim']))
-               $user->aim = wp_specialchars(trim($_POST['aim']));
-       if (isset ($_POST['yim']))
-               $user->yim = wp_specialchars(trim($_POST['yim']));
-
-       $errors = array ();
-
-       /* checking that username has been typed */
-       if ($user->user_login == '')
-               $errors['user_login'] = __('<strong>ERROR</strong>: Please enter a username.');
-
-       /* checking the password has been typed twice */
-       do_action('check_passwords', array ($user->user_login, & $pass1, & $pass2));
-
-       if (!$update) {
-               if ($pass1 == '' || $pass2 == '')
-                       $errors['pass'] = __('<strong>ERROR</strong>: Please enter your password twice.');
-       } else {
-               if ((empty ($pass1) && !empty ($pass2)) || (empty ($pass2) && !empty ($pass1)))
-                       $errors['pass'] = __("<strong>ERROR</strong>: you typed your new password only once.");
-       }
-
-       /* Check for "\" in password */
-       if( strpos( " ".$pass1, "\\" ) )
-               $errors['pass'] = __('<strong>ERROR</strong>: Passwords may not contain the character "\\".');
-
-       /* checking the password has been typed twice the same */
-       if ($pass1 != $pass2)
-               $errors['pass'] = __('<strong>ERROR</strong>: Please type the same password in the two password fields.');
-
-       if (!empty ($pass1))
-               $user->user_pass = $pass1;
-
-       if ( !validate_username($user->user_login) )
-               $errors['user_login'] = __('<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.');
-
-       if (!$update && username_exists($user->user_login))
-               $errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.');
-
-       /* checking e-mail address */
-       if (empty ($user->user_email)) {
-               $errors['user_email'] = __("<strong>ERROR</strong>: please type an e-mail address");
-       } else
-               if (!is_email($user->user_email)) {
-                       $errors['user_email'] = __("<strong>ERROR</strong>: the email address isn't correct");
-               }
-
-       if (count($errors) != 0)
-               return $errors;
-
-       if ($update) {
-               $user_id = wp_update_user(get_object_vars($user));
-       } else {
-               $user_id = wp_insert_user(get_object_vars($user));
-               wp_new_user_notification($user_id);
-       }
-
-       return $errors;
-}
-
-
-function get_link_to_edit($link_id) {
-       $link = get_link($link_id);
-
-       $link->link_url         =        clean_url($link->link_url);
-       $link->link_name        = attribute_escape($link->link_name);
-       $link->link_image       = attribute_escape($link->link_image);
-       $link->link_description = attribute_escape($link->link_description);
-       $link->link_rss         =        clean_url($link->link_rss);
-       $link->link_rel         = attribute_escape($link->link_rel);
-       $link->link_notes       =  wp_specialchars($link->link_notes);
-       $link->post_category    = $link->link_category;
-
-       return $link;
-}
-
-function get_default_link_to_edit() {
-       if ( isset($_GET['linkurl']) )
-               $link->link_url = clean_url($_GET['linkurl']);
-       else
-               $link->link_url = '';
-       
-       if ( isset($_GET['name']) )
-               $link->link_name = attribute_escape($_GET['name']);
-       else
-               $link->link_name = '';
-               
-       return $link;
-}
-
-function add_link() {
-       return edit_link();     
-}
-
-function edit_link($link_id = '') {
-       if (!current_user_can('manage_links'))
-               die(__("Cheatin' uh ?"));
-
-       $_POST['link_url'] = wp_specialchars($_POST['link_url']);
-       $_POST['link_url'] = clean_url($_POST['link_url']);
-       $_POST['link_name'] = wp_specialchars($_POST['link_name']);
-       $_POST['link_image'] = wp_specialchars($_POST['link_image']);
-       $_POST['link_rss'] = clean_url($_POST['link_rss']);
-       $auto_toggle = get_autotoggle($_POST['link_category']);
-       
-       // if we are in an auto toggle category and this one is visible then we
-       // need to make the others invisible before we add this new one.
-       // FIXME Add category toggle func.
-       //if (($auto_toggle == 'Y') && ($link_visible == 'Y')) {
-       //      $wpdb->query("UPDATE $wpdb->links set link_visible = 'N' WHERE link_category = $link_category");
-       //}
-
-       if ( !empty($link_id) ) {
-               $_POST['link_id'] = $link_id;
-               return wp_update_link($_POST);
-       } else {
-               return wp_insert_link($_POST);
-       }
-}
-
-function url_shorten($url) {
-       $short_url = str_replace('http://', '', stripslashes($url));
-       $short_url = str_replace('www.', '', $short_url);
-       if ('/' == substr($short_url, -1))
-               $short_url = substr($short_url, 0, -1);
-       if (strlen($short_url) > 35)
-               $short_url = substr($short_url, 0, 32).'...';
-       return $short_url;
-}
-
-function selected($selected, $current) {
-       if ($selected == $current)
-               echo ' selected="selected"';
-}
-
-function checked($checked, $current) {
-       if ($checked == $current)
-               echo ' checked="checked"';
-}
-
-function return_categories_list($parent = 0) {
-       global $wpdb;
-       return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC");
-}
-
-function sort_cats($cat1, $cat2) {
-       return strcasecmp($cat1['cat_name'], $cat2['cat_name']);
-}
-
-function get_nested_categories($default = 0, $parent = 0) {
-       global $post_ID, $mode, $wpdb;
-
-       if ($post_ID) {
-               $checked_categories = $wpdb->get_col("
-                    SELECT category_id
-                    FROM $wpdb->categories, $wpdb->post2cat
-                    WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$post_ID'
-                    ");
-
-               if (count($checked_categories) == 0) {
-                       // No selected categories, strange
-                       $checked_categories[] = $default;
-               }
-
-       } else {
-               $checked_categories[] = $default;
-       }
-
-       $cats = return_categories_list($parent);
-       $result = array ();
-
-       if (is_array($cats)) {
-               foreach ($cats as $cat) {
-                       $result[$cat]['children'] = get_nested_categories($default, $cat);
-                       $result[$cat]['cat_ID'] = $cat;
-                       $result[$cat]['checked'] = in_array($cat, $checked_categories);
-                       $result[$cat]['cat_name'] = get_the_category_by_ID($cat);
-               }
-       }
-       
-       usort($result, 'sort_cats');
-
-       return $result;
-}
-
-function write_nested_categories($categories) {
-       foreach ($categories as $category) {
-               echo '<label for="category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : ""), '/> ', wp_specialchars($category['cat_name']), "</label>\n";
-
-               if (isset ($category['children'])) {
-                       echo "\n<span class='cat-nest'>\n";
-                       write_nested_categories($category['children']);
-                       echo "</span>\n";
-               }
-       }
-}
-
-function dropdown_categories($default = 0) {
-       write_nested_categories(get_nested_categories($default));
-}
-
-// Dandy new recursive multiple category stuff.
-function cat_rows($parent = 0, $level = 0, $categories = 0) {
-       global $wpdb, $class;
-
-       if (!$categories)
-               $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
-
-       if ($categories) {
-               foreach ($categories as $category) {
-                       if ($category->category_parent == $parent) {
-                               $category->cat_name = wp_specialchars($category->cat_name);
-                               $pad = str_repeat('&#8212; ', $level);
-                               if ( current_user_can('manage_categories') ) {
-                                       $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__('Edit')."</a></td>";
-                                       $default_cat_id = get_option('default_category');
-
-                                       if ($category->cat_ID != $default_cat_id)
-                                               $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape($category->cat_name))."' );\" class='delete'>".__('Delete')."</a>";
-                                       else
-                                               $edit .= "<td style='text-align:center'>".__("Default");
-                               }
-                               else
-                                       $edit = '';
-
-                               $class = ('alternate' == $class) ? '' : 'alternate';
-                               echo "<tr id='cat-$category->cat_ID' class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td>
-                                                               <td>$category->category_description</td>
-                                                               <td>$category->category_count</td>
-                                                               <td>$edit</td>
-                                                               </tr>";
-                               cat_rows($category->cat_ID, $level +1, $categories);
-                       }
-               }
-       } else {
-               return false;
-       }
-}
-
-function page_rows($parent = 0, $level = 0, $pages = 0) {
-       global $wpdb, $class, $post;
-       if (!$pages)
-               $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' ORDER BY menu_order");
-
-       if ($pages) {
-               foreach ($pages as $post) {
-                       start_wp();
-                       if ($post->post_parent == $parent) {
-                               $post->post_title = wp_specialchars($post->post_title);
-                               $pad = str_repeat('&#8212; ', $level);
-                               $id = $post->ID;
-                               $class = ('alternate' == $class) ? '' : 'alternate';
-?>
-  <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> 
-    <th scope="row"><?php echo $post->ID; ?></th> 
-    <td>
-      <?php echo $pad; ?><?php the_title() ?> 
-    </td> 
-    <td><?php the_author() ?></td>
-    <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td> 
-       <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
-    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 
-    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $id) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title()) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> 
-  </tr> 
-
-<?php
-
-                               page_rows($id, $level +1, $pages);
-                       }
-               }
-       } else {
-               return false;
-       }
-}
-
-function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) {
-       global $wpdb, $bgcolor;
-       if (!$categories) {
-               $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
-       }
-       if ($categories) {
-               foreach ($categories as $category) {
-                       if ($currentcat != $category->cat_ID && $parent == $category->category_parent) {
-                               $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
-                               $pad = str_repeat('&#8211; ', $level);
-                               $category->cat_name = wp_specialchars($category->cat_name);
-                               echo "\n\t<option value='$category->cat_ID'";
-                               if ($currentparent == $category->cat_ID)
-                                       echo " selected='selected'";
-                               echo ">$pad$category->cat_name</option>";
-                               wp_dropdown_cats($currentcat, $currentparent, $category->cat_ID, $level +1, $categories);
-                       }
-               }
-       } else {
-               return false;
-       }
-}
-
-function link_category_dropdown($fieldname, $selected = 0) {
-       global $wpdb;
-       
-       $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
-       echo "\n<select name='$fieldname' size='1'>\n";
-       foreach ($results as $row) {
-               echo "\n\t<option value='$row->cat_id'";
-               if ($row->cat_id == $selected)
-                       echo " selected='selected'";
-               echo ">$row->cat_id : " . wp_specialchars($row->cat_name);
-               if ($row->auto_toggle == 'Y')
-                       echo ' (auto toggle)';
-               echo "</option>";
-       }
-       echo "\n</select>\n";
-}
-
-function wp_create_thumbnail($file, $max_side, $effect = '') {
-
-               // 1 = GIF, 2 = JPEG, 3 = PNG
-
-       if (file_exists($file)) {
-               $type = getimagesize($file);
-
-               // if the associated function doesn't exist - then it's not
-               // handle. duh. i hope.
-
-               if (!function_exists('imagegif') && $type[2] == 1) {
-                       $error = __('Filetype not supported. Thumbnail not created.');
-               }
-               elseif (!function_exists('imagejpeg') && $type[2] == 2) {
-                       $error = __('Filetype not supported. Thumbnail not created.');
-               }
-               elseif (!function_exists('imagepng') && $type[2] == 3) {
-                       $error = __('Filetype not supported. Thumbnail not created.');
-               } else {
-
-                       // create the initial copy from the original file
-                       if ($type[2] == 1) {
-                               $image = imagecreatefromgif($file);
-                       }
-                       elseif ($type[2] == 2) {
-                               $image = imagecreatefromjpeg($file);
-                       }
-                       elseif ($type[2] == 3) {
-                               $image = imagecreatefrompng($file);
-                       }
-
-                       if (function_exists('imageantialias'))
-                               imageantialias($image, TRUE);
-
-                       $image_attr = getimagesize($file);
-
-                       // figure out the longest side
-
-                       if ($image_attr[0] > $image_attr[1]) {
-                               $image_width = $image_attr[0];
-                               $image_height = $image_attr[1];
-                               $image_new_width = $max_side;
-
-                               $image_ratio = $image_width / $image_new_width;
-                               $image_new_height = $image_height / $image_ratio;
-                               //width is > height
-                       } else {
-                               $image_width = $image_attr[0];
-                               $image_height = $image_attr[1];
-                               $image_new_height = $max_side;
-
-                               $image_ratio = $image_height / $image_new_height;
-                               $image_new_width = $image_width / $image_ratio;
-                               //height > width
-                       }
-
-                       $thumbnail = imagecreatetruecolor($image_new_width, $image_new_height);
-                       @ imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]);
-
-                       // If no filters change the filename, we'll do a default transformation.
-                       if ( basename($file) == $thumb = apply_filters('thumbnail_filename', basename($file)) )
-                               $thumb = preg_replace('!(\.[^.]+)?$!', __('.thumbnail').'$1', basename($file), 1);
-
-                       $thumbpath = str_replace(basename($file), $thumb, $file);
-
-                       // move the thumbnail to it's final destination
-                       if ($type[2] == 1) {
-                               if (!imagegif($thumbnail, $thumbpath)) {
-                                       $error = __("Thumbnail path invalid");
-                               }
-                       }
-                       elseif ($type[2] == 2) {
-                               if (!imagejpeg($thumbnail, $thumbpath)) {
-                                       $error = __("Thumbnail path invalid");
-                               }
-                       }
-                       elseif ($type[2] == 3) {
-                               if (!imagepng($thumbnail, $thumbpath)) {
-                                       $error = __("Thumbnail path invalid");
-                               }
-                       }
-
-               }
-       } else {
-               $error = __('File not found');
-       }
-
-       if (!empty ($error)) {
-               return $error;
-       } else {
-               return $thumbpath;
-       }
-}
-
-// Some postmeta stuff
-function has_meta($postid) {
-       global $wpdb;
-
-       return $wpdb->get_results("
-                       SELECT meta_key, meta_value, meta_id, post_id
-                       FROM $wpdb->postmeta
-                       WHERE post_id = '$postid'
-                       ORDER BY meta_key,meta_id", ARRAY_A);
-
-}
-
-function list_meta($meta) {
-       global $post_ID;
-       // Exit if no meta
-       if (!$meta)
-               return;
-       $count = 0;
-?>
-<table id='meta-list' cellpadding="3">
-       <tr>
-               <th><?php _e('Key') ?></th>
-               <th><?php _e('Value') ?></th>
-               <th colspan='2'><?php _e('Action') ?></th>
-       </tr>
-<?php
-
-
-       foreach ($meta as $entry) {
-               ++ $count;
-               if ($count % 2)
-                       $style = 'alternate';
-               else
-                       $style = '';
-               if ('_' == $entry['meta_key'] { 0 })
-                       $style .= ' hidden';
-
-               if ( is_serialized($entry['meta_value']) ) {
-                       if ( is_serialized_string($entry['meta_value']) ) {
-                               // this is a serialized string, so we should display it
-                               $entry['meta_value'] = maybe_unserialize($entry['meta_value']);
-                       } else {
-                               // this is a serialized array/object so we should NOT display it
-                               --$count;
-                               continue;
-                       }
-               }
-
-               $entry['meta_key'] = attribute_escape( $entry['meta_key']);
-               $entry['meta_value'] = attribute_escape( $entry['meta_value']);
-               $entry['meta_id'] = (int) $entry['meta_id'];
-               echo "
-                       <tr class='$style'>
-                               <td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>
-                               <td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>
-                               <td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".attribute_escape(__('Update'))."' /><br />
-                               <input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='".attribute_escape(__('Delete'))."' /></td>
-                       </tr>
-               ";
-       }
-       echo "
-               </table>
-       ";
-}
-
-// Get a list of previously defined keys
-function get_meta_keys() {
-       global $wpdb;
-
-       $keys = $wpdb->get_col("
-                       SELECT meta_key
-                       FROM $wpdb->postmeta
-                       GROUP BY meta_key
-                       ORDER BY meta_key");
-
-       return $keys;
-}
-
-function meta_form() {
-       global $wpdb;
-       $keys = $wpdb->get_col("
-                       SELECT meta_key
-                       FROM $wpdb->postmeta
-                       GROUP BY meta_key
-                       ORDER BY meta_id DESC
-                       LIMIT 10");
-?>
-<h3><?php _e('Add a new custom field:') ?></h3>
-<table cellspacing="3" cellpadding="3">
-       <tr>
-<th colspan="2"><?php _e('Key') ?></th>
-<th><?php _e('Value') ?></th>
-</tr>
-       <tr valign="top">
-               <td align="right" width="18%">
-<?php if ($keys) : ?>
-<select id="metakeyselect" name="metakeyselect" tabindex="7">
-<option value="#NONE#"><?php _e('- Select -'); ?></option>
-<?php
-
-       foreach ($keys as $key) {
-               $key = attribute_escape($key);
-               echo "\n\t<option value='$key'>$key</option>";
-       }
-?>
-</select> <?php _e('or'); ?>
-<?php endif; ?>
-</td>
-<td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
-               <td><textarea id="metavalue" name="metavalue" rows="3" cols="25" tabindex="8"></textarea></td>
-       </tr>
-
-</table>
-<p class="submit"><input type="submit" name="updatemeta" tabindex="9" value="<?php _e('Add Custom Field &raquo;') ?>" /></p>
-<?php
-
-}
-
-function add_meta($post_ID) {
-       global $wpdb;
-       $post_ID = (int) $post_ID;
-
-       $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
-
-       $metakeyselect = $wpdb->escape(stripslashes(trim($_POST['metakeyselect'])));
-       $metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput'])));
-       $metavalue = maybe_serialize(stripslashes((trim($_POST['metavalue']))));
-       $metavalue = $wpdb->escape($metavalue);
-
-       if ( ('0' === $metavalue || !empty ($metavalue)) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput)) ) {
-               // We have a key/value pair. If both the select and the 
-               // input for the key have data, the input takes precedence:
-
-               if ('#NONE#' != $metakeyselect)
-                       $metakey = $metakeyselect;
-
-               if ($metakeyinput)
-                       $metakey = $metakeyinput; // default
-
-               if ( in_array($metakey, $protected) )
-                       return false;
-
-               $result = $wpdb->query("
-                                               INSERT INTO $wpdb->postmeta 
-                                               (post_id,meta_key,meta_value) 
-                                               VALUES ('$post_ID','$metakey','$metavalue')
-                                       ");
-       }
-} // add_meta
-
-function delete_meta($mid) {
-       global $wpdb;
-       $mid = (int) $mid;
-
-       $result = $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'");
-}
-
-function update_meta($mid, $mkey, $mvalue) {
-       global $wpdb;
-
-       $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
-
-       if ( in_array($mkey, $protected) )
-               return false;
-
-       $mvalue = maybe_serialize(stripslashes($mvalue));
-       $mvalue = $wpdb->escape($mvalue);
-       $mid = (int) $mid;
-       return $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'");
-}
-
-function touch_time($edit = 1, $for_post = 1) {
-       global $month, $post, $comment;
-
-       if ( $for_post )
-               $edit = ( ('draft' == $post->post_status) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ) ? false : true;
-       echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__('Edit timestamp').'</label></legend>';
-
-       $time_adj = time() + (get_settings('gmt_offset') * 3600);
-       $post_date = ($for_post) ? $post->post_date : $comment->comment_date;
-       $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj);
-       $mm = ($edit) ? mysql2date('m', $post_date) : gmdate('m', $time_adj);
-       $aa = ($edit) ? mysql2date('Y', $post_date) : gmdate('Y', $time_adj);
-       $hh = ($edit) ? mysql2date('H', $post_date) : gmdate('H', $time_adj);
-       $mn = ($edit) ? mysql2date('i', $post_date) : gmdate('i', $time_adj);
-       $ss = ($edit) ? mysql2date('s', $post_date) : gmdate('s', $time_adj);
-
-       echo "<select name=\"mm\">\n";
-       for ($i = 1; $i < 13; $i = $i +1) {
-               echo "\t\t\t<option value=\"$i\"";
-               if ($i == $mm)
-                       echo " selected='selected'";
-               if ($i < 10) {
-                       $ii = "0".$i;
-               } else {
-                       $ii = "$i";
-               }
-               echo ">".$month["$ii"]."</option>\n";
-       }
-?>
-</select>
-<input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" />
-<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" /> @ 
-<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" /> : 
-<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" /> 
-<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" /> 
-<?php
-       if ( $edit ) {
-               _e('Existing timestamp');
-               echo ": {$month[$mm]} $jj, $aa @ $hh:$mn";
-       }
-?>
-</fieldset>
-       <?php
-
-}
-
-// insert_with_markers: Owen Winkler, fixed by Eric Anderson
-// Inserts an array of strings into a file (.htaccess), placing it between
-// BEGIN and END markers.  Replaces existing marked info.  Retains surrounding
-// data.  Creates file if none exists.
-// Returns true on write success, false on failure.
-function insert_with_markers($filename, $marker, $insertion) {
-       if (!file_exists($filename) || is_writeable($filename)) {
-               if (!file_exists($filename)) {
-                       $markerdata = '';
-               } else {
-                       $markerdata = explode("\n", implode('', file($filename)));
-               }
-
-               $f = fopen($filename, 'w');
-               $foundit = false;
-               if ($markerdata) {
-                       $state = true;
-                       foreach ($markerdata as $markerline) {
-                               if (strstr($markerline, "# BEGIN {$marker}"))
-                                       $state = false;
-                               if ($state)
-                                       fwrite($f, "{$markerline}\n");
-                               if (strstr($markerline, "# END {$marker}")) {
-                                       fwrite($f, "# BEGIN {$marker}\n");
-                                       if (is_array($insertion))
-                                               foreach ($insertion as $insertline)
-                                                       fwrite($f, "{$insertline}\n");
-                                       fwrite($f, "# END {$marker}\n");
-                                       $state = true;
-                                       $foundit = true;
-                               }
-                       }
-               }
-               if (!$foundit) {
-                       fwrite($f, "# BEGIN {$marker}\n");
-                       foreach ($insertion as $insertline)
-                               fwrite($f, "{$insertline}\n");
-                       fwrite($f, "# END {$marker}\n");
-               }
-               fclose($f);
-               return true;
-       } else {
-               return false;
-       }
-}
-
-// extract_from_markers: Owen Winkler
-// Returns an array of strings from a file (.htaccess) from between BEGIN
-// and END markers.
-function extract_from_markers($filename, $marker) {
-       $result = array ();
-
-       if (!file_exists($filename)) {
-               return $result;
-       }
-
-       if ($markerdata = explode("\n", implode('', file($filename))));
-       {
-               $state = false;
-               foreach ($markerdata as $markerline) {
-                       if (strstr($markerline, "# END {$marker}"))
-                               $state = false;
-                       if ($state)
-                               $result[] = $markerline;
-                       if (strstr($markerline, "# BEGIN {$marker}"))
-                               $state = true;
-               }
-       }
-
-       return $result;
-}
-
-function got_mod_rewrite() {
-       global $is_apache;
-
-       // take 3 educated guesses as to whether or not mod_rewrite is available
-       if ( !$is_apache )
-               return false;
-
-       if ( function_exists('apache_get_modules') ) {
-               if ( !in_array('mod_rewrite', apache_get_modules()) )
-                       return false;
-       }
-
-       return true;
-}
-
-function save_mod_rewrite_rules() {
-       global $is_apache, $wp_rewrite;
-       $home_path = get_home_path();
-
-       if (!$wp_rewrite->using_mod_rewrite_permalinks())
-               return;
-
-       if (!((!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess')))
-               return;
-
-       if (! got_mod_rewrite())
-               return;
-
-       $rules = explode("\n", $wp_rewrite->mod_rewrite_rules());
-       insert_with_markers($home_path.'.htaccess', 'WordPress', $rules);
-}
-
-function the_quicktags() {
-               echo '
-               <div id="quicktags">
-                       <script src="../wp-includes/js/quicktags.js" type="text/javascript"></script>
-                       <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
-               </div>
-';
-       echo '
-<script type="text/javascript">
-function edInsertContent(myField, myValue) {
-       //IE support
-       if (document.selection) {
-               myField.focus();
-               sel = document.selection.createRange();
-               sel.text = myValue;
-               myField.focus();
-       }
-       //MOZILLA/NETSCAPE support
-       else if (myField.selectionStart || myField.selectionStart == "0") {
-               var startPos = myField.selectionStart;
-               var endPos = myField.selectionEnd;
-               myField.value = myField.value.substring(0, startPos)
-                             + myValue 
-                      + myField.value.substring(endPos, myField.value.length);
-               myField.focus();
-               myField.selectionStart = startPos + myValue.length;
-               myField.selectionEnd = startPos + myValue.length;
-       } else {
-               myField.value += myValue;
-               myField.focus();
-       }
-}
-</script>
-';
-}
-
-function validate_current_theme() {
-       $theme_loc = 'wp-content/themes';
-       $theme_root = ABSPATH.$theme_loc;
-
-       $template = get_settings('template');
-       $stylesheet = get_settings('stylesheet');
-
-       if (($template != 'default') && (!file_exists("$theme_root/$template/index.php"))) {
-               update_option('template', 'default');
-               update_option('stylesheet', 'default');
-               do_action('switch_theme', 'Default');
-               return false;
-       }
-
-       if (($stylesheet != 'default') && (!file_exists("$theme_root/$stylesheet/style.css"))) {
-               update_option('template', 'default');
-               update_option('stylesheet', 'default');
-               do_action('switch_theme', 'Default');
-               return false;
-       }
-
-       return true;
-}
-
-function get_broken_themes() {
-       global $wp_broken_themes;
-
-       get_themes();
-       return $wp_broken_themes;
-}
-
-function get_page_templates() {
-       $themes = get_themes();
-       $theme = get_current_theme();
-       $templates = $themes[$theme]['Template Files'];
-       $page_templates = array ();
-
-       if (is_array($templates)) {
-               foreach ($templates as $template) {
-                       $template_data = implode('', file(ABSPATH.$template));
-                       preg_match("|Template Name:(.*)|i", $template_data, $name);
-                       preg_match("|Description:(.*)|i", $template_data, $description);
-
-                       $name = $name[1];
-                       $description = $description[1];
-
-                       if (!empty ($name)) {
-                               $page_templates[trim($name)] = basename($template);
-                       }
-               }
-       }
-
-       return $page_templates;
-}
-
-function page_template_dropdown($default = '') {
-       $templates = get_page_templates();
-       foreach (array_keys($templates) as $template)
-               : if ($default == $templates[$template])
-                       $selected = " selected='selected'";
-               else
-                       $selected = '';
-       echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
-       endforeach;
-}
-
-function parent_dropdown($default = 0, $parent = 0, $level = 0) {
-       global $wpdb, $post_ID;
-       $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
-
-       if ($items) {
-               foreach ($items as $item) {
-                       // A page cannot be it's own parent.
-                       if (!empty ($post_ID)) {
-                               if ($item->ID == $post_ID) {
-                                       continue;
-                               }
-                       }
-                       $pad = str_repeat('&nbsp;', $level * 3);
-                       if ($item->ID == $default)
-                               $current = ' selected="selected"';
-                       else
-                               $current = '';
-
-                       echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</option>";
-                       parent_dropdown($default, $item->ID, $level +1);
-               }
-       } else {
-               return false;
-       }
-}
-
-function user_can_access_admin_page() {
-       global $pagenow;
-       global $menu;
-       global $submenu;
-       global $plugin_page;
-
-       $parent = get_admin_page_parent();
-
-       foreach ($menu as $menu_array) {
-               //echo "parent array: " . $menu_array[2];
-               if ($menu_array[2] == $parent) {
-                       if (!current_user_can($menu_array[1])) {
-                               return false;
-                       } else {
-                               break;
-                       }
-               }
-       }
-
-       if (isset ($submenu[$parent])) {
-               if ( isset($plugin_page) ) {
-                       foreach ($submenu[$parent] as $submenu_array) {
-                               if ( $submenu_array[2] == $plugin_page ) {
-                                       if (!current_user_can($submenu_array[1]))
-                                               return false;
-                               }
-                       }
-               }
-
-               foreach ($submenu[$parent] as $submenu_array) {         
-                       if ($submenu_array[2] == $pagenow) {
-                               if (!current_user_can($submenu_array[1]))
-                                       return false;
-                               else
-                                       return true;
-                       }
-               }
-       }
-
-       return true;
-}
-
-function get_admin_page_title() {
-       global $title;
-       global $menu;
-       global $submenu;
-       global $pagenow;
-       global $plugin_page;
-
-       if (isset ($title) && !empty ($title)) {
-               return $title;
-       }
-
-       $hook = get_plugin_page_hook($plugin_page, $pagenow);
-
-       $parent = $parent1 = get_admin_page_parent();
-       if (empty ($parent)) {
-               foreach ($menu as $menu_array) {
-                       if (isset ($menu_array[3])) {
-                               if ($menu_array[2] == $pagenow) {
-                                       $title = $menu_array[3];
-                                       return $menu_array[3];
-                               } else
-                                       if (isset ($plugin_page) && ($plugin_page == $menu_array[2]) && ($hook == $menu_array[3])) {
-                                               $title = $menu_array[3];
-                                               return $menu_array[3];
-                                       }
-                       }
-               }
-       } else {
-               foreach (array_keys($submenu) as $parent) {
-                       foreach ($submenu[$parent] as $submenu_array) {
-                               if (isset ($submenu_array[3])) {
-                                       if ($submenu_array[2] == $pagenow) {
-                                               $title = $submenu_array[3];
-                                               return $submenu_array[3];
-                                       } else
-                                               if (isset ($plugin_page) && ($plugin_page == $submenu_array[2]) && (($parent == $pagenow) || ($parent == $plugin_page) || ($plugin_page == $hook) || (($pagenow == 'admin.php') && ($parent1 != $submenu_array[2])))) {
-                                                       $title = $submenu_array[3];
-                                                       return $submenu_array[3];
-                                               }
-                               }
-                       }
-               }
-       }
-
-       return '';
-}
-
-function get_admin_page_parent() {
-       global $parent_file;
-       global $menu;
-       global $submenu;
-       global $pagenow;
-       global $plugin_page;
-
-       if (isset ($parent_file) && !empty ($parent_file)) {
-               return $parent_file;
-       }
-
-       if ($pagenow == 'admin.php' && isset ($plugin_page)) {
-               foreach ($menu as $parent_menu) {
-                       if ($parent_menu[2] == $plugin_page) {
-                               $parent_file = $plugin_page;
-                               return $plugin_page;
-                       }
-               }
-       }
-
-       foreach (array_keys($submenu) as $parent) {
-               foreach ($submenu[$parent] as $submenu_array) {
-                       if ($submenu_array[2] == $pagenow) {
-                               $parent_file = $parent;
-                               return $parent;
-                       } else
-                               if (isset ($plugin_page) && ($plugin_page == $submenu_array[2])) {
-                                       $parent_file = $parent;
-                                       return $parent;
-                               }
-               }
-       }
-
-       $parent_file = '';
-       return '';
-}
-
-function add_menu_page($page_title, $menu_title, $access_level, $file, $function = '') {
-       global $menu, $admin_page_hooks;
-
-       $file = plugin_basename($file);
-
-       $menu[] = array ($menu_title, $access_level, $file, $page_title);
-
-       $admin_page_hooks[$file] = sanitize_title($menu_title);
-
-       $hookname = get_plugin_page_hookname($file, '');
-       if (!empty ($function) && !empty ($hookname))
-               add_action($hookname, $function);
-
-       return $hookname;
-}
-
-function add_submenu_page($parent, $page_title, $menu_title, $access_level, $file, $function = '') {
-       global $submenu;
-       global $menu;
-
-       $parent = plugin_basename($parent);
-       $file = plugin_basename($file);
-
-       // If the parent doesn't already have a submenu, add a link to the parent
-       // as the first item in the submenu.  If the submenu file is the same as the
-       // parent file someone is trying to link back to the parent manually.  In
-       // this case, don't automatically add a link back to avoid duplication.
-       if (!isset ($submenu[$parent]) && $file != $parent) {
-               foreach ($menu as $parent_menu) {
-                       if ($parent_menu[2] == $parent) {
-                               $submenu[$parent][] = $parent_menu;
-                       }
-               }
-       }
-
-       $submenu[$parent][] = array ($menu_title, $access_level, $file, $page_title);
-
-       $hookname = get_plugin_page_hookname($file, $parent);
-       if (!empty ($function) && !empty ($hookname))
-               add_action($hookname, $function);
-
-       return $hookname;
-}
-
-function add_options_page($page_title, $menu_title, $access_level, $file, $function = '') {
-       return add_submenu_page('options-general.php', $page_title, $menu_title, $access_level, $file, $function);
-}
-
-function add_management_page($page_title, $menu_title, $access_level, $file, $function = '') {
-       return add_submenu_page('edit.php', $page_title, $menu_title, $access_level, $file, $function);
-}
-
-function add_theme_page($page_title, $menu_title, $access_level, $file, $function = '') {
-       return add_submenu_page('themes.php', $page_title, $menu_title, $access_level, $file, $function);
-}
-
-function validate_file($file, $allowed_files = '') {
-       if (false !== strpos($file, './'))
-               return 1;
-
-       if (':' == substr($file, 1, 1))
-               return 2;
-
-       if (!empty ($allowed_files) && (!in_array($file, $allowed_files)))
-               return 3;
-
-       return 0;
-}
-
-function validate_file_to_edit($file, $allowed_files = '') {
-       $file = stripslashes($file);
-
-       $code = validate_file($file, $allowed_files);
-
-       if (!$code)
-               return $file;
-
-       switch ($code) {
-               case 1 :
-                       die(__('Sorry, can&#8217;t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.'));
-
-               case 2 :
-                       die(__('Sorry, can&#8217;t call files with their real path.'));
-
-               case 3 :
-                       die(__('Sorry, that file cannot be edited.'));
-       }
-}
-
-function get_home_path() {
-       $home = get_settings('home');
-       if ($home != '' && $home != get_settings('siteurl')) {
-               $home_path = parse_url($home);
-               $home_path = $home_path['path'];
-               $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"]);
-               $home_path = trailingslashit($root.$home_path);
-       } else {
-               $home_path = ABSPATH;
-       }
-
-       return $home_path;
-}
-
-function get_real_file_to_edit($file) {
-       if ('index.php' == $file || '.htaccess' == $file) {
-               $real_file = get_home_path().$file;
-       } else {
-               $real_file = ABSPATH.$file;
-       }
-
-       return $real_file;
-}
-
-$wp_file_descriptions = array ('index.php' => __('Main Index Template'), 'style.css' => __('Stylesheet'), 'comments.php' => __('Comments'), 'comments-popup.php' => __('Popup Comments'), 'footer.php' => __('Footer'), 'header.php' => __('Header'), 'sidebar.php' => __('Sidebar'), 'archive.php' => __('Archives'), 'category.php' => __('Category Template'), 'page.php' => __('Page Template'), 'search.php' => __('Search Results'), 'single.php' => __('Single Post'), '404.php' => __('404 Template'), 'my-hacks.php' => __('my-hacks.php (legacy hacks support)'), '.htaccess' => __('.htaccess (for rewrite rules)'),
-       // Deprecated files
-       'wp-layout.css' => __('Stylesheet'), 'wp-comments.php' => __('Comments Template'), 'wp-comments-popup.php' => __('Popup Comments Template'));
-
-function get_file_description($file) {
-       global $wp_file_descriptions;
-
-       if (isset ($wp_file_descriptions[basename($file)])) {
-               return $wp_file_descriptions[basename($file)];
-       }
-       elseif (file_exists(ABSPATH.$file)) {
-               $template_data = implode('', file(ABSPATH.$file));
-               if (preg_match("|Template Name:(.*)|i", $template_data, $name))
-                       return $name[1];
-       }
-
-       return basename($file);
-}
-
-function update_recently_edited($file) {
-       $oldfiles = (array) get_option('recently_edited');
-       if ($oldfiles) {
-               $oldfiles = array_reverse($oldfiles);
-               $oldfiles[] = $file;
-               $oldfiles = array_reverse($oldfiles);
-               $oldfiles = array_unique($oldfiles);
-               if (5 < count($oldfiles))
-                       array_pop($oldfiles);
-       } else {
-               $oldfiles[] = $file;
-       }
-       update_option('recently_edited', $oldfiles);
-}
-
-function get_plugin_data($plugin_file) {
-       $plugin_data = implode('', file($plugin_file));
-       preg_match("|Plugin Name:(.*)|i", $plugin_data, $plugin_name);
-       preg_match("|Plugin URI:(.*)|i", $plugin_data, $plugin_uri);
-       preg_match("|Description:(.*)|i", $plugin_data, $description);
-       preg_match("|Author:(.*)|i", $plugin_data, $author_name);
-       preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri);
-       if (preg_match("|Version:(.*)|i", $plugin_data, $version))
-               $version = trim($version[1]);
-       else
-               $version = '';
-
-       $description = wptexturize(trim($description[1]));
-
-       $name = $plugin_name[1];
-       $name = trim($name);
-       $plugin = $name;
-       if ('' != $plugin_uri[1] && '' != $name) {
-               $plugin = '<a href="' . trim($plugin_uri[1]) . '" title="'.__('Visit plugin homepage').'">'.$plugin.'</a>';
-       }
-
-       if ('' == $author_uri[1]) {
-               $author = trim($author_name[1]);
-       } else {
-               $author = '<a href="' . trim($author_uri[1]) . '" title="'.__('Visit author homepage').'">' . trim($author_name[1]) . '</a>';
-       }
-
-       return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1]);
-}
-
-function get_plugins() {
-       global $wp_plugins;
-
-       if (isset ($wp_plugins)) {
-               return $wp_plugins;
-       }
-
-       $wp_plugins = array ();
-       $plugin_loc = 'wp-content/plugins';
-       $plugin_root = ABSPATH.$plugin_loc;
-
-       // Files in wp-content/plugins directory
-       $plugins_dir = @ dir($plugin_root);
-       if ($plugins_dir) {
-               while (($file = $plugins_dir->read()) !== false) {
-                       if (preg_match('|^\.+$|', $file))
-                               continue;
-                       if (is_dir($plugin_root.'/'.$file)) {
-                               $plugins_subdir = @ dir($plugin_root.'/'.$file);
-                               if ($plugins_subdir) {
-                                       while (($subfile = $plugins_subdir->read()) !== false) {
-                                               if (preg_match('|^\.+$|', $subfile))
-                                                       continue;
-                                               if (preg_match('|\.php$|', $subfile))
-                                                       $plugin_files[] = "$file/$subfile";
-                                       }
-                               }
-                       } else {
-                               if (preg_match('|\.php$|', $file))
-                                       $plugin_files[] = $file;
-                       }
-               }
-       }
-
-       if ( !$plugins_dir || !$plugin_files )
-               return $wp_plugins;
-
-       foreach ( $plugin_files as $plugin_file ) {
-               if ( !is_readable("$plugin_root/$plugin_file"))
-                       continue;
-
-               $plugin_data = get_plugin_data("$plugin_root/$plugin_file");
-
-               if ( empty ($plugin_data['Name']) )
-                       continue;
-
-               $wp_plugins[plugin_basename($plugin_file)] = $plugin_data;
-       }
-
-       uasort($wp_plugins, create_function('$a, $b', 'return strnatcasecmp($a["Name"], $b["Name"]);'));
-
-       return $wp_plugins;
-}
-
-function get_plugin_page_hookname($plugin_page, $parent_page) {
-       global $admin_page_hooks;
-
-       $parent = get_admin_page_parent();
-
-       if (empty ($parent_page) || 'admin.php' == $parent_page) {
-               if (isset ($admin_page_hooks[$plugin_page]))
-                       $page_type = 'toplevel';
-               else
-                       if (isset ($admin_page_hooks[$parent]))
-                               $page_type = $admin_page_hooks[$parent];
-       } else
-               if (isset ($admin_page_hooks[$parent_page])) {
-                       $page_type = $admin_page_hooks[$parent_page];
-               } else {
-                       $page_type = 'admin';
-               }
-
-       $plugin_name = preg_replace('!\.php!', '', $plugin_page);
-
-       return $page_type.'_page_'.$plugin_name;
-}
-
-function get_plugin_page_hook($plugin_page, $parent_page) {
-       global $wp_filter;
-
-       $hook = get_plugin_page_hookname($plugin_page, $parent_page);
-       if (isset ($wp_filter[$hook]))
-               return $hook;
-       else
-               return '';
-}
-
-function browse_happy() {
-       $getit = __('WordPress recommends a better browser');
-       echo '
-               <p id="bh" style="text-align: center;"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></p>
-               ';
-}
-if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
-       add_action('admin_footer', 'browse_happy');
-
-function documentation_link($for) {
-       return;
-}
-
-function register_importer($id, $name, $description, $callback) {
-       global $wp_importers;
-
-       $wp_importers[$id] = array ($name, $description, $callback);
-}
-
-function get_importers() {
-       global $wp_importers;
-
-       return $wp_importers;
-}
-
-function current_theme_info() {
-       $themes = get_themes();
-       $current_theme = get_current_theme();
-       $ct->name = $current_theme;
-       $ct->title = $themes[$current_theme]['Title'];
-       $ct->version = $themes[$current_theme]['Version'];
-       $ct->parent_theme = $themes[$current_theme]['Parent Theme'];
-       $ct->template_dir = $themes[$current_theme]['Template Dir'];
-       $ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
-       $ct->template = $themes[$current_theme]['Template'];
-       $ct->stylesheet = $themes[$current_theme]['Stylesheet'];
-       $ct->screenshot = $themes[$current_theme]['Screenshot'];
-       $ct->description = $themes[$current_theme]['Description'];
-       $ct->author = $themes[$current_theme]['Author'];
-       return $ct;
-}
-
-
-// array wp_handle_upload ( array &file [, array overrides] )
-// file: reference to a single element of $_FILES. Call the function once for each uploaded file.
-// overrides: an associative array of names=>values to override default variables with extract($overrides, EXTR_OVERWRITE).
-// On success, returns an associative array of file attributes.
-// On failure, returns $overrides['upload_error_handler'](&$file, $message) or array('error'=>$message).
-function wp_handle_upload(&$file, $overrides = false) {
-       // The default error handler.
-       if (! function_exists('wp_handle_upload_error') ) {
-               function wp_handle_upload_error(&$file, $message) {
-                       return array('error'=>$message);
-               }
-       }
-
-       // You may define your own function and pass the name in $overrides['upload_error_handler']
-       $upload_error_handler = 'wp_handle_upload_error';
-
-       // $_POST['action'] must be set and its value must equal $overrides['action'] or this:
-       $action = 'wp_handle_upload';
-
-       // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
-       $upload_error_strings = array(false,
-               __("The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."),
-               __("The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."),
-               __("The uploaded file was only partially uploaded."),
-               __("No file was uploaded."),
-               __("Missing a temporary folder."),
-               __("Failed to write file to disk."));
-
-       // All tests are on by default. Most can be turned off by $override[{test_name}] = false;
-       $test_form = true;
-       $test_size = true;
-
-       // If you override this, you must provide $ext and $type!!!!
-       $test_type = true;
-
-       // Install user overrides. Did we mention that this voids your warranty?
-       if ( is_array($overrides) )
-               extract($overrides, EXTR_OVERWRITE);
-
-       // A correct form post will pass this test.
-       if ( $test_form && (!isset($_POST['action']) || ($_POST['action'] != $action)) )
-               return $upload_error_handler($file, __('Invalid form submission.'));
-
-       // A successful upload will pass this test. It makes no sense to override this one.
-       if ( $file['error'] > 0 )
-               return $upload_error_handler($file, $upload_error_strings[$file['error']]);
-
-       // A non-empty file will pass this test.
-       if ( $test_size && !($file['size'] > 0) )
-               return $upload_error_handler($file, __('File is empty. Please upload something more substantial.'));
-
-       // A properly uploaded file will pass this test. There should be no reason to override this one.
-       if (! @ is_uploaded_file($file['tmp_name']) )
-               return $upload_error_handler($file, __('Specified file failed upload test.'));
-
-       // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
-       if ( $test_type ) {
-               $wp_filetype = wp_check_filetype($file['name'], $mimes);
-
-               extract($wp_filetype);
-
-               if ( !$type || !$ext )
-                       return $upload_error_handler($file, __('File type does not meet security guidelines. Try another.'));
-       }
-
-       // A writable uploads dir will pass this test. Again, there's no point overriding this one.
-       if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
-               return $upload_error_handler($file, $uploads['error']);
-
-       // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
-       if ( isset($unique_filename_callback) && function_exists($unique_filename_callback) ) {
-               $filename = $unique_filename_callback($uploads['path'], $file['name']);
-       } else {
-               $number = '';
-               $filename = str_replace('#', '_', $file['name']);
-               $filename = str_replace(array('\\', "'"), '', $filename);
-               if ( empty($ext) )
-                       $ext = '';
-               else
-                       $ext = ".$ext";
-               while ( file_exists($uploads['path'] . "/$filename") ) {
-                       if ( '' == "$number$ext" )
-                               $filename = $filename . ++$number . $ext;
-                       else
-                               $filename = str_replace("$number$ext", ++$number . $ext, $filename);
-               }
-               $filename = str_replace($ext, '', $filename);
-               $filename = sanitize_title_with_dashes($filename) . $ext;
-       }
-
-       // Move the file to the uploads dir
-       $new_file = $uploads['path'] . "/$filename";
-       if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) )
-               die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
-
-       // Set correct file permissions
-       $stat = stat(dirname($new_file));
-       $perms = $stat['mode'] & 0000666;
-       @ chmod($new_file, $perms);
-
-       // Compute the URL
-       $url = $uploads['url'] . "/$filename";
-
-       return array('file' => $new_file, 'url' => $url, 'type' => $type);
-}
-
-function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96) {
-       if ( $height <= $hmax && $width <= $wmax )
-               return array($width, $height);
-       elseif ( $width / $height > $wmax / $hmax )
-               return array($wmax, (int) ($height / $width * $wmax));
-       else
-               return array((int) ($width / $height * $hmax), $hmax);
-}
-
-function wp_import_cleanup($id) {
-       wp_delete_attachment($id);
-}
-
-function wp_import_upload_form($action) {
-?>
-<script type="text/javascript">
-function cancelUpload() {
-o = document.getElementById('uploadForm');
-o.method = 'GET';
-o.action.value = 'view';
-o.submit();
-}
-</script>
-<form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo attribute_escape($action) ?>">
-<?php wp_nonce_field('import-upload'); ?>
-<label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" />
-<input type="hidden" name="action" value="save" />
-<div id="buttons">
-<input type="submit" value="<?php _e('Import'); ?>" />
-<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
-</div>
-</form>
-<?php  
-}
-
-function wp_import_handle_upload() {
-       $overrides = array('test_form' => false, 'test_type' => false);
-       $file = wp_handle_upload($_FILES['import'], $overrides);
-
-       if ( isset($file['error']) )
-               return $file;
-
-       $url = $file['url'];
-       $file = $file['file'];
-       $filename = basename($file);
-
-       // Construct the object array
-       $object = array(
-               'post_title' => $filename,
-               'post_content' => $url,
-               'post_mime_type' => 'import',
-               'guid' => $url
-       );
-
-       // Save the data
-       $id = wp_insert_attachment($object, $file);
-
-       return array('file' => $file, 'id' => $id);
-}
-
-function user_can_richedit() {
-       if ( 'true' != get_user_option('rich_editing') )
-               return false;
-
-       if ( preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) )
-               return false;
-
-       return true; // Best guess
-}
-
-function the_attachment_links($id = false) {
-       $id = (int) $id;
-       $post = & get_post($id);
-
-       if ( $post->post_status != 'attachment' )
-               return false;
-
-       $icon = get_attachment_icon($post->ID);
-
-?>
-<p><?php _e('Text linked to file') ?><br />
-<textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid) ?></a></textarea></p>
-<p><?php _e('Text linked to subpost') ?><br />
-<textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $post->post_title ?></a></textarea></p>
-<?php if ( $icon ) : ?>
-<p><?php _e('Thumbnail linked to file') ?><br />
-<textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo $icon ?></a></textarea></p>
-<p><?php _e('Thumbnail linked to subpost') ?><br />
-<textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></p>
-<?php endif; ?>
-<?php
-}
-
-function get_udims($width, $height) {
-       if ( $height <= 96 && $width <= 128 )
-               return array($width, $height);
-       elseif ( $width / $height > 4 / 3 )
-               return array(128, (int) ($height / $width * 128));
-       else
-               return array((int) ($width / $height * 96), 96);
-}
-
-?>
+// Deprecated.  Use includes/admin.php.
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
+?>
\ No newline at end of file
index b994f7c523b796852d1155b182d2210f9c2ca26f..a75fe7bb7331b7382263a5aedbb84bb5c1a88ba8 100644 (file)
@@ -1,72 +1,54 @@
-<?php 
-@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
+<?php
+@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
 if (!isset($_GET["page"])) require_once('admin.php');
 if ( $editing ) {
-       $dbx_js = true;
+       wp_enqueue_script( array('dbx-admin-key?pagenow=' . attribute_escape($pagenow),'admin-custom-fields') );
        if ( current_user_can('manage_categories') )
-               $cat_js = true;
+               wp_enqueue_script( 'ajaxcat' );
+       if ( user_can_richedit() )
+               wp_enqueue_script( 'wp_tiny_mce' );
 }
-if ( $list_js || $cat_js )
-       $sack_js = true;
+
+get_admin_page_title();
+
 ?>
-<?php get_admin_page_title(); ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
 <head>
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
-<title><?php bloginfo('name') ?> &rsaquo; <?php echo $title; ?> &#8212; WordPress</title>
-<link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
+<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
+<?php wp_admin_css(); ?>
 <script type="text/javascript">
 //<![CDATA[
 function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
 //]]>
 </script>
-<script type="text/javascript" src="../wp-includes/js/fat.js"></script>
-<?php if ( $xfn_js ) { ?>
-<script type="text/javascript" src="xfn.js"></script>
-<?php } ?>
-<?php if ( $sack_js ) { ?>
-<script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script>
-<?php } ?>
-<?php if ( $list_js ) { ?>
-<script type="text/javascript" src="list-manipulation.js"></script>
-<?php } ?>
-<?php if ( $dbx_js ) { ?>
-<script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
-<script type="text/javascript">
-//<![CDATA[
-addLoadEvent( function() {
-<?php switch ( $pagenow ) : case 'post.php' : ?>
-var manager = new dbxManager('postmeta');
-<?php break; case 'page-new.php' : ?>
-var manager = new dbxManager('pagemeta');
-<?php break; endswitch; ?>
-});
-//]]>
-</script>
-<script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script>
-<?php } ?>
-<?php if ( $editing && user_can_richedit() ) { ?>
-<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script>
-<?php } ?>
-<?php if ( $cat_js ) { ?>
-<script type="text/javascript" src="cat-js.php"></script>
-<?php } ?>
 <?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?>
 <style type="text/css">* html { overflow-x: hidden; }</style>
-<?php endif; ?>
-<?php do_action('admin_head'); ?>
+<?php endif;
+if ( isset($page_hook) )
+       do_action('admin_print_scripts-' . $page_hook);
+else if ( isset($plugin_page) )
+       do_action('admin_print_scripts-' . $plugin_page);
+do_action('admin_print_scripts');
+
+if ( isset($page_hook) )
+       do_action('admin_head-' . $page_hook);
+else if ( isset($plugin_page) )
+       do_action('admin_head-' . $plugin_page);
+do_action('admin_head');
+?>
 </head>
-<body>
+<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
 <div id="wphead">
-<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> &raquo;</a>)</span></h1>
+<h1><?php bloginfo('name'); ?> <span id="viewsite">(<a href="<?php echo get_option('home') . '/'; ?>"><?php _e('View site &raquo;') ?></a>)</span></h1>
 </div>
-<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div>
+<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Profile'); ?></a>] </p></div>
 
 <?php
-require(ABSPATH . '/wp-admin/menu-header.php');
+require(ABSPATH . 'wp-admin/menu-header.php');
 
 if ( $parent_file == 'options-general.php' ) {
-       require(ABSPATH . '/wp-admin/options-head.php');
+       require(ABSPATH . 'wp-admin/options-head.php');
 }
 ?>
index 756cc48062a7ff48cd0bd8873f996430c0478773..0a6f22ae550dd975fcbcaf12f6efee10ef550e50 100644 (file)
@@ -1,15 +1,17 @@
 <?php
+define('WP_ADMIN', TRUE);
+
 if ( defined('ABSPATH') )
        require_once( ABSPATH . 'wp-config.php');
 else
     require_once('../wp-config.php');
 
-if ( get_option('db_version') != $wp_db_version )
-       die (sprintf(__("Your database is out-of-date.  Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php'));
-    
-require_once(ABSPATH . 'wp-admin/admin-functions.php');
-require_once(ABSPATH . 'wp-admin/admin-db.php');
-require_once(ABSPATH . WPINC . '/registration-functions.php');
+if ( get_option('db_version') != $wp_db_version ) {
+       wp_redirect(get_option('siteurl') . '/wp-admin/upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI'])));
+       exit;
+}
+
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
 
 auth_redirect();
 
@@ -19,94 +21,92 @@ update_category_cache();
 
 wp_get_current_user();
 
-$posts_per_page = get_settings('posts_per_page');
-$what_to_show = get_settings('what_to_show');
-$date_format = get_settings('date_format');
-$time_format = get_settings('time_format');
-
-$wpvarstoreset = array('profile','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
-    $wpvar = $wpvarstoreset[$i];
-    if (!isset($$wpvar)) {
-        if (empty($_POST["$wpvar"])) {
-            if (empty($_GET["$wpvar"])) {
-                $$wpvar = '';
-            } else {
-                $$wpvar = $_GET["$wpvar"];
-            }
-        } else {
-            $$wpvar = $_POST["$wpvar"];
-        }
-    }
-}
+$posts_per_page = get_option('posts_per_page');
+$what_to_show = get_option('what_to_show');
+$date_format = get_option('date_format');
+$time_format = get_option('time_format');
+
+wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
 
-$xfn_js = $sack_js = $list_js = $cat_js = $dbx_js = $editing = false;
+wp_enqueue_script( 'fat' );
+
+$editing = false;
 
 if (isset($_GET['page'])) {
        $plugin_page = stripslashes($_GET['page']);
        $plugin_page = plugin_basename($plugin_page);
 }
 
-require(ABSPATH . '/wp-admin/menu.php');
+require(ABSPATH . 'wp-admin/menu.php');
 
 // Handle plugin admin pages.
 if (isset($plugin_page)) {
        $page_hook = get_plugin_page_hook($plugin_page, $pagenow);
 
        if ( $page_hook ) {
+               do_action('load-' . $page_hook);
                if (! isset($_GET['noheader']))
-                       require_once(ABSPATH . '/wp-admin/admin-header.php');
-               
+                       require_once(ABSPATH . 'wp-admin/admin-header.php');
+
                do_action($page_hook);
        } else {
                if ( validate_file($plugin_page) ) {
-                       die(__('Invalid plugin page'));
+                       wp_die(__('Invalid plugin page'));
                }
-               
-               if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
-                       die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
+
+               if (! file_exists(ABSPATH . PLUGINDIR . "/$plugin_page"))
+                       wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
+
+               do_action('load-' . $plugin_page);
 
                if (! isset($_GET['noheader']))
-                       require_once(ABSPATH . '/wp-admin/admin-header.php');
-               
-               include(ABSPATH . "wp-content/plugins/$plugin_page");
+                       require_once(ABSPATH . 'wp-admin/admin-header.php');
+
+               include(ABSPATH . PLUGINDIR . "/$plugin_page");
        }
-       
+
        include(ABSPATH . 'wp-admin/admin-footer.php');
 
        exit();
 } else if (isset($_GET['import'])) {
-       
+
        $importer = $_GET['import'];
 
        if ( ! current_user_can('import') )
                wp_die(__('You are not allowed to import.'));
 
        if ( validate_file($importer) ) {
-               die(__('Invalid importer.'));
+               wp_die(__('Invalid importer.'));
+       }
+
+       // Allow plugins to define importers as well
+       if (! is_callable($wp_importers[$importer][2]))
+       {
+               if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
+               {
+                       wp_die(__('Cannot load importer.'));
+               }
+               include(ABSPATH . "wp-admin/import/$importer.php");
        }
-               
-       if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
-               die(__('Cannot load importer.'));
-       
-       include(ABSPATH . "wp-admin/import/$importer.php");
 
-       $parent_file = 'import.php';
+       $parent_file = 'edit.php';
+       $submenu_file = 'import.php';
        $title = __('Import');
-       
+
        if (! isset($_GET['noheader']))
                require_once(ABSPATH . 'wp-admin/admin-header.php');
 
-       require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
+       require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
 
        define('WP_IMPORTING', true);
-       kses_init_filters();  // Always filter imported data with kses.
 
        call_user_func($wp_importers[$importer][2]);
-                       
+
        include(ABSPATH . 'wp-admin/admin-footer.php');
 
        exit();
+} else {
+       do_action("load-$pagenow");
 }
 
 ?>
index 2fa3c842b7c62fe864b55077b1f12f49cb09a450..fca99e1f6d8f8afbf7064b2caccfaef421e15cb3 100644 (file)
@@ -3,7 +3,7 @@ $mode = 'bookmarklet';
 require_once('admin.php');
 
 if ( ! current_user_can('edit_posts') )
-       die ("Cheatin' uh?");
+       wp_die(__('Cheatin&#8217; uh?'));
 
 if ('b' == $a):
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -25,33 +25,33 @@ $post = get_default_post_to_edit();
 
 $popuptitle = wp_specialchars(stripslashes($popuptitle));
 $text       = wp_specialchars(stripslashes(urldecode($text)));
-       
+
 $popuptitle = funky_javascript_fix($popuptitle);
 $text       = funky_javascript_fix($text);
-       
+
 $post_title = wp_specialchars($_REQUEST['post_title']);
 if (!empty($post_title))
        $post->post_title =  stripslashes($post_title);
 else
        $post->post_title = $popuptitle;
-       
-  
+
+
 $content  = wp_specialchars($_REQUEST['content']);
-$popupurl = clean_url(stripslashes($_REQUEST['popupurl']));
-    if ( !empty($content) ) {
-        $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
-    } else {
-        $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
-    }
+$popupurl = clean_url($_REQUEST['popupurl']);
+if ( !empty($content) ) {
+       $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
+} else {
+       $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
+}
 
-    /* /big funky fixes */
+/* /big funky fixes */
 
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title><?php bloginfo('name') ?> &rsaquo; Bookmarklet &#8212; WordPress</title>
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
-<link rel="stylesheet" href="wp-admin.css" type="text/css" />
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
+<?php wp_admin_css(); ?>
 
 <style type="text/css">
 <!--
@@ -77,15 +77,15 @@ $popupurl = clean_url(stripslashes($_REQUEST['popupurl']));
 }
 
 #wpbookmarklet .wrap {
-    border: 0px;
+       border: 0px;
 }
 
 #wpbookmarklet #postdiv {
-    margin-bottom: 0.5em;
+       margin-bottom: 0.5em;
 }
 
 #wpbookmarklet #titlediv {
-    margin-bottom: 1em;
+       margin-bottom: 1em;
 }
 
 -->
diff --git a/wp-admin/cat-js.php b/wp-admin/cat-js.php
deleted file mode 100644 (file)
index 4ad125b..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-require_once('admin.php');
-header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true);
-?>
-var ajaxCat = new sack();
-var newcat;
-function newCatAddIn() {
-       if ( !document.getElementById('jaxcat') ) return false;
-       var ajaxcat = document.createElement('span');
-       ajaxcat.id = 'ajaxcat';
-
-       newcat = document.createElement('input');
-       newcat.type = 'text';
-       newcat.name = 'newcat';
-       newcat.id = 'newcat';
-       newcat.size = '16';
-       newcat.setAttribute('autocomplete', 'off');
-       newcat.onkeypress = ajaxNewCatKeyPress;
-
-       var newcatSub = document.createElement('input');
-       newcatSub.type = 'button';
-       newcatSub.name = 'Button';
-       newcatSub.id = 'catadd';
-       newcatSub.value = '<?php echo addslashes(__('Add')); ?>';
-       newcatSub.onclick = ajaxNewCat;
-
-       ajaxcat.appendChild(newcat);
-       ajaxcat.appendChild(newcatSub);
-       document.getElementById('jaxcat').appendChild(ajaxcat);
-
-       howto = document.createElement('span');
-       howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>';
-       howto.id = 'howto';
-       ajaxcat.appendChild(howto);
-}
-
-addLoadEvent(newCatAddIn);
-
-function getResponseElement() {
-       var p = document.getElementById('ajaxcatresponse');
-       if (!p) {
-               p = document.createElement('span');
-               document.getElementById('jaxcat').appendChild(p);
-               p.id = 'ajaxcatresponse';
-       }
-       return p;
-}
-
-function newCatLoading() {
-       var p = getResponseElement();
-       p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>';
-}
-
-function newCatLoaded() {
-       var p = getResponseElement();
-       p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>';
-}
-
-function newCatInteractive() {
-       var p = getResponseElement();
-       p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>';
-}
-
-function newCatCompletion() {
-       var p = getResponseElement();
-       var id    = 0;
-       var ids   = new Array();
-       var names = new Array();
-       
-       ids   = myPload( ajaxCat.response );
-       names = myPload( newcat.value );
-       for ( i = 0; i < ids.length; i++ ) {
-               id = ids[i].replace(/[\n\r]+/g, "");
-               if ( id == '-1' ) {
-                       p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";
-                       return;
-               }
-               if ( id == '0' ) {
-                       p.innerHTML = "<?php echo addslashes(__('That category name is invalid.  Try something else.')); ?>";
-                       return;
-               }
-               
-               var exists = document.getElementById('category-' + id);
-               
-               if (exists) {
-                       var moveIt = exists.parentNode;
-                       var container = moveIt.parentNode;
-                       container.removeChild(moveIt);
-                       container.insertBefore(moveIt, container.firstChild);
-                       moveIt.id = 'new-category-' + id;
-                       exists.checked = 'checked';
-                       var nowClass = moveIt.className;
-                       moveIt.className = nowClass + ' fade';
-                       Fat.fade_all();
-                       moveIt.className = nowClass;
-               } else {
-                       var catDiv = document.getElementById('categorychecklist');
-                       var newLabel = document.createElement('label');
-                       newLabel.setAttribute('for', 'category-' + id);
-                       newLabel.id = 'new-category-' + id;
-                       newLabel.className = 'selectit fade';
-       
-                       var newCheck = document.createElement('input');
-                       newCheck.type = 'checkbox';
-                       newCheck.value = id;
-                       newCheck.name = 'post_category[]';
-                       newCheck.id = 'category-' + id;
-                       newLabel.appendChild(newCheck);
-       
-                       var newLabelText = document.createTextNode(' ' + names[i]);
-                       newLabel.appendChild(newLabelText);
-       
-                       catDiv.insertBefore(newLabel, catDiv.firstChild);
-                       newCheck.checked = 'checked';
-       
-                       Fat.fade_all();
-                       newLabel.className = 'selectit';
-               }
-               newcat.value = '';
-       }
-       p.parentNode.removeChild(p);
-//     var id = parseInt(ajaxCat.response, 10);
-}
-
-function ajaxNewCatKeyPress(e) {
-       if (!e) {
-               if (window.event) {
-                       e = window.event;
-               } else {
-                       return;
-               }
-       }
-       if (e.keyCode == 13) {
-               ajaxNewCat();
-               e.returnValue = false;
-               e.cancelBubble = true;
-               return false;
-       }
-}
-
-function ajaxNewCat() {
-       var newcat = document.getElementById('newcat');
-       var split_cats = new Array(1);
-       var catString = '';
-
-       catString = ajaxCat.encVar('ajaxnewcat', newcat.value) + '&' + ajaxCat.encVar('cookie', document.cookie);
-       ajaxCat.requestFile = 'edit-form-ajax-cat.php';
-       ajaxCat.method = 'POST';
-       ajaxCat.onLoading = newCatLoading;
-       ajaxCat.onLoaded = newCatLoaded;
-       ajaxCat.onInteractive = newCatInteractive;
-       ajaxCat.onCompletion = newCatCompletion;
-       ajaxCat.runAJAX(catString);
-}
-
-function myPload( str ) {
-       var fixedExplode = new Array();
-       var comma = new String(',');
-       var count = 0;
-       var currentElement = '';
-
-       for( x=0; x < str.length; x++) {
-               andy = str.charAt(x);
-               if ( comma.indexOf(andy) != -1 ) {
-                       currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim
-                       fixedExplode[count] = currentElement;
-                       currentElement = "";
-                       count++;
-               } else {
-                       currentElement += andy;
-               }
-       }
-
-       if ( currentElement != "" )
-               fixedExplode[count] = currentElement;
-       return fixedExplode;
-}
index d26a847bbbc38b8ab61dd5107fe5354cb4af7653..cc2b37a5a2675d3fdb40674ff593d29bb763f534 100644 (file)
@@ -3,23 +3,8 @@ require_once('admin.php');
 
 $title = __('Categories');
 $parent_file = 'edit.php';
-$list_js = true;
-
-$wpvarstoreset = array('action','cat');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
-    $wpvar = $wpvarstoreset[$i];
-    if (!isset($$wpvar)) {
-        if (empty($_POST["$wpvar"])) {
-            if (empty($_GET["$wpvar"])) {
-                $$wpvar = '';
-            } else {
-                $$wpvar = $_GET["$wpvar"];
-            }
-        } else {
-            $$wpvar = $_POST["$wpvar"];
-        }
-    }
-}
+
+wp_reset_vars(array('action', 'cat'));
 
 switch($action) {
 
@@ -28,11 +13,13 @@ case 'addcat':
        check_admin_referer('add-category');
 
        if ( !current_user_can('manage_categories') )
-               die (__('Cheatin&#8217; uh?'));
-       
-       wp_insert_category($_POST);
+               wp_die(__('Cheatin&#8217; uh?'));
 
-       wp_redirect('categories.php?message=1#addcat');
+       if( wp_insert_category($_POST ) ) {
+               wp_redirect('categories.php?message=1#addcat');
+       } else {
+               wp_redirect('categories.php?message=4#addcat');
+       }
        exit;
 break;
 
@@ -41,59 +28,27 @@ case 'delete':
        check_admin_referer('delete-category_' .  $cat_ID);
 
        if ( !current_user_can('manage_categories') )
-               die (__('Cheatin&#8217; uh?'));
+               wp_die(__('Cheatin&#8217; uh?'));
 
        $cat_name = get_catname($cat_ID);
 
        // Don't delete the default cats.
-       if ( $cat_ID == get_option('default_category') )
-               die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+    if ( $cat_ID == get_option('default_category') )
+               wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
 
        wp_delete_category($cat_ID);
 
        wp_redirect('categories.php?message=2');
        exit;
+
 break;
 
 case 'edit':
 
-    require_once ('admin-header.php');
-    $cat_ID = (int) $_GET['cat_ID'];
-    $category = get_category_to_edit($cat_ID);
-    ?>
-
-<div class="wrap">
- <h2><?php _e('Edit Category') ?></h2>
- <form name="editcat" action="categories.php" method="post">
-         <?php wp_nonce_field('update-category_' .  $category->cat_ID); ?>
-         <table class="editform" width="100%" cellspacing="2" cellpadding="5">
-               <tr>
-                 <th width="33%" scope="row"><?php _e('Category name:') ?></th>
-                 <td width="67%"><input name="cat_name" type="text" value="<?php echo attribute_escape($category->cat_name); ?>" size="40" /> <input type="hidden" name="action" value="editedcat" />
-<input type="hidden" name="cat_ID" value="<?php echo $category->cat_ID ?>" /></td>
-               </tr>
-               <tr>
-                       <th scope="row"><?php _e('Category slug:') ?></th>
-                       <td><input name="category_nicename" type="text" value="<?php echo attribute_escape($category->category_nicename); ?>" size="40" /></td>
-               </tr>
-               <tr>
-                       <th scope="row"><?php _e('Category parent:') ?></th>
-                       <td>        
-                       <select name='category_parent'>
-         <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>
-         <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>
-         </select></td>
-               </tr>
-               <tr>
-                       <th scope="row"><?php _e('Description:') ?></th>
-                       <td><textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description); ?></textarea></td>
-               </tr>
-               </table>
-         <p class="submit"><input type="submit" name="submit" value="<?php _e('Edit category') ?> &raquo;" /></p>
- </form>
- <p><a href="categories.php"><?php _e('&laquo; Return to category list'); ?></a></p>
-</div>
-    <?php
+       require_once ('admin-header.php');
+       $cat_ID = (int) $_GET['cat_ID'];
+       $category = get_category_to_edit($cat_ID);
+       include('edit-category-form.php');
 
 break;
 
@@ -102,21 +57,26 @@ case 'editedcat':
        check_admin_referer('update-category_' . $cat_ID);
 
        if ( !current_user_can('manage_categories') )
-               die (__('Cheatin&#8217; uh?'));
-       
-       wp_update_category($_POST);
+               wp_die(__('Cheatin&#8217; uh?'));
+
+       if ( wp_update_category($_POST) )
+               wp_redirect('categories.php?message=3');
+       else
+               wp_redirect('categories.php?message=5');
 
-       wp_redirect('categories.php?message=3');
        exit;
 break;
 
 default:
 
+wp_enqueue_script( 'admin-categories' );
 require_once ('admin-header.php');
 
 $messages[1] = __('Category added.');
 $messages[2] = __('Category deleted.');
 $messages[3] = __('Category updated.');
+$messages[4] = __('Category not added.');
+$messages[5] = __('Category not updated.');
 ?>
 
 <?php if (isset($_GET['message'])) : ?>
@@ -129,44 +89,33 @@ $messages[3] = __('Category updated.');
 <?php else : ?>
        <h2><?php _e('Categories') ?> </h2>
 <?php endif; ?>
-<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
+<table class="widefat">
+       <thead>
        <tr>
-               <th scope="col"><?php _e('ID') ?></th>
+               <th scope="col" style="text-align: center"><?php _e('ID') ?></th>
         <th scope="col"><?php _e('Name') ?></th>
         <th scope="col"><?php _e('Description') ?></th>
-        <th scope="col"><?php _e('# Posts') ?></th>
-        <th colspan="2"><?php _e('Action') ?></th>
+        <th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th>
+        <th colspan="2" style="text-align: center"><?php _e('Action') ?></th>
        </tr>
+       </thead>
+       <tbody id="the-list">
 <?php
 cat_rows();
 ?>
+       </tbody>
 </table>
 
-<div id="ajax-response"></div>
-
 </div>
 
 <?php if ( current_user_can('manage_categories') ) : ?>
 <div class="wrap">
-<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete posts from that category, it will just set them back to the default category <strong>%s</strong>.'), get_catname(get_option('default_category'))) ?></p>
+<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?></p>
+<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
 </div>
 
-<div class="wrap">
-    <h2><?php _e('Add New Category') ?></h2>
-    <form name="addcat" id="addcat" action="categories.php" method="post">
-    <?php wp_nonce_field('add-category'); ?>
-        <p><?php _e('Name:') ?><br />
-        <input type="text" name="cat_name" value="" /></p>
-        <p><?php _e('Category parent:') ?><br />
-        <select name='category_parent' class='postform'>
-        <option value='0'><?php _e('None') ?></option>
-        <?php wp_dropdown_cats(0); ?>
-        </select></p>
-        <p><?php _e('Description: (optional)') ?> <br />
-        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
-        <p class="submit"><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php _e('Add Category &raquo;') ?>" /></p>
-    </form>
-</div>
+<?php include('edit-category-form.php'); ?>
+
 <?php endif; ?>
 
 <?php
@@ -174,4 +123,5 @@ break;
 }
 
 include('admin-footer.php');
+
 ?>
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
new file mode 100644 (file)
index 0000000..eee6a12
--- /dev/null
@@ -0,0 +1,213 @@
+<?php
+require_once('admin.php');
+
+$parent_file = 'edit-comments.php';
+$submenu_file = 'edit-comments.php';
+
+wp_reset_vars(array('action'));
+
+if ( isset( $_POST['deletecomment'] ) )
+       $action = 'deletecomment';
+
+switch($action) {
+case 'editcomment':
+       $title = __('Edit Comment');
+
+       require_once ('admin-header.php');
+
+       $comment = (int) $_GET['c'];
+
+       if ( ! $comment = get_comment($comment) )
+               wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)'));
+
+       if ( !current_user_can('edit_post', $comment->comment_post_ID) )
+               wp_die( __('You are not allowed to edit comments on this post.') );
+
+       $comment = get_comment_to_edit($comment);
+
+       include('edit-form-comment.php');
+
+       break;
+
+case 'cdc':
+case 'mac':
+
+       require_once('./admin-header.php');
+
+       $comment = (int) $_GET['c'];
+       $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment';
+       $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
+       $nonce_action .= $comment;
+
+       if ( ! $comment = get_comment_to_edit($comment) )
+               wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php'));
+
+       if ( !current_user_can('edit_post', $comment->comment_post_ID) )
+               wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
+?>
+<div class='wrap'>
+
+<div class="narrow">
+<?php if ( 'spam' == $_GET['dt'] ) { ?>
+<p><?php echo '<strong>'.__('Caution:').'</strong> '.__('You are about to mark the following comment as spam:'); ?></p>
+<?php } elseif ( 'cdc' == $action ) { ?>
+<p><?php echo '<strong>'.__('Caution:').'</strong> '.__('You are about to delete the following comment:'); ?></p>
+<?php } else { ?>
+<p><?php echo '<strong>'.__('Caution:').'</strong> '.__('You are about to approve the following comment:'); ?></p>
+<?php } ?>
+
+<p><?php _e('Are you sure you want to do that?'); ?></p>
+
+<form action='<?php echo get_option('siteurl'); ?>/wp-admin/comment.php' method='get'>
+
+<table width="100%">
+<tr>
+<td><input type='button' value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td>
+<td align="right"><input type='submit' value='<?php _e('Yes'); ?>' /></td>
+</tr>
+</table>
+
+<?php wp_nonce_field($nonce_action); ?>
+<input type='hidden' name='action' value='<?php echo $formaction; ?>' />
+<?php if ( 'spam' == $_GET['dt'] ) { ?>
+<input type='hidden' name='dt' value='spam' />
+<?php } ?>
+<input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' />
+<input type='hidden' name='c' value='<?php echo $comment->comment_ID; ?>' />
+<input type='hidden' name='noredir' value='1' />
+</form>
+
+<table class="editform" cellpadding="5">
+<tr class="alt">
+<th scope="row"><?php _e('Author:'); ?></th>
+<td><?php echo $comment->comment_author; ?></td>
+</tr>
+<?php if ( $comment->comment_author_email ) { ?>
+<tr>
+<th scope="row"><?php _e('E-mail:'); ?></th>
+<td><?php echo $comment->comment_author_email; ?></td>
+</tr>
+<?php } ?>
+<?php if ( $comment->comment_author_url ) { ?>
+<tr>
+<th scope="row"><?php _e('URL:'); ?></th>
+<td><a href='<?php echo $comment->comment_author_url; ?>'><?php echo $comment->comment_author_url; ?></a></td>
+</tr>
+<?php } ?>
+<tr>
+<th scope="row" valign="top"><p><?php _e('Comment:'); ?></p></th>
+<td><?php echo $comment->comment_content; ?></td>
+</tr>
+</table>
+
+</div>
+</div>
+<?php
+       break;
+
+case 'deletecomment':
+       $comment = (int) $_REQUEST['c'];
+       check_admin_referer('delete-comment_' . $comment);
+
+       if ( isset($_REQUEST['noredir']) ) {
+               $noredir = true;
+       } else {
+               $noredir = false;
+       }
+
+       if ( ! $comment = get_comment($comment) )
+                        wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php'));
+
+       if ( !current_user_can('edit_post', $comment->comment_post_ID) )
+               wp_die( __('You are not allowed to edit comments on this post.') );
+
+       if ( 'spam' == $_REQUEST['dt'] )
+               wp_set_comment_status($comment->comment_ID, 'spam');
+       else
+               wp_delete_comment($comment->comment_ID);
+
+       if ((wp_get_referer() != '') && (false == $noredir)) {
+               wp_redirect(wp_get_referer());
+       } else {
+               wp_redirect(get_option('siteurl') .'/wp-admin/edit-comments.php');
+       }
+       exit();
+       break;
+
+case 'unapprovecomment':
+       $comment = (int) $_GET['c'];
+       check_admin_referer('unapprove-comment_' . $comment);
+
+       if (isset($_GET['noredir'])) {
+               $noredir = true;
+       } else {
+               $noredir = false;
+       }
+
+       if ( ! $comment = get_comment($comment) )
+               wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php'));
+
+       if ( !current_user_can('edit_post', $comment->comment_post_ID) )
+               wp_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
+
+       wp_set_comment_status($comment->comment_ID, "hold");
+
+       if ((wp_get_referer() != "") && (false == $noredir)) {
+               wp_redirect(wp_get_referer());
+       } else {
+               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments');
+       }
+       exit();
+       break;
+
+case 'approvecomment':
+       $comment = (int) $_GET['c'];
+       check_admin_referer('approve-comment_' . $comment);
+
+       if (isset($_GET['noredir'])) {
+               $noredir = true;
+       } else {
+               $noredir = false;
+       }
+
+       if ( ! $comment = get_comment($comment) )
+               wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php'));
+
+       if ( !current_user_can('edit_post', $comment->comment_post_ID) )
+               wp_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
+
+       wp_set_comment_status($comment->comment_ID, "approve");
+       if (get_option("comments_notify") == true) {
+               wp_notify_postauthor($comment->comment_ID);
+       }
+
+
+       if ((wp_get_referer() != "") && (false == $noredir)) {
+               wp_redirect(wp_get_referer());
+       } else {
+               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments');
+       }
+       exit();
+       break;
+
+case 'editedcomment':
+
+       $comment_ID = (int) $_POST['comment_ID'];
+       $comment_post_ID = (int) $_POST['comment_post_id'];
+
+       check_admin_referer('update-comment_' . $comment_ID);
+
+       edit_comment();
+
+       $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID;
+       $location = apply_filters('comment_edit_redirect', $location, $comment_ID);
+       wp_redirect($location);
+       exit();
+       break;
+default:
+       break;
+} // end switch
+
+include('admin-footer.php');
+
+?>
diff --git a/wp-admin/css/install-rtl.css b/wp-admin/css/install-rtl.css
new file mode 100644 (file)
index 0000000..6912736
--- /dev/null
@@ -0,0 +1,15 @@
+body { font: 13px Tahoma, Georgia, "Times New Roman", Times, serif; }
+
+ul, ol { padding: 5px 20px 5px 5px; }
+
+h1, h2, h3 { font-family: "Times New Roman", Times, serif; font-weight: 700 }
+
+.step, th { text-align: left }
+
+input { font-family: "Times New Roman", Times, serif; padding: 1px }
+
+#logo {        background: url(../wp-content/plugins/WP-Jalali/wp-fa-logo.png) center right no-repeat; text-align: left; }
+
+#admin_email {direction: ltr; text-align: left; }
+
+#footer { font-style: normal; }
\ No newline at end of file
diff --git a/wp-admin/css/install.css b/wp-admin/css/install.css
new file mode 100644 (file)
index 0000000..5eb85cd
--- /dev/null
@@ -0,0 +1,40 @@
+html { background: #eee; }
+
+body {
+       background: #fff;
+       color: #000;
+       font-family: Georgia, "Times New Roman", Times, serif;
+       margin-left: 20%;
+       margin-right: 20%;
+       padding: .2em 2em;
+}
+
+h1 {
+       color: #006;
+       font-size: 18px;
+       font-weight: lighter;
+}
+
+h2 { font-size: 16px; }
+
+p, li, dt {
+       line-height: 140%;
+       padding-bottom: 2px;
+}
+
+ul, ol { padding: 5px 5px 5px 20px; }
+
+#logo { margin-bottom: 2em; }
+
+.step a, .step input { font-size: 2em; }
+
+td input { font-size: 1.5em; }
+
+.step, th { text-align: right; }
+
+#footer {
+       text-align: center; 
+       border-top: 1px solid #ccc; 
+       padding-top: 1em; 
+       font-style: italic;
+}
\ No newline at end of file
diff --git a/wp-admin/css/upload-rtl.css b/wp-admin/css/upload-rtl.css
new file mode 100644 (file)
index 0000000..dc13a4b
--- /dev/null
@@ -0,0 +1,12 @@
+html {
+       direction: ltr;
+       }
+#uploadoptions, table {
+       direction: rtl;
+       }
+td {
+       padding: 1px 6px 0;
+       }
+.submit {
+       text-align: left;
+       }
\ No newline at end of file
diff --git a/wp-admin/css/upload.css b/wp-admin/css/upload.css
new file mode 100644 (file)
index 0000000..009986c
--- /dev/null
@@ -0,0 +1,204 @@
+body { background: #f9fcfe; }
+
+.upload-file-data { display: none; }
+
+#upload-menu {
+       border-top: 2em solid #247fab;
+       margin: 0;
+       padding: 0;
+       height: 0;
+       list-style: none;
+       width: 100%;
+}
+
+body > #upload-menu { border-bottom: 7px solid #fff; }
+
+#upload-menu li {
+       margin: 0;
+       position: relative;
+       top: -2em;
+       padding-bottom: 5px;
+       border: none;
+       border-top: 3px solid #247fab;
+}
+
+#upload-menu li a.upload-tab-link {
+       margin-left: 0.75em;
+       padding: 5px 5px 0;
+       display: block;
+       float: left;
+       height: 100%;
+       text-decoration: none;
+       border-bottom: none;
+       color: #fff;
+}
+
+#upload-menu li.current {
+       border-right: 2px solid #448abd;
+       color: #000;
+}
+
+#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover {
+       background: #f9fcfe;
+       color: #000;
+}
+
+#upload-menu li #current-tab-nav {
+       background: #f9fcfe;
+       float: left;
+       padding: 5px 5px 0 0;
+       margin-left: -5px;
+}
+
+#upload-menu li span .page-numbers {
+       padding: 0;
+       border: none;
+}
+
+#upload-menu li span a.page-numbers { color: #00019b; }
+#upload-menu li span a.page-numbers:hover { text-decoration: underline; }
+
+#upload-content {
+       position: relative;
+       clear: both;
+       margin: 0;
+       padding: 0;
+       border: none;
+       width: 100%;
+       height: 100%;
+       background: none;
+}
+
+#upload-file {
+       margin: 0 auto;
+       top: 0;
+       left: 0;
+       width: 95%;
+       height: 100%;
+       background: #f9fcfe;
+}
+
+#upload-file th {
+       width: 8em;
+}
+
+form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; }
+
+form#upload-file .submit input { width: auto; }
+
+#upload-file-view { padding: 0 0 0 75px; }
+
+#file-title {
+       margin: 0 0 .2em 75px;
+       padding: 0;
+       display: block;
+       font-family: Georgia, "Times New Roman", Times, serif;
+       font-size: 16px;
+}
+
+h2 {
+       margin: 0 .2em 0 0;
+       padding: 0;
+       display: inline;
+       border: none;
+       color: #000;
+       font-size: 1.4em;
+       line-height: 1.4em;
+}
+
+.wrap h2 {
+       margin: .4em 0 .5em;
+       display: block;
+       border-bottom: .5em solid #e5f3ff;
+       color: #333;
+       font: normal 32px/5px serif;
+       clear: both;
+}
+
+* html .wrap h2 {
+       margin-top: 1em;
+}
+
+.back {
+       display: block;
+       position: absolute;
+       left: 14px;
+       top: 10px;
+}
+
+#upload-files {
+       list-style-type: none;
+       margin: 0;
+       padding: 15px 0 0;
+}
+
+#upload-files li { margin: 0 0 15px 15px; }
+
+#upload-files a, #upload-file-view a, a.file-link {
+       border: none;
+       text-decoration: none;
+}
+
+#upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; }
+
+#upload-files a.file-link {
+       display: block;
+       width: 130px;
+       height: 128px;
+       background-color: rgb(209, 226, 239);
+       text-align: center;
+       overflow: hidden;
+}
+
+#upload-files a.text {
+       padding-top: 40px;
+       height: 88px;
+       font-size: 16px;
+}
+
+#upload-files a.file-link.image {
+       font-size: 2px;
+       letter-spacing: 0;
+}
+
+#upload-files a.file-link img { vertical-align: middle; }
+
+#the-attachment-links textarea {
+       font-size: 10px;
+       overflow: hidden;
+}
+
+form table { float: none; padding: 0 15px; }
+
+table {
+       float: left;
+       margin: 0;
+       padding: 0;
+}
+
+th { text-align: right; vertical-align: text-top; }
+
+tr, td, th {
+       margin-top: 0;
+       padding-top: 0;
+}
+
+#uploadoptions th {
+       width: 80px;
+}
+
+#uploadoptions p {
+       margin: 0;
+       padding: 0;
+}
+
+#uploadoptions td {
+       padding-left: 1em;
+       line-height: 140%;
+}
+
+#uploadoptions table {
+       width: 300px;
+}
+
+input.readonly { background-color: #ddd; }
diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css
new file mode 100644 (file)
index 0000000..d76cc9f
--- /dev/null
@@ -0,0 +1,38 @@
+.dropzone,
+#palettediv,
+.handle,
+.controlform {
+       direction: rtl;
+       text-align: justify;
+       }
+.dropzone {
+       float: right;
+       margin-left: 10px;
+       margin-right: auto;
+       width: 240px;
+       }
+* html .dropzone ul {
+       margin-right: 0;
+       }
+* .handle, #lastmodule span {
+       border-left: 1px solid #e8e8e8;
+       border-right: 1px solid #f2f2f2;
+       }
+* .popper {
+       right: auto;
+       left: 3px;
+       }
+#palettediv .module, #lastmodule {
+       margin-right: auto;
+       margin-left: 10px;
+       float: right;
+       }
+#palettediv ul {
+       padding: 0 10px 0 0;
+       margin-right: 0;
+       width: 100%;
+       }
+.placemat {
+       margin-right: 0;
+       float: right;
+       }
\ No newline at end of file
diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css
new file mode 100644 (file)
index 0000000..f46c4ce
--- /dev/null
@@ -0,0 +1,236 @@
+body {
+       height: 100%;
+}
+
+#sbadmin #zones {
+       -moz-user-select: none;
+       -khtml-user-select: none;
+       user-select: none;
+}
+
+#sbreset {
+       float: left;
+       margin: 1px 0;
+}
+
+.dropzone {
+       border: 1px solid #bbb;
+       float: left;
+       margin-right: 10px;
+       padding: 5px;
+       background-color: #f0f8ff;
+}
+
+.dropzone h3 {
+       text-align: center;
+       color: #333;
+}
+
+.dropzone input {
+       display: none;
+}
+
+.dropzone ul {
+       float: left;
+       list-style-type: none;
+       width: 240px;
+       margin: 0;
+       min-height: 200px;
+       padding: 0;
+       display: block;
+}
+
+* .module {
+       width: 238px;
+       padding: 0;
+       margin: 5px 0;
+       cursor: move;
+       display: block;
+       border: 1px solid #ccc;
+       background-color: #fbfbfb;
+       position: relative;
+       text-align: left;
+       line-height: 25px;
+}
+
+* .handle {
+       display: block;
+       width: 216px;
+       padding: 0 10px;
+       position: relative;
+       border-top: 1px solid #f2f2f2;
+       border-right: 1px solid #e8e8e8;
+       border-bottom: 1px solid #e8e8e8;
+       border-left: 1px solid #f2f2f2;
+}
+
+* .popper {
+       margin: 0;
+       display: inline;
+       position: absolute;
+       top: 3px;
+       right: 3px;
+       overflow: hidden;
+       text-align: center;
+       height: 16px;
+       font-size: 18px;
+       line-height: 14px;
+       cursor: pointer;
+       padding: 0 3px 1px;
+       border-top: 4px solid #6da6d1;
+       background: url( ../images/fade-butt.png ) -5px 0px;
+}
+
+* html .popper {
+       padding: 1px 6px 0;
+       font-size: 16px;
+}
+
+#sbadmin p.submit {
+       padding-right: 10px;
+       clear: left;
+}
+
+.placemat {
+       cursor: default;
+       margin: 0;
+       padding: 0;
+       position: relative;
+}
+
+.placemat h4 {
+       text-align: center;
+}
+
+.placemat span {
+       background-color: #ffe;
+       border: 1px solid #ccc;
+       padding: 0 10px 10px;
+       position: absolute;
+       text-align: justify;
+}
+
+#palettediv {
+       border: 1px solid #bbb;
+       background-color: #f0f8ff;
+       height:auto;
+       margin-top: 10px;
+       padding-bottom: 10px;
+}
+
+#palettediv:after, #zones:after, .dropzone:after {
+       content: ".";
+       display: block;
+       height: 0;
+       clear: both;
+       visibility: hidden;
+}
+
+#palettediv, #zones, .dropzone {
+       display: block;
+       min-height: 1px;
+}
+
+* html #palettediv, * html #zones, * html .dropzone {
+       height: 1%;
+}
+
+#palettediv h3 {
+       text-align: center;
+       color: #333;
+       min-height: 1px;
+}
+
+#palettediv ul {
+       padding: 0 0 0 10px;
+}
+
+#palettediv .module {
+       margin-right: 10px;
+       float: left;
+       width: 120px;
+}
+
+#palettediv .handle {
+       height: 40px;
+       font-size: 90%;
+       width: 110px;
+       padding: 0 5px;
+}
+
+#palettediv .popper {
+       visibility: hidden;
+}
+
+* html #palettediv ul {
+       margin: 0;
+       padding: 0 0 0 10px;
+}
+
+#controls {
+       height: 0px;
+}
+
+.control {
+       position: absolute;
+       display: block;
+       background: #f9fcfe;
+       padding: 0;
+}
+
+.controlhandle {
+       cursor: move;
+       background-color: #6da6d1;
+       border-bottom: 2px solid #448abd;
+       color: #333;
+       display: block;
+       margin: 0 0 5px;
+       padding: 4px;
+       font-size: 120%;
+}
+
+.controlcloser {
+       cursor: pointer;
+       font-size: 120%;
+       display: block;
+       position: absolute;
+       top: 2px;
+       right: 8px;
+       padding: 0 3px;
+       font-weight: bold;
+}
+
+.controlform {
+       margin: 20px 30px;
+}
+
+.controlform p {
+       text-align: center;
+}
+
+.control .checkbox {
+       border: none;
+       background: transparent;
+}
+
+.hidden {
+       display: none;
+}
+
+#shadow {
+       background: black;
+       display: none;
+       position: absolute;
+       top: 0px;
+       left: 0px;
+       width: 100%;
+}
+
+#dragHelper {
+       position: absolute;
+}
+
+#dragHelper li.module {
+       display: block;
+       float: left;
+}
diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php
new file mode 100644 (file)
index 0000000..8d60565
--- /dev/null
@@ -0,0 +1,332 @@
+<?php
+
+class Custom_Image_Header {
+       var $admin_header_callback;
+
+       function Custom_Image_Header($admin_header_callback) {
+               $this->admin_header_callback = $admin_header_callback;
+       }
+
+       function init() {
+               $page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page'));
+
+               add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
+               add_action("admin_head-$page", array(&$this, 'js'), 50);
+               add_action("admin_head-$page", $this->admin_header_callback, 51);
+       }
+
+       function js_includes() {
+               wp_enqueue_script('cropper');
+               wp_enqueue_script('colorpicker');
+       }
+
+       function js() {
+
+               if ( isset( $_POST['textcolor'] ) ) {
+                       check_admin_referer('custom-header');
+                       if ( 'blank' == $_POST['textcolor'] ) {
+                               set_theme_mod('header_textcolor', 'blank');
+                       } else {
+                               $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']);
+                               if ( strlen($color) == 6 || strlen($color) == 3 )
+                                       set_theme_mod('header_textcolor', $color);
+                       }
+               }
+               if ( isset($_POST['resetheader']) ) {
+                       check_admin_referer('custom-header');
+                       remove_theme_mods();
+               }
+       ?>
+<script type="text/javascript">
+
+       function onEndCrop( coords, dimensions ) {
+               $( 'x1' ).value = coords.x1;
+               $( 'y1' ).value = coords.y1;
+               $( 'x2' ).value = coords.x2;
+               $( 'y2' ).value = coords.y2;
+               $( 'width' ).value = dimensions.width;
+               $( 'height' ).value = dimensions.height;
+       }
+
+       // with a supplied ratio
+       Event.observe(
+               window,
+               'load',
+               function() {
+                       var xinit = <?php echo HEADER_IMAGE_WIDTH; ?>;
+                       var yinit = <?php echo HEADER_IMAGE_HEIGHT; ?>;
+                       var ratio = xinit / yinit;
+                       var ximg = $('upload').width;
+                       var yimg = $('upload').height;
+                       if ( yimg < yinit || ximg < xinit ) {
+                               if ( ximg / yimg > ratio ) {
+                                       yinit = yimg;
+                                       xinit = yinit * ratio;
+                               } else {
+                                       xinit = ximg;
+                                       yinit = xinit / ratio;
+                               }
+                       }
+                       new Cropper.Img(
+                               'upload',
+                               {
+                                       ratioDim: { x: xinit, y: yinit },
+                                       displayOnInit: true,
+                                       onEndCrop: onEndCrop
+                               }
+                       )
+               }
+       );
+
+       var cp = new ColorPicker();
+
+       function pickColor(color) {
+               $('name').style.color = color;
+               $('desc').style.color = color;
+               $('textcolor').value = color;
+       }
+       function PopupWindow_hidePopup(magicword) {
+               if ( magicword != 'prettyplease' )
+                       return false;
+               if (this.divName != null) {
+                       if (this.use_gebi) {
+                               document.getElementById(this.divName).style.visibility = "hidden";
+                       }
+                       else if (this.use_css) {
+                               document.all[this.divName].style.visibility = "hidden";
+                       }
+                       else if (this.use_layers) {
+                               document.layers[this.divName].visibility = "hidden";
+                       }
+               }
+               else {
+                       if (this.popupWindow && !this.popupWindow.closed) {
+                               this.popupWindow.close();
+                               this.popupWindow = null;
+                       }
+               }
+               return false;
+       }
+       function colorSelect(t,p) {
+               if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) {
+                       cp.hidePopup('prettyplease');
+               } else {
+                       cp.p = p;
+                       cp.select(t,p);
+               }
+       }
+       function colorDefault() {
+               pickColor('<?php echo HEADER_TEXTCOLOR; ?>');
+       }
+
+       function hide_text() {
+               $('name').style.display = 'none';
+               $('desc').style.display = 'none';
+               $('pickcolor').style.display = 'none';
+               $('defaultcolor').style.display = 'none';
+               $('textcolor').value = 'blank';
+               $('hidetext').value = '<?php _e('Show Text'); ?>';
+//             $('hidetext').onclick = 'show_text()';
+               Event.observe( $('hidetext'), 'click', show_text );
+       }
+
+       function show_text() {
+               $('name').style.display = 'block';
+               $('desc').style.display = 'block';
+               $('pickcolor').style.display = 'inline';
+               $('defaultcolor').style.display = 'inline';
+               $('textcolor').value = '<?php echo HEADER_TEXTCOLOR; ?>';
+               $('hidetext').value = '<?php _e('Hide Text'); ?>';
+               Event.stopObserving( $('hidetext'), 'click', show_text );
+               Event.observe( $('hidetext'), 'click', hide_text );
+       }
+
+       <?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?>
+Event.observe( window, 'load', hide_text );
+       <?php } ?>
+
+</script>
+<?php
+       }
+
+       function step_1() {
+               if ( $_GET['updated'] ) { ?>
+<div id="message" class="updated fade">
+<p><?php _e('Header updated.') ?></p>
+</div>
+               <?php } ?>
+
+<div class="wrap">
+<h2><?php _e('Your Header Image'); ?></h2>
+<p><?php _e('This is your header image. You can change the text color or upload and crop a new image.'); ?></p>
+
+<div id="headimg" style="background-image: url(<?php clean_url(header_image()) ?>);">
+<h1><a onclick="return false;" href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>" id="name"><?php bloginfo('name'); ?></a></h1>
+<div id="desc"><?php bloginfo('description');?></div>
+</div>
+<?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?>
+<form method="post" action="<?php echo get_option('siteurl') ?>/wp-admin/themes.php?page=custom-header&amp;updated=true">
+<input type="button" value="<?php _e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
+<input type="button" value="<?php _e('Select a Text Color'); ?>" onclick="colorSelect($('textcolor'), 'pickcolor')" id="pickcolor" /><input type="button" value="<?php _e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
+<?php wp_nonce_field('custom-header') ?>
+<input type="hidden" name="textcolor" id="textcolor" value="#<?php attribute_escape(header_textcolor()) ?>" /><input name="submit" type="submit" value="<?php _e('Save Changes &raquo;'); ?>" /></form>
+<?php } ?>
+
+<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
+</div>
+<div class="wrap">
+<h2><?php _e('Upload New Header Image'); ?></h2><p><?php _e('Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.'); ?></p>
+<p><?php printf(__('Images of exactly <strong>%1$d x %2$d pixels</strong> will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?></p>
+
+<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo attribute_escape(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
+<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
+<input type="hidden" name="action" value="save" />
+<?php wp_nonce_field('custom-header') ?>
+<p class="submit">
+<input type="submit" value="<?php _e('Upload &raquo;'); ?>" />
+</p>
+</form>
+
+</div>
+
+               <?php if ( get_theme_mod('header_image') || get_theme_mod('header_textcolor') ) : ?>
+<div class="wrap">
+<h2><?php _e('Reset Header Image and Color'); ?></h2>
+<p><?php _e('This will restore the original header image and color. You will not be able to retrieve any customizations.') ?></p>
+<form method="post" action="<?php echo attribute_escape(add_query_arg('step', 1)) ?>">
+<?php wp_nonce_field('custom-header'); ?>
+<input type="submit" name="resetheader" value="<?php _e('Restore Original Header'); ?>" />
+</form>
+</div>
+               <?php endif;
+
+       }
+
+       function step_2() {
+               check_admin_referer('custom-header');
+               $overrides = array('test_form' => false);
+               $file = wp_handle_upload($_FILES['import'], $overrides);
+
+               if ( isset($file['error']) )
+               die( $file['error'] );
+
+               $url = $file['url'];
+               $file = $file['file'];
+               $filename = basename($file);
+
+               // Construct the object array
+               $object = array(
+               'post_title' => $filename,
+               'post_content' => $url,
+               'post_mime_type' => 'import',
+               'guid' => $url);
+
+               // Save the data
+               $id = wp_insert_attachment($object, $file);
+
+               $upload = array('file' => $file, 'id' => $id);
+
+               list($width, $height, $type, $attr) = getimagesize( $file );
+
+               if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) {
+                       set_theme_mod('header_image', clean_url($url));
+                       $header = apply_filters('wp_create_file_in_uploads', $file, $id); // For replication
+                       return $this->finished();
+               } elseif ( $width > HEADER_IMAGE_WIDTH ) {
+                       $oitar = $width / HEADER_IMAGE_WIDTH;
+                       $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file));
+                       $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication
+
+                       $url = str_replace(basename($url), basename($image), $url);
+                       $width = $width / $oitar;
+                       $height = $height / $oitar;
+               } else {
+                       $oitar = 1;
+               }
+               ?>
+
+<div class="wrap">
+
+<form method="POST" action="<?php echo attribute_escape(add_query_arg('step', 3)) ?>">
+
+<p><?php _e('Choose the part of the image you want to use as your header.'); ?></p>
+<div id="testWrap">
+<img src="<?php echo $url; ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
+</div>
+
+<p class="submit">
+<input type="hidden" name="x1" id="x1" />
+<input type="hidden" name="y1" id="y1" />
+<input type="hidden" name="x2" id="x2" />
+<input type="hidden" name="y2" id="y2" />
+<input type="hidden" name="width" id="width" />
+<input type="hidden" name="height" id="height" />
+<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo $id; ?>" />
+<input type="hidden" name="oitar" id="oitar" value="<?php echo $oitar; ?>" />
+<?php wp_nonce_field('custom-header') ?>
+<input type="submit" value="<?php _e('Crop Header &raquo;'); ?>" />
+</p>
+
+</form>
+</div>
+               <?php
+       }
+
+       function step_3() {
+               check_admin_referer('custom-header');
+               if ( $_POST['oitar'] > 1 ) {
+                       $_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
+                       $_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
+                       $_POST['width'] = $_POST['width'] * $_POST['oitar'];
+                       $_POST['height'] = $_POST['height'] * $_POST['oitar'];
+               }
+
+               $header = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT);
+               $header = apply_filters('wp_create_file_in_uploads', $header); // For replication
+
+               $parent = get_post($_POST['attachment_id']);
+
+               $parent_url = $parent->guid;
+
+               $url = str_replace(basename($parent_url), basename($header), $parent_url);
+
+               set_theme_mod('header_image', $url);
+
+               // cleanup
+               $file = get_attached_file( $_POST['attachment_id'] );
+               $medium = str_replace(basename($file), 'midsize-'.basename($file), $file);
+               @unlink( apply_filters( 'wp_delete_file', $medium ) );
+               wp_delete_attachment( $_POST['attachment_id'] );
+
+               return $this->finished();
+       }
+
+       function finished() {
+               ?>
+<div class="wrap">
+<h2><?php _e('Header complete!'); ?></h2>
+
+<p><?php _e('Visit your site and you should see the new header now.'); ?></p>
+
+</div>
+               <?php
+       }
+
+       function admin_page() {
+               if ( !isset( $_GET['step'] ) )
+                       $step = 1;
+               else
+                       $step = (int) $_GET['step'];
+
+               if ( 1 == $step ) {
+                       $this->step_1();
+               } elseif ( 2 == $step ) {
+                       $this->step_2();
+               } elseif ( 3 == $step ) {
+                       $this->step_3();
+               }
+
+       }
+
+}
+?>
diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php
new file mode 100644 (file)
index 0000000..2b8883e
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+if ( ! empty($cat_ID) ) {
+       $heading = __('Edit Category');
+       $submit_text = __('Edit Category &raquo;');
+       $form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
+       $action = 'editedcat';
+       $nonce_action = 'update-category_' . $cat_ID;
+       do_action('edit_category_form_pre', $category);
+} else {
+       $heading = __('Add Category');
+       $submit_text = __('Add Category &raquo;');
+       $form = '<form name="addcat" id="addcat" method="post" action="categories.php">';
+       $action = 'addcat';
+       $nonce_action = 'add-category';
+       do_action('add_category_form_pre', $category);
+}
+?>
+
+<div class="wrap">
+<h2><?php echo $heading ?></h2>
+<div id="ajax-response"></div>
+<?php echo $form ?>
+<input type="hidden" name="action" value="<?php echo $action ?>" />
+<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
+<?php wp_nonce_field($nonce_action); ?>
+       <table class="editform" width="100%" cellspacing="2" cellpadding="5">
+               <tr>
+                       <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>
+                       <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /></td>
+               </tr>
+               <tr>
+                       <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category slug:') ?></label></th>
+                       <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->slug); ?>" size="40" /></td>
+               </tr>
+               <tr>
+                       <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th>
+                       <td>
+                               <?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
+                       </td>
+               </tr>
+               <tr>
+                       <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th>
+                       <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea></td>
+               </tr>
+       </table>
+<p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
+<?php do_action('edit_category_form', $category); ?>
+</form>
+</div>
index ab0f0a8e46e538f8183d6304d987de7380f13718..ab1bdbce19440006f637cbadb52422467e651d3b 100644 (file)
@@ -2,8 +2,8 @@
 require_once('admin.php');
 
 $title = __('Edit Comments');
-$parent_file = 'edit.php';
-$list_js = true;
+$parent_file = 'edit-comments.php';
+wp_enqueue_script( 'admin-comments' );
 
 require_once('admin-header.php');
 if (empty($_GET['mode'])) $mode = 'view';
@@ -23,18 +23,30 @@ function checkAll(form)
                }
        }
 }
+
+function getNumChecked(form)
+{
+       var num = 0;
+       for (i = 0, n = form.elements.length; i < n; i++) {
+               if(form.elements[i].type == "checkbox") {
+                       if(form.elements[i].checked == true)
+                               num++;
+               }
+       }
+       return num;
+}
 //-->
 </script>
 <div class="wrap">
 <h2><?php _e('Comments'); ?></h2>
-<form name="searchform" action="" method="get"
-  <fieldset> 
-  <legend><?php _e('Show Comments That Contain...') ?></legend> 
-  <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" /> 
-  <input type="submit" name="submit" value="<?php _e('Search') ?>"  />  
+<form name="searchform" action="" method="get" id="editcomments">
+  <fieldset>
+  <legend><?php _e('Show Comments That Contain...') ?></legend>
+  <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" />
+  <input type="submit" name="submit" value="<?php _e('Search') ?>"  />
   <input type="hidden" name="mode" value="<?php echo $mode; ?>" />
-  <?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?>
-  </fieldset> 
+  <?php _e('(Searches within comment text, e-mail, URL, and IP address.)') ?>
+  </fieldset>
 </form>
 <p><a href="?mode=view"><?php _e('View Mode') ?></a> | <a href="?mode=edit"><?php _e('Mass Edit Mode') ?></a></p>
 <?php
@@ -45,82 +57,81 @@ if ( !empty( $_POST['delete_comments'] ) ) :
        foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each
                $comment = (int) $comment;
                $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
-               $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
-               if ( current_user_can('edit_post', $post_id) ) :
-                       wp_set_comment_status($comment, "delete");
+               // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
+               if ( current_user_can('edit_post', $post_id) ) {
+                       if ( !empty( $_POST['spam_button'] ) )
+                               wp_set_comment_status($comment, 'spam');
+                       else
+                               wp_set_comment_status($comment, 'delete');
                        ++$i;
-               endif;
+               }
        endforeach;
-       echo "<div class='wrap'><p>" . sprintf(__('%s comments deleted.'), $i) . "</p></div>";
+       echo '<div style="background-color: rgb(207, 235, 247);" id="message" class="updated fade"><p>';
+       if ( !empty( $_POST['spam_button'] ) ) {
+               printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i);
+       } else {
+               printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i);
+       }
+       echo '</p></div>';
 endif;
 
-if (isset($_GET['s'])) {
-       $s = $wpdb->escape($_GET['s']);
-       $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments  WHERE
-               (comment_author LIKE '%$s%' OR
-               comment_author_email LIKE '%$s%' OR
-               comment_author_url LIKE ('%$s%') OR
-               comment_author_IP LIKE ('%$s%') OR
-               comment_content LIKE ('%$s%') ) AND
-               comment_approved != 'spam'
-               ORDER BY comment_date DESC");
-} else {
-       if ( isset($_GET['offset']) )
-               $offset = (int) $_GET['offset'] * 20;
-       else
-               $offset = 0;
-
-       $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date DESC LIMIT $offset,20");
-}
+if ( isset( $_GET['apage'] ) )
+       $page = abs( (int) $_GET['apage'] );
+else
+       $page = 1;
+
+$start = $offset = ( $page - 1 ) * 20;
+
+list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 25 ); // Grab a few extra
+
+$comments = array_slice($_comments, 0, 20);
+$extra_comments = array_slice($_comments, 20);
+
+$page_links = paginate_links( array(
+       'base' => add_query_arg( 'apage', '%#%' ),
+       'format' => '',
+       'total' => ceil($total / 20),
+       'current' => $page
+));
+
+if ( $page_links )
+       echo "<p class='pagenav'>$page_links</p>";
+
 if ('view' == $mode) {
        if ($comments) {
-               if ($offset)
-                       $start = " start='$offset'";
-               else
-                       $start = '';
+               $offset = $offset + 1;
+               $start = " start='$offset'";
 
-               echo "<ol id='the-list' class='commentlist' $start>";
+               echo "<ol id='the-comment-list' class='commentlist' $start>\n";
                $i = 0;
-               foreach ($comments as $comment) {
-               ++$i; $class = '';
-               $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
-                       $comment_status = wp_get_comment_status($comment->comment_ID);
-                       if ('unapproved' == $comment_status) 
-                               $class .= ' unapproved';
-                       if ($i % 2)
-                               $class .= ' alternate';
-                       echo "<li id='comment-$comment->comment_ID' class='$class'>";
-?>             
-        <p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
-               
-               <?php comment_text() ?>
-
-        <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');  
-                       if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-                               echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
-                               echo ' | <a href="' . wp_nonce_url('post.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . __("You are about to delete this comment.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete.") . "' );\">" . __('Delete Comment') . '</a> ';
-                       } // end if any comments to show
-                       // Get post title
-                       if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-                               $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID");
-                               $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
-                               ?> | <a href="post.php?action=edit&amp;post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post &#8220;%s&#8221;'), stripslashes($post_title)); ?></a>
-                               <?php } ?>
-                        | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a></p>
-               </li>
-
-<?php } // end foreach ?>
-</ol>
+               foreach ( $comments as $comment ) {
+                       get_comment( $comment ); // Cache it
+                       _wp_comment_list_item( $comment->comment_ID, ++$i );
+               }
+               echo "</ol>\n\n";
+
+if ( $extra_comments ) : ?>
+<div id="extra-comments" style="display:none">
+<ul id="the-extra-comment-list" class="commentlist">
+<?php
+       foreach ( $extra_comments as $comment ) {
+               get_comment( $comment ); // Cache it
+               _wp_comment_list_item( $comment->comment_ID, ++$i );
+       }
+?>
+</ul>
+</div>
+<?php endif; // $extra_comments ?>
 
 <div id="ajax-response"></div>
 
 <?php
-       } else {
+       } else { //no comments to show
 
                ?>
                <p>
-        <strong><?php _e('No comments found.') ?></strong></p>
-               
+                       <strong><?php _e('No comments found.') ?></strong></p>
+
                <?php
        } // end if ($comments)
 } elseif ('edit' == $mode) {
@@ -128,37 +139,50 @@ if ('view' == $mode) {
        if ($comments) {
                echo '<form name="deletecomments" id="deletecomments" action="" method="post"> ';
                wp_nonce_field('bulk-comments');
-               echo '<table width="100%" cellpadding="3" cellspacing="3">
+               echo '<table class="widefat">
+<thead>
   <tr>
-    <th scope="col">*</th>
+    <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById(\'deletecomments\'));" /></th>
     <th scope="col">' .  __('Name') . '</th>
     <th scope="col">' .  __('E-mail') . '</th>
     <th scope="col">' . __('IP') . '</th>
     <th scope="col">' . __('Comment Excerpt') . '</th>
-       <th scope="col" colspan="3">' .  __('Actions') . '</th>
-  </tr>';
+       <th scope="col" colspan="3" style="text-align: center">' .  __('Actions') . '</th>
+  </tr>
+</thead>';
                foreach ($comments as $comment) {
-               $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
+               $post = get_post($comment->comment_post_ID);
+               $authordata = get_userdata($post->post_author);
+               $comment_status = wp_get_comment_status($comment->comment_ID);
                $class = ('alternate' == $class) ? '' : 'alternate';
+               $class .= ('unapproved' == $comment_status) ? ' unapproved' : '';
 ?>
-  <tr class='<?php echo $class; ?>'>
-    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
+  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
+    <td style="text-align: center"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
     <td><?php comment_author_link() ?></td>
     <td><?php comment_author_email_link() ?></td>
-    <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>
+    <td><a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=edit"><?php comment_author_IP() ?></a></td>
     <td><?php comment_excerpt(); ?></td>
-    <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td>
+    <td>
+       <?php if ('unapproved' == $comment_status) {
+               _e('Unapproved');
+       } else { ?>
+               <a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a>
+       <?php } ?>
+    </td>
     <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-       echo "<a href='post.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td>
+       echo "<a href='comment.php?action=editcomment&amp;c=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td>
     <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-            echo "<a href=\"" . wp_nonce_url("post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return confirm('" . __("You are about to delete this comment.\\n  \'Cancel\' to stop, \'OK\' to delete.") . "')\"    class='delete'>" . __('Delete') . "</a>"; } ?></td>
+               echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'. \n  'Cancel' to stop, 'OK' to delete."), $comment->comment_author ))  . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> ";
+               } ?></td>
   </tr>
-               <?php 
+               <?php
                } // end foreach
        ?></table>
-    <p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; "><?php _e('Invert Checkbox Selection') ?></a></p>
-            <p class="submit"><input type="submit" name="Submit" value="<?php _e('Delete Checked Comments') ?> &raquo;" onclick="return confirm('<?php _e("You are about to delete these comments permanently.\\n  \'Cancel\' to stop, \'OK\' to delete.") ?>')" />    </p>
+<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n  'Cancel' to stop, 'OK' to delete.")), "' + numchecked + '"); ?>')" />
+                       <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to mark as spam")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to mark %s comments as spam \n  'Cancel' to stop, 'OK' to mark as spam.")), "' + numchecked + '"); ?>')" /></p>
   </form>
+<div id="ajax-response"></div>
 <?php
        } else {
 ?>
@@ -168,7 +192,11 @@ if ('view' == $mode) {
 <?php
        } // end if ($comments)
 }
-       ?>
+
+if ( $page_links )
+       echo "<p class='pagenav'>$page_links</p>";
+
+?>
 
 </div>
 
index e7490fe25c1b385da5000a24b2152fc14917be9a..ab3adff464b02ed4ddd3a6a0bcfd8054110ab63b 100644 (file)
@@ -10,31 +10,28 @@ $messages[3] = __('Custom field deleted.');
 <?php endif; ?>
 
 <form name="post" action="post.php" method="post" id="post">
-<?php if ( (isset($mode) && 'bookmarklet' == $mode) || 
-            isset($_GET['popupurl']) ): ?>
+<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
 <input type="hidden" name="mode" value="bookmarklet" />
 <?php endif; ?>
 
 <div class="wrap">
-<h2 id="write-post"><?php _e('Write Post'); ?><?php if ( 0 != $post_ID ) : ?>
- <small class="quickjump"><a href="#preview-post"><?php _e('preview &darr;'); ?></a></small><?php endif; ?></h2>
 <?php
 
 if (0 == $post_ID) {
        $form_action = 'post';
-       $temp_ID = -1 * time();
-       $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />";
+       $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
+       $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
        wp_nonce_field('add-post');
 } else {
        $post_ID = (int) $post_ID;
        $form_action = 'editpost';
-       $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />";
+       $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
        wp_nonce_field('update-post_' .  $post_ID);
 }
 
-$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />'; 
+$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
 
-$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />'; 
+$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';
 
 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
 
@@ -47,18 +44,20 @@ if ('' != $post->pinged) {
        $pings .= '</ul>';
 }
 
-$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape(__('Save and Continue Editing')) . '" />';
+$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';
 
 if (empty($post->post_status)) $post->post_status = 'draft';
 
 ?>
 
 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
-<input type="hidden" name="action" value="<?php echo $form_action ?>" />
-<input type="hidden" name="post_author" value="<?php echo attribute_escape($post->post_author) ?>" />
+<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
+<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
+<input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
+<input type="hidden" id="post_type" name="post_type" value="post" />
 
 <?php echo $form_extra ?>
-<?php if (isset($_GET['message']) && 2 > $_GET['message']) : ?>
+<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
 <script type="text/javascript">
 function focusit() {
        // focus on first input field
@@ -72,64 +71,62 @@ addLoadEvent(focusit);
 <div id="moremeta">
 <div id="grabit" class="dbx-group">
 
+<fieldset id="categorydiv" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
+<div class="dbx-content">
+<p id="jaxcat"></p>
+<ul id="categorychecklist"><?php dropdown_categories(); ?></ul></div>
+</fieldset>
+
 <fieldset id="commentstatusdiv" class="dbx-box">
 <h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
 <div class="dbx-content">
 <input name="advanced_view" type="hidden" value="1" />
 <label for="comment_status" class="selectit">
 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
-<?php _e('Allow Comments') ?></label> 
+<?php _e('Allow Comments') ?></label>
 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
 </div>
 </fieldset>
 
 <fieldset id="passworddiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 
-<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape($post->post_password) ?>" /></div>
+<h3 class="dbx-handle"><?php _e('Post Password') ?></h3>
+<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div>
 </fieldset>
 
 <fieldset id="slugdiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 
-<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape($post->post_name) ?>" /></div>
-</fieldset>
-
-<fieldset id="categorydiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
-<div class="dbx-content">
-<p id="jaxcat"></p>
-<div id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></div></div>
+<h3 class="dbx-handle"><?php _e('Post Slug') ?></h3>
+<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div>
 </fieldset>
 
 <fieldset id="poststatusdiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Post Status') ?></h3> 
-<div class="dbx-content"><?php if ( current_user_can('publish_posts') ) : ?>
-<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); ?> /> <?php _e('Published') ?></label>
+<h3 class="dbx-handle"><?php _e('Post Status') ?></h3>
+<div class="dbx-content">
+<?php if ( current_user_can('publish_posts') ) : ?>
+       <label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label>
 <?php endif; ?>
+       <label for="post_status_pending" class="selectit"><input id="post_status_pending" name="post_status" type="radio" value="pending" <?php checked($post->post_status, 'pending'); ?> /> <?php _e('Pending Review') ?></label>
          <label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>
          <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>
 </fieldset>
 
 <?php if ( current_user_can('edit_posts') ) : ?>
 <fieldset id="posttimestampdiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Post Timestamp'); ?>:</h3>
+<h3 class="dbx-handle"><?php _e('Post Timestamp'); ?></h3>
 <div class="dbx-content"><?php touch_time(($action == 'edit')); ?></div>
 </fieldset>
 <?php endif; ?>
 
-<?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
+<?php
+$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
+if ( $post->post_author && !in_array($post->post_author, $authors) )
+       $authors[] = $post->post_author;
+if ( $authors && count( $authors ) > 1 ) :
+?>
 <fieldset id="authordiv" class="dbx-box">
-<h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
+<h3 class="dbx-handle"><?php _e('Post Author'); ?></h3>
 <div class="dbx-content">
-<select name="post_author_override" id="post_author_override">
-<?php 
-foreach ($authors as $o) :
-$o = get_userdata( $o->ID );
-if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
-else $selected = '';
-echo "<option value='" . (int) $o->ID . "' $selected>" . wp_specialchars($o->display_name) . "</option>";
-endforeach;
-?>
-</select>
+<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
 </div>
 </fieldset>
 <?php endif; ?>
@@ -140,84 +137,53 @@ endforeach;
 </div>
 
 <fieldset id="titlediv">
-  <legend><?php _e('Title') ?></legend> 
-  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div>
+       <legend><?php _e('Title') ?></legend>
+       <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div>
 </fieldset>
 
 <fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
-<legend><?php _e('Post') ?></legend>
+<legend><?php _e('Post') ?>
 
-<?php
- $rows = get_settings('default_post_edit_rows');
- if (($rows < 3) || ($rows > 100)) {
-     $rows = 12;
- }
-?>
-<?php the_quicktags(); ?>
+<?php if ( 'publish' == $post->post_status ) { ?>
+<a href="<?php echo clean_url(get_permalink($post->ID)); ?>" class="view-link" target="_blank"><?php _e('View &raquo;'); ?></a>
+<?php } elseif ( 'edit' == $action ) { ?>
+<a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" class="view-link" target="_blank"><?php _e('Preview &raquo;'); ?></a>
+<?php } ?>
+</legend>
 
-<div><textarea <?php if ( user_can_richedit() ) echo 'title="true" '; ?>rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
+       <?php the_editor($post->post_content); ?>
 </fieldset>
 
-<script type="text/javascript">
-// <![CDATA[
-edCanvas = document.getElementById('content');
-<?php if ( user_can_richedit() ) : ?>
-// This code is meant to allow tabbing from Title to Post (TinyMCE).
-if ( tinyMCE.isMSIE )
-       document.getElementById('title').onkeydown = function (e)
-               {
-                       e = e ? e : window.event;
-                       if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
-                               var i = tinyMCE.selectedInstance;
-                               if(typeof i ==  'undefined')
-                                       return true;
-                                tinyMCE.execCommand("mceStartTyping");
-                               this.blur();
-                               i.contentWindow.focus();
-                               e.returnValue = false;
-                               return false;
-                       }
-               }
-else
-       document.getElementById('title').onkeypress = function (e)
-               {
-                       e = e ? e : window.event;
-                       if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
-                               var i = tinyMCE.selectedInstance;
-                               if(typeof i ==  'undefined')
-                                       return true;
-                                tinyMCE.execCommand("mceStartTyping");
-                               this.blur();
-                               i.contentWindow.focus();
-                               e.returnValue = false;
-                               return false;
-                       }
-               }
-<?php endif; ?>
-// ]]>
-</script>
-
 <?php echo $form_pingback ?>
 <?php echo $form_prevstatus ?>
 
+<fieldset id="tagdiv">
+       <legend><?php _e('Tags (separate multiple tags with commas: cats, pet food, dogs)'); ?></legend>
+       <div><input type="text" name="tags_input" class="tags-input" id="tags-input" size="30" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></div>
+</fieldset>
 
-<p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 
-<?php 
-if ('publish' != $post->post_status || 0 == $post_ID) {
+<p class="submit">
+<span id="autosave"></span>
+<?php echo $saveasdraft; ?>
+<input type="submit" name="submit" value="<?php _e('Save'); ?>" style="font-weight: bold;" tabindex="4" />
+<?php
+if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) {
 ?>
 <?php if ( current_user_can('publish_posts') ) : ?>
-       <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 
+       <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
+<?php else : ?>
+       <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
 <?php endif; ?>
 <?php
 }
 ?>
-<input name="referredby" type="hidden" id="referredby" value="<?php 
+<input name="referredby" type="hidden" id="referredby" value="<?php
 if ( !empty($_REQUEST['popupurl']) )
-       echo attribute_escape(stripslashes($_REQUEST['popupurl']));
-else if ( url_to_postid(stripslashes(wp_get_referer())) == $post_ID )
+       echo clean_url(stripslashes($_REQUEST['popupurl']));
+else if ( url_to_postid(wp_get_referer()) == $post_ID )
        echo 'redo';
 else
-       echo attribute_escape(stripslashes(wp_get_referer()));
+       echo clean_url(stripslashes(wp_get_referer()));
 ?>" /></p>
 
 <?php do_action('edit_form_advanced'); ?>
@@ -225,10 +191,10 @@ else
 <?php
 if (current_user_can('upload_files')) {
        $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
-       $uploading_iframe_src = wp_nonce_url("inline-uploading.php?action=view&amp;post=$uploading_iframe_ID", 'inlineuploading');
+       $uploading_iframe_src = wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID", 'inlineuploading');
        $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
        if ( false != $uploading_iframe_src )
-               echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
+               echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
 }
 ?>
 
@@ -251,8 +217,8 @@ if (current_user_can('upload_files')) {
 <h3 class="dbx-handle"><?php _e('Trackbacks') ?></h3>
 </div>
 <div class="dbx-c-ontent-wrapper">
-<div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>)
-<?php 
+<div class="dbx-content"><?php _e('Send trackbacks to:'); ?> <?php echo $form_trackback; ?> (<?php _e('Separate multiple URLs with spaces'); ?>)
+<?php
 if ( ! empty($pings) )
        echo $pings;
 ?>
@@ -268,16 +234,17 @@ if ( ! empty($pings) )
 </div>
 <div class="dbx-c-ontent-wrapper">
 <div id="postcustomstuff" class="dbx-content">
-<?php 
-if($metadata = has_meta($post_ID)) {
-?>
+<table cellpadding="3">
 <?php
-       list_meta($metadata); 
+$metadata = has_meta($post_ID);
+list_meta($metadata);
 ?>
+
+</table>
 <?php
-}
        meta_form();
 ?>
+<div id="ajax-response"></div>
 </div>
 </div>
 </fieldset>
@@ -288,7 +255,7 @@ if($metadata = has_meta($post_ID)) {
 </div>
 
 <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?>
-<input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
+<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php echo ( 'draft' == $post->post_status ) ? __('Delete this draft') : __('Delete this post'); ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
 <?php endif; ?>
 
 </div>
diff --git a/wp-admin/edit-form-ajax-cat.php b/wp-admin/edit-form-ajax-cat.php
deleted file mode 100644 (file)
index f182334..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-require_once('../wp-config.php');
-require_once('admin-functions.php');
-require_once('admin-db.php');
-
-if ( !current_user_can('manage_categories') )
-       die('-1');
-if ( !check_ajax_referer() )
-       die('-1');
-
-function get_out_now() { exit; }
-
-add_action('shutdown', 'get_out_now', -1);
-
-$names = explode(',', rawurldecode($_POST['ajaxnewcat']) );
-$ids   = array();
-
-foreach ($names as $cat_name) {
-       $cat_name = trim( $cat_name );
-       
-       if ( !$category_nicename = sanitize_title($cat_name) )
-               continue;
-       if ( $already = category_exists($cat_name) ) {
-               $ids[] = (string) $already;
-               continue;
-       }
-       
-       $new_cat_id = wp_create_category($cat_name);
-       
-       $ids[] = (string) $new_cat_id;
-}
-
-$return = join(',', $ids);
-
-die( (string) $return );
-
-?>
index 7a09960724d4e7b5427dea83b61685d9cb0588cd..2f06909614ce43b71deaa6554b24a0d73d6cdcd8 100644 (file)
@@ -2,10 +2,11 @@
 $submitbutton_text = __('Edit Comment &raquo;');
 $toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID);
 $form_action = 'editedcomment';
-$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='".$comment->comment_post_ID;
+$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID;
 ?>
 
-<form name="post" action="post.php" method="post" id="post">
+<form name="post" action="comment.php" method="post" id="post">
+<h2><?php echo $toprow_title; ?></h2>
 <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
 <div class="wrap">
 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
@@ -18,76 +19,29 @@ function focusit() { // focus on first input field
 addLoadEvent(focusit);
 </script>
 <fieldset id="namediv">
-    <legend><?php _e('Name:') ?></legend>
+    <legend><label for="name"><?php _e('Name:') ?></label></legend>
        <div>
-         <input type="text" name="newcomment_author" size="22" value="<?php echo attribute_escape($comment->comment_author); ?>" tabindex="1" id="name" />
+         <input type="text" name="newcomment_author" size="25" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
     </div>
 </fieldset>
 <fieldset id="emaildiv">
-        <legend><?php _e('E-mail:') ?></legend>
+        <legend><label for="email"><?php _e('E-mail:') ?></label></legend>
                <div>
-                 <input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape($comment->comment_author_email); ?>" tabindex="2" id="email" />
+                 <input type="text" name="newcomment_author_email" size="20" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
     </div>
 </fieldset>
 <fieldset id="uridiv">
-        <legend><?php _e('URI:') ?></legend>
+        <legend><label for="newcomment_author_url"><?php _e('URL:') ?></label></legend>
                <div>
-                 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape($comment->comment_author_url); ?>" tabindex="3" id="URL" />
+                 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="2" />
     </div>
 </fieldset>
 
 <fieldset style="clear: both;">
         <legend><?php _e('Comment') ?></legend>
-<?php the_quicktags(); ?>
-
-<?php
- $rows = get_settings('default_post_edit_rows');
- if (($rows < 3) || ($rows > 100)) {
-     $rows = 10;
- }
-?>
-<div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content" style="width: 99%"><?php echo user_can_richedit() ? wp_richedit_pre($comment->comment_content) : $comment->comment_content; ?></textarea></div>
+       <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?>
 </fieldset>
 
-<script type="text/javascript">
-<!--
-edCanvas = document.getElementById('content');
-<?php if ( user_can_richedit() ) : ?>
-// This code is meant to allow tabbing from Author URL to Post (TinyMCE).
-if ( tinyMCE.isMSIE )
-       document.getElementById('newcomment_author_url').onkeydown = function (e)
-               {
-                       e = e ? e : window.event;
-                       if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
-                               var i = tinyMCE.selectedInstance;
-                               if(typeof i ==  'undefined')
-                                       return true;
-                                tinyMCE.execCommand("mceStartTyping");
-                               this.blur();
-                               i.contentWindow.focus();
-                               e.returnValue = false;
-                               return false;
-                       }
-               }
-else
-       document.getElementById('newcomment_author_url').onkeypress = function (e)
-               {
-                       e = e ? e : window.event;
-                       if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
-                               var i = tinyMCE.selectedInstance;
-                               if(typeof i ==  'undefined')
-                                       return true;
-                                tinyMCE.execCommand("mceStartTyping");
-                               this.blur();
-                               i.contentWindow.focus();
-                               e.returnValue = false;
-                               return false;
-                       }
-               }
-<?php endif; ?>
-//-->
-</script>
-
 <p class="submit"><input type="submit" name="editcomment" id="editcomment" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" />
   <input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" />
 </p>
@@ -100,21 +54,25 @@ else
 <table width="100%" cellspacing="2" cellpadding="5" class="editform">
        <tr>
                <th scope="row" valign="top"><?php _e('Comment Status') ?>:</th>
-               <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> /> <?php _e('Approved') ?></label><br />
-         <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label><br />
-         <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td>
+               <td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> tabindex="4" /> <?php _e('Approved') ?></label> &nbsp;
+               <label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> tabindex="4" /> <?php _e('Moderated') ?></label> &nbsp;
+               <label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> tabindex="4" /> <?php _e('Spam') ?></label></td>
        </tr>
 
 <?php if ( current_user_can('edit_posts') ) : ?>
        <tr>
-               <th scope="row"><?php _e('Edit time'); ?>:</th>
-               <td><?php touch_time(('editcomment' == $action), 0); ?></td>
+               <th scope="row" valign="top"><?php _e('Edit time'); ?>:</th>
+               <td><?php touch_time(('editcomment' == $action), 0, 5); ?> </td>
        </tr>
 <?php endif; ?>
 
        <tr>
-               <th scope="row"><?php _e('Delete'); ?>:</th>
-               <td><p><a class="delete" href="post.php?action=confirmdeletecomment&amp;noredir=true&amp;comment=<?php echo $comment->comment_ID; ?>&amp;p=<?php echo $comment->comment_post_ID; ?>"><?php _e('Delete comment') ?></a></p></td>
+               <th scope="row" valign="top">&nbsp;</th>
+               <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { document.forms.post._wpnonce.value = '" . wp_create_nonce( 'delete-comment_' . $comment->comment_ID ) . "'; return true; } return false;\""; ?> />
+               <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" />
+               <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
+               <input type="hidden" name="noredir" value="1" />
+       </td>
        </tr>
 </table>
 
index de5937e38ef634040f8a13f219a483c125aa1e0f..00e4932b31df848258abe6c9197d78b86edc0d9d 100644 (file)
@@ -20,21 +20,20 @@ addLoadEvent(focusit);
 
 <div id="poststuff">
     <fieldset id="titlediv">
-      <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend> 
-         <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div>
+      <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
+         <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
     </fieldset>
 
     <fieldset id="categorydiv">
-      <legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend> 
+      <legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend>
          <div><?php dropdown_categories($post->post_category); ?></div>
     </fieldset>
 
 <br />
 <fieldset id="postdiv">
     <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>
-<?php the_quicktags(); ?>
 <?php
- $rows = get_settings('default_post_edit_rows');
+ $rows = get_option('default_post_edit_rows');
  if (($rows < 3) || ($rows > 100)) {
      $rows = 10;
  }
@@ -51,20 +50,20 @@ edCanvas = document.getElementById('content');
 
 <input type="hidden" name="post_pingback" value="<?php echo (int) get_option('default_pingback_flag') ?>" id="post_pingback" />
 
-<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?>
+<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '<br />'; ?>
        <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>
 
-<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" /> 
-  <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
+<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
+       <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
 
         <?php if ( current_user_can('edit_posts') ) : ?>
-  <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" /> 
+       <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
 <?php endif; ?>
 
 <?php if ('bookmarklet' != $mode) {
-      echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' .  __('Advanced Editing &raquo;') . '" />';
-  } ?>
-  <input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" />
+               echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' .  __('Advanced Editing &raquo;') . '" />';
+       } ?>
+       <input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" />
 </p>
 
 <?php do_action('simple_edit_form', ''); ?>
diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php
new file mode 100644 (file)
index 0000000..3e05f5a
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+require_once('admin.php');
+
+$title = __('Categories');
+$parent_file = 'link-manager.php';
+
+//wp_enqueue_script( 'admin-categories' );  TODO: Fix AJAX
+require_once ('admin-header.php');
+
+$messages[1] = __('Category added.');
+$messages[2] = __('Category deleted.');
+$messages[3] = __('Category updated.');
+$messages[4] = __('Category not added.');
+$messages[5] = __('Category not updated.');
+
+function link_cat_row($category) {
+       global $class;
+
+       if ( current_user_can( 'manage_categories' ) ) {
+               $edit = "<a href='link-category.php?action=edit&amp;cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>";
+               $default_cat_id = (int) get_option( 'default_link_category' );
+
+               if ( $category->term_id != $default_cat_id )
+                       $edit .= "<td><a href='" . wp_nonce_url( "link-category.php?action=delete&amp;cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id ) . "' onclick=\"return deleteSomething( 'cat', $category->term_id, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->name, get_term_field( 'name', $default_cat_id,  'link_category' ))) . "' );\" class='delete'>".__( 'Delete' )."</a>";
+               else
+                       $edit .= "<td style='text-align:center'>".__( "Default" );
+       } else {
+               $edit = '';
+       }
+
+       $class = ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'";
+
+       $category->count = number_format_i18n( $category->count );
+       $count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count;
+       return "<tr id='cat-$category->term_id'$class>
+               <th scope='row' style='text-align: center'>$category->term_id</th>
+               <td>" . ( $name_override ? $name_override : $pad . ' ' . $category->name ) . "</td>
+               <td>$category->description</td>
+               <td align='center'>$count</td>
+               <td>$edit</td>\n\t</tr>\n";
+}
+?>
+
+<?php if (isset($_GET['message'])) : ?>
+<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<?php endif; ?>
+
+<div class="wrap">
+<?php if ( current_user_can('manage_categories') ) : ?>
+       <h2><?php printf(__('Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>
+<?php else : ?>
+       <h2><?php _e('Categories') ?> </h2>
+<?php endif; ?>
+<table class="widefat">
+       <thead>
+       <tr>
+               <th scope="col" style="text-align: center"><?php _e('ID') ?></th>
+        <th scope="col"><?php _e('Name') ?></th>
+        <th scope="col"><?php _e('Description') ?></th>
+        <th scope="col" width="90" style="text-align: center"><?php _e('Links') ?></th>
+        <th colspan="2" style="text-align: center"><?php _e('Action') ?></th>
+       </tr>
+       </thead>
+       <tbody id="the-list">
+<?php
+$categories = get_terms( 'link_category', 'hide_empty=0' );
+if ( $categories ) {
+       $output = '';
+       foreach ( $categories as $category ) {
+               $category = sanitize_term($category, 'link_category', 'display');
+               $output .= link_cat_row($category);
+       }
+       $output = apply_filters('cat_rows', $output);
+       echo $output;
+       unset($category);
+}
+
+?>
+       </tbody>
+</table>
+
+</div>
+
+<?php if ( current_user_can('manage_categories') ) : ?>
+<div class="wrap">
+<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?></p>
+</div>
+
+<?php include('edit-link-category-form.php'); ?>
+
+<?php endif; ?>
+
+<?php include('admin-footer.php'); ?>
diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php
new file mode 100644 (file)
index 0000000..51bbcda
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+if ( ! empty($cat_ID) ) {
+       $heading = __('Edit Category');
+       $submit_text = __('Edit Category &raquo;');
+       $form = '<form name="editcat" id="editcat" method="post" action="link-category.php">';
+       $action = 'editedcat';
+       $nonce_action = 'update-link-category_' . $cat_ID;
+       do_action('edit_link_category_form_pre', $category);
+} else {
+       $heading = __('Add Category');
+       $submit_text = __('Add Category &raquo;');
+       $form = '<form name="addcat" id="addcat" method="post" action="link-category.php">';
+       $action = 'addcat';
+       $nonce_action = 'add-link-category';
+       do_action('add_link_category_form_pre', $category);
+}
+?>
+
+<div class="wrap">
+<h2><?php echo $heading ?></h2>
+<div id="ajax-response"></div>
+<?php echo $form ?>
+<input type="hidden" name="action" value="<?php echo $action ?>" />
+<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
+<?php wp_nonce_field($nonce_action); ?>
+       <table class="editform" width="100%" cellspacing="2" cellpadding="5">
+               <tr>
+                       <th width="33%" scope="row" valign="top"><label for="name"><?php _e('Category name:') ?></label></th>
+                       <td width="67%"><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" /></td>
+               </tr>
+               <tr>
+                       <th scope="row" valign="top"><label for="slug"><?php _e('Category slug:') ?></label></th>
+                       <td><input name="slug" id="slug" type="text" value="<?php echo $category->slug; ?>" size="40" /></td>
+               </tr>
+               <tr>
+                       <th scope="row" valign="top"><label for="description"><?php _e('Description: (optional)') ?></label></th>
+                       <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
+               </tr>
+       </table>
+<p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
+<?php do_action('edit_link_category_form', $category); ?>
+</form>
+</div>
index 5111c0b86b9b30003ca23d6c91d1d9b3cb13081b..e281d3095c131400c4c2ca7504deb561a5f4c62b 100644 (file)
@@ -1,15 +1,13 @@
 <?php
 if ( ! empty($link_id) ) {
-       $editing = true;
-       $heading = __('Edit a link:');
+       $heading = __('Edit Link');
        $submit_text = __('Save Changes &raquo;');
-       $form = '<form action="" method="post" name="editlink" id="editlink">'; 
+       $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
        $nonce_action = 'update-bookmark_' . $link_id;
 } else {
-       $editing = false;
-       $heading = __('<strong>Add</strong> a link:');
+       $heading = __('Add Link');
        $submit_text = __('Add Link &raquo;');
-       $form = '<form name="addlink" method="post" action="link-manager.php">';
+       $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
        $nonce_action = 'add-bookmark';
 }
 
@@ -24,216 +22,237 @@ function xfn_check($class, $value = '', $type = 'check') {
        }
 
        if ('' == $value) {
-               if ('family' == $class && !strstr($link_rel, 'child') && !strstr($link_rel, 'parent') && !strstr($link_rel, 'sibling') && !strstr($link_rel, 'spouse') && !strstr($link_rel, 'kin')) echo ' checked="checked"';
-               if ('friendship' == $class && !strstr($link_rel, 'friend') && !strstr($link_rel, 'acquaintance') && !strstr($link_rel, 'contact') ) echo ' checked="checked"';
-               if ('geographical' == $class && !strstr($link_rel, 'co-resident') && !strstr($link_rel, 'neighbor') ) echo ' checked="checked"';
+               if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
+               if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
+               if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
                if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
        }
 }
-
 ?>
 
-<div class="wrap"> 
-  <?php echo $form ?>
-  <?php wp_nonce_field($nonce_action); ?>
-  <h2><?php echo $heading ?></h2>
-<fieldset class="options">
-    <legend><?php _e('Basics') ?></legend>
-        <table class="editform" width="100%" cellspacing="2" cellpadding="5">
-         <tr>
-           <th width="33%" scope="row"><?php _e('URI:') ?></th>
-           <td width="67%"><input type="text" name="link_url" value="<?php echo $link->link_url; ?>" style="width: 95%;" /></td>
-         </tr>
-         <tr>
-           <th scope="row"><?php _e('Link Name:') ?></th>
-           <td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
-         </tr>
-         <tr>
-            <th scope="row"><?php _e('Short description:') ?></th>
-               <td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
-               </tr>
-        <tr>
-           <th scope="row"><?php _e('Category:') ?></th>
-           <td><?php link_category_dropdown('link_category', $link->link_category); ?></td>
-         </tr>
-</table>
+<div class="wrap">
+<h2><?php echo $heading ?></h2>
+<?php echo $form ?>
+<?php wp_nonce_field($nonce_action); ?>
+
+<div id="poststuff">
+<div id="moremeta">
+<div id="grabit" class="dbx-group">
+
+<fieldset id="categorydiv" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
+<div class="dbx-content">
+<p id="jaxcat"></p>
+<ul id="linkcategorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
+</div>
 </fieldset>
-       <p class="submit">
-       <input type="submit" name="submit" value="<?php echo $submit_text ?>" />
-       </p>
-       <fieldset class="options">
-        <legend><?php _e('Link Relationship (XFN)') ?></legend>
-        <table class="editform" width="100%" cellspacing="2" cellpadding="5">
-            <tr>
-                <th width="33%" scope="row"><?php _e('rel:') ?></th>
-               <td width="67%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
-               </tr>
-            <tr>
-                <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
-               <td>
-                                       <table cellpadding="3" cellspacing="5">
-                 <tr>
-              <th scope="row"> <?php _e('identity') ?> </th>
-              <td>
-                <label for="me">
-                <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
-          <?php _e('another web address of mine') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('friendship') ?> </th>
-              <td>
-                           <label for="contact">
-                <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
-                <label for="acquaintance">
-                <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> />  <?php _e('acquaintance') ?></label>
-                <label for="friend">
-                <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
-                <label for="friendship">
-                <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('physical') ?> </th>
-              <td>
-                <label for="met">
-                <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
-          <?php _e('met') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('professional') ?> </th>
-              <td>
-                <label for="co-worker">
-                <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
-          <?php _e('co-worker') ?></label>
-                <label for="colleague">
-                <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
-          <?php _e('colleague') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('geographical') ?> </th>
-              <td>
-                <label for="co-resident">
-                <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
-          <?php _e('co-resident') ?></label>
-                <label for="neighbor">
-                <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
-          <?php _e('neighbor') ?></label>
-                <label for="geographical">
-                <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
-          <?php _e('none') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('family') ?> </th>
-              <td>
-                <label for="child">
-                <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?>  />
-          <?php _e('child') ?></label>
-                <label for="kin">
-                <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?>  />
-          <?php _e('kin') ?></label>
-                <label for="parent">
-                <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
-          <?php _e('parent') ?></label>
-                <label for="sibling">
-                <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
-          <?php _e('sibling') ?></label>
-                <label for="spouse">
-                <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
-          <?php _e('spouse') ?></label>
-                <label for="family">
-                <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
-          <?php _e('none') ?></label>
-              </td>
-            </tr>
-            <tr>
-              <th scope="row"> <?php _e('romantic') ?> </th>
-              <td>
-                <label for="muse">
-                <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
-         <?php _e('muse') ?></label>
-                <label for="crush">
-                <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
-         <?php _e('crush') ?></label>
-                <label for="date">
-                <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
-         <?php _e('date') ?></label>
-                <label for="romantic">
-                <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
-         <?php _e('sweetheart') ?></label>
-              </td>
-            </tr>
-        </table>
-                 </td>
-               </tr>
-</table>
+
+<fieldset class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Target') ?></h3>
+<div class="dbx-content">
+<label for="link_target_blank" class="selectit">
+<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
+<code>_blank</code></label>
+<label for="link_target_top" class="selectit">
+<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
+<code>_top</code></label>
+<label for="link_target_none" class="selectit">
+<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
+<?php _e('none') ?></label>
+</div>
 </fieldset>
-       <p class="submit">
-       <input type="submit" name="submit" value="<?php echo $submit_text ?>" />
-       </p>
-<fieldset class="options">
-        <legend><?php _e('Advanced') ?></legend>
-        <table class="editform" width="100%" cellspacing="2" cellpadding="5">
-         <tr>
-           <th width="33%" scope="row"><?php _e('Image URI:') ?></th>
-           <td width="67%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
-         </tr>
+
+<fieldset class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
+<div class="dbx-content">
+<label for="link_visible_yes" class="selectit">
+<input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
+<?php _e('Yes') ?></label>
+<label for="link_visible_no" class="selectit">
+<input id="link_visible_no" type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
+<?php _e('No') ?></label>
+</div>
+</fieldset>
+
+</div>
+</div>
+
+<table class="editform" width="100%" cellspacing="2" cellpadding="5">
 <tr>
-           <th scope="row"><?php _e('RSS URI:') ?> </th>
-           <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
-         </tr>
-         <tr>
-           <th scope="row"><?php _e('Notes:') ?></th>
-           <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
-         </tr>
-         <tr>
-           <th scope="row"><?php _e('Rating:') ?></th>
-           <td><select name="link_rating" size="1">
-<?php
-    for ($r = 0; $r < 10; $r++) {
-      echo('            <option value="'.$r.'" ');
-      if ($link->link_rating == $r)
-        echo 'selected="selected"';
-      echo('>'.$r.'</option>');
-    }
-?>
-           </select>
-         &nbsp;<?php _e('(Leave at 0 for no rating.)') ?> </td>
-         </tr>
-         <tr>
-           <th scope="row"><?php _e('Target') ?></th>
-           <td><label>
-          <input type="radio" name="link_target" value="_blank"   <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
-          <code>_blank</code></label><br />
-<label>
-<input type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
-<code>_top</code></label><br />
-<label>
-<input type="radio" name="link_target" value=""     <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
-<?php _e('none') ?></label><br />
-<?php _e('(Note that the <code>target</code> attribute is illegal in XHTML 1.1 and 1.0 Strict.)') ?></td>
-         </tr>
-         <tr>
-           <th scope="row"><?php _e('Visible:') ?></th>
-           <td><label>
-             <input type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
-<?php _e('Yes') ?></label><br /><label>
-<input type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
-<?php _e('No') ?></label></td>
-         </tr>
+<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
+<td><input type="text" name="link_name" id="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
+</tr>
+<tr>
+<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th>
+<td width="80%"><input type="text" name="link_url" id="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
+</tr>
+<tr>
+<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th>
+<td><input type="text" name="link_description" id="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
+</tr>
 </table>
+
+<p class="submit">
+<input type="submit" name="submit" value="<?php echo $submit_text ?>" />
+</p>
+
+<div id="advancedstuff" class="dbx-group" >
+
+<fieldset id="xfn" class="dbx-box">
+<h3 class="dbx-handle"><?php _e('Link Relationship (XFN)') ?></h3>
+<div class="dbx-content">
+<table class="editform" width="100%" cellspacing="2" cellpadding="5">
+       <tr>
+               <th width="20%" scope="row"><?php _e('rel:') ?></th>
+               <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
+       </tr>
+       <tr>
+               <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
+               <td>
+                       <table cellpadding="3" cellspacing="5">
+                               <tr>
+                                       <th scope="row"> <?php _e('identity') ?> </th>
+                                       <td>
+                                               <label for="me">
+                                               <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
+                                               <?php _e('another web address of mine') ?></label>