Upgrade WordPress.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2007 22:16:10 +0000 (22:16 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2007 22:16:10 +0000 (22:16 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27233 268f45cc-cd09-0410-ab3c-d52691b4dbfc

324 files changed:
WebKitSite/ChangeLog
WebKitSite/blog/license.txt [deleted file]
WebKitSite/blog/readme.html [deleted file]
WebKitSite/blog/wp-admin/admin-ajax.php
WebKitSite/blog/wp-admin/admin-db.php [deleted file]
WebKitSite/blog/wp-admin/admin-footer.php
WebKitSite/blog/wp-admin/admin-functions.php
WebKitSite/blog/wp-admin/admin-header.php
WebKitSite/blog/wp-admin/admin.php
WebKitSite/blog/wp-admin/bookmarklet.php
WebKitSite/blog/wp-admin/categories.php
WebKitSite/blog/wp-admin/comment.php
WebKitSite/blog/wp-admin/css/install-rtl.css [new file with mode: 0644]
WebKitSite/blog/wp-admin/css/install.css [moved from WebKitSite/blog/wp-admin/install.css with 100% similarity]
WebKitSite/blog/wp-admin/css/upload-rtl.css [new file with mode: 0644]
WebKitSite/blog/wp-admin/css/upload.css [moved from WebKitSite/blog/wp-admin/upload.css with 100% similarity]
WebKitSite/blog/wp-admin/css/widgets-rtl.css [new file with mode: 0644]
WebKitSite/blog/wp-admin/css/widgets.css [moved from WebKitSite/blog/wp-admin/widgets.css with 77% similarity]
WebKitSite/blog/wp-admin/custom-header.php
WebKitSite/blog/wp-admin/edit-category-form.php
WebKitSite/blog/wp-admin/edit-comments.php
WebKitSite/blog/wp-admin/edit-form-advanced.php
WebKitSite/blog/wp-admin/edit-form-comment.php
WebKitSite/blog/wp-admin/edit-form.php
WebKitSite/blog/wp-admin/edit-link-categories.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/edit-link-category-form.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/edit-link-form.php
WebKitSite/blog/wp-admin/edit-page-form.php
WebKitSite/blog/wp-admin/edit-pages.php
WebKitSite/blog/wp-admin/edit-post-rows.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/edit.php
WebKitSite/blog/wp-admin/export.php
WebKitSite/blog/wp-admin/images/heading-bg.gif [new file with mode: 0644]
WebKitSite/blog/wp-admin/images/logo-ghost.png [new file with mode: 0644]
WebKitSite/blog/wp-admin/import-b2.php [deleted file]
WebKitSite/blog/wp-admin/import-blogger.php [deleted file]
WebKitSite/blog/wp-admin/import-greymatter.php [deleted file]
WebKitSite/blog/wp-admin/import-livejournal.php [deleted file]
WebKitSite/blog/wp-admin/import-mt.php [deleted file]
WebKitSite/blog/wp-admin/import-rss.php [deleted file]
WebKitSite/blog/wp-admin/import-textpattern.php [deleted file]
WebKitSite/blog/wp-admin/import.php
WebKitSite/blog/wp-admin/import/blogger.php
WebKitSite/blog/wp-admin/import/blogware.php
WebKitSite/blog/wp-admin/import/btt.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/import/dotclear.php
WebKitSite/blog/wp-admin/import/greymatter.php
WebKitSite/blog/wp-admin/import/jkw.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/import/livejournal.php
WebKitSite/blog/wp-admin/import/mt.php
WebKitSite/blog/wp-admin/import/rss.php
WebKitSite/blog/wp-admin/import/stp.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/import/textpattern.php
WebKitSite/blog/wp-admin/import/utw.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/import/wordpress.php
WebKitSite/blog/wp-admin/import/wp-cat2tag.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/admin.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/bookmark.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/comment.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/file.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/image.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/import.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/misc.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/plugin.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/post.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/schema.php [moved from WebKitSite/blog/wp-admin/upgrade-schema.php with 88% similarity]
WebKitSite/blog/wp-admin/includes/taxonomy.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/template.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/theme.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/update.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/upgrade.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/includes/upload.php [moved from WebKitSite/blog/wp-admin/upload-functions.php with 89% similarity]
WebKitSite/blog/wp-admin/includes/user.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/index-extra.php
WebKitSite/blog/wp-admin/index.php
WebKitSite/blog/wp-admin/install-rtl.css [deleted file]
WebKitSite/blog/wp-admin/install.php
WebKitSite/blog/wp-admin/js/cat.js [moved from WebKitSite/blog/wp-admin/cat.js with 74% similarity]
WebKitSite/blog/wp-admin/js/categories.js [moved from WebKitSite/blog/wp-admin/categories.js with 100% similarity]
WebKitSite/blog/wp-admin/js/custom-fields.js [moved from WebKitSite/blog/wp-admin/custom-fields.js with 100% similarity]
WebKitSite/blog/wp-admin/js/dbx-admin-key.js [moved from WebKitSite/blog/wp-admin/dbx-admin-key.js with 100% similarity]
WebKitSite/blog/wp-admin/js/edit-comments.js [moved from WebKitSite/blog/wp-admin/edit-comments.js with 100% similarity]
WebKitSite/blog/wp-admin/js/link-cat.js [new file with mode: 0644]
WebKitSite/blog/wp-admin/js/upload.js [moved from WebKitSite/blog/wp-admin/upload.js with 72% similarity]
WebKitSite/blog/wp-admin/js/users.js [moved from WebKitSite/blog/wp-admin/users.js with 100% similarity]
WebKitSite/blog/wp-admin/js/xfn.js [moved from WebKitSite/blog/wp-admin/xfn.js with 100% similarity]
WebKitSite/blog/wp-admin/link-add.php
WebKitSite/blog/wp-admin/link-categories.php [deleted file]
WebKitSite/blog/wp-admin/link-category.php [new file with mode: 0644]
WebKitSite/blog/wp-admin/link-import.php
WebKitSite/blog/wp-admin/link-manager.php
WebKitSite/blog/wp-admin/link.php
WebKitSite/blog/wp-admin/menu.php
WebKitSite/blog/wp-admin/moderation.php
WebKitSite/blog/wp-admin/options-discussion.php
WebKitSite/blog/wp-admin/options-general.php
WebKitSite/blog/wp-admin/options-permalink.php
WebKitSite/blog/wp-admin/options-reading.php
WebKitSite/blog/wp-admin/options-writing.php
WebKitSite/blog/wp-admin/options.php
WebKitSite/blog/wp-admin/page-new.php
WebKitSite/blog/wp-admin/page.php
WebKitSite/blog/wp-admin/plugins.php
WebKitSite/blog/wp-admin/post-new.php
WebKitSite/blog/wp-admin/post.php
WebKitSite/blog/wp-admin/profile.php
WebKitSite/blog/wp-admin/quicktags.js [deleted file]
WebKitSite/blog/wp-admin/rtl.css
WebKitSite/blog/wp-admin/setup-config.php
WebKitSite/blog/wp-admin/sidebar.php
WebKitSite/blog/wp-admin/theme-editor.php
WebKitSite/blog/wp-admin/themes.php
WebKitSite/blog/wp-admin/update-links.php
WebKitSite/blog/wp-admin/upgrade-functions.php
WebKitSite/blog/wp-admin/upgrade.php
WebKitSite/blog/wp-admin/upload-rtl.css [deleted file]
WebKitSite/blog/wp-admin/upload.php
WebKitSite/blog/wp-admin/user-edit.php
WebKitSite/blog/wp-admin/users.php
WebKitSite/blog/wp-admin/widgets-rtl.css [deleted file]
WebKitSite/blog/wp-admin/widgets.php
WebKitSite/blog/wp-admin/wp-admin.css
WebKitSite/blog/wp-app.php
WebKitSite/blog/wp-atom.php
WebKitSite/blog/wp-comments-post.php
WebKitSite/blog/wp-commentsrss2.php
WebKitSite/blog/wp-content/advanced-cache.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_about.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_admin_css.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_blacklist_class.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_captcha_graphic.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_comment_class.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_core_class.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_functions.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugin_class.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_anubis_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_basic_plugins.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_blacklist_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_captcha_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_javascript_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_payload_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_pjw_daily_digest_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_rbl_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_referrer_check_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_plugins/sk2_snowball_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_second_chance.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/sk2_util_class.php [deleted file]
WebKitSite/blog/wp-content/plugins/SK2/spam_karma_2_plugin.php [deleted file]
WebKitSite/blog/wp-content/plugins/akismet/akismet.php
WebKitSite/blog/wp-content/plugins/cjd_delete.php [deleted file]
WebKitSite/blog/wp-content/plugins/hello.php
WebKitSite/blog/wp-content/plugins/markdown.php [deleted file]
WebKitSite/blog/wp-content/plugins/textile1.php [deleted file]
WebKitSite/blog/wp-content/plugins/wp-cache/README.txt [deleted file]
WebKitSite/blog/wp-content/plugins/wp-cache/wp-cache-config-sample.php [deleted file]
WebKitSite/blog/wp-content/plugins/wp-cache/wp-cache-phase1.php [deleted file]
WebKitSite/blog/wp-content/plugins/wp-cache/wp-cache-phase2.php [deleted file]
WebKitSite/blog/wp-content/plugins/wp-cache/wp-cache.php [deleted file]
WebKitSite/blog/wp-content/themes/classic/comments-popup.php
WebKitSite/blog/wp-content/themes/classic/comments.php
WebKitSite/blog/wp-content/themes/classic/index.php
WebKitSite/blog/wp-content/themes/classic/rtl.css [new file with mode: 0644]
WebKitSite/blog/wp-content/themes/classic/style.css
WebKitSite/blog/wp-content/themes/default/archive.php
WebKitSite/blog/wp-content/themes/default/attachment.php
WebKitSite/blog/wp-content/themes/default/comments-popup.php
WebKitSite/blog/wp-content/themes/default/comments.php
WebKitSite/blog/wp-content/themes/default/footer.php
WebKitSite/blog/wp-content/themes/default/functions.php
WebKitSite/blog/wp-content/themes/default/images/header-img.php
WebKitSite/blog/wp-content/themes/default/index.php
WebKitSite/blog/wp-content/themes/default/rtl.css
WebKitSite/blog/wp-content/themes/default/search.php
WebKitSite/blog/wp-content/themes/default/sidebar.php
WebKitSite/blog/wp-content/themes/default/single.php
WebKitSite/blog/wp-content/wp-cache-config.php [deleted file]
WebKitSite/blog/wp-cron.php
WebKitSite/blog/wp-images/get-firefox.png [deleted file]
WebKitSite/blog/wp-images/smilies/icon_arrow.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_biggrin.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_confused.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_cool.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_cry.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_eek.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_evil.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_exclaim.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_idea.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_lol.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_mad.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_mrgreen.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_neutral.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_question.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_razz.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_redface.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_rolleyes.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_sad.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_smile.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_surprised.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_twisted.gif [deleted file]
WebKitSite/blog/wp-images/smilies/icon_wink.gif [deleted file]
WebKitSite/blog/wp-images/wp-small.png [deleted file]
WebKitSite/blog/wp-images/wpminilogo.png [deleted file]
WebKitSite/blog/wp-includes/atomlib.php [new file with mode: 0644]
WebKitSite/blog/wp-includes/author-template.php
WebKitSite/blog/wp-includes/bookmark-template.php
WebKitSite/blog/wp-includes/bookmark.php
WebKitSite/blog/wp-includes/cache.php
WebKitSite/blog/wp-includes/canonical.php [new file with mode: 0644]
WebKitSite/blog/wp-includes/capabilities.php
WebKitSite/blog/wp-includes/category-template.php
WebKitSite/blog/wp-includes/category.php
WebKitSite/blog/wp-includes/class-IXR.php
WebKitSite/blog/wp-includes/class-phpmailer.php
WebKitSite/blog/wp-includes/class-pop3.php
WebKitSite/blog/wp-includes/class-smtp.php
WebKitSite/blog/wp-includes/class-snoopy.php
WebKitSite/blog/wp-includes/classes.php
WebKitSite/blog/wp-includes/comment-functions.php [deleted file]
WebKitSite/blog/wp-includes/comment-template.php
WebKitSite/blog/wp-includes/comment.php
WebKitSite/blog/wp-includes/compat.php
WebKitSite/blog/wp-includes/cron.php
WebKitSite/blog/wp-includes/default-filters.php
WebKitSite/blog/wp-includes/deprecated.php
WebKitSite/blog/wp-includes/feed-atom-comments.php
WebKitSite/blog/wp-includes/feed-atom.php
WebKitSite/blog/wp-includes/feed-functions.php [deleted file]
WebKitSite/blog/wp-includes/feed-rdf.php
WebKitSite/blog/wp-includes/feed-rss.php
WebKitSite/blog/wp-includes/feed-rss2-comments.php
WebKitSite/blog/wp-includes/feed-rss2.php
WebKitSite/blog/wp-includes/feed.php
WebKitSite/blog/wp-includes/formatting.php
WebKitSite/blog/wp-includes/functions-compat.php [deleted file]
WebKitSite/blog/wp-includes/functions-formatting.php [deleted file]
WebKitSite/blog/wp-includes/functions-post.php [deleted file]
WebKitSite/blog/wp-includes/functions.php
WebKitSite/blog/wp-includes/general-template.php
WebKitSite/blog/wp-includes/gettext.php
WebKitSite/blog/wp-includes/images/wlw/WpComments.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/images/wlw/WpIcon.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/images/wlw/WpWatermark.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/images/wlw/wp-comments.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/images/wlw/wp-icon.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/images/wlw/wp-watermark.png [new file with mode: 0644]
WebKitSite/blog/wp-includes/js/jquery/jquery.js
WebKitSite/blog/wp-includes/js/prototype.js
WebKitSite/blog/wp-includes/js/scriptaculous/MIT-LICENSE
WebKitSite/blog/wp-includes/js/scriptaculous/builder.js
WebKitSite/blog/wp-includes/js/scriptaculous/controls.js
WebKitSite/blog/wp-includes/js/scriptaculous/dragdrop.js
WebKitSite/blog/wp-includes/js/scriptaculous/effects.js
WebKitSite/blog/wp-includes/js/scriptaculous/prototype.js
WebKitSite/blog/wp-includes/js/scriptaculous/scriptaculous.js
WebKitSite/blog/wp-includes/js/scriptaculous/slider.js
WebKitSite/blog/wp-includes/js/scriptaculous/sound.js [new file with mode: 0644]
WebKitSite/blog/wp-includes/js/scriptaculous/unittest.js
WebKitSite/blog/wp-includes/js/scriptaculous/wp-scriptaculous.js
WebKitSite/blog/wp-includes/js/tinymce/license.html [deleted file]
WebKitSite/blog/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js
WebKitSite/blog/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
WebKitSite/blog/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
WebKitSite/blog/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
WebKitSite/blog/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
WebKitSite/blog/wp-includes/js/tinymce/plugins/wordpress/langs/en.js
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/color_picker.htm
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/css/colorpicker.css [new file with mode: 0644]
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/css/editor_popup.css
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/editor_template.js
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/image.htm
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/images/colors.jpg [new file with mode: 0644]
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/jscripts/link.js
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/langs/en.js
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/link.htm
WebKitSite/blog/wp-includes/js/tinymce/themes/advanced/source_editor.htm
WebKitSite/blog/wp-includes/js/tinymce/tiny_mce.js
WebKitSite/blog/wp-includes/js/tinymce/tiny_mce_config.php
WebKitSite/blog/wp-includes/js/tinymce/tiny_mce_gzip.php
WebKitSite/blog/wp-includes/js/tinymce/tiny_mce_popup.js
WebKitSite/blog/wp-includes/js/tinymce/wp-mce-help.php
WebKitSite/blog/wp-includes/js/wp-ajax.js
WebKitSite/blog/wp-includes/kses.php
WebKitSite/blog/wp-includes/link-template.php
WebKitSite/blog/wp-includes/links.php [deleted file]
WebKitSite/blog/wp-includes/locale.php
WebKitSite/blog/wp-includes/pluggable-functions.php [deleted file]
WebKitSite/blog/wp-includes/pluggable.php
WebKitSite/blog/wp-includes/plugin.php
WebKitSite/blog/wp-includes/post-template.php
WebKitSite/blog/wp-includes/post.php
WebKitSite/blog/wp-includes/query.php
WebKitSite/blog/wp-includes/registration.php
WebKitSite/blog/wp-includes/rewrite.php
WebKitSite/blog/wp-includes/rss.php
WebKitSite/blog/wp-includes/script-loader.php
WebKitSite/blog/wp-includes/streams.php
WebKitSite/blog/wp-includes/taxonomy.php [new file with mode: 0644]
WebKitSite/blog/wp-includes/template-functions-author.php [deleted file]
WebKitSite/blog/wp-includes/template-functions-category.php [deleted file]
WebKitSite/blog/wp-includes/template-functions-general.php [deleted file]
WebKitSite/blog/wp-includes/template-functions-links.php [deleted file]
WebKitSite/blog/wp-includes/template-functions-post.php [deleted file]
WebKitSite/blog/wp-includes/template-loader.php
WebKitSite/blog/wp-includes/theme.php
WebKitSite/blog/wp-includes/update.php [new file with mode: 0644]
WebKitSite/blog/wp-includes/user.php
WebKitSite/blog/wp-includes/vars.php
WebKitSite/blog/wp-includes/version.php
WebKitSite/blog/wp-includes/widgets.php
WebKitSite/blog/wp-includes/wlwmanifest.xml [new file with mode: 0644]
WebKitSite/blog/wp-includes/wp-db.php
WebKitSite/blog/wp-includes/wp-l10n.php [deleted file]
WebKitSite/blog/wp-links-opml.php
WebKitSite/blog/wp-login.php
WebKitSite/blog/wp-mail.php
WebKitSite/blog/wp-pass.php
WebKitSite/blog/wp-rdf.php
WebKitSite/blog/wp-rss.php
WebKitSite/blog/wp-rss2.php
WebKitSite/blog/wp-settings.php
WebKitSite/blog/wp-trackback.php
WebKitSite/blog/wp.php [deleted file]
WebKitSite/blog/xmlrpc.php

index 0e9be0033e75e05e2e9487fed0315fb816e4b96c..82b9c5e65731e7d935efeccdd118342edce76467 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-29  Mark Rowe  <mrowe@apple.com>
+
+        Upgrade WordPress.
+
+        * blog: Updated.
+
 2007-10-29  Mark Rowe  <mrowe@apple.com>
 
         Files that have been added or modified on the web server without making it in to SVN.
diff --git a/WebKitSite/blog/license.txt b/WebKitSite/blog/license.txt
deleted file mode 100644 (file)
index 8882205..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-
diff --git a/WebKitSite/blog/readme.html b/WebKitSite/blog/readme.html
deleted file mode 100644 (file)
index 8b2d65e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<!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" />
-       <link rel="stylesheet" href="wp-admin/install.css" type="text/css" />
-</head>
-<body>
-<h1 id="logo" style="text-align: center">
-       <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
-       <br /> Version 2.2
-</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>
-
-<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>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><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.2:</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>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>
-       <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>
-       <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>
-       <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>
-       <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. (<a href="irc://irc.freenode.net/wordpress">irc.freenode.net #wordpress</a>)</dd>
-</dl>
-
-<h1>System Recommendations</h1>
-<ul>
-       <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>
-
-<h1>Upgrading from another system</h1>
-<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>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>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>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>
-
-<h1>Share the Love</h1>
-<p>WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better&#8212;you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgable than yourself, or writing the author of a media article that overlooks us.</p>
-
-<h1>Copyright</h1>
-<p>WordPress is released under the <abbr title="GNU Public License">GPL</abbr> (see <a href="license.txt">license.txt</a>).</p>
-
-</body>
-</html>
index ad5064fd78c8eed06e8cd9273bb6b66323494d9d..013e37502c29d99a709879bac284aa787b04d419 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 require_once('../wp-config.php');
-require_once('admin-functions.php');
-require_once('admin-db.php');
+require_once('includes/admin.php');
 
 define('DOING_AJAX', true);
 
@@ -126,6 +125,28 @@ case 'add-category' : // On the Fly
        }
        $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');
@@ -183,8 +204,11 @@ case 'add-meta' :
                $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 ) ) {
@@ -286,7 +310,7 @@ case 'autosave-generate-nonces' :
                        die(wp_create_nonce('update-page_' . $ID));
                }
        }
-       die($_POST['post_type']);
+       die('0');
 break;
 default :
        do_action( 'wp_ajax_' . $_POST['action'] );
diff --git a/WebKitSite/blog/wp-admin/admin-db.php b/WebKitSite/blog/wp-admin/admin-db.php
deleted file mode 100644 (file)
index b2ebd38..0000000
+++ /dev/null
@@ -1,523 +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_type = 'post' AND 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_type = 'post' AND 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);
-
-       if( trim( $cat_name ) == '' )
-               return 0;
-
-       $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) || !get_category( $category_parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $category_parent) ) )
-               $category_parent = 0;
-
-       if ( isset($posts_private) )
-               $posts_private = (int) $posts_private;
-       else
-               $posts_private = 0;
-
-       if ( isset($links_private) )
-               $links_private = (int) $links_private;
-       else
-               $links_private = 0;
-
-       if (!$update) {
-               $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private')");
-               $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', links_private = '$links_private', posts_private = '$posts_private' 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'" );
-       }
-
-       // Keep in mind when using this filter and altering the cat_ID that the two queries above
-       // have already taken place with the OLD cat_ID
-       // Also note that you may have post2cat entries with the old cat_ID if this is an update
-
-       if ($update) {
-               do_action('edit_category', $cat_ID);
-       } else {
-               do_action('create_category', $cat_ID);
-               do_action('add_category', $cat_ID);
-       }
-
-       $cat_ID = apply_filters('cat_id_filter', $cat_ID, $update);
-
-       clean_category_cache($cat_ID);
-
-       if ($update)
-               do_action('edited_category', $cat_ID);
-       else
-               do_action('created_category', $cat_ID);
-       
-       return $cat_ID;
-}
-
-function wp_update_category($catarr) {
-       global $wpdb;
-
-       $cat_ID = (int) $catarr['cat_ID'];
-
-       if( $cat_ID == $catarr['category_parent'] )
-               return false;
-
-       // 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;
-       $default_cat = get_option('default_category');
-       $default_link_cat = get_option('default_link_category');
-
-       // Don't delete either of the default cats
-       if ( $cat_ID == $default_cat || $cat_ID == $default_link_cat )
-               return 0;
-
-       $category = get_category($cat_ID);
-
-       $parent = $category->category_parent;
-
-       // Delete the category
-       if ( !$wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = '$cat_ID'") )
-               return 0;
-
-       // Update children to point to new parent
-       $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$parent' WHERE category_parent = '$cat_ID'");
-
-       // Only set posts and links to the default category if they're not in another category already
-       $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'");
-       foreach ( (array) $posts as $post_id ) {
-               $cats = wp_get_post_categories($post_id);
-               if ( 1 == count($cats) )
-                       $cats = array($default_cat);
-               else
-                       $cats = array_diff($cats, array($cat_ID));
-               wp_set_post_categories($post_id, $cats);
-       }
-
-       $links = $wpdb->get_col("SELECT link_id FROM $wpdb->link2cat WHERE category_id='$cat_ID'");
-       foreach ( (array) $links as $link_id ) {
-               $cats = wp_get_link_cats($link_id);
-               if ( 1 == count($cats) )
-                       $cats = array($default_link_cat);
-               else
-                       $cats = array_diff($cats, array($cat_ID));
-               wp_set_link_cats($link_id, $cats);
-       }
-
-       clean_category_cache($cat_ID);
-       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_categories($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
-       do_action('delete_user', $id);
-
-       $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');
-
-       return true;
-}
-
-function wp_revoke_user($id) {
-       $id = (int) $id;
-
-       $user = new WP_User($id);
-       $user->remove_all_caps();
-}
-
-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);
-
-       // Make sure we set a valid category
-       if (0 == count($link_category) || !is_array($link_category)) {
-               $link_category = array(get_option('default_link_category'));
-       }
-
-       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_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_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
-               $link_id = (int) $wpdb->insert_id;
-       }
-
-       wp_set_link_cats($link_id, $link_category);
-
-       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);
-
-       // Passed link category list overwrites existing category list if not empty.
-       if ( isset($linkdata['link_category']) && is_array($linkdata['link_category'])
-                        && 0 != count($linkdata['link_category']) )
-               $link_cats = $linkdata['link_category'];
-       else
-               $link_cats = $link['link_category'];
-
-       // Merge old and new fields with new fields overwriting old ones.
-       $linkdata = array_merge($link, $linkdata);
-       $linkdata['link_category'] = $link_cats;
-
-       return wp_insert_link($linkdata);
-}
-
-function wp_delete_link($link_id) {
-       global $wpdb;
-
-       do_action('delete_link', $link_id);
-
-       $categories = wp_get_link_cats($link_id);
-       if( is_array( $categories ) ) {
-               foreach ( $categories as $category ) {
-                       $wpdb->query("UPDATE $wpdb->categories SET link_count = link_count - 1 WHERE cat_ID = '$category'");
-                       wp_cache_delete($category, 'category');
-                       do_action('edit_category', $cat_id);
-               }
-       }
-
-       $wpdb->query("DELETE FROM $wpdb->link2cat WHERE link_id = '$link_id'");
-       return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
-       
-       do_action('deleted_link', $link_id);
-}
-
-function wp_get_link_cats($link_ID = 0) {
-       global $wpdb;
-
-       $sql = "SELECT category_id
-               FROM $wpdb->link2cat
-               WHERE link_id = $link_ID
-               ORDER BY category_id";
-
-       $result = $wpdb->get_col($sql);
-
-       if ( !$result )
-               $result = array();
-
-       return array_unique($result);
-}
-
-function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
-       global $wpdb;
-       // If $link_categories isn't already an array, make it one:
-       if (!is_array($link_categories) || 0 == count($link_categories))
-               $link_categories = array(get_option('default_link_category'));
-
-       $link_categories = array_unique($link_categories);
-
-       // First the old categories
-       $old_categories = $wpdb->get_col("
-               SELECT category_id
-               FROM $wpdb->link2cat
-               WHERE link_id = '$link_ID'");
-
-       if (!$old_categories) {
-               $old_categories = array();
-       } else {
-               $old_categories = array_unique($old_categories);
-       }
-
-       // Delete any?
-       $delete_cats = array_diff($old_categories,$link_categories);
-
-       if ($delete_cats) {
-               foreach ($delete_cats as $del) {
-                       $del = (int) $del;
-                       $wpdb->query("
-                               DELETE FROM $wpdb->link2cat
-                               WHERE category_id = '$del'
-                                       AND link_id = '$link_ID'
-                               ");
-               }
-       }
-
-       // Add any?
-       $add_cats = array_diff($link_categories, $old_categories);
-
-       if ($add_cats) {
-               foreach ($add_cats as $new_cat) {
-                       $new_cat = (int) $new_cat;
-                       if ( !empty($new_cat) )
-                               $wpdb->query("
-                                       INSERT INTO $wpdb->link2cat (link_id, category_id)
-                                       VALUES ('$link_ID', '$new_cat')");
-               }
-       }
-
-       // Update category counts.
-       $all_affected_cats = array_unique(array_merge($link_categories, $old_categories));
-       foreach ( $all_affected_cats as $cat_id ) {
-               $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->link2cat, $wpdb->links WHERE $wpdb->links.link_id = $wpdb->link2cat.link_id AND category_id = '$cat_id'");
-               $wpdb->query("UPDATE $wpdb->categories SET link_count = '$count' WHERE cat_ID = '$cat_id'");
-               wp_cache_delete($cat_id, 'category');
-               do_action('edit_category', $cat_id);
-       }
-
-}      // wp_set_link_cats()
-
-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 6023bed960eb5c5da74b47950d52d176fb225961..a96770b53166df92ab03cde6a17bb097dae4f45a 100644 (file)
@@ -1,10 +1,13 @@
 
 <div id="footer">
-<p class="logo"><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
-<p class="docs"><?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?><br />
-<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?></p>
+<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>
 </body>
-</html>
\ No newline at end of file
+</html>
index 4ee8b1acd9b99f7a8d2f38931950f7821f5ee62b..04b1b364f196b550a231df33a184f25b6f14f8c4 100644 (file)
 <?php
-
-function write_post() {
-       $result = wp_write_post();
-       if( is_wp_error( $result ) )
-               wp_die( $result->get_error_message() );
-       else
-               return $result;
-}
-
-// Creates a new post from the "Write Post" form using $_POST information.
-function wp_write_post() {
-       global $user_ID;
-
-       if ( 'page' == $_POST['post_type'] ) {
-               if ( !current_user_can( 'edit_pages' ) )
-                       return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) );
-       } else {
-               if ( !current_user_can( 'edit_posts' ) )
-                       return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) );
-       }
-
-
-       // Check for autosave collisions
-       $temp_id = false;
-       if ( isset($_POST['temp_ID']) ) {
-               $temp_id = (int) $_POST['temp_ID'];
-               if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
-                       $draft_ids = array();
-               foreach ( $draft_ids as $temp => $real )
-                       if ( time() + $temp > 86400 ) // 1 day: $temp is equal to -1 * time( then )
-                               unset($draft_ids[$temp]);
-
-               if ( isset($draft_ids[$temp_id]) ) { // Edit, don't write
-                       $_POST['post_ID'] = $draft_ids[$temp_id];
-                       unset($_POST['temp_ID']);
-                       update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
-                       return edit_post();
-               }
-       }
-
-       // 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'] ) {
-               if ( 'page' == $_POST['post_type'] ) {
-                       if ( !current_user_can( 'edit_others_pages' ) )
-                               return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
-               } else {
-                       if ( !current_user_can( 'edit_others_posts' ) )
-                               return new WP_Error( 'edit_others_posts', __( 'You are not allowed to 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 ( 'page' == $_POST['post_type'] ) {
-               if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
-                       $_POST['post_status'] = 'draft';
-       } else {
-               if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) )
-                       $_POST['post_status'] = 'draft';
-       }
-
-       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'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
-               $_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
-       }
-
-       // Create the post.
-       $post_ID = wp_insert_post( $_POST );
-
-       add_meta( $post_ID );
-
-       // Reunite any orphaned attachments with their parent
-       if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
-               $draft_ids = array();
-       if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
-               relocate_children( $draft_temp_id, $post_ID );
-       if ( $temp_id && $temp_id != $draft_temp_id )
-               relocate_children( $temp_id, $post_ID );
-
-       // Update autosave collision detection
-       if ( $temp_id ) {
-               $draft_ids[$temp_id] = $post_ID;
-               update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
-       }
-
-       // 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 = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i";
-       foreach ( $anchor_matches[0] as $anchor ) {
-               if ( 0 == preg_match( $search, $anchor, $id_matches ) )
-                       continue;
-
-               $id = (int) $id_matches[3];
-
-               // 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 ( 'page' == $_POST['post_type'] ) {
-               if ( !current_user_can( 'edit_page', $post_ID ) )
-                       wp_die( __('You are not allowed to edit this page.' ));
-       } else {
-               if ( !current_user_can( 'edit_post', $post_ID ) )
-                       wp_die( __('You are not allowed to edit this post.' ));
-       }
-
-       // Autosave shouldn't save too soon after a real save
-       if ( 'autosave' == $_POST['action'] ) {
-               $post =& get_post( $post_ID );
-               $now = time();
-               $then = strtotime($post->post_date_gmt . ' +0000');
-               // Keep autosave_interval in sync with autosave-js.php.
-               $delta = apply_filters( 'autosave_interval', 120 ) / 2;
-               if ( ($now - $then) < $delta )
-                       return $post_ID;
-       }
-
-       // 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'] ) {
-               if ( 'page' == $_POST['post_type'] ) {
-                       if ( !current_user_can( 'edit_others_pages' ) )
-                               wp_die( __('You are not allowed to edit pages as this user.' ));
-               } else {
-                       if ( !current_user_can( 'edit_others_posts' ) )
-                               wp_die( __('You are not allowed to edit posts 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 ( 'page' == $_POST['post_type'] ) {
-               if ('publish' == $_POST['post_status'] && !current_user_can( 'edit_published_pages' ))
-                       $_POST['post_status'] = 'draft';
-       } else {
-               if ('publish' == $_POST['post_status'] && !current_user_can( 'edit_published_posts' ))
-                       $_POST['post_status'] = 'draft';
-       }
-
-       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 );
-
-       // Reunite any orphaned attachments with their parent
-       if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
-               $draft_ids = array();
-       if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
-               relocate_children( $draft_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;
-}
-
-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 ))
-               wp_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 ) {
-
-       $post = get_post( $id );
-
-       $post->post_content = format_to_edit( $post->post_content, user_can_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_type == 'page' )
-               $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($_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_option( 'default_comment_status' );
-       $post->ping_status = get_option( 'default_ping_status' );
-       $post->post_pingback = get_option( 'default_pingback_flag' );
-       $post->post_category = get_option( '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 ) {
-       $comment = get_comment( $id );
-
-       $comment->comment_content = format_to_edit( $comment->comment_content, user_can_richedit() );
-       $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 = format_to_edit( $comment->comment_author_url );
-
-       return $comment;
-}
-
-function get_category_to_edit( $id ) {
-       $category = get_category( $id );
-
-       return $category;
-}
-
-function wp_dropdown_roles( $default = false ) {
-       global $wp_roles;
-       $r = '';
-       foreach( $wp_roles->role_names as $role => $name )
-               if ( $default == $role ) // Make default first in list
-                       $p = "\n\t<option selected='selected' value='$role'>$name</option>";
-               else
-                       $r .= "\n\t<option value='$role'>$name</option>";
-       echo $p . $r;
-}
-
-
-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() {
-       if ( func_num_args() ) { // The hackiest hack that ever did hack
-               global $current_user, $wp_roles;
-               $user_id = (int) func_get_arg( 0 );
-
-               if ( isset( $_POST['role'] ) ) {
-                       if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) {
-                               $user = new WP_User( $user_id );
-                               $user->set_role( $_POST['role'] );
-                       }
-               }
-       } else {
-               add_action( 'user_register', 'add_user' ); // See above
-               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|irc|gopher|nntp|feed|telnet):/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'] ));
-       if ( !$update )
-               $user->rich_editing = 'true';  // Default to true for new users.
-       else if ( isset( $_POST['rich_editing'] ) )
-               $user->rich_editing = $_POST['rich_editing'];
-       else
-               $user->rich_editing = 'false';
-
-       $errors = new WP_Error();
-
-       /* checking that username has been typed */
-       if ( $user->user_login == '' )
-               $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));
-
-       /* checking the password has been typed twice */
-       do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
-
-       if (!$update ) {
-               if ( $pass1 == '' || $pass2 == '' )
-                       $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ));
-       } else {
-               if ((empty ( $pass1 ) && !empty ( $pass2 ) ) || (empty ( $pass2 ) && !empty ( $pass1 ) ) )
-                       $errors->add( 'pass', __( "<strong>ERROR</strong>: you typed your new password only once." ));
-       }
-
-       /* Check for "\" in password */
-       if( strpos( " ".$pass1, "\\" ) )
-               $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ));
-
-       /* checking the password has been typed twice the same */
-       if ( $pass1 != $pass2 )
-               $errors->add( 'pass', __( '<strong>ERROR</strong>: Please type the same password in the two password fields.' ));
-
-       if (!empty ( $pass1 ))
-               $user->user_pass = $pass1;
-
-       if ( !$update && !validate_username( $user->user_login ) )
-               $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.' ));
-
-       if (!$update && username_exists( $user->user_login ))
-               $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered, please choose another one.' ));
-
-       /* checking e-mail address */
-       if ( empty ( $user->user_email ) ) {
-               $errors->add( 'user_email', __( "<strong>ERROR</strong>: please type an e-mail address" ));
-       } else
-               if (!is_email( $user->user_email ) ) {
-                       $errors->add( 'user_email', __( "<strong>ERROR</strong>: the email address isn't correct" ));
-               }
-
-       if ( $errors->get_error_codes() )
-               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 $user_id;
-}
-
-
-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 = '';
-
-       $link->link_visible = 'Y';
-
-       return $link;
-}
-
-function add_link() {
-       return edit_link();
-}
-
-function edit_link( $link_id = '' ) {
-       if (!current_user_can( 'manage_links' ))
-               wp_die( __( 'Cheatin&#8217; 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']);
-       $_POST['link_category'] = $_POST['post_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 AND ( link_count = 0 OR category_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY category_count DESC" );
-}
-
-function sort_cats( $cat1, $cat2 ) {
-       if ( $cat1['checked'] || $cat2['checked'] )
-               return ( $cat1['checked'] && !$cat2['checked'] ) ? -1 : 1;
-       else
-               return strcasecmp( $cat1['cat_name'], $cat2['cat_name'] );
-}
-
-function get_nested_categories( $default = 0, $parent = 0 ) {
-       global $post_ID, $link_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 if ( $link_id ) {
-               $checked_categories = $wpdb->get_col( "
-                    SELECT category_id
-                    FROM $wpdb->categories, $wpdb->link2cat
-                    WHERE $wpdb->link2cat.category_id = cat_ID AND $wpdb->link2cat.link_id = '$link_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 '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : "" ), '/> ', wp_specialchars( apply_filters('the_category', $category['cat_name'] )), "</label></li>";
-
-               if ( $category['children'] ) {
-                       echo "<ul>\n";
-                       write_nested_categories( $category['children'] );
-                       echo "</ul>\n";
-               }
-       }
-}
-
-function dropdown_categories( $default = 0 ) {
-       write_nested_categories( get_nested_categories( $default) );
-}
-
-function return_link_categories_list( $parent = 0 ) {
-       global $wpdb;
-       return $wpdb->get_col( "SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND ( category_count = 0  OR link_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY link_count DESC" );
-}
-
-function get_nested_link_categories( $default = 0, $parent = 0 ) {
-       global $post_ID, $link_id, $mode, $wpdb;
-
-       if ( $link_id ) {
-               $checked_categories = $wpdb->get_col( "
-                    SELECT category_id
-                    FROM $wpdb->categories, $wpdb->link2cat
-                    WHERE $wpdb->link2cat.category_id = cat_ID AND $wpdb->link2cat.link_id = '$link_id'
-                    " );
-
-               if ( count( $checked_categories ) == 0 ) {
-                       // No selected categories, strange
-                       $checked_categories[] = $default;
-               }
-       } else {
-               $checked_categories[] = $default;
-       }
-
-       $cats = return_link_categories_list( $parent);
-       $result = array ();
-
-       if ( is_array( $cats ) ) {
-               foreach ( $cats as $cat) {
-                       $result[$cat]['children'] = get_nested_link_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 dropdown_link_categories( $default = 0 ) {
-       write_nested_categories( get_nested_link_categories( $default) );
-}
-
-// Dandy new recursive multiple category stuff.
-function cat_rows( $parent = 0, $level = 0, $categories = 0 ) {
-       if (!$categories )
-               $categories = get_categories( 'hide_empty=0' );
-
-       $children = _get_category_hierarchy();
-
-       if ( $categories ) {
-               ob_start();
-               foreach ( $categories as $category ) {
-                       if ( $category->category_parent == $parent) {
-                               echo "\t" . _cat_row( $category, $level );
-                               if ( isset($children[$category->cat_ID]) )
-                                       cat_rows( $category->cat_ID, $level +1, $categories );
-                       }
-               }
-               $output = ob_get_contents();
-               ob_end_clean();
-
-               $output = apply_filters('cat_rows', $output);
-
-               echo $output;
-       } else {
-               return false;
-       }
-}
-
-function _cat_row( $category, $level, $name_override = false ) {
-       global $class;
-
-       $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 = (int) get_option( 'default_category' );
-               $default_link_cat_id = (int) get_option( 'default_link_category' );
-
-               if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_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, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" 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->category_count = number_format( $category->category_count );
-       $category->link_count = number_format( $category->link_count );
-       $posts_count = ( $category->category_count > 0 ) ? "<a href='edit.php?cat=$category->cat_ID'>$category->category_count</a>" : $category->category_count;
-       return "<tr id='cat-$category->cat_ID'$class>
-               <th scope='row' style='text-align: center'>$category->cat_ID</th>
-               <td>" . ( $name_override ? $name_override : $pad . ' ' . $category->cat_name ) . "</td>
-               <td>$category->category_description</td>
-               <td align='center'>$posts_count</td>
-               <td align='center'>$category->link_count</td>
-               <td>$edit</td>\n\t</tr>\n";
-}
-
-function page_rows( $parent = 0, $level = 0, $pages = 0, $hierarchy = true ) {
-       global $wpdb, $class, $post;
-
-       if (!$pages )
-               $pages = get_pages( 'sort_column=menu_order' );
-
-       if (! $pages )
-               return false;
-
-       foreach ( $pages as $post) {
-               setup_postdata( $post);
-               if ( $hierarchy && ($post->post_parent != $parent) )
-                       continue;
-
-               $post->post_title = wp_specialchars( $post->post_title );
-               $pad = str_repeat( '&#8212; ', $level );
-               $id = (int) $post->ID;
-               $class = ('alternate' == $class ) ? '' : 'alternate';
-?>
-  <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'> 
-    <th scope="row" style="text-align: center"><?php echo $post->ID; ?></th> 
-    <td>
-      <?php echo $pad; ?><?php the_title() ?>
-    </td> 
-    <td><?php the_author() ?></td>
-    <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else 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_page', $id ) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td> 
-    <td><?php if ( current_user_can( 'delete_page', $id ) ) { echo "<a href='" . wp_nonce_url( "page.php?action=delete&amp;post=$id", 'delete-page_' . $id ) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . js_escape(sprintf( __("You are about to delete the '%s' page.\n'OK' to delete, 'Cancel' to stop." ), get_the_title() ) ) . "' );\">" . __( 'Delete' ) . "</a>"; } ?></td> 
-  </tr> 
-
-<?php
-               if ( $hierarchy ) page_rows( $id, $level + 1, $pages );
-       }
-}
-
-function user_row( $user_object, $style = '' ) {
-       if ( !(is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
-               $user_object = new WP_User( (int) $user_object );
-       $email = $user_object->user_email;
-       $url = $user_object->user_url;
-       $short_url = str_replace( 'http://', '', $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 ).'...';
-       $numposts = get_usernumposts( $user_object->ID );
-       $r = "<tr id='user-$user_object->ID'$style>
-               <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
-               <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td>
-               <td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
-               <td><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td>
-               <td><a href='$url' title='website: $url'>$short_url</a></td>";
-       $r .= "\n\t\t<td align='center'>";
-       if ( $numposts > 0 ) {
-               $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
-               $r .= sprintf(__ngettext( 'View %s post', 'View %s posts', $numposts ), $numposts);
-               $r .= '</a>';
-       }
-       $r .= "</td>\n\t\t<td>";
-       if ( current_user_can( 'edit_user', $user_object->ID ) ) {
-               $edit_link = add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" );
-               $r .= "<a href='$edit_link' class='edit'>".__( 'Edit' )."</a>";
-       }
-       $r .= "</td>\n\t</tr>";
-       return $r;
-}
-
-function _wp_get_comment_list( $s = false, $start, $num ) {
-       global $wpdb;
-
-       $start = (int) $start;
-       $num = (int) $num;
-
-       if ( $s ) {
-               $s = $wpdb->escape($s);
-               $comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * 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 LIMIT $start, $num");
-       } else {
-               $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date DESC LIMIT $start, $num" );
-       }
-
-       $total = $wpdb->get_var( "SELECT FOUND_ROWS()" );
-
-       return array($comments, $total);
-}
-
-function _wp_comment_list_item( $id, $alt = 0 ) {
-       global $authordata, $comment, $wpdb;
-       $id = (int) $id;
-       $comment =& get_comment( $id );
-       $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 ( $alt % 2 )
-               $class .= ' alternate';
-       echo "<li id='comment-$comment->comment_ID' class='$class'>";
-?>
-<p><strong><?php comment_author(); ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <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 comment_date(__('M j, g:i A'));  ?> &#8212; [
-<?php
-if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-       echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>';
-       echo ' | <a href="' . wp_nonce_url('ocomment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $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 );\">" . __('Delete') . '</a> ';
-       if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
-               echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
-               echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
-       }
-       echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ";
-}
-$post = get_post($comment->comment_post_ID);
-$post_title = wp_specialchars( $post->post_title, 'double' );
-$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
-?>
- ] &#8212; <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p>
-               </li>
-<?php
-}
-
-function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
-       global $wpdb;
-       if (!$categories )
-               $categories = get_categories( 'hide_empty=0' );
-
-       if ( $categories ) {
-               foreach ( $categories as $category ) {
-                       if ( $currentcat != $category->cat_ID && $parent == $category->category_parent) {
-                               $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;
-       }
-}
-
-// 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 ) {
-               echo '<tbody id="the-list"><tr style="display: none;"><td>&nbsp;</td></tr></tbody>'; //TBODY needed for list-manipulation JS
-               return;
-       }
-       $count = 0;
-?>
-       <thead>
-       <tr>
-               <th><?php _e( 'Key' ) ?></th>
-               <th><?php _e( 'Value' ) ?></th>
-               <th colspan='2'><?php _e( 'Action' ) ?></th>
-       </tr>
-       </thead>
-<?php
-       $r ="\n\t<tbody id='the-list'>";
-       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;
-                       }
-               }
-
-               $key_js = js_escape( $entry['meta_key'] );
-               $entry['meta_key']   = attribute_escape($entry['meta_key']);
-               $entry['meta_value'] = attribute_escape($entry['meta_value']);
-               $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
-               $r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
-               $r .= "\n\t\t<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
-               $r .= "\n\t\t<td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='".attribute_escape(__( 'Update' ))."' /><br />";
-               $r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' onclick=\"return deleteSomething( 'meta', {$entry['meta_id']}, '";
-               $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>";
-               $r .= "\n\t</tr>";
-       }
-       echo $r;
-       echo "\n\t</tbody>";
-}
-
-// 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;
-       $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
-       $keys = $wpdb->get_col( "
-               SELECT meta_key
-               FROM $wpdb->postmeta
-               GROUP BY meta_key
-               ORDER BY meta_id DESC
-               LIMIT $limit" );
-       if ( $keys )
-               natcasesort($keys);
-?>
-<h3><?php _e( 'Add a new custom field:' ) ?></h3>
-<table id="newmeta" 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" id="updatemetasub" 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;
-
-       $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
-
-               $result = $wpdb->query( "
-                                               INSERT INTO $wpdb->postmeta 
-                                               (post_id,meta_key,meta_value ) 
-                                               VALUES ('$post_ID','$metakey','$metavalue' )
-                                       " );
-               return $wpdb->insert_id;
-       }
-       return false;
-} // add_meta
-
-function delete_meta( $mid ) {
-       global $wpdb;
-       $mid = (int) $mid;
-
-       return $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
-}
-
-function update_meta( $mid, $mkey, $mvalue ) {
-       global $wpdb;
-       $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 get_post_meta_by_id( $mid ) {
-       global $wpdb;
-       $mid = (int) $mid;
-
-       $meta = $wpdb->get_row( "SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
-       if ( is_serialized_string( $meta->meta_value ) )
-               $meta->meta_value = maybe_unserialize( $meta->meta_value );
-       return $meta;
-}
-
-function touch_time( $edit = 1, $for_post = 1 ) {
-       global $wp_locale, $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_option( '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\" onchange=\"edit_date.checked=true\">\n";
-       for ( $i = 1; $i < 13; $i = $i +1 ) {
-               echo "\t\t\t<option value=\"$i\"";
-               if ( $i == $mm )
-                       echo ' selected="selected"';
-               echo '>' . $wp_locale->get_month( $i ) . "</option>\n";
-       }
-?>
-</select>
-<input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"/>
-<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @
-<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> :
-<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
-<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
-<?php
-       if ( $edit ) {
-               printf( __('Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_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 $n => $markerline ) {
-                               if (strpos($markerline, '# BEGIN ' . $marker) !== false)
-                                       $state = false;
-                               if ( $state ) {
-                                       if ( $n + 1 < count( $markerdata ) )
-                                               fwrite( $f, "{$markerline}\n" );
-                                       else
-                                               fwrite( $f, "{$markerline}" );
-                               }
-                               if (strpos($markerline, '# END ' . $marker) !== false) {
-                                       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 (strpos($markerline, '# END ' . $marker) !== false)
-                               $state = false;
-                       if ( $state )
-                               $result[] = $markerline;
-                       if (strpos($markerline, '# BEGIN ' . $marker) !== false)
-                               $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 false;
-
-       if (!((!file_exists( $home_path.'.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path.'.htaccess' ) ) )
-               return false;
-
-       if (! got_mod_rewrite() )
-               return false;
-
-       $rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() );
-       return insert_with_markers( $home_path.'.htaccess', 'WordPress', $rules );
-}
-
-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_type = 'page' ORDER BY menu_order" );
-
-       if ( $items ) {
-               foreach ( $items as $item ) {
-                       // A page cannot be its 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 $_wp_menu_nopriv;
-       global $_wp_submenu_nopriv;
-       global $plugin_page;
-
-       $parent = get_admin_page_parent();
-
-       if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
-               return false;
-
-       if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
-               return false;
-
-       if ( empty( $parent) ) {
-               if ( isset( $_wp_menu_nopriv[$pagenow] ) )
-                       return false;
-               if ( isset( $_wp_submenu_nopriv[$pagenow][$pagenow] ) )
-                       return false;
-               if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
-                       return false;
-               foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
-                       if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
-                               return false;
-                       if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
-                       return false;
-               }
-               return true;
-       }
-
-       if ( isset( $submenu[$parent] ) ) {
-               foreach ( $submenu[$parent] as $submenu_array ) {
-                       if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {
-                               if ( current_user_can( $submenu_array[1] ))
-                                       return true;
-                               else
-                                       return false;
-                       } else if ( $submenu_array[2] == $pagenow ) {
-                               if ( current_user_can( $submenu_array[1] ))
-                                       return true;
-                               else
-                                       return false;
-                       }
-               }
-       }
-
-       foreach ( $menu as $menu_array ) {
-               if ( $menu_array[2] == $parent) {
-                       if ( current_user_can( $menu_array[1] ))
-                               return true;
-                       else
-                               return false;
-               }
-       }
-
-       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 {
-                               $title = $menu_array[0];
-                               return $title;
-                       }
-               }
-       } else {
-               foreach (array_keys( $submenu ) as $parent) {
-                       foreach ( $submenu[$parent] as $submenu_array ) {
-                               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];
-                                       }
-
-                               if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) // not the current page
-                                       continue;
-
-                               if ( isset( $submenu_array[3] ) ) {
-                                       $title = $submenu_array[3];
-                                       return $submenu_array[3];
-                               } else {
-                                       $title = $submenu_array[0];
-                                       return $title;
-                               }
-                       }
-               }
-       }
-
-       return $title;
-}
-
-function get_admin_page_parent() {
-       global $parent_file;
-       global $menu;
-       global $submenu;
-       global $pagenow;
-       global $plugin_page;
-       global $_wp_real_parent_file;
-       global $_wp_menu_nopriv;
-       global $_wp_submenu_nopriv;
-
-       if ( !empty ( $parent_file ) ) {
-               if ( isset( $_wp_real_parent_file[$parent_file] ) )
-                       $parent_file = $_wp_real_parent_file[$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;
-                               if ( isset( $_wp_real_parent_file[$parent_file] ) )
-                                       $parent_file = $_wp_real_parent_file[$parent_file];
-                               return $parent_file;
-                       }
-               }
-               if ( isset( $_wp_menu_nopriv[$plugin_page] ) ) {
-                       $parent_file = $plugin_page;
-                       if ( isset( $_wp_real_parent_file[$parent_file] ) )
-                                       $parent_file = $_wp_real_parent_file[$parent_file];
-                       return $parent_file;
-               }
-       }
-
-       if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) {
-               $parent_file = $pagenow;
-               if ( isset( $_wp_real_parent_file[$parent_file] ) )
-                       $parent_file = $_wp_real_parent_file[$parent_file];
-               return $parent_file;
-       }
-
-       foreach (array_keys( $submenu ) as $parent) {
-               foreach ( $submenu[$parent] as $submenu_array ) {
-                       if ( isset( $_wp_real_parent_file[$parent] ) )
-                               $parent = $_wp_real_parent_file[$parent];
-                       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;
-       global $_wp_real_parent_file;
-       global $_wp_submenu_nopriv;
-       global $_wp_menu_nopriv;
-
-       $file = plugin_basename( $file );
-
-       $parent = plugin_basename( $parent);
-       if ( isset( $_wp_real_parent_file[$parent] ) )
-               $parent = $_wp_real_parent_file[$parent];
-
-       if ( !current_user_can( $access_level ) ) {
-               $_wp_submenu_nopriv[$parent][$file] = true;
-               return false;
-       }
-
-       // 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 && current_user_can( $parent_menu[1] ) )
-                               $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 add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
-       if ( current_user_can('edit_users') )
-               $parent = 'users.php';
-       else
-               $parent = 'profile.php';
-       return add_submenu_page( $parent, $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 :
-                       wp_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 :
-                       wp_die( __('Sorry, can&#8217;t call files with their real path.' ));
-
-               case 3 :
-                       wp_die( __('Sorry, that file cannot be edited.' ));
-       }
-}
-
-function get_home_path() {
-       $home = get_option( 'home' );
-       if ( $home != '' && $home != get_option( '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 ) && is_file( 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);
-}
-
-function get_plugins() {
-       global $wp_plugins;
-
-       if ( isset( $wp_plugins ) ) {
-               return $wp_plugins;
-       }
-
-       $wp_plugins = array ();
-       $plugin_root = ABSPATH . PLUGINDIR;
-
-       // Files in wp-content/plugins directory
-       $plugins_dir = @ dir( $plugin_root);
-       if ( $plugins_dir ) {
-               while (($file = $plugins_dir->read() ) !== false ) {
-                       if ( substr($file, 0, 1) == '.' )
-                               continue;
-                       if ( is_dir( $plugin_root.'/'.$file ) ) {
-                               $plugins_subdir = @ dir( $plugin_root.'/'.$file );
-                               if ( $plugins_subdir ) {
-                                       while (($subfile = $plugins_subdir->read() ) !== false ) {
-                                               if ( substr($subfile, 0, 1) == '.' )
-                                                       continue;
-                                               if ( substr($subfile, -4) == '.php' )
-                                                       $plugin_files[] = "$file/$subfile";
-                                       }
-                               }
-                       } else {
-                               if ( substr($file, -4) == '.php' )
-                                       $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 (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
-       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;
-       uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
-       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 ) )
-               wp_die( printf( __('The uploaded file could not be moved to %s.' ), $uploads['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 = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
-
-       return $return;
-}
-
-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 ) {
-       $size = strtolower( ini_get( 'upload_max_filesize' ) );
-       $bytes = 0;
-       if (strpos($size, 'k') !== false)
-               $bytes = $size * 1024;
-       if (strpos($size, 'm') !== false)
-               $bytes = $size * 1024 * 1024;
-       if (strpos($size, 'g') !== false)
-               $bytes = $size * 1024 * 1024 * 1024;
-?>
-<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attribute_escape($action) ?>">
-<p>
-<?php wp_nonce_field('import-upload'); ?>
-<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?> )
-<input type="file" id="upload" name="import" size="25" />
-<input type="hidden" name="action" value="save" />
-<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
-</p>
-<p class="submit">
-<input type="submit" value="<?php _e( 'Upload file and import' ); ?> &raquo;" />
-</p>
-</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'];
-       $type = $file['type'];
-       $file = addslashes( $file['file'] );
-       $filename = basename( $file );
-
-       // Construct the object array
-       $object = array( 'post_title' => $filename,
-               'post_content' => $url,
-               'post_mime_type' => $type,
-               'guid' => $url
-       );
-
-       // Save the data
-       $id = wp_insert_attachment( $object, $file );
-
-       return array( 'file' => $file, 'id' => $id );
-}
-
-function the_attachment_links( $id = false ) {
-       $id = (int) $id;
-       $post = & get_post( $id );
-
-       if ( $post->post_type != 'attachment' )
-               return false;
-
-       $icon = get_attachment_icon( $post->ID );
-       $attachment_data = wp_get_attachment_metadata( $id );
-       $thumb = isset( $attachment_data['thumb'] );
-?>
-<form id="the-attachment-links">
-<table>
-       <col />
-       <col class="widefat" />
-       <tr>
-               <th scope="row"><?php _e( 'URL' ) ?></th>
-               <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo wp_get_attachment_url(); ?></textarea></td>
-       </tr>
-<?php if ( $icon ) : ?>
-       <tr>
-               <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th>
-               <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon ?></a></textarea></td>
-       </tr>
-       <tr>
-               <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th>
-               <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td>
-       </tr>
-<?php else : ?>
-       <tr>
-               <th scope="row"><?php _e( 'Link to file' ) ?></th>
-               <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() );  ?></a></textarea></td>
-       </tr>
-       <tr>
-               <th scope="row"><?php _e( 'Link to page' ) ?></th>
-               <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
-       </tr>
-<?php endif; ?>
-</table>
-</form>
-<?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 );
-}
-
-function wp_reset_vars( $vars ) {
-       for ( $i=0; $i<count( $vars ); $i += 1 ) {
-               $var = $vars[$i];
-               global $$var;
-
-               if (!isset( $$var ) ) {
-                       if ( empty( $_POST["$var"] ) ) {
-                               if ( empty( $_GET["$var"] ) )
-                                       $$var = '';
-                               else
-                                       $$var = $_GET["$var"];
-                       } else {
-                               $$var = $_POST["$var"];
-                       }
-               }
-       }
-}
-
-
-function wp_remember_old_slug() {
-       global $post;
-       $name = attribute_escape($post->post_name); // just in case
-       if ( strlen($name) )
-               echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />';
-}
-
-
-// If siteurl or home changed, reset cookies and flush rewrite rules.
-function update_home_siteurl( $old_value, $value ) {
-       global $wp_rewrite, $user_login, $user_pass_md5;
-
-       if ( defined( "WP_INSTALLING" ) )
-               return;
-
-       // If home changed, write rewrite rules to new location.
-       $wp_rewrite->flush_rules();
-       // Clear cookies for old paths.
-       wp_clearcookie();
-       // Set cookies for new paths.
-       wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' ));
-}
-
-add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
-add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
-
-function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
-       if ( ctype_digit( $src_file ) ) // Handle int as attachment ID
-               $src_file = get_attached_file( $src_file );
-
-       $src = wp_load_image( $src_file );
-
-       if ( !is_resource( $src ))
-               return $src;
-
-       $dst = imagecreatetruecolor( $dst_w, $dst_h );
-
-       if ( $src_abs ) {
-               $src_w -= $src_x;
-               $src_h -= $src_y;
-       }
-
-       if (function_exists('imageantialias'))
-               imageantialias( $dst, true );
-       
-       imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
-
-       if ( !$dst_file )
-               $dst_file = str_replace( basename( $src_file ), 'cropped-'.basename( $src_file ), $src_file );
-
-       $dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file );
-
-       if ( imagejpeg( $dst, $dst_file ) )
-               return $dst_file;
-       else
-               return false;
-}
-
-function wp_load_image( $file ) {
-       if ( ctype_digit( $file ) )
-               $file = get_attached_file( $file );
-
-       if ( !file_exists( $file ) )
-               return sprintf(__("File '%s' doesn't exist?"), $file);
-
-       if ( ! function_exists('imagecreatefromstring') )
-               return __('The GD image library is not installed.');
-
-       $contents = file_get_contents( $file );
-
-       $image = imagecreatefromstring( $contents );
-
-       if ( !is_resource( $image ) )
-               return sprintf(__("File '%s' is not an image."), $file);
-
-       return $image;
-}
-
-function wp_generate_attachment_metadata( $attachment_id, $file ) {
-       $attachment = get_post( $attachment_id );
-
-       $metadata = array();
-       if ( preg_match('!^image/!', get_post_mime_type( $attachment )) ) {
-               $imagesize = getimagesize($file);
-               $metadata['width'] = $imagesize['0'];
-               $metadata['height'] = $imagesize['1'];
-               list($uwidth, $uheight) = get_udims($metadata['width'], $metadata['height']);
-               $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
-               $metadata['file'] = $file;
-
-               $max = apply_filters( 'wp_thumbnail_creation_size_limit', 3 * 1024 * 1024, $attachment_id, $file );
-
-               if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
-                       $max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
-                       $thumb = wp_create_thumbnail( $file, $max_side );
-
-                       if ( @file_exists($thumb) )
-                               $metadata['thumb'] = basename($thumb);
-               }
-       }
-       return apply_filters( 'wp_generate_attachment_metadata', $metadata );
-}
-
-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 its 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 apply_filters( 'wp_create_thumbnail', $thumbpath );
-       }
-}
-
-?>
+// Deprecated.  Use includes/admin.php.
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
+?>
\ No newline at end of file
index d6ff2efc2117a0646ded138f07a192264ef15bdb..a75fe7bb7331b7382263a5aedbb84bb5c1a88ba8 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
+@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
 if (!isset($_GET["page"])) require_once('admin.php');
 if ( $editing ) {
        wp_enqueue_script( array('dbx-admin-key?pagenow=' . attribute_escape($pagenow),'admin-custom-fields') );
@@ -17,10 +17,7 @@ get_admin_page_title();
 <head>
 <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>
-<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
-<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
-<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
-<?php endif; ?> 
+<?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();}}}
@@ -42,16 +39,16 @@ else if ( isset($plugin_page) )
 do_action('admin_head');
 ?>
 </head>
-<body>
+<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
 <div id="wphead">
-<h1><?php bloginfo('name'); ?> <span>(<a href="<?php echo get_option('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_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 b5b83a7ad69838742550c6513d63cb2a8d9e94d0..c0456192d696825fe6e20559769bc953cef645e9 100644 (file)
@@ -9,9 +9,7 @@ if ( get_option('db_version') != $wp_db_version ) {
        exit;
 }
 
-require_once(ABSPATH . 'wp-admin/admin-functions.php');
-require_once(ABSPATH . 'wp-admin/admin-db.php');
-require_once(ABSPATH . WPINC . '/registration.php');
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
 
 auth_redirect();
 
@@ -37,7 +35,7 @@ if (isset($_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)) {
@@ -46,7 +44,7 @@ if (isset($plugin_page)) {
        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 {
@@ -60,7 +58,7 @@ if (isset($plugin_page)) {
                do_action('load-' . $plugin_page);
 
                if (! isset($_GET['noheader']))
-                       require_once(ABSPATH . '/wp-admin/admin-header.php');
+                       require_once(ABSPATH . 'wp-admin/admin-header.php');
 
                include(ABSPATH . PLUGINDIR . "/$plugin_page");
        }
@@ -79,10 +77,15 @@ if (isset($plugin_page)) {
                wp_die(__('Invalid importer.'));
        }
 
-       if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
-               wp_die(__('Cannot load importer.'));
-
-       include(ABSPATH . "wp-admin/import/$importer.php");
+       // 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");
+       }
 
        $parent_file = 'edit.php';
        $submenu_file = 'import.php';
@@ -91,7 +94,7 @@ if (isset($plugin_page)) {
        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);
 
index e84b5d9d02be5acf25d8a83ceec0638c7d53603a..fca99e1f6d8f8afbf7064b2caccfaef421e15cb3 100644 (file)
@@ -51,7 +51,7 @@ if ( !empty($content) ) {
 <head>
 <title><?php bloginfo('name') ?> &rsaquo; Bookmarklet &#8212; WordPress</title>
 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
-<link rel="stylesheet" href="wp-admin.css" type="text/css" />
+<?php wp_admin_css(); ?>
 
 <style type="text/css">
 <!--
index 5e77e0fd6524c71e8b27481b8c6ab002433a4d1d..cc2b37a5a2675d3fdb40674ff593d29bb763f534 100644 (file)
@@ -36,9 +36,6 @@ case 'delete':
     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));
 
-    if ( $cat_ID == get_option('default_link_category') )
-               wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name));
-
        wp_delete_category($cat_ID);
 
        wp_redirect('categories.php?message=2');
@@ -63,9 +60,9 @@ case 'editedcat':
                wp_die(__('Cheatin&#8217; uh?'));
 
        if ( wp_update_category($_POST) )
-               wp_redirect('categories.php?message=3'); 
+               wp_redirect('categories.php?message=3');
        else
-               wp_redirect('categories.php?message=5'); 
+               wp_redirect('categories.php?message=5');
 
        exit;
 break;
@@ -99,7 +96,6 @@ $messages[5] = __('Category not updated.');
         <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('Posts') ?></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>
@@ -114,10 +110,12 @@ cat_rows();
 
 <?php if ( current_user_can('manage_categories') ) : ?>
 <div class="wrap">
-<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong> and links that were only assigned to the deleted category are set to <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category'))), apply_filters('the_category', get_catname(get_option('default_link_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>
 
 <?php include('edit-category-form.php'); ?>
+
 <?php endif; ?>
 
 <?php
index 063b825d6f9a8ed2b03f0182534dd92fa2ea63be..eee6a12fa0008da4b032390e0a7c093c11aa472a 100644 (file)
@@ -39,7 +39,7 @@ case 'mac':
        $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
        $nonce_action .= $comment;
 
-       if ( ! $comment = get_comment($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) )
@@ -91,12 +91,12 @@ case 'mac':
 <?php if ( $comment->comment_author_url ) { ?>
 <tr>
 <th scope="row"><?php _e('URL:'); ?></th>
-<td><?php echo $comment->comment_author_url; ?></td>
+<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 apply_filters( 'comment_text', $comment->comment_content ); ?></td>
+<td><?php echo $comment->comment_content; ?></td>
 </tr>
 </table>
 
@@ -155,7 +155,7 @@ case 'unapprovecomment':
        if ((wp_get_referer() != "") && (false == $noredir)) {
                wp_redirect(wp_get_referer());
        } else {
-               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments');
+               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments');
        }
        exit();
        break;
@@ -185,7 +185,7 @@ case 'approvecomment':
        if ((wp_get_referer() != "") && (false == $noredir)) {
                wp_redirect(wp_get_referer());
        } else {
-               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments');
+               wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments');
        }
        exit();
        break;
diff --git a/WebKitSite/blog/wp-admin/css/install-rtl.css b/WebKitSite/blog/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/WebKitSite/blog/wp-admin/css/upload-rtl.css b/WebKitSite/blog/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/WebKitSite/blog/wp-admin/css/widgets-rtl.css b/WebKitSite/blog/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
similarity index 77%
rename from WebKitSite/blog/wp-admin/widgets.css
rename to WebKitSite/blog/wp-admin/css/widgets.css
index 54b21e6d841bb7adf0d38361a940bd8e156da6dd..f46c4ce8b7f8ffdaf9478d6265cb0693700dfa7c 100644 (file)
@@ -14,10 +14,10 @@ body {
 }
 
 .dropzone {
+       border: 1px solid #bbb;
        float: left;
        margin-right: 10px;
        padding: 5px;
-       border: 1px solid #bbb;
        background-color: #f0f8ff;
 }
 
@@ -26,15 +26,21 @@ body {
        color: #333;
 }
 
+.dropzone input {
+       display: none;
+}
+
 .dropzone ul {
+       float: left;
        list-style-type: none;
        width: 240px;
-       float: left;
        margin: 0;
+       min-height: 200px;
        padding: 0;
+       display: block;
 }
 
-* .module, #lastmodule {
+* .module {
        width: 238px;
        padding: 0;
        margin: 5px 0;
@@ -42,14 +48,16 @@ body {
        display: block;
        border: 1px solid #ccc;
        background-color: #fbfbfb;
+       position: relative;
        text-align: left;
        line-height: 25px;
 }
 
-* .handle, #lastmodule span {
+* .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;
@@ -70,7 +78,7 @@ body {
        cursor: pointer;
        padding: 0 3px 1px;
        border-top: 4px solid #6da6d1;
-       background: url( images/fade-butt.png ) -5px 0px;
+       background: url( ../images/fade-butt.png ) -5px 0px;
 }
 
 * html .popper {
@@ -83,52 +91,67 @@ body {
        clear: left;
 }
 
-.placematt {
-       position: absolute;
+.placemat {
        cursor: default;
-       margin: 10px 0 0;
+       margin: 0;
        padding: 0;
-       width: 238px;
-       background-color: #ffe;
+       position: relative;
 }
 
-* html .placematt {
-       margin-top: 5px;
-}
-
-.placematt h4 {
+.placemat h4 {
        text-align: center;
-       margin-bottom: 5px;
 }
 
-.placematt span {
+.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: 180px;
+       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, #lastmodule {
+#palettediv .module {
        margin-right: 10px;
        float: left;
        width: 120px;
 }
 
-#palettediv .handle, #lastmodule span {
+#palettediv .handle {
        height: 40px;
        font-size: 90%;
        width: 110px;
@@ -139,20 +162,11 @@ body {
        visibility: hidden;
 }
 
-#lastmodule {
-       visibility: hidden;
-}
-
 * html #palettediv ul {
        margin: 0;
        padding: 0 0 0 10px;
 }
 
-* html #palettediv .module {
-       float: none;
-       display: inline;
-}
-
 #controls {
        height: 0px;
 }
@@ -210,4 +224,13 @@ body {
        top: 0px;
        left: 0px;
        width: 100%;
-}
\ No newline at end of file
+}
+
+#dragHelper {
+       position: absolute;
+}
+
+#dragHelper li.module {
+       display: block;
+       float: left;
+}
index d18ed87beb38356c69300b2636b6d7c90a773f6a..8d605655df0287022e0e30f4ad81a340e781ec7a 100644 (file)
@@ -160,7 +160,7 @@ Event.observe( window, 'load', hide_text );
 <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: url(<?php clean_url(header_image()) ?>) no-repeat;">
+<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>
@@ -169,7 +169,7 @@ Event.observe( window, 'load', hide_text );
 <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>
+<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>
@@ -183,7 +183,7 @@ Event.observe( window, 'load', hide_text );
 <input type="hidden" name="action" value="save" />
 <?php wp_nonce_field('custom-header') ?>
 <p class="submit">
-<input type="submit" value="<?php _e('Upload'); ?> &raquo;" />
+<input type="submit" value="<?php _e('Upload &raquo;'); ?>" />
 </p>
 </form>
 
index 9430ae876e8f47ed0bd3123a1983f98efa0102b4..2b8883eb20535992df0bc4025dc372b9acf6e215 100644 (file)
@@ -21,26 +21,26 @@ if ( ! empty($cat_ID) ) {
 <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->cat_ID ?>" />
+<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->cat_name); ?>" size="40" /></td>
+                       <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->category_nicename); ?>" size="40" /></td>
+                       <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->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
+                       <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->category_description); ?></textarea></td>
+                       <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>
index 80a614758aa31c0ee6f2add80058a4e8f55172dd..ab1bdbce19440006f637cbadb52422467e651d3b 100644 (file)
@@ -39,14 +39,14 @@ function getNumChecked(form)
 </script>
 <div class="wrap">
 <h2><?php _e('Comments'); ?></h2>
-<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') ?>"  />  
+<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, URL, and IP address.)') ?>
-  </fieldset> 
+  </fieldset>
 </form>
 <p><a href="?mode=view"><?php _e('View Mode') ?></a> | <a href="?mode=edit"><?php _e('Mass Edit Mode') ?></a></p>
 <?php
@@ -76,9 +76,10 @@ if ( !empty( $_POST['delete_comments'] ) ) :
 endif;
 
 if ( isset( $_GET['apage'] ) )
-       $page = (int) $_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
@@ -87,8 +88,8 @@ $comments = array_slice($_comments, 0, 20);
 $extra_comments = array_slice($_comments, 20);
 
 $page_links = paginate_links( array(
-       'base' => 'edit-comments.php?%_%',
-       'format' => 'apage=%#%',
+       'base' => add_query_arg( 'apage', '%#%' ),
+       'format' => '',
        'total' => ceil($total / 20),
        'current' => $page
 ));
@@ -150,21 +151,22 @@ if ( $extra_comments ) : ?>
   </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 id="comment-<?php echo $comment->comment_ID; ?>" 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>
+    <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>
-       <?php if ('unapproved' == $comment_status) { ?>
-               (Unapproved)
-       <?php } else { ?>
+       <?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>
@@ -174,7 +176,7 @@ if ( $extra_comments ) : ?>
                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 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 + '"); ?>')" />
index f53c3c4125735e55b08645e58f57bbd56c87ac32..ab3adff464b02ed4ddd3a6a0bcfd8054110ab63b 100644 (file)
@@ -1,10 +1,12 @@
 <?php
+if ( isset($_GET['message']) )
+       $_GET['message'] = (int) $_GET['message'];
 $messages[1] = __('Post updated');
 $messages[2] = __('Custom field updated');
 $messages[3] = __('Custom field deleted.');
 ?>
 <?php if (isset($_GET['message'])) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div>
 <?php endif; ?>
 
 <form name="post" action="post.php" method="post" id="post">
@@ -21,16 +23,17 @@ if (0 == $post_ID) {
        $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' 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="' . 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="' . $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="'. str_replace("\n", ' ', $post->to_ping) .'" />';
+$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
 
 if ('' != $post->pinged) {
        $pings = '<p>'. __('Already pinged:') . '</p><ul>';
@@ -41,20 +44,20 @@ if ('' != $post->pinged) {
        $pings .= '</ul>';
 }
 
-$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('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 $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
 <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 $post->post_author ?>" />
+<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
@@ -81,26 +84,28 @@ addLoadEvent(focusit);
 <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('Post Password') ?></h3> 
-<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $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 $post->post_name ?>" /></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'); checked($post->post_status, 'future'); ?> /> <?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>
@@ -112,23 +117,16 @@ addLoadEvent(focusit);
 </fieldset>
 <?php endif; ?>
 
-<?php 
-$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>
 <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='$o->ID' $selected>$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,7 +138,7 @@ endforeach;
 
 <fieldset id="titlediv">
        <legend><?php _e('Title') ?></legend>
-       <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
+       <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'; ?>">
@@ -159,21 +157,27 @@ endforeach;
 <?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">
 <span id="autosave"></span>
 <?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) {
+<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 clean_url(stripslashes($_REQUEST['popupurl']));
 else if ( url_to_postid(wp_get_referer()) == $post_ID )
@@ -186,11 +190,11 @@ else
 
 <?php
 if (current_user_can('upload_files')) {
-       $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID);
+       $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
        $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>';
 }
 ?>
 
index 3e278bcfe60c41cb02c7f42ee26729c34971b5bc..2f06909614ce43b71deaa6554b24a0d73d6cdcd8 100644 (file)
@@ -2,13 +2,14 @@
 $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="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 $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
 
 <script type="text/javascript">
@@ -20,19 +21,19 @@ addLoadEvent(focusit);
 <fieldset id="namediv">
     <legend><label for="name"><?php _e('Name:') ?></label></legend>
        <div>
-         <input type="text" name="newcomment_author" size="25" value="<?php echo $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><label for="email"><?php _e('E-mail:') ?></label></legend>
                <div>
-                 <input type="text" name="newcomment_author_email" size="20" value="<?php echo $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><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 $comment->comment_author_url ?>" tabindex="3" />
+                 <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>
 
@@ -53,21 +54,21 @@ addLoadEvent(focusit);
 <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" valign="top"><?php _e('Edit time'); ?>:</th>
-               <td><?php touch_time(('editcomment' == $action), 0); ?> </td>
+               <td><?php touch_time(('editcomment' == $action), 0, 5); ?> </td>
        </tr>
 <?php endif; ?>
 
        <tr>
-               <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</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 = '$delete_nonce'; return true; } return false;\""; ?> /> 
+               <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" />
index 8ed3d54374c3f03a47c5e50940507eac3d56e570..00e4932b31df848258abe6c9197d78b86edc0d9d 100644 (file)
@@ -6,7 +6,7 @@
 <?php if (isset($mode) && 'bookmarklet' == $mode) : ?>
 <input type="hidden" name="mode" value="bookmarklet" />
 <?php endif; ?>
-<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
+<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
 <input type="hidden" name="action" value='post' />
 
 <script type="text/javascript">
@@ -20,19 +20,18 @@ 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 $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_option('default_post_edit_rows');
  if (($rows < 3) || ($rows > 100)) {
@@ -49,7 +48,7 @@ edCanvas = document.getElementById('content');
 //-->
 </script>
 
-<input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" />
+<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 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>
@@ -64,7 +63,7 @@ edCanvas = document.getElementById('content');
 <?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 ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />
+       <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/WebKitSite/blog/wp-admin/edit-link-categories.php b/WebKitSite/blog/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/WebKitSite/blog/wp-admin/edit-link-category-form.php b/WebKitSite/blog/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 bd226e717ae2c2dff3292c9639c7553e844834e5..e281d3095c131400c4c2ca7504deb561a5f4c62b 100644 (file)
@@ -43,7 +43,7 @@ function xfn_check($class, $value = '', $type = 'check') {
 <h3 class="dbx-handle"><?php _e('Categories') ?></h3>
 <div class="dbx-content">
 <p id="jaxcat"></p>
-<ul id="categorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
+<ul id="linkcategorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
 </div>
 </fieldset>
 
@@ -80,15 +80,15 @@ function xfn_check($class, $value = '', $type = 'check') {
 <table class="editform" width="100%" cellspacing="2" cellpadding="5">
 <tr>
 <th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
-<td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
+<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" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
+<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" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
+<td><input type="text" name="link_description" id="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
 </tr>
 </table>
 
@@ -241,6 +241,7 @@ function xfn_check($class, $value = '', $type = 'check') {
                </td>
        </tr>
 </table>
+</div>
 </fieldset>
 </div>
 
index 0dff30a1a683220f1372944ec65c62d99f3a114d..e3a039ebb281204087ec03f160f520d4b0c4eeac 100644 (file)
@@ -2,17 +2,22 @@
 <div class="wrap">
 <h2 id="write-post"><?php _e('Write Page'); ?></h2>
 <?php
+
 if (0 == $post_ID) {
        $form_action = 'post';
        $nonce_action = 'add-page';
        $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' />";
 } else {
+       $post_ID = (int) $post_ID;
        $form_action = 'editpost';
        $nonce_action = 'update-page_' . $post_ID;
        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
 }
 
+$temp_ID = (int) $temp_ID;
+$user_ID = (int) $user_ID;
+
 $sendto = clean_url(stripslashes(wp_get_referer()));
 
 if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
@@ -68,7 +73,7 @@ addLoadEvent(focusit);
 
 <fieldset id="passworddiv" class="dbx-box">
 <h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
-<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
+<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="pageparent" class="dbx-box">
@@ -93,7 +98,7 @@ addLoadEvent(focusit);
 
 <fieldset id="slugdiv" class="dbx-box">
 <h3 class="dbx-handle"><?php _e('Page Slug') ?></h3>
-<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
+<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>
 
 <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?>
@@ -106,6 +111,8 @@ 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 = '';
+$o->ID = (int) $o->ID;
+$o->display_name = wp_specialchars( $o->display_name );
 echo "<option value='$o->ID' $selected>$o->display_name</option>";
 endforeach;
 ?>
@@ -126,7 +133,7 @@ endforeach;
 
 <fieldset id="titlediv">
   <legend><?php _e('Page Title') ?></legend>
-  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
+  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
 </fieldset>
 
 
@@ -163,7 +170,7 @@ if (current_user_can('upload_files')) {
        $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>';
 }
 ?>
 
index 627a0315c54ec503509bafd13e04e4498a891d4f..f2633481b2ed02f61529bfbd78aa851ed3c609f0 100644 (file)
@@ -4,31 +4,74 @@ $title = __('Pages');
 $parent_file = 'edit.php';
 wp_enqueue_script( 'listman' );
 require_once('admin-header.php');
+
+$post_stati  = array(  //      array( adj, noun )
+                       'publish' => array(__('Published'), __('Published pages')),
+                       'draft'   => array(__('Draft'), __('Draft pages')),
+                       'private' => array(__('Private'), __('Private pages'))
+               );
+
+
+$post_status_label = __('Pages');
+$post_status_q = '';
+if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
+       $post_status_label = $post_stati[$_GET['post_status']][1];
+       $post_status_q = '&post_status=' . $_GET['post_status'];
+}
+
 ?>
 
 <div class="wrap">
-<h2><?php _e('Page Management'); ?></h2>
+
+<h2><?php
+// Use $_GET instead of is_ since they can override each other
+$h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( stripslashes( $_GET['s'] ) ) ) : '';
+$h2_author = '';
+if ( isset($_GET['author']) && $_GET['author'] ) {
+       $author_user = get_userdata( (int) $_GET['author'] );
+       $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
+}
+printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search );
+?></h2>
+
 <p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page &raquo;'); ?></a></p>
 
-<form name="searchform" action="" method="get">
-       <fieldset>
-       <legend><?php _e('Search Pages&hellip;') ?></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" id="searchform" action="" method="get">
+       <fieldset><legend><?php _e('Search Terms&hellip;') ?></legend>
+               <input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" />
+       </fieldset>
+
+
+       <fieldset><legend><?php _e('Page Type&hellip;'); ?></legend>
+               <select name='post_status'>
+                       <option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
+<?php  foreach ( $post_stati as $status => $label ) : ?>
+                       <option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option>
+<?php  endforeach; ?>
+               </select>
        </fieldset>
+
+<?php $editable_ids = get_editable_user_ids( $user_ID ); if ( $editable_ids && count( $editable_ids ) > 1 ) : ?>
+
+       <fieldset><legend><?php _e('Author&hellip;'); ?></legend>
+               <?php wp_dropdown_users( array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?>
+       </fieldset>
+
+<?php endif; ?>
+
+       <input type="submit" id="post-query-submit" value="<?php _e('Filter &#187;'); ?>" class="button" />
 </form>
 
+<br style="clear:both;" />
+
 <?php
-wp('post_type=page&orderby=menu_order&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1&order=asc');
+wp("post_type=page&orderby=menu_order&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc");
 
-if ( $_GET['s'] )
-       $all = false;
-else
-       $all = true;
+$all = !( $h2_search || $post_status_q );
 
 if ($posts) {
 ?>
-<table class="widefat"> 
+<table class="widefat">
   <thead>
   <tr>
     <th scope="col" style="text-align: center"><?php _e('ID') ?></th>
@@ -39,9 +82,7 @@ if ($posts) {
   </tr>
   </thead>
   <tbody id="the-list">
-<?php
-page_rows(0, 0, $posts, $all);
-?>
+<?php page_rows(0, 0, $posts, $all); ?>
   </tbody>
 </table>
 
@@ -50,7 +91,7 @@ page_rows(0, 0, $posts, $all);
 <?php
 } else {
 ?>
-<p><?php _e('No pages yet.') ?></p>
+<p><?php _e('No pages found.') ?></p>
 <?php
 } // end if ($posts)
 ?>
diff --git a/WebKitSite/blog/wp-admin/edit-post-rows.php b/WebKitSite/blog/wp-admin/edit-post-rows.php
new file mode 100644 (file)
index 0000000..c5e3a58
--- /dev/null
@@ -0,0 +1,118 @@
+<?php if ( ! defined('ABSPATH') ) die(); ?>
+<table class="widefat">
+       <thead>
+       <tr>
+
+<?php foreach($posts_columns as $column_display_name) { ?>
+       <th scope="col"><?php echo $column_display_name; ?></th>
+<?php } ?>
+
+       </tr>
+       </thead>
+       <tbody id="the-list">
+<?php
+if ( have_posts() ) {
+$bgcolor = '';
+add_filter('the_title','wp_specialchars');
+while (have_posts()) : the_post();
+$class = ('alternate' == $class) ? '' : 'alternate';
+global $current_user;
+$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
+?>
+       <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>'>
+
+<?php
+
+foreach($posts_columns as $column_name=>$column_display_name) {
+
+       switch($column_name) {
+
+       case 'id':
+               ?>
+               <th scope="row" style="text-align: center"><?php echo $id ?></th>
+               <?php
+               break;
+       case 'modified':
+               ?>
+               <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Never'); else the_modified_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>
+               <?php
+               break;
+       case 'date':
+               ?>
+               <td><?php if ( '0000-00-00 00:00:00' ==$post->post_date) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>
+               <?php
+               break;
+       case 'title':
+               ?>
+               <td><?php the_title() ?>
+               <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
+               <?php
+               break;
+
+       case 'categories':
+               ?>
+               <td><?php the_category(','); ?></td>
+               <?php
+               break;
+
+       case 'comments':
+               ?>
+               <td style="text-align: center">
+               <?php
+               $left = get_pending_comments_num( $post->ID );
+               $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
+               if ( $left )
+                       echo '<strong>';
+               comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('%') . '</a>');
+               if ( $left )
+                       echo '</strong>';
+               ?>
+               </td>
+               <?php
+               break;
+
+       case 'author':
+               ?>
+               <td><?php the_author() ?></td>
+               <?php
+               break;
+
+       case 'control_view':
+               ?>
+               <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
+               <?php
+               break;
+
+       case 'control_edit':
+               ?>
+               <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
+               <?php
+               break;
+
+       case 'control_delete':
+               ?>
+               <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>
+               <?php
+               break;
+
+       default:
+               ?>
+               <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
+               <?php
+               break;
+       }
+}
+?>
+       </tr>
+<?php
+endwhile;
+} else {
+?>
+  <tr style='background-color: <?php echo $bgcolor; ?>'>
+    <td colspan="8"><?php _e('No posts found.') ?></td>
+  </tr>
+<?php
+} // end if ( have_posts() )
+?>
+       </tbody>
+</table>
index 47f5ad8b3cbcb92bd43b3a2efaf8167f0b6defc3..ba4cc04a80996ab5280d462cdd8c8c9531ddcb5d 100644 (file)
@@ -6,134 +6,58 @@ $parent_file = 'edit.php';
 wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' );
 require_once('admin-header.php');
 
-$_GET['m'] = (int) $_GET['m'];
-
-$drafts = get_users_drafts( $user_ID );
-$other_drafts = get_others_drafts( $user_ID);
-
-if ($drafts || $other_drafts) {
+$_GET['m']   = (int) $_GET['m'];
+$_GET['cat'] = (int) $_GET['cat'];
+$post_stati  = array(  //      array( adj, noun )
+                       'publish' => array(__('Published'), __('Published posts')),
+                       'future' => array(__('Scheduled'), __('Scheduled posts')),
+                       'pending' => array(__('Pending Review'), __('Pending posts')),
+                       'draft' => array(__('Draft'), _c('Drafts|manage posts header')),
+                       'private' => array(__('Private'), __('Private posts'))
+               );
+
+$avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'");
+
+$post_status_q = '';
+$post_status_label = __('Posts');
+if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
+       $post_status_label = $post_stati[$_GET['post_status']][1];
+       $post_status_q = '&post_status=' . $_GET['post_status'];
+}
 ?>
-<div class="wrap">
-<?php if ($drafts) { ?>
-       <p><strong><?php _e('Your Drafts:') ?></strong>
-       <?php
-       $i = 0;
-       foreach ($drafts as $draft) {
-               if (0 != $i)
-                       echo ', ';
-               $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title));
-               if ($draft->post_title == '')
-                       $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
-               echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
-               ++$i;
-               }
-       ?>
-.</p>
-<?php } ?>
-
-<?php if ($other_drafts) { ?>
-       <p><strong><?php _e('Other&#8217;s Drafts:') ?></strong>
-       <?php
-       $i = 0;
-       foreach ($other_drafts as $draft) {
-               if (0 != $i)
-                       echo ', ';
-               $draft->post_title = apply_filters('the_title', stripslashes($draft->post_title));
-               if ($draft->post_title == '')
-                       $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
-               echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
-               ++$i;
-               }
-       ?>
-       .</p>
-
-<?php } ?>
-
-</div>
-<?php } ?>
 
 <div class="wrap">
-<h2>
-<?php
 
-wp('what_to_show=posts&posts_per_page=15&posts_per_archive_page=-1');
+<?php
 
-if ( is_month() ) {
-       single_month_title(' ');
-} elseif ( is_search() ) {
-       printf(__('Search for &#8220;%s&#8221;'), wp_specialchars($_GET['s']) );
+if ( 'pending' === $_GET['post_status'] ) {
+       $order = 'ASC';
+       $orderby = 'modified';
+} elseif ( 'draft' === $_GET['post_status'] ) {
+       $order = 'DESC';
+       $orderby = 'modified';
 } else {
-       if ( is_single() )
-               printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
-       elseif ( ! is_paged() || get_query_var('paged') == 1 )
-               _e('Last 15 Posts');
-       else
-               _e('Previous Posts');
+       $order = 'DESC';
+       $orderby = 'date';
 }
-?>
-</h2>
 
-<form name="searchform" id="searchform" action="" method="get">
-  <fieldset> 
-  <legend><?php _e('Search Posts&hellip;') ?></legend> 
-  <input type="text" name="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" /> 
-  <input type="submit" name="submit" value="<?php _e('Search') ?>" class="button" /> 
-  </fieldset>
-</form>
+wp("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");
 
-<?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC");
-
-if ( count($arc_result) ) { ?>
-
-<form name="viewarc" id="viewarc" action="" method="get">
-       <fieldset>
-       <legend><?php _e('Browse Month&hellip;') ?></legend>
-       <select name='m'>
-       <?php
-               foreach ($arc_result as $arc_row) {
-                       if ( $arc_row->yyear == 0 )
-                               continue;
-                       $arc_row->mmonth = zeroise($arc_row->mmonth, 2);
-
-                       if( isset($_GET['m']) && $arc_row->yyear . $arc_row->mmonth == (int) $_GET['m'] )
-                               $default = 'selected="selected"';
-                       else
-                               $default = null;
-
-                       echo "<option $default value='$arc_row->yyear$arc_row->mmonth'>";
-                       echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
-                       echo "</option>\n";
-               }
-       ?>
-       </select>
-               <input type="submit" name="submit" value="<?php _e('Show Month') ?>" class="button" /> 
-       </fieldset>
-</form>
-
-<?php } ?>
-
-<form name="viewcat" id="viewcat" action="" method="get">
-       <fieldset>
-       <legend><?php _e('Browse Category&hellip;') ?></legend>
-       <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?>
-       <input type="submit" name="submit" value="<?php _e('Show Category') ?>" class="button" /> 
-       </fieldset>
-</form>
-
-<?php do_action('restrict_manage_posts'); ?>
-
-<br style="clear:both;" />
-
-<?php
 // define the columns to display, the syntax is 'internal name' => 'display name'
-$posts_columns = array(
-       'id'         => '<div style="text-align: center">' . __('ID') . '</div>',
-       'date'       => __('When'),
-       'title'      => __('Title'),
-       'categories' => __('Categories'),
-       'comments'   => '<div style="text-align: center">' . __('Comments') . '</div>',
-       'author'     => __('Author')
-);
+$posts_columns = array();
+$posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>';
+if ( 'draft' === $_GET['post_status'] )
+       $posts_columns['modified'] = __('Modified');
+elseif ( 'pending' === $_GET['post_status'] )
+       $posts_columns['modified'] = __('Submitted');
+else
+       $posts_columns['date'] = __('When');
+$posts_columns['title'] = __('Title');
+$posts_columns['categories'] = __('Categories');
+if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
+       $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>';
+$posts_columns['author'] = __('Author');
+
 $posts_columns = apply_filters('manage_posts_columns', $posts_columns);
 
 // you can not edit these at the moment
@@ -143,109 +67,100 @@ $posts_columns['control_delete'] = '';
 
 ?>
 
-<table class="widefat">
-       <thead>
-       <tr>
+<h2><?php
+if ( is_single() ) {
+       printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
+} else {
+       if ( $post_listing_pageable && !is_archive() && !is_search() )
+               $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
+       else
+               $h2_noun = $post_status_label;
+       // Use $_GET instead of is_ since they can override each other
+       $h2_author = '';
+       $_GET['author'] = (int) $_GET['author'];
+       if ( $_GET['author'] != 0 ) {
+               if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion
+                       $h2_author = ' ' . __('by other authors');
+               } else {
+                       $author_user = get_userdata( get_query_var( 'author' ) );
+                       $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
+               }
+       }
+       $h2_search = isset($_GET['s'])   && $_GET['s']   ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( get_search_query() ) ) : '';
+       $h2_cat    = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in &#8220;%s&#8221;'), single_cat_title('', false) ) : '';
+       $h2_month  = isset($_GET['m'])   && $_GET['m']   ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
+       printf( _c( '%1$s%2$s%3$s%4$s%5$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_month );
+}
+?></h2>
 
-<?php foreach($posts_columns as $column_display_name) { ?>
-       <th scope="col"><?php echo $column_display_name; ?></th>
-<?php } ?>
+<form name="searchform" id="searchform" action="" method="get">
+       <fieldset><legend><?php _e('Search terms&hellip;'); ?></legend>
+               <input type="text" name="s" id="s" value="<?php the_search_query(); ?>" size="17" />
+       </fieldset>
+
+       <fieldset><legend><?php _e('Status&hellip;'); ?></legend>
+               <select name='post_status'>
+                       <option<?php selected( @$_GET['post_status'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
+<?php  foreach ( $post_stati as $status => $label ) : if ( !in_array($status, $avail_post_stati) ) continue; ?>
+                       <option<?php selected( @$_GET['post_status'], $status ); ?> value='<?php echo $status; ?>'><?php echo $label[0]; ?></option>
+<?php  endforeach; ?>
+               </select>
+       </fieldset>
 
-       </tr>
-       </thead>
-       <tbody id="the-list">
 <?php
-if ($posts) {
-$bgcolor = '';
-while (have_posts()) : the_post();
-add_filter('the_title','wp_specialchars');
-$class = ('alternate' == $class) ? '' : 'alternate';
+$editable_ids = get_editable_user_ids( $user_ID );
+if ( $editable_ids && count( $editable_ids ) > 1 ) :
 ?>
-       <tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'>
+       <fieldset><legend><?php _e('Author&hellip;'); ?></legend>
+               <?php wp_dropdown_users( array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?>
+       </fieldset>
 
 <?php
+endif;
 
-foreach($posts_columns as $column_name=>$column_display_name) {
+$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC";
 
-       switch($column_name) {
+$arc_result = $wpdb->get_results( $arc_query );
 
-       case 'id':
-               ?>
-               <th scope="row" style="text-align: center"><?php echo $id ?></th>
-               <?php
-               break;
+$month_count = count($arc_result);
 
-       case 'date':
-               ?>
-               <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?></td>
-               <?php
-               break;
-       case 'title':
-               ?>
-               <td><?php the_title() ?>
-               <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
-               <?php
-               break;
+if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
 
-       case 'categories':
-               ?>
-               <td><?php the_category(','); ?></td>
+       <fieldset><legend><?php _e('Month&hellip;') ?></legend>
+               <select name='m'>
+                       <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
                <?php
-               break;
+               foreach ($arc_result as $arc_row) {
+                       if ( $arc_row->yyear == 0 )
+                               continue;
+                       $arc_row->mmonth = zeroise($arc_row->mmonth, 2);
 
-       case 'comments':
-               ?>
-               <td style="text-align: center">
-                       <?php comments_number(__('0'), "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?>
-                       </td>
-               <?php
-               break;
+                       if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
+                               $default = ' selected="selected"';
+                       else
+                               $default = '';
 
-       case 'author':
+                       echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
+                       echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
+                       echo "</option>\n";
+               }
                ?>
-               <td><?php the_author() ?></td>
-               <?php
-               break;
+               </select>
+       </fieldset>
 
-       case 'control_view':
-               ?>
-               <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
-               <?php
-               break;
+<?php } ?>
 
-       case 'control_edit':
-               ?>
-               <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
-               <?php
-               break;
+       <fieldset><legend><?php _e('Category&hellip;') ?></legend>
+               <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?>
+       </fieldset>
+       <input type="submit" id="post-query-submit" value="<?php _e('Filter &#187;'); ?>" class="button" />
+</form>
 
-       case 'control_delete':
-               ?>
-               <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>
-               <?php
-               break;
+<?php do_action('restrict_manage_posts'); ?>
 
-       default:
-               ?>
-               <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
-               <?php
-               break;
-       }
-}
-?>
-       </tr> 
-<?php
-endwhile;
-} else {
-?>
-  <tr style='background-color: <?php echo $bgcolor; ?>'> 
-    <td colspan="8"><?php _e('No posts found.') ?></td> 
-  </tr> 
-<?php
-} // end if ($posts)
-?>
-       </tbody>
-</table>
+<br style="clear:both;" />
+
+<?php include( 'edit-post-rows.php' ); ?>
 
 <div id="ajax-response"></div>
 
@@ -255,10 +170,12 @@ endwhile;
 </div>
 
 <?php
+
 if ( 1 == count($posts) ) {
 
        $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
        if ($comments) {
+               update_comment_cache($comments);
        ?>
 <h3 id="comments"><?php _e('Comments') ?></h3>
 <ol id="the-comment-list" class="commentlist">
@@ -267,7 +184,8 @@ $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"));
+               $post = get_post($comment->comment_post_ID);
+               $authordata = get_userdata($post->post_author);
                        $comment_status = wp_get_comment_status($comment->comment_ID);
                        if ('unapproved' == $comment_status)
                                $class .= ' unapproved';
@@ -275,22 +193,22 @@ foreach ($comments as $comment) {
                                $class .= ' alternate';
                        echo "<li id='comment-$comment->comment_ID' class='$class'>";
 ?>
-<p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
+<p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=edit"><?php comment_author_IP() ?></a></p>
 
 <?php comment_text() ?>
 
-<p><?php comment_date(__('M j, g:i A'));  ?> &#8212; [
+<p><?php comment_date(__('M j, g:i A')); ?> &#8212; [
 <?php
 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
-       echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>';
+       echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" . __('Edit') . '</a>';
        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $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 );\">" . __('Delete') . '</a> ';
        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
        }
-       echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ";
+       echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=" . $comment->comment_post_ID . "&amp;c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";
 }
-?>
+?> ]
 </p>
                </li>
 
@@ -301,6 +219,5 @@ if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
        ?>
 <?php } ?>
 </div>
-<?php
- include('admin-footer.php');
-?>
+
+<?php include('admin-footer.php'); ?>
index ea44d7c0292b240a60b78acced2a5a32fbb903ce..eab8044d4bf4fd9e7c1e7a6618aa89bd0c651143 100644 (file)
@@ -25,7 +25,7 @@ require_once ('admin-header.php');
 <select name="author">
 <option value="all" selected="selected"><?php _e('All'); ?></option>
 <?php
-$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );  
+$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
 foreach ( $authors as $id ) {
        $o = get_userdata( $id );
        echo "<option value='$o->ID'>$o->display_name</option>";
@@ -45,13 +45,15 @@ foreach ( $authors as $id ) {
 <?php
 
 function export_wp() {
-global $wpdb, $posts, $post;
+global $wpdb, $post_ids, $post;
+
+do_action('export_wp');
 
 $filename = 'wordpress.' . date('Y-m-d') . '.xml';
 
 header('Content-Description: File Transfer');
 header("Content-Disposition: attachment; filename=$filename");
-header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
+header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
 
 $where = '';
 if ( isset( $_GET['author'] ) && $_GET['author'] != 'all' ) {
@@ -59,16 +61,18 @@ if ( isset( $_GET['author'] ) && $_GET['author'] != 'all' ) {
        $where = " WHERE post_author = '$author_id' ";
 }
 
-$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
+// grab a snapshot of post IDs, just in case it changes during the export
+$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
 
-$categories = (array) $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories LEFT JOIN $wpdb->post2cat ON (category_id = cat_id) LEFT JOIN $wpdb->posts ON (post_id <=> id) $where GROUP BY cat_id");
+$categories = (array) get_categories('get=all');
+$tags = (array) get_tags('get=all');
 
 function wxr_missing_parents($categories) {
        if ( !is_array($categories) || empty($categories) )
                return array();
 
        foreach ( $categories as $category )
-               $parents[$category->cat_ID] = $category->category_parent;
+               $parents[$category->term_id] = $category->parent;
 
        $parents = array_unique(array_diff($parents, array_keys($parents)));
 
@@ -79,7 +83,7 @@ function wxr_missing_parents($categories) {
 }
 
 while ( $parents = wxr_missing_parents($categories) ) {
-       $found_parents = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, posts_private, links_private FROM $wpdb->categories WHERE cat_ID IN (" . join(', ', $parents) . ")");
+       $found_parents = get_categories("include=" . join(', ', $parents));
        if ( is_array($found_parents) && count($found_parents) )
                $categories = array_merge($categories, $found_parents);
        else
@@ -90,8 +94,8 @@ while ( $parents = wxr_missing_parents($categories) ) {
 $pass = 0;
 $passes = 1000 + count($categories);
 while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) {
-       if ( $cat->category_parent == 0 || isset($cats[$cat->category_parent]) ) {
-               $cats[$cat->cat_ID] = $cat;
+       if ( $cat->parent == 0 || isset($cats[$cat->parent]) ) {
+               $cats[$cat->term_id] = $cat;
        } else {
                $categories[] = $cat;
        }
@@ -110,44 +114,74 @@ function wxr_cdata($str) {
 }
 
 function wxr_cat_name($c) {
-       if ( empty($c->cat_name) )
+       if ( empty($c->name) )
                return;
 
-       echo '<wp:cat_name>' . wxr_cdata($c->cat_name) . '</wp:cat_name>';
+       echo '<wp:cat_name>' . wxr_cdata($c->name) . '</wp:cat_name>';
 }
 
 function wxr_category_description($c) {
-       if ( empty($c->category_description) )
+       if ( empty($c->description) )
                return;
 
-       echo '<wp:category_description>' . wxr_cdata($c->category_description) . '</wp:category_description>';
+       echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
 }
 
-print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
+function wxr_tag_name($t) {
+       if ( empty($t->name) )
+               return;
 
-?>
+       echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
+}
+
+function wxr_tag_description($t) {
+       if ( empty($t->description) )
+               return;
+
+       echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
+}
+
+function wxr_post_taxonomy() {
+       $categories = get_the_category();
+       $tags = get_the_tags();
+       $cat_names = array();
+       $tag_names = array();
+       $the_list = '';
+       $filter = 'rss';
+
+       if ( !empty($categories) ) foreach ( (array) $categories as $category ) {
+               $cat_name = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);
+               $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n";
+       }
+
+       if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {
+               $tag_name = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);
+               $the_list .= "\n\t\t<category domain=\"tag\"><![CDATA[$tag_name]]></category>\n";
+       }
+
+       echo $the_list;
+}
 
-<!--
-       This is a WordPress eXtended RSS file generated by WordPress as an export of 
-       your blog. It contains information about your blog's posts, comments, and 
-       categories. You may use this file to transfer that content from one site to 
-       another. This file is not intended to serve as a complete backup of your 
-       blog.
-       
-       To import this information into a WordPress blog follow these steps:
-       
-       1.      Log into that blog as an administrator.
-       2.      Go to Manage > Import in the blog's admin.
-       3.      Choose "WordPress" from the list of importers.
-       4.      Upload this file using the form provided on that page.
-       5.      You will first be asked to map the authors in this export file to users 
-               on the blog. For each author, you may choose to map an existing user on 
-               the blog or to create a new user.
-       6.      WordPress will then import each of the posts, comments, and categories 
-               contained in this file onto your blog.
--->
-
-<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"-->
+echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
+
+?>
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
+<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- You may use this file to transfer that content from one site to another. -->
+<!-- This file is not intended to serve as a complete backup of your blog. -->
+
+<!-- To import this information into a WordPress blog follow these steps. -->
+<!-- 1. Log into that blog as an administrator. -->
+<!-- 2. Go to Manage: Import in the blog's admin panels. -->
+<!-- 3. Choose "WordPress" from the list. -->
+<!-- 4. Upload this file using the form provided on that page. -->
+<!-- 5. You will first be asked to map the authors in this export file to users -->
+<!--    on the blog.  For each author, you may choose to map to an -->
+<!--    existing user on the blog or to create a new user -->
+<!-- 6. WordPress will then import each of the posts, comments, and categories -->
+<!--    contained in this file into your blog -->
+
+<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"-->
 <rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
@@ -163,16 +197,27 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
        <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
        <language><?php echo get_option('rss_language'); ?></language>
 <?php if ( $cats ) : foreach ( $cats as $c ) : ?>
-       <wp:category><wp:category_nicename><?php echo $c->category_nicename; ?></wp:category_nicename><wp:category_parent><?php echo $c->category_parent ? $cats[$c->category_parent]->cat_name : ''; ?></wp:category_parent><wp:posts_private><?php echo $c->posts_private ? '1' : '0'; ?></wp:posts_private><wp:links_private><?php echo $c->links_private ? '1' : '0'; ?></wp:links_private><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
+       <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
+<?php endforeach; endif; ?>
+<?php if ( $tags ) : foreach ( $tags as $t ) : ?>
+       <wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
 <?php endforeach; endif; ?>
        <?php do_action('rss2_head'); ?>
-       <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
+       <?php if ($post_ids) {
+               global $wp_query;
+               $wp_query->in_the_loop = true;  // Fake being in the loop.
+               // fetch 20 posts at a time rather than loading the entire table into memory
+               while ( $next_posts = array_splice($post_ids, 0, 20) ) {
+                       $where = "WHERE ID IN (".join(',', $next_posts).")";
+                       $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
+                               foreach ($posts as $post) {
+                       setup_postdata($post); ?>
 <item>
 <title><?php the_title_rss() ?></title>
-<link><?php permalink_single_rss() ?></link>
+<link><?php the_permalink_rss() ?></link>
 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
 <dc:creator><?php the_author() ?></dc:creator>
-<?php the_category_rss() ?>
+<?php wxr_post_taxonomy() ?>
 
 <guid isPermaLink="false"><?php the_guid(); ?></guid>
 <description></description>
@@ -203,7 +248,7 @@ $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post
 if ( $comments ) { foreach ( $comments as $c ) { ?>
 <wp:comment>
 <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
-<wp:comment_author><?php echo $c->comment_author; ?></wp:comment_author>
+<wp:comment_author><?php echo wxr_cdata($c->comment_author); ?></wp:comment_author>
 <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
 <wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
 <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
@@ -216,7 +261,7 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
 </wp:comment>
 <?php } } ?>
        </item>
-<?php } } ?>
+<?php } } ?>
 </channel>
 </rss>
 <?php
diff --git a/WebKitSite/blog/wp-admin/images/heading-bg.gif b/WebKitSite/blog/wp-admin/images/heading-bg.gif
new file mode 100644 (file)
index 0000000..bea18ca
Binary files /dev/null and b/WebKitSite/blog/wp-admin/images/heading-bg.gif differ
diff --git a/WebKitSite/blog/wp-admin/images/logo-ghost.png b/WebKitSite/blog/wp-admin/images/logo-ghost.png
new file mode 100644 (file)
index 0000000..46d26cc
Binary files /dev/null and b/WebKitSite/blog/wp-admin/images/logo-ghost.png differ
diff --git a/WebKitSite/blog/wp-admin/import-b2.php b/WebKitSite/blog/wp-admin/import-b2.php
deleted file mode 100644 (file)
index 28a84d5..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-<?php
-if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");
-require_once('../wp-config.php');
-require('upgrade-functions.php');
-$step = $_GET['step'];
-if (!$step) $step = 0;
-header( 'Content-Type: text/html; charset=utf-8' );
-?>
-<!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">
-       <title>WordPress &#8212; b2 Conversion</title>
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-       <style media="screen" type="text/css">
-       body {
-               font-family: Georgia, "Times New Roman", Times, serif;
-               margin-left: 15%;
-               margin-right: 15%;
-       }
-       #logo {
-               margin: 0;
-               padding: 0;
-               background-image: url(http://wordpress.org/images/wordpress.gif);
-               background-repeat: no-repeat;
-               height: 60px;
-               border-bottom: 4px solid #333;
-       }
-       #logo a {
-               display: block;
-               height: 60px;
-       }
-       #logo a span {
-               display: none;
-       }
-       p, li {
-               line-height: 140%;
-       }
-       </style>
-</head>
-<body>
-<h1 id="logo"><a href="http://wordpress.org"><span>WordPress</span></a></h1>
-<?php
-switch($step) {
-
-       case 0:
-?>
-<p>Welcome to WordPress. Since you&#8217;re upgrading from b2 everything should be relatively 
-  familiar to you. Here are some notes on upgrading:</p>
-<ul>
-  <li>If you&#8217;re using an older version of b2, it's probably a good idea to upgrade 
-    to at least .61 before makin