Compare commits

..

714 Commits
2.2.2 ... 2.3

Author SHA1 Message Date
westi
85806701cf Remove accidental change to tags 2.3
git-svn-id: http://svn.automattic.com/wordpress/tags/2.3@6197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-10-06 08:12:06 +00:00
westi
7785eaddd7 Move database class loading to a shared function to ensure all of WordPress is wp-content/wp-db.php aware. Fixes #5128 props ComputerGuru.
git-svn-id: http://svn.automattic.com/wordpress/tags/2.3@6196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-10-06 07:55:03 +00:00
ryan
d20349b9b8 2.3
git-svn-id: http://svn.automattic.com/wordpress/tags/2.3@6165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-25 00:37:00 +00:00
matt
15372a22b6 bumpity
git-svn-id: http://svn.automattic.com/wordpress/trunk@6164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-25 00:34:43 +00:00
ryan
fd17fe449d Remove reference to importers and move the note about converting up to the Note section. fixes #5060
git-svn-id: http://svn.automattic.com/wordpress/trunk@6163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-24 02:39:49 +00:00
ryan
6486085cf4 STP importer fixes from momo360modena. fixes #5059
git-svn-id: http://svn.automattic.com/wordpress/trunk@6162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-24 01:57:55 +00:00
ryan
a48973211c Fix typo. fixes #5061
git-svn-id: http://svn.automattic.com/wordpress/trunk@6161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-24 01:48:36 +00:00
ryan
8d349aa85c Add some filtering. Props jhodgdon. fixes #3595
git-svn-id: http://svn.automattic.com/wordpress/trunk@6160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-23 19:25:15 +00:00
ryan
e76e370638 Fix term count padding.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-23 00:35:59 +00:00
markjaquith
5f4c602776 Cast to array in upgrade foreach(). props arnee. fixes #5047
git-svn-id: http://svn.automattic.com/wordpress/trunk@6158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 23:14:38 +00:00
ryan
683db28b4c Term with slug that conflicts with existing term with different parent gets a new term entry with a unique slug. see #5034
git-svn-id: http://svn.automattic.com/wordpress/trunk@6157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 18:01:08 +00:00
ryan
add4250c0d Revert part of [5263] to fix downloading in Safari. fixes #5040
git-svn-id: http://svn.automattic.com/wordpress/trunk@6156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 16:50:35 +00:00
ryan
72e74add8d Don't reset parent when updating attachment. Props filosofo and michelwp. fixes #5010
git-svn-id: http://svn.automattic.com/wordpress/trunk@6155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 16:30:40 +00:00
markjaquith
e56c1c2097 Bookend moderation links properly with right square bracket. highest omg bbq? Still, nice catch, ozh. fixes #5035
git-svn-id: http://svn.automattic.com/wordpress/trunk@6154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 06:28:47 +00:00
markjaquith
0fb4233fdf Add tag_base to list of untrailingslashed options, and standardize the unslashing. Prevents /mytags//tagname/
git-svn-id: http://svn.automattic.com/wordpress/trunk@6153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 06:11:48 +00:00
markjaquith
c005340430 Fix PATH_INFO first page paging link. fixes #5039
git-svn-id: http://svn.automattic.com/wordpress/trunk@6152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 06:07:03 +00:00
markjaquith
d3d447d6e9 Core and plugin update checking: make sure fsockopen() is available and check file resources with is_resource() -- both to prevent feof() infinite loops. Props xknown. fixes #5037
git-svn-id: http://svn.automattic.com/wordpress/trunk@6151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-22 00:08:50 +00:00
ryan
48813443db Revert [5969]. It can break permalinks. see #4739
git-svn-id: http://svn.automattic.com/wordpress/trunk@6150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-21 19:36:12 +00:00
ryan
a366ee01ef Export and import of post tags. fixes #4682
git-svn-id: http://svn.automattic.com/wordpress/trunk@6149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-21 18:34:28 +00:00
ryan
81482db30b Add checks for WP_Error. Props filosofo. see #4809
git-svn-id: http://svn.automattic.com/wordpress/trunk@6148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-21 15:51:00 +00:00
ryan
2794b34f4a Add some filtering. Props jhodgdon. fixes #5030
git-svn-id: http://svn.automattic.com/wordpress/trunk@6147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-21 15:04:13 +00:00
ryan
94349171ec Updated RTL CSS from mani_monaj. fixes #5025
git-svn-id: http://svn.automattic.com/wordpress/trunk@6146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 23:36:45 +00:00
markjaquith
5177c0e5c7 Pass the attempted redirect host as a second parameter in the allowed_redirect_hosts filter. props mdawaffe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 21:53:42 +00:00
ryan
40b7e58b82 Always remove index.php from request before contructing page links. fixes #5000
git-svn-id: http://svn.automattic.com/wordpress/trunk@6144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 20:56:22 +00:00
markjaquith
3be5215e08 Remove trailing /index.php fixing from canonical.php ... Thanks chaoticmortalcom. fixes #5017
git-svn-id: http://svn.automattic.com/wordpress/trunk@6143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 20:25:43 +00:00
ryan
4a03a94051 Bail if post is empty. Props mdawaffe. fixes #5019
git-svn-id: http://svn.automattic.com/wordpress/trunk@6142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 18:25:14 +00:00
ryan
3542e01f19 Don't specialchars markup in term description. fixes #5021
git-svn-id: http://svn.automattic.com/wordpress/trunk@6141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-20 18:23:33 +00:00
markjaquith
315a28c4b5 Remove non-functioning and misleading "Privacy" label on install. fixes #5012
git-svn-id: http://svn.automattic.com/wordpress/trunk@6140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 21:45:23 +00:00
markjaquith
4f6b825b8b Make sure number_format_i18n() is available before calling it in timer_stop(). fixes #5016
git-svn-id: http://svn.automattic.com/wordpress/trunk@6139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 20:48:34 +00:00
ryan
9eb6351d24 Extra protection in check_ajax_referer from mdawaffe. fixes #4939
git-svn-id: http://svn.automattic.com/wordpress/trunk@6138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 19:32:34 +00:00
ryan
3ac0df5170 Fix includes for setup-config so that wp_die is defined. Props DD32. fixes #4997
git-svn-id: http://svn.automattic.com/wordpress/trunk@6137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 04:27:56 +00:00
markjaquith
f25f33c4ba Put a filter in wp_safe_redirect() so people can whitelist other domains. see #4606
git-svn-id: http://svn.automattic.com/wordpress/trunk@6136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 04:14:53 +00:00
ryan
192cb2dda5 RC1
git-svn-id: http://svn.automattic.com/wordpress/trunk@6135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 04:14:27 +00:00
markjaquith
3c89a5c5d7 More robust wp_safe_redirect(). Introducing wp_sanitize_redirect() for use in wp_redirect() and wp_safe_redirect(). fixes #4606
git-svn-id: http://svn.automattic.com/wordpress/trunk@6134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 03:47:37 +00:00
ryan
deb7701a85 Script loader cleanup from mdawaffe. fixes #5003
git-svn-id: http://svn.automattic.com/wordpress/trunk@6133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-19 00:51:21 +00:00
ryan
1fa2f6df66 the_title_attribute(). Props Nazgul. fixes #4731
git-svn-id: http://svn.automattic.com/wordpress/trunk@6132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 22:50:59 +00:00
markjaquith
dbd3d07274 Introducing wp_safe_redirect(). fixes #4606 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 22:23:16 +00:00
ryan
bbe284b1d1 Fake being in the loop during export so that template tags work.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 18:01:47 +00:00
ryan
8eceaca349 Import tags. see #4682
git-svn-id: http://svn.automattic.com/wordpress/trunk@6129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 17:50:21 +00:00
ryan
1d146b6153 Revert rename of more-link class. Props foolswisdom. fixes #4999
git-svn-id: http://svn.automattic.com/wordpress/trunk@6128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 16:44:35 +00:00
ryan
39152aff25 Replace faulty regex. Props tenpura. fixes #4820
git-svn-id: http://svn.automattic.com/wordpress/trunk@6127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 16:42:25 +00:00
ryan
c352f29893 Drop old tables. Props Nazgul. fixes #4995
git-svn-id: http://svn.automattic.com/wordpress/trunk@6126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 16:37:21 +00:00
ryan
9bfccd6286 Add checks for WP_Error. Props filosofo. see #4809
git-svn-id: http://svn.automattic.com/wordpress/trunk@6125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-18 16:32:22 +00:00
markjaquith
f30cd7acec Use maybe_unserialize() in get_usermeta(). Props filosofo. fixes #4993
git-svn-id: http://svn.automattic.com/wordpress/trunk@6124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-17 19:19:55 +00:00
ryan
3ccba6071a Add tags-input class. Props momo360modena. fixes #4989
git-svn-id: http://svn.automattic.com/wordpress/trunk@6123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-16 18:25:10 +00:00
ryan
6d53f77f31 gettext string. Props tai. fixes #4985
git-svn-id: http://svn.automattic.com/wordpress/trunk@6122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-16 18:15:03 +00:00
ryan
76fee1da02 Don't lose tags when saving a post with attachments. Props filosofo. fixes #4532
git-svn-id: http://svn.automattic.com/wordpress/trunk@6121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-16 02:36:23 +00:00
matt
1e127b413c Sometimes the $page global is set but it's just an integer, like 1, not an object which we should try to address and put in the cache. The page would work but we'd do spurious wp_cache_add
git-svn-id: http://svn.automattic.com/wordpress/trunk@6120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-15 21:52:37 +00:00
matt
4216f95b64 Because we're modifying an existing cache variable we need to do a _set, not an _add, like we do other places we stick multiple cache values in a single var and key.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-15 21:50:53 +00:00
westi
e08024d86e Set svn:eol-style on a few files.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-15 17:35:32 +00:00
matt
8bfcfae2f8 Incorrect cache group was causing terms never to get cached.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-15 16:48:29 +00:00
markjaquith
d3db272764 Properly name files with unknown extensions (for people with unfiltered_upload cap, natch). props Nazgul. fixes #4974 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-14 21:13:23 +00:00
markjaquith
8a6802ef00 Canonical fixes: Allow Pages to have /page/x/. Always trailing slash home when it is not paged. Strip extra trailing slashes off of /page/x///
git-svn-id: http://svn.automattic.com/wordpress/trunk@6115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-14 19:41:23 +00:00
ryan
ec182d74a6 Deprecate fakeit arg. Props Nazgul. fixes #4439
git-svn-id: http://svn.automattic.com/wordpress/trunk@6114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 21:27:26 +00:00
westi
b36db5619b Switch to is_callable instead of function_exists to allow for class based importer plugins. Fixes #4614
git-svn-id: http://svn.automattic.com/wordpress/trunk@6113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 20:36:31 +00:00
markjaquith
3d3846ee8a Handle ports for canonical redirects. Props driverkt and westi. fixes #4970
git-svn-id: http://svn.automattic.com/wordpress/trunk@6112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 19:24:05 +00:00
markjaquith
9ea001d704 Just some indent fixes in canonical.php
git-svn-id: http://svn.automattic.com/wordpress/trunk@6111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 19:12:53 +00:00
markjaquith
b36471d4cf Use wp_die() for WPDB bails. Send 500 response and no-cache headers so wp_die()s are not cached. props DD32. fixes #3471
git-svn-id: http://svn.automattic.com/wordpress/trunk@6110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 06:23:23 +00:00
ryan
9e61170004 s/onChange/onchange/. Props grubgirl, Nazgul. fixes #4630
git-svn-id: http://svn.automattic.com/wordpress/trunk@6109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 05:33:54 +00:00
markjaquith
3fc1d4f08d De-rabbit-hole compat.php
git-svn-id: http://svn.automattic.com/wordpress/trunk@6108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 05:24:31 +00:00
markjaquith
76d0f29698 Check for apply_filters() in status_header() so that it can be called early on in load process
git-svn-id: http://svn.automattic.com/wordpress/trunk@6107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 05:00:46 +00:00
ryan
103e793478 no follow callback
git-svn-id: http://svn.automattic.com/wordpress/trunk@6105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 04:51:33 +00:00
markjaquith
95908afb48 Move $wp_header_to_desc array to get_status_header_desc() so that it can be called before vars.php is loaded.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 04:48:41 +00:00
markjaquith
1cae6a8691 Plugins are not loaded at this point, so the wp_header_to_desc_array filter is useless
git-svn-id: http://svn.automattic.com/wordpress/trunk@6103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 04:13:32 +00:00
ryan
7bbd23f3c6 Don't strip slashes from pre. Props DelGurth and mdawaffe. fixes #2059
git-svn-id: http://svn.automattic.com/wordpress/trunk@6102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 04:11:21 +00:00
markjaquith
b9dcf3c0c3 Don't set comment_author_email for pings in MT import. fixes #4461
git-svn-id: http://svn.automattic.com/wordpress/trunk@6101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-13 04:10:36 +00:00
markjaquith
ec6416ec0b fix links generated by get_category_rss_link(). props gwagenknecht. fixes #4550 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 22:24:28 +00:00
markjaquith
791aec14b2 Set $theme_loc correctly when ABSPATH is "/". Props arabek. fixes #4541
git-svn-id: http://svn.automattic.com/wordpress/trunk@6099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 22:19:26 +00:00
markjaquith
0880ca8693 Set widget classname when passed string, object/method, object-reference/method. fixes #4910
git-svn-id: http://svn.automattic.com/wordpress/trunk@6098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 20:48:21 +00:00
markjaquith
1f3ce09d52 Ignore HOST capitalization differences for canonical redirects. props jbctech. fixes #4773
git-svn-id: http://svn.automattic.com/wordpress/trunk@6097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 20:44:41 +00:00
westi
d1acf020b5 Allow plugins to sanitize there own options easily.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 18:15:29 +00:00
westi
223182463d Ensure the parentlink is trailingslashed when building the url - don't trim / off the front. Fixes #2801 props Libertus
git-svn-id: http://svn.automattic.com/wordpress/trunk@6095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 17:46:13 +00:00
westi
2f44508e9b Consolidate shared code in get_userdata and get_userdatabylogin. Fixes #2134 props johnjosephbachir
git-svn-id: http://svn.automattic.com/wordpress/trunk@6094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 17:15:17 +00:00
westi
cf26b9d049 Make the atom feed updated field actually tell you when the post was updated. Fixes #4816 props lapcat.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 16:26:39 +00:00
ryan
60bec14a4e More phpdoc for taxonomy from darkdragon. see #4742
git-svn-id: http://svn.automattic.com/wordpress/trunk@6092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 02:56:44 +00:00
ryan
48b96208e2 Add echo or return option to wp_list_categories. Props Otto42. fixes #4182
git-svn-id: http://svn.automattic.com/wordpress/trunk@6091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 02:53:27 +00:00
ryan
159ea09341 Resurrect admin-functions.php and upgrade-functions.php for back compat. fixes #4956
git-svn-id: http://svn.automattic.com/wordpress/trunk@6090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 02:36:04 +00:00
ryan
8e5302b57f Add cat_row filter. Props johnbillion. fixes #4926
git-svn-id: http://svn.automattic.com/wordpress/trunk@6089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 01:08:19 +00:00
ryan
a1046188b8 Deprecate old links functions. Props rob1n. fixes #3413
git-svn-id: http://svn.automattic.com/wordpress/trunk@6088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 01:01:48 +00:00
ryan
98d52ab1f2 Resurrect count padding.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-12 00:49:16 +00:00
ryan
c06e70516a Remove duplicate code from wp_insert_attachment(). Update to use sanitize_post. Props Otto42. fixes #4946
git-svn-id: http://svn.automattic.com/wordpress/trunk@6086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 22:27:36 +00:00
markjaquith
4bc7869c84 Always trailingslash the "home" URL. Protect against chained redirects. Thanks wantmoore. fixes #4773
git-svn-id: http://svn.automattic.com/wordpress/trunk@6085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 21:21:40 +00:00
westi
ca4ddf50f8 Allow the wp_mail filter to change the passed data. Fixes #4511 props ryan.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 20:49:28 +00:00
westi
446c704af5 Ensure (next|previous)_post_link always have some content even when the post title is blank. Fixes #1835, props johnbillion
git-svn-id: http://svn.automattic.com/wordpress/trunk@6082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 20:05:52 +00:00
ryan
e3db8369d0 Remove reference to the_quicktags. Props Nazgul. fixes #4925
git-svn-id: http://svn.automattic.com/wordpress/trunk@6081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 19:56:40 +00:00
ryan
6d983b5bb5 If a category is already a tag, don't put it in the list of categories to convert. fixes #4955
git-svn-id: http://svn.automattic.com/wordpress/trunk@6080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 19:54:19 +00:00
ryan
33953bc337 Retain default category when converting categories to tags. fixes #4845
git-svn-id: http://svn.automattic.com/wordpress/trunk@6079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 19:33:35 +00:00
westi
c3155a54b2 Fix tab order when edit comments. Props Nazgul fixes #4726
git-svn-id: http://svn.automattic.com/wordpress/trunk@6078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 19:08:26 +00:00
ryan
6df40aea78 Use setup_postdata instead of deprecated start_wp. fixes #3188
git-svn-id: http://svn.automattic.com/wordpress/trunk@6077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 18:56:16 +00:00
ryan
87fcc363c1 Add tags to export. see #4682
git-svn-id: http://svn.automattic.com/wordpress/trunk@6076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 18:35:21 +00:00
ryan
c8077169aa Add user_nicename key to users table. fixes #4937
git-svn-id: http://svn.automattic.com/wordpress/trunk@6075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 18:13:56 +00:00
ryan
368b18d383 Set tag_id to first tag in multi tag queries. Have single_cat_title() fallback to single_tag_title() if is_tag so that existing category templates will work with tags. fixes #4506
git-svn-id: http://svn.automattic.com/wordpress/trunk@6074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 18:06:52 +00:00
ryan
9fbbf54462 beta3
git-svn-id: http://svn.automattic.com/wordpress/trunk@6073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-11 01:43:49 +00:00
westi
a4a609093e Add importer for Bunny's Technorati Tags plugin. Fixes #4931
git-svn-id: http://svn.automattic.com/wordpress/trunk@6072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-10 20:30:55 +00:00
ryan
d84f590203 References don't work inside foreach in php4. Props mdawaffe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-10 19:37:00 +00:00
markjaquith
ba6e8f4a92 Actually, we always need to URLencode square brackets... or wp_redirect() will strip them out. see #4935. see #4878
git-svn-id: http://svn.automattic.com/wordpress/trunk@6070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-10 15:53:34 +00:00
markjaquith
51299852ef Forgot to use $lsb and $rsb in [6064]. Props mdawaffe. see #4935. see #4878
git-svn-id: http://svn.automattic.com/wordpress/trunk@6069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-10 15:34:13 +00:00
markjaquith
d59743c972 Strip index.php/ before adding it in get_pagenum_link(). Insert index.php/ for the first page when blog is on a page. fixes #4945
git-svn-id: http://svn.automattic.com/wordpress/trunk@6068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-10 15:06:21 +00:00
markjaquith
7931d5eca5 Revert [6047] -- we await a better solution. see #4858
git-svn-id: http://svn.automattic.com/wordpress/trunk@6065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-08 17:20:35 +00:00
markjaquith
79c4324e01 Only urlencode previously existing values in add_query_arg() (more backwards compatible). fixes #4935. see #4084. see #4878
git-svn-id: http://svn.automattic.com/wordpress/trunk@6064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-08 14:27:24 +00:00
markjaquith
23b1e871a1 Don't show a plugin author byline if no author name has been specified. Props Viper007Bond. fixes #4927
git-svn-id: http://svn.automattic.com/wordpress/trunk@6060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 18:53:56 +00:00
markjaquith
229a52b3a1 focus the cursor when writing a new post. Props foolswisdom and Nazgul. fixes #3936
git-svn-id: http://svn.automattic.com/wordpress/trunk@6059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 02:56:05 +00:00
markjaquith
6a1c63e2f7 Correctly set REQUEST_URI for IIS setups that put that info into SCRIPT_NAME as well as PATH_INFO. props snakefoot and Nazgul. fixes #4853
git-svn-id: http://svn.automattic.com/wordpress/trunk@6058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 02:43:00 +00:00
markjaquith
ead6bfebf7 Try more ways of getting wp-admin URL in wp_die(). props Nazgul. fixes #4006
git-svn-id: http://svn.automattic.com/wordpress/trunk@6057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 02:25:54 +00:00
markjaquith
6ecaec3d1f Skip deprecated option replacement in wp-mail.php. props Nazgul. fixes #4924
git-svn-id: http://svn.automattic.com/wordpress/trunk@6056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 02:07:13 +00:00
markjaquith
95b86a22f5 Don't re-add the deprecated new_users_can_blog option. Props Nazgul. fixes #4923
git-svn-id: http://svn.automattic.com/wordpress/trunk@6055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-07 01:44:24 +00:00
markjaquith
1ba81b4f02 Properly construct widget classname if second param is an array. Props f00f. fixes #4910
git-svn-id: http://svn.automattic.com/wordpress/trunk@6054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 23:27:16 +00:00
markjaquith
eb2d6cea06 Upgrade the options table before calling populate_options() to avoid errors. Props Nazgul. fixes #4921
git-svn-id: http://svn.automattic.com/wordpress/trunk@6053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 23:08:25 +00:00
markjaquith
445d7b077f Set guid when creating first post during install. Props Nazgul and rubys. fixes #4894
git-svn-id: http://svn.automattic.com/wordpress/trunk@6052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 23:01:30 +00:00
ryan
8bbd1008f1 Fix term count calculation during upgrade. fixes #4922
git-svn-id: http://svn.automattic.com/wordpress/trunk@6051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 22:56:03 +00:00
ryan
8d33c59576 Case terms to int so we don't try to create new terms with the term ids as the names. fixes #4920
git-svn-id: http://svn.automattic.com/wordpress/trunk@6050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 22:07:23 +00:00
markjaquith
f851dc2257 Always put the author of the post in the authors dropdown, even if they have since been demoted to a role without post-saving capabilities. fixes #4458
git-svn-id: http://svn.automattic.com/wordpress/trunk@6049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 04:46:56 +00:00
ryan
a428494291 Resurrect hide_empty
git-svn-id: http://svn.automattic.com/wordpress/trunk@6048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 04:34:06 +00:00
markjaquith
94973a275b Default to showing published posts on Manage Posts page. fixes #4858
git-svn-id: http://svn.automattic.com/wordpress/trunk@6047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-06 04:33:35 +00:00
ryan
a40345190e Add missing instance var. Props filosofo. see #4806
git-svn-id: http://svn.automattic.com/wordpress/trunk@6046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 23:17:41 +00:00
ryan
827ed61968 Remove redundant declaration ofedInsertContent. Props Viper007Bond. fixes #4902
git-svn-id: http://svn.automattic.com/wordpress/trunk@6045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 23:14:39 +00:00
ryan
b5a2f7431e Update pop3 class to latest from squirrelmail. Props westi. see #4337
git-svn-id: http://svn.automattic.com/wordpress/trunk@6044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 22:55:38 +00:00
ryan
2ee9183f8a Fix comment orphaning in blogger importer. Props andy. fixes #4406
git-svn-id: http://svn.automattic.com/wordpress/trunk@6043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 22:48:58 +00:00
ryan
7bdf6d6c6e Remove redundant url filter. fixes #4663
git-svn-id: http://svn.automattic.com/wordpress/trunk@6042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 22:44:58 +00:00
markjaquith
bdd9e5e1e4 Use post_date (not post_modified) to check for unpublished posts when showing post listings in admin. fixes #4914
git-svn-id: http://svn.automattic.com/wordpress/trunk@6041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 22:17:59 +00:00
ryan
c5d33cbebd Basic tag cloud widget. Props Stargazer. fixes #4130
git-svn-id: http://svn.automattic.com/wordpress/trunk@6040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 21:50:52 +00:00
markjaquith
98a92950a3 Deprecate option_can_override, option_type, option_width, option_height, option_description, option_admin_level from options table. Props Nazgul. fixes #4390
git-svn-id: http://svn.automattic.com/wordpress/trunk@6039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 19:20:53 +00:00
markjaquith
c8215773ce Fix link to others' drafts from nag. fixes #4912
git-svn-id: http://svn.automattic.com/wordpress/trunk@6038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 18:40:40 +00:00
markjaquith
f396867f60 Show "Post #N" for posts without a title in the nag. Props Viper007Bond. fixes #4849
git-svn-id: http://svn.automattic.com/wordpress/trunk@6037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 18:33:45 +00:00
ryan
1760555e8b Don't skip sanitization if 404. Add wp_title display filters.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-05 03:11:04 +00:00
ryan
64382fbdc9 mprove desriptions for I18N strings. Props nbachiyski. fixes #4906
git-svn-id: http://svn.automattic.com/wordpress/trunk@6034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 22:50:31 +00:00
westi
d7c37c0c02 Improve desriptions for I18N strings. Fixes #4906 props nbachiyski
git-svn-id: http://svn.automattic.com/wordpress/trunk@6033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 20:56:08 +00:00
ryan
40527f6ac2 APP taxonomy fixes from rubys. fixes #4904
git-svn-id: http://svn.automattic.com/wordpress/trunk@6032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 17:09:57 +00:00
markjaquith
1e8e248b97 Actually, let's just drop that slash check altogether. Equals sign is the best indicator. fixes #4903 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 05:26:18 +00:00
markjaquith
ab71cc4a4f Require a slash AND the absence of an equals sign to designate the passed $uri as a base (without a query string). fixes #4903 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 05:21:54 +00:00
markjaquith
5913b16065 Better $pagenow determination. fixes #4748
git-svn-id: http://svn.automattic.com/wordpress/trunk@6029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 03:21:04 +00:00
markjaquith
2f0e0c8760 Clean up Jerome's Keywords importer
git-svn-id: http://svn.automattic.com/wordpress/trunk@6028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 02:14:34 +00:00
ryan
a4f8a52b4e beta2
git-svn-id: http://svn.automattic.com/wordpress/trunk@6027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-04 01:01:01 +00:00
ryan
321c310717 Remove trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@6026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 23:32:58 +00:00
ryan
87c4f3a17f Strip lines that contain only whitespace down to newlines.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 23:19:20 +00:00
westi
d38d018ce9 Fix admin css link when installing in a directory. Fixes #4877
git-svn-id: http://svn.automattic.com/wordpress/trunk@6024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 20:20:18 +00:00
ryan
8c8c1cb4f7 Remove unused var. Props johnjosephbachir. fixes #4764
git-svn-id: http://svn.automattic.com/wordpress/trunk@6023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 20:06:27 +00:00
markjaquith
e468628526 Check for wp-admin case-insensitively in is_admin()
git-svn-id: http://svn.automattic.com/wordpress/trunk@6022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 19:56:09 +00:00
ryan
58c7ce91e3 Tag unions and intersections. fixes #4895
git-svn-id: http://svn.automattic.com/wordpress/trunk@6021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 18:14:05 +00:00
markjaquith
6cfdd1934b trim() plugin URL before deciding whether to show a link. props Gary King. fixes #4633
git-svn-id: http://svn.automattic.com/wordpress/trunk@6020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 16:55:10 +00:00
westi
03d6c4d0ba Change queries in get_{next|previous}_post so that plugins can INNER JOIN on other tables with an ID column. Fixes #4822 props Cimmo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 16:46:31 +00:00
westi
36851becbd Switch to require_once for wp-includes/db.php when it exists. Fixes #4597 props intoxination.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 16:17:10 +00:00
westi
3235902cff urlencode the theme name and stylesheet name in the activate links so as to support directories with + in the name. Fixes #3279.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 16:11:10 +00:00
ryan
4726644b8b Don't strip @ from url. Fix scheme prefixing. Props pishmishy. fixes #3299
git-svn-id: http://svn.automattic.com/wordpress/trunk@6015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 15:59:12 +00:00
ryan
97918578a4 Remove category parent dropdown from edit link category form since link categories are non-hierarchical. fixes #4896
git-svn-id: http://svn.automattic.com/wordpress/trunk@6013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 14:49:02 +00:00
ryan
986715f5b6 tag_id not tag__id. see #4895
git-svn-id: http://svn.automattic.com/wordpress/trunk@6012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 03:26:57 +00:00
ryan
f87baf5b1f tag__in, tag__not_in, and tag_and queries. fixes #4895
git-svn-id: http://svn.automattic.com/wordpress/trunk@6011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 03:24:23 +00:00
markjaquith
d723ff00d8 Escape text titles in AtomParser. Props Sam Ruby. fixes #4892
git-svn-id: http://svn.automattic.com/wordpress/trunk@6010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-02 20:42:00 +00:00
westi
2662be2098 Inform the user when cookies are disabled and login fails. Fixed #2039 props tellyworth.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-02 17:20:37 +00:00
markjaquith
7e45ed193a Eliminate double urlencode()ing in add_query_arg(). Move &-to-& conversion to wp_nonce_url(). fixes #4884
git-svn-id: http://svn.automattic.com/wordpress/trunk@6008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-02 05:49:54 +00:00
markjaquith
e26363a568 Correct variable name in clean_object_term_cache(). props arnee. fixes #4888
git-svn-id: http://svn.automattic.com/wordpress/trunk@6007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-02 05:08:48 +00:00
markjaquith
747bd2cf21 urlencode() redirect_to param in login links for both themes. fixes #4873 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 23:05:11 +00:00
markjaquith
d60384b385 Turn & to & in add_query_arg(). fixes #4878
git-svn-id: http://svn.automattic.com/wordpress/trunk@6005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 22:12:17 +00:00
ryan
b04e8d39ee AtomPub fixes from Pete Lacey. fixes #4887
git-svn-id: http://svn.automattic.com/wordpress/trunk@6004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 19:32:54 +00:00
westi
1290e8caed Tell the user what number comment they are editing. Fixes #4524 props momo360modena and Nazgul.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 16:33:55 +00:00
westi
7b9174524a Enable full translation of the Tags description. Fixes #4885 props nbachiyski.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 12:06:47 +00:00
westi
7612bc20b1 Fix RDF feeds to not contain invalid tag "category". Fixed #4643 props kztk
git-svn-id: http://svn.automattic.com/wordpress/trunk@6001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 08:33:08 +00:00
ryan
a43e37b8a1 get_tag() and get_tag_feed_link()
git-svn-id: http://svn.automattic.com/wordpress/trunk@6000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 04:43:27 +00:00
markjaquith
0906863d2c Preserve query string arrays in add_query_arg(). fixes #4878 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-01 03:41:50 +00:00
ryan
93840b1632 Add some filtering. Props jhodgdon. see #4516
git-svn-id: http://svn.automattic.com/wordpress/trunk@5998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-31 23:55:56 +00:00
ryan
277e5aa914 Don't use unavailable func. Props filosofo. fixes #4881
git-svn-id: http://svn.automattic.com/wordpress/trunk@5997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-31 22:36:16 +00:00
markjaquith
c8d7b27ed2 Use single_tag_title() on tag pages in the Default theme. Props Andy. fixes #4876
git-svn-id: http://svn.automattic.com/wordpress/trunk@5996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 19:54:46 +00:00
markjaquith
a2cac0cf09 Kill %tag%-based permalinks. fixes #4875
git-svn-id: http://svn.automattic.com/wordpress/trunk@5995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 19:42:34 +00:00
markjaquith
0219651b96 Check manage_options for upgrade notification. Tailor message accordingly. Props johnbillion. fixes #4869
git-svn-id: http://svn.automattic.com/wordpress/trunk@5994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 18:21:03 +00:00
markjaquith
bacbca924f Roll back [5986], [5988], [5989]. We are in a char class, so no escaping needed. Props mdawaffe. see #4873
git-svn-id: http://svn.automattic.com/wordpress/trunk@5993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 18:13:48 +00:00
markjaquith
f0b39c1b5c Better %0d/%0a sanitization for wp_redirect() from hakre. fixes #4819 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 17:46:09 +00:00
westi
f9e28418ce Ensure we always show the current version in the footer if the last update check failed. Fixes #4867 props Viper007Bond
git-svn-id: http://svn.automattic.com/wordpress/trunk@5987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 16:25:50 +00:00
ryan
5a997f588b Escape special chars in regex. Props eightize and Otto42. fixes #4873
git-svn-id: http://svn.automattic.com/wordpress/trunk@5986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 15:42:26 +00:00
markjaquith
88f73f7f41 Use "update" language to refer to new versions. Props johnbillion. fixes #4868
git-svn-id: http://svn.automattic.com/wordpress/trunk@5985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 14:41:03 +00:00
ryan
8790a28916 Importer for Jerome's Keywords. fixes #4346
git-svn-id: http://svn.automattic.com/wordpress/trunk@5984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 01:39:46 +00:00
ryan
56dd1d2033 Make sure term cache is cleared when updating term counts.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-30 00:34:55 +00:00
ryan
b92227412a Trackback fxn cleanup from Otto42. fixes #4800
git-svn-id: http://svn.automattic.com/wordpress/trunk@5982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 23:08:44 +00:00
ryan
560b73b9e3 mt_keywords support. Props westi and josephscott. fixes #900
git-svn-id: http://svn.automattic.com/wordpress/trunk@5981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 23:01:48 +00:00
ryan
aac14d9531 Don't convert category to tag if tag of the same name already exists. fixes #4864
git-svn-id: http://svn.automattic.com/wordpress/trunk@5980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 22:47:07 +00:00
ryan
395ee1acad Include tags in feeds. fixes #4537
git-svn-id: http://svn.automattic.com/wordpress/trunk@5979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 21:10:20 +00:00
markjaquith
816f89fb03 More cautious canonical-ness. Exclude IIS and POSTs. Better paging handling. Still a work in progress! see #4773
git-svn-id: http://svn.automattic.com/wordpress/trunk@5978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 21:06:51 +00:00
ryan
440c4dedd6 Simple Tagging importer. Props bloertscher and joostdevalk. fixes #4247
git-svn-id: http://svn.automattic.com/wordpress/trunk@5977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 19:55:39 +00:00
ryan
d330ec7e34 delete_post_meta_by_key() from Mark Jaquith. fixes #4178
git-svn-id: http://svn.automattic.com/wordpress/trunk@5976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 19:12:20 +00:00
ryan
0f6dfb8b1f Remove hardcoded clean_url on comment_author_url since it is handled on the pre_comment_author_url filter. Props wnorris. fixes #4120
git-svn-id: http://svn.automattic.com/wordpress/trunk@5975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 19:04:14 +00:00
markjaquith
9e48d38752 Fix paging and preview links for canonical stuff. see #4773. fixes #4862
git-svn-id: http://svn.automattic.com/wordpress/trunk@5974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 18:10:11 +00:00
ryan
ef5caabe37 Limit recent entries query to published posts. fixes #4786
git-svn-id: http://svn.automattic.com/wordpress/trunk@5973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 18:02:19 +00:00
ryan
6a0629e717 Take port into consideration when spawning cron. Props bchecketts. fixes #4782
git-svn-id: http://svn.automattic.com/wordpress/trunk@5972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:57:06 +00:00
westi
ad90a8f560 CSS fix for IE7 so that the login button is in the box. Fixed #4828 props intoxination.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:39:41 +00:00
westi
51bde8f657 Remove dead code. Fixed #4791 props filosofo
git-svn-id: http://svn.automattic.com/wordpress/trunk@5970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:36:46 +00:00
westi
5691b03700 Add utf8->ascii mappings for icelandic letters. Fixes #4739 props einare
git-svn-id: http://svn.automattic.com/wordpress/trunk@5969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:34:15 +00:00
westi
36ec45d7ff Fix xhtml output for RSS widget when feed contains no items. Fixed #4671 props brettz95 and Nazgul
git-svn-id: http://svn.automattic.com/wordpress/trunk@5968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:28:07 +00:00
ryan
f78592cf01 Redirect back to post-new.php when doing a save and continue with empty post fields. fixes #4855
git-svn-id: http://svn.automattic.com/wordpress/trunk@5967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-29 17:24:42 +00:00
ryan
0cb5968afc Fix blogger auth. Props andy. fixes #4847
git-svn-id: http://svn.automattic.com/wordpress/trunk@5966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 23:31:51 +00:00
ryan
014915caea Make css cache busting and rtl inclusion uniform across admin. Props mdawaffe. fixes #4830
git-svn-id: http://svn.automattic.com/wordpress/trunk@5965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 23:23:38 +00:00
ryan
c630733e1d Take post_max_size into account when determining the upload limit. Props mdawaffe. fixes #4240
git-svn-id: http://svn.automattic.com/wordpress/trunk@5964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 23:13:16 +00:00
ryan
6050182157 Reorder post/page status dropdowns. Props mdawaffe. fixes #4848
git-svn-id: http://svn.automattic.com/wordpress/trunk@5963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 21:04:17 +00:00
ryan
82705c845d Remove extraneous tag. Props nbachiyski. fixes #4838
git-svn-id: http://svn.automattic.com/wordpress/trunk@5962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 20:25:57 +00:00
westi
67d21286a8 Ensure we flush the recent entries widget cache after a post has been deleted. Fixes #4825 props donncha
git-svn-id: http://svn.automattic.com/wordpress/trunk@5960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 20:12:43 +00:00
westi
9b742b7959 Pass through the function argument so rules can actually be added to the top of the stack, props santos
git-svn-id: http://svn.automattic.com/wordpress/trunk@5959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 19:55:11 +00:00
ryan
3fe16de587 explicitly check next() against FALSE in do_action_ref_array(). Props Denis-de-Bernardy, Otto42, Nazgul, santosj, DD32. fixes #4625 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 19:06:56 +00:00
ryan
c0287d8f23 Update readme version to 2.3. Props Nazgul. fixes #4840
git-svn-id: http://svn.automattic.com/wordpress/trunk@5957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 19:01:20 +00:00
ryan
666bfd2d91 Don't return permalink for non-existent post. Props Viper007Bond. fixes #4834
git-svn-id: http://svn.automattic.com/wordpress/trunk@5956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 18:58:54 +00:00
ryan
5fc07fcd15 Gettext fixes from nbachiyski. fixes #4835
git-svn-id: http://svn.automattic.com/wordpress/trunk@5955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 18:57:55 +00:00
ryan
501833e41e beta1
git-svn-id: http://svn.automattic.com/wordpress/trunk@5954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 00:18:36 +00:00
ryan
3d9dce3497 Update dotclear and textpattern importers to use taxonomy
git-svn-id: http://svn.automattic.com/wordpress/trunk@5953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-28 00:08:58 +00:00
ryan
788512c881 Add clean_url filter. see #4570
git-svn-id: http://svn.automattic.com/wordpress/trunk@5952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 23:31:09 +00:00
ryan
f8d09ad828 Bring in atomlib 0.4 and update wp-app to use it. Props eliast and placey. fixes #4191
git-svn-id: http://svn.automattic.com/wordpress/trunk@5951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 19:52:58 +00:00
ryan
7aa077d6a0 Revert get_col behavior. Props mdawaffe. fixes #4826
git-svn-id: http://svn.automattic.com/wordpress/trunk@5950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 19:44:53 +00:00
matt
27f66be1cd Minor styling change for update notification.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 18:52:50 +00:00
ryan
5217cd1838 Trim before comparison. Props foolswisdom and Nazgul. fixes #4815
git-svn-id: http://svn.automattic.com/wordpress/trunk@5948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 15:17:00 +00:00
matt
d9793c3e8d Make the entire comment flood check pluggable as it can cause load problems on large sites.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-27 06:34:18 +00:00
ryan
c89928a4c8 Escape parsed fields.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-26 22:13:54 +00:00
ryan
e80177b92b Display tag name, not slug, in title. Props ionfish. fixes #4812
git-svn-id: http://svn.automattic.com/wordpress/trunk@5945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-26 17:18:00 +00:00
ryan
86932908e3 Add missing global and remove unused var. Props JeremyVisser. fixes #4818
git-svn-id: http://svn.automattic.com/wordpress/trunk@5944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-26 17:12:31 +00:00
ryan
62f60a666d Fix typo
git-svn-id: http://svn.automattic.com/wordpress/trunk@5943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-25 18:41:12 +00:00
matt
77c64399d0 As the developer links are out of date and just used to attack us now, updating the blogroll to include links to WP resources.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-25 18:06:22 +00:00
ryan
a03073ef0a Add nonces to tag importers. Props xknown. fixes #4811
git-svn-id: http://svn.automattic.com/wordpress/trunk@5941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-25 17:07:10 +00:00
ryan
a5fbb3f85f Fix blogroll upgrades from 2.0. fixes #4813
git-svn-id: http://svn.automattic.com/wordpress/trunk@5940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-25 16:57:56 +00:00
ryan
4340c63de1 Update to jquery 1.1.4. Props mdawaffe. fixes #4810
git-svn-id: http://svn.automattic.com/wordpress/trunk@5939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-24 21:46:03 +00:00
ryan
51b6d6f6ea Don't pass cat as ref. Fix some term sanitization. fixes #4702
git-svn-id: http://svn.automattic.com/wordpress/trunk@5938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-24 18:41:01 +00:00
ryan
ccdf20ef62 Update WP importer to use taxonomy and query cat based on slug. see #4613
git-svn-id: http://svn.automattic.com/wordpress/trunk@5937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-24 14:44:26 +00:00
ryan
c8723a4f3f Fix how wp_filter array is keyed. Props santosj/darkdragon. fixes #3875 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-24 14:18:08 +00:00
ryan
6db72e6e43 Allow plugins to register importers. Props westi and Nazgul. fixes #4614
git-svn-id: http://svn.automattic.com/wordpress/trunk@5935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 23:09:03 +00:00
ryan
7c0ecf6202 jquery for widgets admin. Props filosofo. see #3824
git-svn-id: http://svn.automattic.com/wordpress/trunk@5934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 22:34:15 +00:00
ryan
f3ed626d52 eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 22:19:53 +00:00
westi
fcd0a36f09 Enable plugins to override the cockney replace array, fixes #4804 props andihit
git-svn-id: http://svn.automattic.com/wordpress/trunk@5930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 21:02:31 +00:00
westi
31992bac0d Allow upload of all Open Office document types props nbachiyski fixes #4615
git-svn-id: http://svn.automattic.com/wordpress/trunk@5929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 18:28:14 +00:00
westi
8047b60291 Give the view links in post/page listings the view class rather than the edit class, fixes #4058 props rgovostes
git-svn-id: http://svn.automattic.com/wordpress/trunk@5927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 18:04:15 +00:00
ryan
ac46bc16c7 Don't allow private query vars in url_to_postid
git-svn-id: http://svn.automattic.com/wordpress/trunk@5925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 16:09:37 +00:00
westi
07ff444b6f Fix plugin basename for Windows servers. Fixes #3002 props Ozh
git-svn-id: http://svn.automattic.com/wordpress/trunk@5924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 16:07:21 +00:00
ryan
c6d79a79b0 Don't die with type
git-svn-id: http://svn.automattic.com/wordpress/trunk@5923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 15:53:25 +00:00
markjaquith
68501fd51b No canonical-ness for wp-admin. see #4773
git-svn-id: http://svn.automattic.com/wordpress/trunk@5921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-23 03:40:51 +00:00
ryan
276b690c7e Add cat-item-id and page-item-id classes. Props Otto42. fixes #4703
git-svn-id: http://svn.automattic.com/wordpress/trunk@5920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 22:59:45 +00:00
ryan
f65528ed41 Fix get_post_comments_feed_link() to work with pages. fixes #4637
git-svn-id: http://svn.automattic.com/wordpress/trunk@5919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 22:42:57 +00:00
ryan
200f0b020f Add get_lastpostdate and 'get_lastpostdatemodified filters. Props rob1n. fixes #4801
git-svn-id: http://svn.automattic.com/wordpress/trunk@5918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 22:30:06 +00:00
ryan
02df4f722c Add class to tag cloud links. Props filosofo. fixes #4798
git-svn-id: http://svn.automattic.com/wordpress/trunk@5917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 22:28:00 +00:00
ryan
cbad9a2993 posts_results and posts_selection hooks. fixes #4799
git-svn-id: http://svn.automattic.com/wordpress/trunk@5916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 18:03:26 +00:00
ryan
1a2aa3fcc3 Sanitize a few options
git-svn-id: http://svn.automattic.com/wordpress/trunk@5914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 17:57:36 +00:00
matt
27657cd8cf First pass plugin update notification, see #4795
git-svn-id: http://svn.automattic.com/wordpress/trunk@5913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-22 10:48:48 +00:00
ryan
851ce58496 Some tag api additions from andy.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-21 18:39:45 +00:00
ryan
763f8b8821 commentsrss2_head action from joostdevalk. fixes #4694
git-svn-id: http://svn.automattic.com/wordpress/trunk@5911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-21 18:32:39 +00:00
ryan
9b395107f4 Deprecate permalink_single_rss(). Add the_permalink_rss() with accompanying filter. Props joostdevalk and Otto42. fixes #4654
git-svn-id: http://svn.automattic.com/wordpress/trunk@5910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-21 18:27:45 +00:00
ryan
d3754cc69b i18n fix from momo360modena and nbachiyski. fixes #4523
git-svn-id: http://svn.automattic.com/wordpress/trunk@5909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-21 00:35:55 +00:00
ryan
eb30d086be Really make slugs unique during upgrade. fixes #4776
git-svn-id: http://svn.automattic.com/wordpress/trunk@5908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-21 00:11:46 +00:00
ryan
567bc9d3f1 wp_reset_query() from mdawaffe. fixes #4741
git-svn-id: http://svn.automattic.com/wordpress/trunk@5907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-20 22:55:43 +00:00
ryan
ba0f401390 bookmark sanitizer funcs and default filter cleanup. see #4546
git-svn-id: http://svn.automattic.com/wordpress/trunk@5906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-20 22:50:04 +00:00
matt
7bacf89b7e Better styling for update notice, fixes #1476
git-svn-id: http://svn.automattic.com/wordpress/trunk@5904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-20 07:01:15 +00:00
matt
f273f7a17b Change IPs to link to local search instead of cryptic ARIN info
git-svn-id: http://svn.automattic.com/wordpress/trunk@5903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-20 07:00:29 +00:00
ryan
645bbfa324 Formatting cleanups from johnjosephbachir. fixes #4775
git-svn-id: http://svn.automattic.com/wordpress/trunk@5901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-19 22:25:44 +00:00
matt
04558f4424 Don't run if installing, fixes $4772
git-svn-id: http://svn.automattic.com/wordpress/trunk@5900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-19 04:27:04 +00:00
ryan
b4cd7ba224 Add back compat to get_the_category. Props nbachiyski. fixes #4771
git-svn-id: http://svn.automattic.com/wordpress/trunk@5899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-18 17:21:51 +00:00
ryan
4f183b4fe7 mt_allow_pings fix. Props Joseph Scott and Allan Odgaard. fixes #4770 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 23:32:49 +00:00
ryan
8d75bcef27 Revert accidental commit.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 21:23:39 +00:00
ryan
0458d919c0 First cut of taxonomy API phpdoc from darkdragon. see #4742
git-svn-id: http://svn.automattic.com/wordpress/trunk@5896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 21:22:37 +00:00
matt
be96bdbdaa Missing image from earlier commit.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 13:34:26 +00:00
matt
096bece621 Switch to init action. Hat tip: westi. See #1476
git-svn-id: http://svn.automattic.com/wordpress/trunk@5894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 13:28:45 +00:00
matt
242e21e732 Switch incoming links to use Google, fixes #4577
git-svn-id: http://svn.automattic.com/wordpress/trunk@5893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 11:08:00 +00:00
matt
7c2dbb9cb1 First pass at upgrade notification for core, see #1476. Also includes some minor footer styling changes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 10:33:52 +00:00
markjaquith
410a3c5762 Oops... forgot the svn add. Thanks mdawaffe. see #4554
git-svn-id: http://svn.automattic.com/wordpress/trunk@5891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 03:45:59 +00:00
markjaquith
6fc031de6b Canonical URLs, first swing. Props to Scott Yang, Ryan and Matt. see #4554 (and report bugs there, for now)
git-svn-id: http://svn.automattic.com/wordpress/trunk@5890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 03:35:15 +00:00
markjaquith
54639a391b Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
git-svn-id: http://svn.automattic.com/wordpress/trunk@5889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 03:32:19 +00:00
markjaquith
d55ac9708c Send dateCreated as local blog time, add date_created_gmt with GMT value. Props josephscott. fixes #4624. refs #4158, #4314
git-svn-id: http://svn.automattic.com/wordpress/trunk@5888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 03:18:58 +00:00
markjaquith
e9c8915627 correct logic grouping when reading importers. fixes #4763
git-svn-id: http://svn.automattic.com/wordpress/trunk@5887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-17 01:59:37 +00:00
ryan
84f43891f6 Don't trim option arrays on save. Props m0n5t3r, Nazgul. fixes #4571
git-svn-id: http://svn.automattic.com/wordpress/trunk@5886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 19:55:19 +00:00
ryan
948284b296 Don't update comments feed last-modified header for unapproved comments. Props James Ballantine and Nazgul. fixes #4618 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 19:26:01 +00:00
ryan
96aba6a4c7 RTL CSS fixes from sewar. fixes #4655
git-svn-id: http://svn.automattic.com/wordpress/trunk@5884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:49:32 +00:00
ryan
08e94676ef Add id to viewsite span. Props JeremyVisser. fixes #4666
git-svn-id: http://svn.automattic.com/wordpress/trunk@5883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:46:50 +00:00
ryan
19f1e721bb Use dc:creator instead of author for rss2 comment feeds. Props lexhair, Otto42. fixes #4704 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:34:57 +00:00
ryan
4ae69ee6a8 Advanced Toolbar shortcut hint fix from leonid. fixes #4707
git-svn-id: http://svn.automattic.com/wordpress/trunk@5880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:17:54 +00:00
ryan
aa1b4e8968 Set instead of add since the cache value has multiple keys that can change. Props josephscott. fixes #4743
git-svn-id: http://svn.automattic.com/wordpress/trunk@5879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:12:12 +00:00
ryan
5e34cab763 Fix css path for readme.html. Props Stevie212, JeremyVisser. fixes #4751
git-svn-id: http://svn.automattic.com/wordpress/trunk@5878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:09:30 +00:00
ryan
f478ddaa36 Pass args as array instead of query string.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-16 18:00:47 +00:00
ryan
eb3e9e6dc7 Display error message when attempting to edit post or page IDs that do not exist. Props Viper007Bond. fixes #4737
git-svn-id: http://svn.automattic.com/wordpress/trunk@5875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-15 22:31:19 +00:00
ryan
4ab52670e9 Remove extra paren. Props tmountjr. fixes #4752
git-svn-id: http://svn.automattic.com/wordpress/trunk@5874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-15 22:26:54 +00:00
ryan
ff20fd6c17 Category union and intersection query vars. fixes #4750
git-svn-id: http://svn.automattic.com/wordpress/trunk@5873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-15 22:08:51 +00:00
ryan
8b205f4e87 Typo fix
git-svn-id: http://svn.automattic.com/wordpress/trunk@5872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-15 21:54:02 +00:00
ryan
951a41ad1e get_the_tag_list from andy. fixes #4733
git-svn-id: http://svn.automattic.com/wordpress/trunk@5871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 03:44:49 +00:00
ryan
13b23aa20a Space before slash to properly close br tag. Props tmountjr. fixes #4717
git-svn-id: http://svn.automattic.com/wordpress/trunk@5870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 03:12:24 +00:00
ryan
ddc05f60ea wp_update_comment_count hook from mdawaffe. fixes #4740
git-svn-id: http://svn.automattic.com/wordpress/trunk@5869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 03:08:44 +00:00
ryan
2ae70d7c72 Update in_category() to use object term cache API. Props technosailor. fixes #4442
git-svn-id: http://svn.automattic.com/wordpress/trunk@5868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 03:01:26 +00:00
ryan
dc1c54a35c Use opendir instead of dir. Props nbachiyski. fixes #4450
git-svn-id: http://svn.automattic.com/wordpress/trunk@5867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 02:58:33 +00:00
ryan
638d5e6e39 wp_update_term_count fixes from cavemonkey50. fixes #4500
git-svn-id: http://svn.automattic.com/wordpress/trunk@5866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 02:54:02 +00:00
ryan
7c1ce10fae sanitize the value, not the field. Props cavemonkey50. fixes #4651
git-svn-id: http://svn.automattic.com/wordpress/trunk@5865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-14 02:46:06 +00:00
ryan
74fcc19b8e RTL fixes from mani_monaj. fixes #4730
git-svn-id: http://svn.automattic.com/wordpress/trunk@5863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-13 15:36:26 +00:00
matt
98a674b2e9 A quick hook when an export is done
git-svn-id: http://svn.automattic.com/wordpress/trunk@5862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-11 01:31:10 +00:00
matt
c13a667443 A more elegant way of doing get_col.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-10 19:30:24 +00:00
markjaquith
5b82b1c426 Prevent get_col() from returning an array of NULLs. see #4725
git-svn-id: http://svn.automattic.com/wordpress/trunk@5860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-10 18:08:04 +00:00
markjaquith
676ea2ea3c globalize wp_version so Magpie can use it. props Nazgul, hakre. fixes #3996
git-svn-id: http://svn.automattic.com/wordpress/trunk@5859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-10 08:07:53 +00:00
matt
0311e61389 If you don't have anything nice to say, don't say anything at all. (And certainly don't return the results of a previous query to an empty query.)
git-svn-id: http://svn.automattic.com/wordpress/trunk@5858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-10 01:33:56 +00:00
markjaquith
b64ce2d0f0 explicitly check next() against FALSE when iterating through filters. Props Denis-de-Bernardy, Otto42, Nazgul, santosj (go team effort!). fixes #4625 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-08 17:41:46 +00:00
markjaquith
48b20cf17d Specify our serif fonts for h2s. Props JeremyVisser. fixes #4713
git-svn-id: http://svn.automattic.com/wordpress/trunk@5856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-08 12:08:28 +00:00
markjaquith
2af150e496 Avoid running get_posts filter twice. Props DD32. fixes #4712
git-svn-id: http://svn.automattic.com/wordpress/trunk@5855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-08 04:24:44 +00:00
markjaquith
773e23d2e6 Don't tell users they have to update their .htaccess unless we're actually giving them something with which to update it. fixes #4706
git-svn-id: http://svn.automattic.com/wordpress/trunk@5854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-08 04:10:20 +00:00
markjaquith
5c83a39e33 Clear old future post cron entry before creating the authoritative one. Props Barry. fixes #4710
git-svn-id: http://svn.automattic.com/wordpress/trunk@5853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-08 04:08:06 +00:00
markjaquith
44df30f2d6 Fix class-smtp.php typo. Props Nazgul, tension7. fixes #4700
git-svn-id: http://svn.automattic.com/wordpress/trunk@5852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-05 18:13:24 +00:00
markjaquith
fa0dc110d9 Allow for hour/minute/second values in the QS that evaluate as false (like 0). Props Otto42 and agharbeia. fixes #4499
git-svn-id: http://svn.automattic.com/wordpress/trunk@5848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-04 16:30:27 +00:00
matt
763b0b689e If no user ID for whatever reason, bail early.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-04 03:58:42 +00:00
markjaquith
9e21fb42fc function_exists() wrapper around fetch_rss() to allow for plugin replacement. Props Otto42. see #4547
git-svn-id: http://svn.automattic.com/wordpress/trunk@5845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-03 01:39:36 +00:00
markjaquith
25abcd1338 More streamlined install process. Obeys WP_SITEURL if defined. fixes #4687 (props JeremyVisser, Nazgul), see #4685
git-svn-id: http://svn.automattic.com/wordpress/trunk@5844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-03 01:08:59 +00:00
markjaquith
5897a90fd7 Consistently include wp-config.php. fixes #3349
git-svn-id: http://svn.automattic.com/wordpress/trunk@5843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-03 00:45:06 +00:00
markjaquith
3ba71111de Allow pre_option_ filters to return values that evaluate as false. fixes #4695
git-svn-id: http://svn.automattic.com/wordpress/trunk@5842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-02 22:51:42 +00:00
markjaquith
f359dab72e More upload escaping. Props Brian Layman. fixes #4689 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 20:58:19 +00:00
matt
f526180278 Absolute numbers where we will never allow negatives, fixes #4692
git-svn-id: http://svn.automattic.com/wordpress/trunk@5836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 19:41:44 +00:00
matt
0c1b4f93ca Sanitize cat_id, fixes #4691
git-svn-id: http://svn.automattic.com/wordpress/trunk@5835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 19:40:30 +00:00
markjaquith
f28dad8261 Sanitize option names in option.php, use current escaping functions. for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 19:24:51 +00:00
markjaquith
ad81604c8c add_option()/update_option() should pass the option name to get_option() pre-escaped. fixes #4690 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 19:14:10 +00:00
markjaquith
e9b0e8284b attribute_escape() in upload form action. Props Nazgul. fixes #4689 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 17:20:01 +00:00
markjaquith
5a833d50ef Ending DIV was missing in edit-link-form.php. Props idle and Nazgul. fixes #4688
git-svn-id: http://svn.automattic.com/wordpress/trunk@5826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-01 16:14:46 +00:00
markjaquith
8c454d7909 Favor the term "blog" instead of "weblog." Props foolswisdom and Nazgul. fixes #4674
git-svn-id: http://svn.automattic.com/wordpress/trunk@5825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-30 16:32:12 +00:00
markjaquith
e06883dfcc Use "home," not "siteurl" for widget dropdown category URLs. Props Pastinakel. fixes #4683 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-30 16:23:04 +00:00
matt
51ce46e892 Shows pending moderation comments in title and bold comment numbers with comments that need attention.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-29 19:56:55 +00:00
markjaquith
764f50bd3d ABSPATH already has a trailing slash. Props Nazgul. fixes #4607
git-svn-id: http://svn.automattic.com/wordpress/trunk@5820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-27 21:28:01 +00:00
ryan
343cbb9421 Set eol style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-25 16:58:01 +00:00
ryan
f2223e6dc5 In your cats, making them back compat.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-25 03:04:46 +00:00
ryan
401f581879 Don't forget to filter post_category
git-svn-id: http://svn.automattic.com/wordpress/trunk@5817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-24 22:29:41 +00:00
ryan
b01cbf1b76 fix FF bug in write screen: post status change on reload. Props mdawaffe. fixes #4664
git-svn-id: http://svn.automattic.com/wordpress/trunk@5816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-24 21:40:58 +00:00
ryan
00ac511053 Recalculate counts
git-svn-id: http://svn.automattic.com/wordpress/trunk@5815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-21 21:52:35 +00:00
ryan
a7720182d1 First attempt at upgrading old releases that used the linkcategories table to taxonomy. Needs testing.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-21 20:53:19 +00:00
ryan
451ec5e6ec RTL styling from sewar. fixes #4653
git-svn-id: http://svn.automattic.com/wordpress/trunk@5813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-21 18:55:36 +00:00
ryan
5f26b1b415 RTL styling from sewar. fixes #4653
git-svn-id: http://svn.automattic.com/wordpress/trunk@5812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-21 18:55:11 +00:00
ryan
491ee1a1aa add title filter outside of the loop. Do we even need it?
git-svn-id: http://svn.automattic.com/wordpress/trunk@5811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-21 00:05:28 +00:00
westi
75a3af7d17 Only enable gzip compression if it is not enabled in php.ini. Fixes #4426
git-svn-id: http://svn.automattic.com/wordpress/trunk@5810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-18 21:12:22 +00:00
westi
c510f1060d Update .htaccess file when rewrite rules are deleted if it exists.
Fixes #4018


git-svn-id: http://svn.automattic.com/wordpress/trunk@5809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-18 20:46:54 +00:00
ryan
e7d71efdd9 Revert jcalendar date picker experiment. Save it for another day. fixes #4641
git-svn-id: http://svn.automattic.com/wordpress/trunk@5808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-17 19:26:03 +00:00
ryan
7217266ca3 AND get_terms() field queries
git-svn-id: http://svn.automattic.com/wordpress/trunk@5807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-17 02:02:52 +00:00
ryan
460ddd3a1d Eliminate post_pingback stuff since we always use default_pingback_flag. fixes pingback problems caused by [5797] for #4620
git-svn-id: http://svn.automattic.com/wordpress/trunk@5806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-16 23:11:51 +00:00
ryan
db54c8c57d Make balanceTags() option independent. Props mdawaffe. fixes #4626
git-svn-id: http://svn.automattic.com/wordpress/trunk@5805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-16 19:23:41 +00:00
ryan
714f8edd6c jquery data selector for post timestamps. Props tellyworth. fixes #4641
git-svn-id: http://svn.automattic.com/wordpress/trunk@5804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-16 19:22:27 +00:00
ryan
05c0d6840b Return hook as null instead of empty string. Props DD32. fixes #4639
git-svn-id: http://svn.automattic.com/wordpress/trunk@5803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-15 17:59:05 +00:00
ryan
b6978b2123 Don't slurp in entire file. Props tellyworth. see #4421
git-svn-id: http://svn.automattic.com/wordpress/trunk@5802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-15 17:55:12 +00:00
ryan
d8d651221c Show upload file size in upload browser. Props tellyworth. fixes #4561
git-svn-id: http://svn.automattic.com/wordpress/trunk@5801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-15 17:52:50 +00:00
ryan
17a5de92fe Password reset usability improvements from tellyworth. fixes #4527
git-svn-id: http://svn.automattic.com/wordpress/trunk@5800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-15 17:50:38 +00:00
ryan
22c16718c5 Add classes that indicate post status and author ownership. Props tellyworth. fixes #4628
git-svn-id: http://svn.automattic.com/wordpress/trunk@5799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-15 17:48:01 +00:00
ryan
c140ccb72d Fix variable name. Props bgracewood. fixes #4621
git-svn-id: http://svn.automattic.com/wordpress/trunk@5797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-12 16:00:51 +00:00
ryan
ebf520f0d7 Post filter rework. see #4546
git-svn-id: http://svn.automattic.com/wordpress/trunk@5796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-11 19:57:43 +00:00
matt
9813daa487 Make this more specific so it can be more easily overridden with CSS.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-10 04:38:27 +00:00
ryan
b4557ec25b Don't load all includes by default. We have our own script loader. fixes #4512
git-svn-id: http://svn.automattic.com/wordpress/trunk@5794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-09 21:22:38 +00:00
ryan
6eb4acd7fd Bump scriptaculous ver in script loader. fixes #4512
git-svn-id: http://svn.automattic.com/wordpress/trunk@5793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-09 20:20:34 +00:00
ryan
e47dfd7529 Update to scriptaculous 1.7.1_beta3. Props Nazgul. fixes #4512
git-svn-id: http://svn.automattic.com/wordpress/trunk@5792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-09 20:14:28 +00:00
markjaquith
76ed1bdad8 Undo pre-doublequoting in prepare(). Props JeremyVisser. see #4553
git-svn-id: http://svn.automattic.com/wordpress/trunk@5791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-09 17:55:32 +00:00
ryan
97daaa0d03 Update jquery to 1.1.3.1. Fixes http://bugs.kde.org/show_bug.cgi?id=147661
git-svn-id: http://svn.automattic.com/wordpress/trunk@5790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-08 21:10:14 +00:00
markjaquith
9b0c0d56db Properly unset notoptions cache in add_option() so that get_option() and update_option() work on the same load. fixes #4429 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-07 04:06:29 +00:00
markjaquith
b721942f26 Pass extra args to pre_kses hook. Props mdawaffe. see #4409
git-svn-id: http://svn.automattic.com/wordpress/trunk@5787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 22:47:24 +00:00
ryan
d5842abd35 don't show Publish button when editing a future post. Props tellyworth.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 21:04:37 +00:00
ryan
4ba5f806d7 Reduce export mem usage. Props tellyworth. fixes #4589
git-svn-id: http://svn.automattic.com/wordpress/trunk@5785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 20:57:28 +00:00
ryan
fd4c86f9a4 Resurrect noquery
git-svn-id: http://svn.automattic.com/wordpress/trunk@5784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 20:45:46 +00:00
markjaquith
2304077c2b Entitize lone less-than characters. Props mdawaffe. fixes #4409
git-svn-id: http://svn.automattic.com/wordpress/trunk@5783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 12:53:15 +00:00
ryan
821cf4b63f suggestCategories cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@5782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-06 00:15:13 +00:00
ryan
0d05f746cf Don't richedit for comments. Props Joseph Scott. fixes #4587 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-05 20:11:32 +00:00
markjaquith
45db1a512a Automatically quote strings in $wpdb->prepare(). Use vsprintf(). see #4553
git-svn-id: http://svn.automattic.com/wordpress/trunk@5779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-05 17:32:46 +00:00
markjaquith
fbdfcce157 Introducing "prepare", a WPDB method for sprintf()-prepared SQL statements. see #4553. Implementation details to follow.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-04 16:18:57 +00:00
markjaquith
c671554b03 Update wp-comments-post.php to WP coding conventions. props JeremyVisser. fixes #4573
git-svn-id: http://svn.automattic.com/wordpress/trunk@5777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-04 16:12:37 +00:00
markjaquith
6e0ef646b7 Make it possible for a plugin to replace the feed-parsing engine. see: #4547
git-svn-id: http://svn.automattic.com/wordpress/trunk@5776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-03 18:10:20 +00:00
matt
d31029a026 Upgrade to jQuery 1.1.3, fixes #4576
git-svn-id: http://svn.automattic.com/wordpress/trunk@5775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-02 23:57:52 +00:00
ryan
46110c7774 Delete term relationship only for the given object.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-07-02 15:47:27 +00:00
markjaquith
aec08dedad Use doublequotes so line break works. Props Lloyd. fixes #4557
git-svn-id: http://svn.automattic.com/wordpress/trunk@5773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-28 23:08:23 +00:00
markjaquith
a2f7332558 Mark pingback as already pinged when the target site says it already got the pingback. props mdawaffe. fixes #4289
git-svn-id: http://svn.automattic.com/wordpress/trunk@5772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-27 23:28:36 +00:00
markjaquith
83d0dab731 Correct grammatical error (comment splice). Props filosofo. fixes #4551
git-svn-id: http://svn.automattic.com/wordpress/trunk@5771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-27 23:25:49 +00:00
ryan
c1adb3c7ad Allow rules to be added to the top of the rule stack.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-27 21:39:50 +00:00
markjaquith
0e2d9ff004 Fix typo in get_the_author_url(). props pgdx. fixes #4542
git-svn-id: http://svn.automattic.com/wordpress/trunk@5767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-27 00:51:04 +00:00
markjaquith
4e9c69747b Check post type after upload. Props Alexander Concha
git-svn-id: http://svn.automattic.com/wordpress/trunk@5765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-26 20:45:30 +00:00
markjaquith
64ef1ed841 Correctly grab Content-Type from old-school headers, skip blank headers. fixes #4296
git-svn-id: http://svn.automattic.com/wordpress/trunk@5764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-26 20:18:56 +00:00
markjaquith
9a91481a2b Don't add MIME-Version header twice (PHPMailer already adds it). see #4296
git-svn-id: http://svn.automattic.com/wordpress/trunk@5763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-26 19:11:23 +00:00
markjaquith
d9d5fde1e7 compare mail headers case-insensitively and actually use the Content-Type specified. Props Nazgul. see: #4296
git-svn-id: http://svn.automattic.com/wordpress/trunk@5762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-26 18:28:56 +00:00
markjaquith
829ace3e68 strpos() is "haystack,needle", not "needle,haystack" Props pishmishy. fixes #4520
git-svn-id: http://svn.automattic.com/wordpress/trunk@5761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-26 18:06:17 +00:00
ryan
1d13d95eeb s/cat_name/name/
git-svn-id: http://svn.automattic.com/wordpress/trunk@5760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 21:39:17 +00:00
ryan
3dc720588b Change cat_name, cat_ID to name, term_id.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 21:37:47 +00:00
ryan
5ebed51846 Eliminate cat select. Use API.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 21:34:06 +00:00
markjaquith
b1a12f6718 get_comment_to_edit() should return false when the comment does not exist or is marked as spam. props Westi. fixes #4533.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 21:30:18 +00:00
ryan
267997a4fd Add name_like query to get_terms(). Use it in suggestCategories.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 21:28:19 +00:00
ryan
0e7483cc5a s/cat_name/name/ see #4537
git-svn-id: http://svn.automattic.com/wordpress/trunk@5755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 20:06:02 +00:00
ryan
a5e56dc9db s/cat_name/name/ see #4537
git-svn-id: http://svn.automattic.com/wordpress/trunk@5754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 19:51:26 +00:00
markjaquith
2fd0094ce3 Display fatal errors that prevent plugins from being activated. fixes #4508
git-svn-id: http://svn.automattic.com/wordpress/trunk@5753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 18:57:54 +00:00
ryan
ed549303d7 Move the_title filter to get_the_title. Props jhodgdon. fixes #4477
git-svn-id: http://svn.automattic.com/wordpress/trunk@5752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-25 17:48:35 +00:00
markjaquith
1111b0c5fe Ordering and labeling niceties for the Manage > Posts screen. see #4446
git-svn-id: http://svn.automattic.com/wordpress/trunk@5751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-24 06:25:49 +00:00
markjaquith
d50996b941 Order pending posts nag by post_modified ASC, drafts by post_modified DESC
git-svn-id: http://svn.automattic.com/wordpress/trunk@5750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-24 05:58:38 +00:00
markjaquith
a05fcdcf23 Change to "and x more" for nags. see #4446
git-svn-id: http://svn.automattic.com/wordpress/trunk@5749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-24 05:46:08 +00:00
markjaquith
3f154010f3 Only hide comments column for pending, future, and draft posts. see #4446
git-svn-id: http://svn.automattic.com/wordpress/trunk@5748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-24 05:05:22 +00:00
markjaquith
ad9271f86f Don't init widgets if the blog isn't installed yet. fixes #4504
git-svn-id: http://svn.automattic.com/wordpress/trunk@5747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-23 05:32:16 +00:00
markjaquith
bf8b03a928 Matt requested that I revert this ([5742]). see #4254 for discussion
git-svn-id: http://svn.automattic.com/wordpress/trunk@5744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-22 01:29:57 +00:00
markjaquith
eefdd4cef7 Upgrade to Prototype 1.5.1.1 (bugfix release). Props Nazgul. fixes #4502
git-svn-id: http://svn.automattic.com/wordpress/trunk@5743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-21 22:01:21 +00:00
markjaquith
37dbcc2a80 BrowseHappy is outdated. fixes #4254
git-svn-id: http://svn.automattic.com/wordpress/trunk@5742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-21 21:53:41 +00:00
ryan
74bc9bb8a6 Term count fixes
git-svn-id: http://svn.automattic.com/wordpress/trunk@5741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-21 15:46:49 +00:00
ryan
21e8f43f8c Don't create '0' categories. fixes #4413
git-svn-id: http://svn.automattic.com/wordpress/trunk@5739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-20 22:06:29 +00:00
ryan
9d84bef608 js_escape improvements from Alexander Concha. Catches &#39 &#039 ' ' ' ' &#x000027 etc.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 22:46:55 +00:00
ryan
fd5da3a85e Protect _wp_page_template too.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 22:42:25 +00:00
ryan
7ffc5ee8b0 Accept 'open' and 'closed' as valid values for mt_allow_comments and mt_allow_pings in XML-RPC. Props Joseph Scott. see #4469
git-svn-id: http://svn.automattic.com/wordpress/trunk@5729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 19:12:24 +00:00
rob1n
7b09e504e7 Change references of get_object_terms() to wp_get_object_terms(). fixes #4490
git-svn-id: http://svn.automattic.com/wordpress/trunk@5728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 18:03:12 +00:00
rob1n
0eb86404da Fix up wp_list_authors() SQL. fixes #4485
git-svn-id: http://svn.automattic.com/wordpress/trunk@5727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 17:57:53 +00:00
ryan
e2dc2a8dd3 Add some taxonomy validation. Rearrange funcs.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-19 00:33:44 +00:00
ryan
e8dc080307 Prevent editing of protected meta keys.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-18 16:28:11 +00:00
ryan
c09f6ffbdb escape before extracting. Props Alexander Concha.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-18 00:18:18 +00:00
rob1n
3ca7762517 Add missing </em>. Props johnbillion. fixes #4479
git-svn-id: http://svn.automattic.com/wordpress/trunk@5720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-16 17:52:08 +00:00
ryan
9fbb55032a Regex fix. Props tellyworth. fixes #4452
git-svn-id: http://svn.automattic.com/wordpress/trunk@5718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-16 02:09:08 +00:00
ryan
e30a9ba012 Upgrade code for multiple category widgets. Props Andy. see #4285
git-svn-id: http://svn.automattic.com/wordpress/trunk@5717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-16 02:03:25 +00:00
ryan
64d3a54b85 Don't use permalinks for pending posts. see #4446
git-svn-id: http://svn.automattic.com/wordpress/trunk@5716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-15 22:11:01 +00:00
rob1n
404e50bfb3 Show the name, not the slug. fixes #4473
git-svn-id: http://svn.automattic.com/wordpress/trunk@5715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-15 18:26:43 +00:00
ryan
e7890261e5 EXTR_SKIP. See #4468
git-svn-id: http://svn.automattic.com/wordpress/trunk@5712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-15 17:30:37 +00:00
ryan
2ea53cf51a Use CDATA escaping on fields. Props tellyworth. fixes #4452
git-svn-id: http://svn.automattic.com/wordpress/trunk@5711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-15 17:22:38 +00:00
rob1n
560d294867 Fix reference to ocomment.php. Props alanjcastonguay and Lloyd. fixes #4471
git-svn-id: http://svn.automattic.com/wordpress/trunk@5710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-15 16:54:17 +00:00
ryan
aac03a2066 wp_parse_str() from mdawaffe. see #4467
git-svn-id: http://svn.automattic.com/wordpress/trunk@5709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 22:46:59 +00:00
ryan
9d3d20f063 Use EXTR_SKIP when extracting. see #4468
git-svn-id: http://svn.automattic.com/wordpress/trunk@5708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 22:45:40 +00:00
markjaquith
7f44512c5d Introducing post_status="pending". see #4446 and put any initial bug reports on that ticket
git-svn-id: http://svn.automattic.com/wordpress/trunk@5707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 16:24:28 +00:00
markjaquith
e211aa64e7 use FALSE to designate lack of user-supplied URL in *_query_arg() funcs. fixes #4465 for 2.3 (trunk)
git-svn-id: http://svn.automattic.com/wordpress/trunk@5705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 05:12:22 +00:00
markjaquith
99f0971b73 only strip question marks from the RIGHT side of the query string. fixes #4464 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 04:44:06 +00:00
rob1n
9fac8dcbae Use display_name instead. Props Pal Gronas Drange. fixes #4459
git-svn-id: http://svn.automattic.com/wordpress/trunk@5701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 02:30:26 +00:00
ryan
2f09416258 Trim empty lines. Nothing but newline.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 02:25:30 +00:00
ryan
72c169c2f1 Don't output author uri tag if uri is empty.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 18:03:17 +00:00
rob1n
cbdc90759c wp_rss() updates. fixes #3834
git-svn-id: http://svn.automattic.com/wordpress/trunk@5698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 17:23:38 +00:00
rob1n
a14a68b216 Translate some strings in the classic theme that were missed. Props nbachiyski. fixes #4451
git-svn-id: http://svn.automattic.com/wordpress/trunk@5697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 16:41:21 +00:00
rob1n
ab2e725577 Translate the rest of the &raquo;'s. Props nbachiyski. fixes #3401
git-svn-id: http://svn.automattic.com/wordpress/trunk@5696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 16:29:55 +00:00
markjaquith
8187ddb3d7 correct CSS link for install. Props Viper007Bond. fixes #4443
git-svn-id: http://svn.automattic.com/wordpress/trunk@5694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 06:33:17 +00:00
matt
81dd1f1737 Update in_category to use the new object_term_cache, it wasn't so much with the working before.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-13 00:16:33 +00:00
markjaquith
6dca00cae6 Correct SQL query in [5691]. fixes #2316
git-svn-id: http://svn.automattic.com/wordpress/trunk@5692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 23:44:45 +00:00
markjaquith
f1fa801385 Omit underscore-prefixed meta keys from dropdown list. fixes #2316
git-svn-id: http://svn.automattic.com/wordpress/trunk@5691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 23:22:38 +00:00
rob1n
d4f95b7fd4 Accidental commit. Props Nazgul. fixes #4437
git-svn-id: http://svn.automattic.com/wordpress/trunk@5690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 21:59:22 +00:00
rob1n
845ae5609d Add ID's to profile edit form's fieldsets. fixes #4434
git-svn-id: http://svn.automattic.com/wordpress/trunk@5689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 21:52:50 +00:00
rob1n
e3328ca20b Don't include HTML in gettext call. Props nbachiyski and Nazgul. fixes #4437
git-svn-id: http://svn.automattic.com/wordpress/trunk@5688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 21:48:55 +00:00
ryan
b26a66ced0 Fix image path
git-svn-id: http://svn.automattic.com/wordpress/trunk@5687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 21:47:12 +00:00
markjaquith
6d5da3e33c Force $autoload to be either "yes" or "no". see #4440. props Nazgul
git-svn-id: http://svn.automattic.com/wordpress/trunk@5686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 20:57:58 +00:00
markjaquith
cf2b700d93 Make sure post titles longer than 200 chars get unique slugs. fixes #4433. props AaronCampbell.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 20:49:40 +00:00
ryan
56272d8507 MT importer rework. see #4421
git-svn-id: http://svn.automattic.com/wordpress/trunk@5684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 19:49:30 +00:00
ryan
21dff0640c Add a prophylactic sanitize_user()
git-svn-id: http://svn.automattic.com/wordpress/trunk@5683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-12 18:11:06 +00:00
ryan
66e6a55c7e escapeshellarg the sender
git-svn-id: http://svn.automattic.com/wordpress/trunk@5682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-11 23:19:33 +00:00
ryan
81c90fcd76 attribute_escape REQUEST_URI
git-svn-id: http://svn.automattic.com/wordpress/trunk@5679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-11 22:41:47 +00:00
rob1n
ff6f1383d1 Maintain "Page order" for consistency. fixes #4431
git-svn-id: http://svn.automattic.com/wordpress/trunk@5677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-11 21:11:40 +00:00
rob1n
458b65a2f0 Translate &raquo;. see #3401
git-svn-id: http://svn.automattic.com/wordpress/trunk@5676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-11 21:05:50 +00:00
rob1n
6e5e54b5ae Revert multiple category stuff. see #4285
git-svn-id: http://svn.automattic.com/wordpress/trunk@5675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-09 00:59:14 +00:00
rob1n
a79c4dbda3 Fix <!--generator--> line's time format. Props macbis. fixes #4424 for 2.3 and 2.2.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 23:06:10 +00:00
rob1n
32a890bd26 Some more multiple category widget stuff. see #4285
git-svn-id: http://svn.automattic.com/wordpress/trunk@5673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 22:50:37 +00:00
rob1n
d84178acd7 Check the user before overwriting the attachment. Props xknown and Joseph Scott. fixes #4422
git-svn-id: http://svn.automattic.com/wordpress/trunk@5671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 17:07:59 +00:00
rob1n
64b91fc94b Add support for multiple instances of the category widget. see #4285
git-svn-id: http://svn.automattic.com/wordpress/trunk@5669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 14:49:30 +00:00
ryan
b5598e2bda More comment caching. see #4387
git-svn-id: http://svn.automattic.com/wordpress/trunk@5667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 06:56:34 +00:00
ryan
f2f6101e1c Comment caching. Reduce queries on edit-comments.php page. Add non-persistent cache groups. Hat tip to hovenko. fixes #4387
git-svn-id: http://svn.automattic.com/wordpress/trunk@5666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 00:20:22 +00:00
rob1n
fbfafcf27a Update CSS paths. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-08 00:19:35 +00:00
rob1n
4d5baa0fad Use Older/Newer rather than Previous/Next for sake of clarity. fixes #4397
git-svn-id: http://svn.automattic.com/wordpress/trunk@5664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-07 23:33:06 +00:00
rob1n
02959eb9d4 Move a stray <p> from a recent change.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-07 22:52:09 +00:00
matt
adda69e289 We prefer our own API. (Which MT/Typepad have cloned already.)
git-svn-id: http://svn.automattic.com/wordpress/trunk@5662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-07 14:10:53 +00:00
matt
ff1e0f32fc No good reason to align the mark all in the center or move the metadata around.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-07 14:01:02 +00:00
ryan
a09031ecd0 Use get_term_children() and get_term_field(). see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-06 16:13:12 +00:00
ryan
d2188a7dde Fix category renaming. fixes #4415 see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-06 16:12:02 +00:00
ryan
bac1fccf3a Fix category renaming. fixes #4415 see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-06 16:10:52 +00:00
ryan
d5f3d0c2d7 Remove comment_text filter from get_comment_to_edit. fixes #4403 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-05 14:41:02 +00:00
ryan
539b2e48f0 First cut of link category management. Rough and ugly.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-05 05:08:27 +00:00
rob1n
1390f9deee Better use empty alt attribute than the filename. Props cpoteet. fixes #3100
git-svn-id: http://svn.automattic.com/wordpress/trunk@5653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-05 04:40:10 +00:00
ryan
9f46c4af44 Term sanitization. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-05 00:57:23 +00:00
ryan
f904142767 Add 'edit_posts' capability check to metaWeblog.newPost. Props Joseph Scott and Wei-Yeh Lee. fixes #4404 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-04 18:31:32 +00:00
ryan
e515401912 Run comment_text filter before format_to_edit() when getting a comment to edit. fixes #4403 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-04 17:43:22 +00:00
ryan
b8c0875ef0 Upgrade fixes. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-03 18:57:14 +00:00
ryan
16e8f842f5 Fix link category dropdown and filter. Add some back compat to get_categories. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-03 17:28:27 +00:00
rob1n
bf88d4adc0 Make visited links in the admin stand out more. Props ptvguy and Nazgul. fixes #2779
git-svn-id: http://svn.automattic.com/wordpress/trunk@5641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-03 01:00:03 +00:00
rob1n
9ce729e656 Content-Type, not Content-type, as headers are case sensitive. Props foolswisdom and Nazgul. fixes #3545
git-svn-id: http://svn.automattic.com/wordpress/trunk@5640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 05:21:18 +00:00
rob1n
64820ed1ae wp_mail() rewrite that handles HTML mail. fixes #4296
git-svn-id: http://svn.automattic.com/wordpress/trunk@5639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 03:18:24 +00:00
rob1n
026cdded71 phpDoc effort for wp-includes/author-template.php. fixes #4393
git-svn-id: http://svn.automattic.com/wordpress/trunk@5638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 03:04:01 +00:00
ryan
4214428322 Separate AJAX cat adder into post and link flavors. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 02:53:09 +00:00
rob1n
9828d17066 Don't queue Prototype or Interface, just jQuery.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 01:01:57 +00:00
rob1n
73e7d2ff2e Ugh. We need to consolidate these headers. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:43:40 +00:00
rob1n
23057b57fb Revert some links. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:42:32 +00:00
rob1n
16c43baa92 Don't more wp-admin.css and rtl.css for compat.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:41:37 +00:00
rob1n
5d27044a24 Whoops, forgot about wp-login.php. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:40:23 +00:00
rob1n
cac67278d2 Move JavaScript to js subfolder, and CSS to css subfolder. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:37:51 +00:00
rob1n
c927ae3f37 Keep greedy regex's in control. fixes #4165
git-svn-id: http://svn.automattic.com/wordpress/trunk@5630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-02 00:02:06 +00:00
rob1n
168c858844 Move uploads JS to jQuery. Props filosofo. see #3824
git-svn-id: http://svn.automattic.com/wordpress/trunk@5629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 23:52:27 +00:00
rob1n
f7ba6b94d9 A bit simpler.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 23:16:50 +00:00
rob1n
d9757a4426 phpDoc for wp-includes/registration.php. fixes #4383
git-svn-id: http://svn.automattic.com/wordpress/trunk@5627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 23:13:41 +00:00
rob1n
82e3bf32c3 Fix a strpos typo. fixes #4390
git-svn-id: http://svn.automattic.com/wordpress/trunk@5626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 23:10:03 +00:00
rob1n
a437fa5e23 Fix wp_title single post title filters. Props jhodgdon. fixes #3755
git-svn-id: http://svn.automattic.com/wordpress/trunk@5625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 22:54:46 +00:00
markjaquith
06e670d043 Allow wp_list_authors() to optionally return. fixes #4323. see #3567.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 05:43:24 +00:00
rob1n
b8c26df7e0 Fix nestable HTML, including <blockquote>'s. Props anonymousbugger (!) and Nazgul. fixes #1170
git-svn-id: http://svn.automattic.com/wordpress/trunk@5623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 02:33:03 +00:00
ryan
9e8bfa7f7b query by parent, not child_of, in get_nested_categories(). see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-01 02:24:07 +00:00
ryan
fb6ce027e1 Use new term tables in wp_install_defaults(). see #4380, #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 22:50:47 +00:00
markjaquith
bd89b78f8d get_bloginfo("comments_atom_url") now works properly. fixes #4382 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 22:44:21 +00:00
markjaquith
09202da539 correct "type" in Atom comments feed alternate links. fixes #4381 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 22:13:06 +00:00
ryan
fbe9b4d76e Abstract object term cache a bit more. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 21:38:33 +00:00
rob1n
71a095d0ee Don't translate "you haven't installed" text yet, because text domain isn't installed. Props nbachiyski.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 12:29:46 +00:00
rob1n
01af55cbf7 Bring tinyspell.php into sync. Props Nazgul. fixes #4368
git-svn-id: http://svn.automattic.com/wordpress/trunk@5614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 12:22:06 +00:00
rob1n
e836ded63b Fix variable typo. Props schulte. fixes #4374
git-svn-id: http://svn.automattic.com/wordpress/trunk@5613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:51:03 +00:00
ryan
e7e4c113fd If a term has no children, return an empty array for child_of queries. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:44:18 +00:00
rob1n
d268eae391 Some more get_pagenum_link() fixes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:36:40 +00:00
rob1n
544f18ce7d Fix get_pagenum_link() for query strings. fixes #3930
git-svn-id: http://svn.automattic.com/wordpress/trunk@5610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:29:44 +00:00
rob1n
fb2f7fb6b0 Fix some typos in query.php. Props schulte. fixes #4373
git-svn-id: http://svn.automattic.com/wordpress/trunk@5609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:19:38 +00:00
ryan
48bfddf9fc Disable nesting until inifinite loop tracked down.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 03:09:58 +00:00
rob1n
ce8ddce5c4 Move the restrict_manage_posts hook to somewhere more reasonable. see #4359
git-svn-id: http://svn.automattic.com/wordpress/trunk@5607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 02:12:04 +00:00
rob1n
990ca286c1 Localize the "you haven't installed WP yet" message. fixes #4370
git-svn-id: http://svn.automattic.com/wordpress/trunk@5606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 02:03:22 +00:00
rob1n
ba3abf0733 Add option to exclude pages to pages widget. see #4259
git-svn-id: http://svn.automattic.com/wordpress/trunk@5605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 01:57:10 +00:00
rob1n
fc76cc488d Prototype fix to keep Safari < 2 from blowing up. fixes #4363
git-svn-id: http://svn.automattic.com/wordpress/trunk@5604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 01:38:11 +00:00
rob1n
ebee78ae54 Check that tinyMCE is defined. Props johnbillion. fixes #4257
git-svn-id: http://svn.automattic.com/wordpress/trunk@5602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 00:24:31 +00:00
rob1n
e83a798987 Upgrade TinyMCE spell checker to 1.0.5. fixes #4368
git-svn-id: http://svn.automattic.com/wordpress/trunk@5601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-31 00:21:55 +00:00
rob1n
a8d5942028 Some comment edit form aesthetics. fixes #4367
git-svn-id: http://svn.automattic.com/wordpress/trunk@5600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-30 23:53:34 +00:00
ryan
7800ed531e Fix slug queries. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-30 21:50:57 +00:00
ryan
df1a8696d5 Some term caching. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-30 03:36:59 +00:00
ryan
7c39499aa0 Category hierarchy fixes. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-30 01:39:47 +00:00
ryan
facc7245fa Add ignore_empty option to wp_count_terms(). see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-30 01:05:44 +00:00
ryan
e2a9845a94 Add missing taxonomy argument. Props nbachiyski. fixes #4362 see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 23:06:46 +00:00
ryan
083dfb059b Fix listing of categories with parents. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 21:50:00 +00:00
ryan
3176f1acd2 get_term_children() and category query fixes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 21:27:49 +00:00
ryan
6a314d85d8 Use taxonomy instead of post2cat. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 16:52:31 +00:00
markjaquith
b0ffd98c95 switch to term_id and name for category sorting. see #4189. sort by term_id for category permalinks, by name for get_the_category(). fixes #4335 for trunk. Props Erik Barzeski for the find.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 04:54:45 +00:00
markjaquith
007e5937cf use clean_url(). Nice catch, g30rg3x. see #4333 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 04:35:23 +00:00
ryan
4efb612c1a Post and page management filter additions from mdawaffe. see #3945
git-svn-id: http://svn.automattic.com/wordpress/trunk@5587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 04:28:10 +00:00
ryan
c09ea05543 Use API instead of SELECT. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 04:26:36 +00:00
ryan
13a01467dc get_objects_in_term()
git-svn-id: http://svn.automattic.com/wordpress/trunk@5585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-29 04:25:09 +00:00
ryan
283458e631 Nomenclature changes. see #3945
git-svn-id: http://svn.automattic.com/wordpress/trunk@5583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 22:31:31 +00:00
ryan
957cd7955b Show drafts that have a published parent. Props mdawaffe. fixes #4356
git-svn-id: http://svn.automattic.com/wordpress/trunk@5582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 21:55:12 +00:00
markjaquith
fcf640dd6b declare $user_ID global in load_template(). fixes #4354.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 21:32:35 +00:00
rob1n
16dab6f6db Move Dashboard's news to jQuery. see #3824
git-svn-id: http://svn.automattic.com/wordpress/trunk@5580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 20:46:03 +00:00
rob1n
4b9d4641be Add a is_user_logged_in() check.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 20:39:24 +00:00
rob1n
380d9c3487 Show me more!
git-svn-id: http://svn.automattic.com/wordpress/trunk@5578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 19:32:24 +00:00
rob1n
5aedce1521 Update TinyMCE to 2.1.1.1 (look at all those 1's...). fixes #4262
git-svn-id: http://svn.automattic.com/wordpress/trunk@5577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 19:30:05 +00:00
ryan
6621b8eed0 Fix category permalinks. Update cat_ID to term_id. fixes #4349 see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 18:47:08 +00:00
ryan
a438f8a92a Better draft, private, and future post/page management from mdawaffe. fixes #3945
git-svn-id: http://svn.automattic.com/wordpress/trunk@5575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 18:34:06 +00:00
rob1n
a5e4caba87 Moderation cleaned up, add paging and various bug fixes. fixes #4317
git-svn-id: http://svn.automattic.com/wordpress/trunk@5574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 17:21:25 +00:00
rob1n
6800fa5564 Actually, this makes more sense.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 17:11:42 +00:00
rob1n
673cab8183 Turn string to upper. Props Donncha. fixes #4350
git-svn-id: http://svn.automattic.com/wordpress/trunk@5572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 17:05:46 +00:00
markjaquith
7e9cfad780 Fix category/tag base wording. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 06:46:39 +00:00
markjaquith
070d2fd62b Int cast. Props to Alexander Concha for the find, Joseph Scott for the patch.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 05:12:56 +00:00
markjaquith
6a41f63aae permalink_link() is deprecated, and should reference its replacement.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 04:39:40 +00:00
rob1n
0617eb51d0 Add rel="tag" to tag links. fixes #4159
git-svn-id: http://svn.automattic.com/wordpress/trunk@5568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 02:07:59 +00:00
ryan
965e63b970 Register taxonomies as object instead of arrays. Fix tt_ids query in get_post_terms().
git-svn-id: http://svn.automattic.com/wordpress/trunk@5567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 00:51:24 +00:00
ryan
e3f7055082 Set eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-28 00:04:33 +00:00
matt
0ee4823f71 A helpful pointer for a possible cause of this error.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 22:08:42 +00:00
ryan
ab1d417e55 Return true when deleting link to satisfy admin-ajax error check. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 19:43:44 +00:00
ryan
ee5ec0c505 Fix up exporter. Remove more refrences to the categories table. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 19:32:45 +00:00
ryan
2857b43d78 Fix default cat options. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 17:57:15 +00:00
ryan
333d77ea9c Typo fix from flinkflonk. fixes #4347 see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 17:45:31 +00:00
ryan
eb541a962f Link category fixes. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 17:21:04 +00:00
ryan
49953705f1 Delete term if no taxonomies use it. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 06:29:52 +00:00
ryan
128bbfa161 Change term count callback style. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 06:17:50 +00:00
ryan
3e59a81327 Remove debug. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 05:28:30 +00:00
ryan
c816b51b8c Fix object term relationship deletion and count updating.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-27 05:15:18 +00:00
ryan
2918f50e90 Term cache work. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-26 23:32:06 +00:00
ryan
474e769f07 cat2tag fixes. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-26 18:59:58 +00:00
ryan
80ce3031d1 Update cat2tag converter. Some term API tweaks. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-26 18:54:16 +00:00
ryan
b068bd6447 During upgrade, make slugs unique and put like slugs in a term group. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-26 17:47:20 +00:00
ryan
f24ed6715f Fix schema formatting to appease dbDelta. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 22:57:52 +00:00
rob1n
77a141151f Fix typo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 16:27:34 +00:00
rob1n
a98bb3abda Fix Atom feeds' categories. fixes #4307
git-svn-id: http://svn.automattic.com/wordpress/trunk@5548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 15:55:30 +00:00
rob1n
8a3ed389bb More xmlrpc.php i18n fixes from nbachiyski. fixes #3997
git-svn-id: http://svn.automattic.com/wordpress/trunk@5547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 15:33:47 +00:00
rob1n
629dde868c Actually check for PHP 4.2. Props nbachiyski. fixes #4336
git-svn-id: http://svn.automattic.com/wordpress/trunk@5546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 14:51:33 +00:00
ryan
fa860d54c0 Fix include path. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 09:53:16 +00:00
ryan
f7e5557f6e Don't load category cache from old tables. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 09:45:55 +00:00
ryan
8e547a3677 attribute_escape()s and int casts. see #4333
git-svn-id: http://svn.automattic.com/wordpress/trunk@5543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 09:41:04 +00:00
ryan
770613e763 Admin includes reorg. see #4334
git-svn-id: http://svn.automattic.com/wordpress/trunk@5542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 07:16:21 +00:00
ryan
92e7d3c3bc Make sure sanitize_option() is always called when updating options.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-25 02:22:30 +00:00
ryan
677b609ee2 Don't create old tables. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-24 22:55:33 +00:00
ryan
6445fc55a2 Category/tag to taxonomy upgrade. First cut.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-24 22:40:24 +00:00
ryan
fe5e71cfaa RSD link fixes from Joseph Scott. fixes #4329 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-24 17:09:39 +00:00
rob1n
315fcd5cd6 the_search_query() revamp. fixes #4327
git-svn-id: http://svn.automattic.com/wordpress/trunk@5536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-24 03:37:10 +00:00
rob1n
cf3f7ac197 Use selected() to clean that up. Thanks Mark. fixes #4291
git-svn-id: http://svn.automattic.com/wordpress/trunk@5535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-24 00:29:51 +00:00
ryan
76d2530a7e No more TAXONOMY bit fiels. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 22:11:02 +00:00
ryan
6251eb3ca6 wp_delete_term(). see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 22:03:24 +00:00
ryan
1b783b9b9a More rel_type elimination. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 20:59:11 +00:00
markjaquith
563c0ab7a2 Allow MT Importer to use FTP-uploaded file (to get around php.ini-set file upload size limit). fixes #4284
git-svn-id: http://svn.automattic.com/wordpress/trunk@5531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 19:36:35 +00:00
ryan
b00beb3027 Convert category queries and list cats to taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 18:59:12 +00:00
ryan
0e05576999 Set and get post cats to taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 18:07:53 +00:00
ryan
675cc0d029 wp_insert_category(), cat_rows(), and others using taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 17:28:13 +00:00
rob1n
040263799f Filter max upload file size for import form. Props Donncha. fixes #4320
git-svn-id: http://svn.automattic.com/wordpress/trunk@5527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 15:45:28 +00:00
rob1n
4d9a6e1a98 Fix bloginfo() filtering when it comes to links. Props Nazgul. fixes #4116
git-svn-id: http://svn.automattic.com/wordpress/trunk@5526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 14:58:32 +00:00
ryan
42df47a478 Add get_term_by() and taxonomy registration bits. Move more category stuff to taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 10:32:33 +00:00
ryan
557eafd82e Add some term hooks. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 07:26:52 +00:00
ryan
4bbddb6559 Start moving link categories to taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 07:15:10 +00:00
ryan
b450105bfd wp_insert_term() and wp_update_term(). see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 05:42:31 +00:00
ryan
0b795ff92b Add get_terms() and get_term(). Move more of tagging to taxonomy. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-23 03:57:20 +00:00
rob1n
e623c78708 Run the i through the parseInt to avoid IE 7 errors. fixes #4268
git-svn-id: http://svn.automattic.com/wordpress/trunk@5520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 22:52:29 +00:00
rob1n
6a1b3fcd19 Run it through the filter. see #4259
git-svn-id: http://svn.automattic.com/wordpress/trunk@5519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 22:36:56 +00:00
ryan
c5967f3432 Remove the_content filter from widget text. see #4259
git-svn-id: http://svn.automattic.com/wordpress/trunk@5518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 21:32:07 +00:00
ryan
fe1178d848 Keep the old tables in the schema until everything is converted. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 20:59:00 +00:00
ryan
6ecc901391 Fix primary key on term_relationships. Add wp_set_object_terms(). Setting post tags working now. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 20:39:26 +00:00
markjaquith
0c80a47d13 explicitly state Zulu time for desktop editors. Props Erik Barzeski and Joseph Scott. fixes #4314 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 19:57:50 +00:00
markjaquith
9a75737897 Prevent current author from claiming authorship of posts from other authors when editing via desktop client. Props Erik Barzeski. fixes #4315 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@5511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 19:53:16 +00:00
ryan
634a33c206 Very rough initial commit of taxonomy for everyone's hacking pleasure. There be dragons. see #4189
git-svn-id: http://svn.automattic.com/wordpress/trunk@5510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 05:12:38 +00:00
rob1n
3ed5b0a01e Don't show title if user leaves it blank. see #4259
git-svn-id: http://svn.automattic.com/wordpress/trunk@5509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-22 00:25:44 +00:00
rob1n
3fab6618e2 Fix accidental typo. fixes #4300
git-svn-id: http://svn.automattic.com/wordpress/trunk@5508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 22:58:22 +00:00
rob1n
7048b27ede Don't call is_wp_error() in wp_die() if it hasn't been defined yet. fixes #4308
git-svn-id: http://svn.automattic.com/wordpress/trunk@5507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 22:50:32 +00:00
ryan
aeb569d93d Fix theme template field. fixes #4310 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 20:11:53 +00:00
ryan
b634b18433 Check if is_array before unsetting array index. fixes #4306 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 16:39:08 +00:00
rob1n
041135b01b Pass text widget text through format_to_edit. Props Ryan. fixes #4302
git-svn-id: http://svn.automattic.com/wordpress/trunk@5499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 13:13:22 +00:00
rob1n
b83c9dae09 Fix wp-ajax.js addArg's hashes. Props technosailor. fixes #4277
git-svn-id: http://svn.automattic.com/wordpress/trunk@5498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 12:56:39 +00:00
rob1n
69c2d56a31 Keep editing mode when paging through comments. fixes #4300
git-svn-id: http://svn.automattic.com/wordpress/trunk@5497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-21 12:52:44 +00:00
rob1n
4e6e08e11d Doh. fixes #4292
git-svn-id: http://svn.automattic.com/wordpress/trunk@5496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 23:44:37 +00:00
ryan
7a3c62d0dd Fix widget admin layout for IE7. Props Denis-de-Bernardy. fixes #4264 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 17:24:25 +00:00
rob1n
4a83568904 Check for switch_themes, not edit_themes. Props Denis de Bernardy. fixes #4292
git-svn-id: http://svn.automattic.com/wordpress/trunk@5492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 04:38:51 +00:00
rob1n
a45c3a3f23 Don't fail when the user don't set WP-Cache up correctly. Props Denis de Bernardy. fixes #4293
git-svn-id: http://svn.automattic.com/wordpress/trunk@5491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 04:32:28 +00:00
rob1n
1d47f812cd Select the option if it's set to that. fixes #4291
git-svn-id: http://svn.automattic.com/wordpress/trunk@5490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 04:26:02 +00:00
ryan
90986b4697 s/2.1/2.2/
git-svn-id: http://svn.automattic.com/wordpress/trunk@5489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 00:24:08 +00:00
ryan
592c3c0767 Fix tinymce colorpicker. Props azaozz. fixes #4188 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-19 00:10:24 +00:00
rob1n
5d40bf562c Texturize and autop the text widgets, and allow pages to be sorted by a specified field. Props Denis de Bernardy. see #4259
git-svn-id: http://svn.automattic.com/wordpress/trunk@5486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-18 02:29:11 +00:00
ryan
8da6590866 Restore crack-headed arg passing to register_sidebar_widget(). fixes #4275 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-16 17:49:32 +00:00
rob1n
349ba3a536 Fix some attribute misnamings. Props Erunafailaro. fixes #4274
git-svn-id: http://svn.automattic.com/wordpress/trunk@5483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-16 17:37:55 +00:00
rob1n
d6b4808d80 Update Prototype to 1.5.1 and script.aculo.us to 1.7.1-b2. Props zamoose. fixes #4265
git-svn-id: http://svn.automattic.com/wordpress/trunk@5482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-16 03:27:07 +00:00
rob1n
77b86e7c68 Fix get_pagenum_link(). fixes #3930
git-svn-id: http://svn.automattic.com/wordpress/trunk@5481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-16 02:47:24 +00:00
ryan
d4288b9aee Add nonce to avoid AYS when restoring image header.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-15 16:47:15 +00:00
ryan
a291731ed3 Theme screenshot fix from mdawaffe. fixes #4266 for 2.3.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 23:30:17 +00:00
ryan
1fbb89b1a0 Allow sidebar names to be passed to dynamic_sidebar(). fixes #4258 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 05:13:39 +00:00
matt
b0d60f0351 Show post name and bring organization in line with the edit comments page.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 03:41:03 +00:00
matt
537f72cffb This button gets buried, especially when you have a lot of widgets, and it needs to be at the top too.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 03:39:05 +00:00
rob1n
05c0fccdf9 Get rid of stray space.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 03:28:10 +00:00
matt
0e8598a256 Remove the generation time, it isn't terribly useful to users and gets confused with version
git-svn-id: http://svn.automattic.com/wordpress/trunk@5469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-14 03:14:17 +00:00
ryan
d7e422644f More Kubrick custom color header i18n from nbachiyski. fixes #4256 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-13 18:46:17 +00:00
ryan
5b000b1507 Kubrick custin color header i18n from nbachiyski. fixes #4256 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-13 17:56:30 +00:00
ryan
f5b4234c59 Flush all output buffers during shutdown to avoid PHP 5 bustage. see #3354
git-svn-id: http://svn.automattic.com/wordpress/trunk@5462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 22:06:31 +00:00
ryan
b820d101d6 Return proper protocol. fixes #3886 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 21:55:14 +00:00
rob1n
24399dcbfb Seeing double. Good spot momo360modena. fixes #4251 for 2.1, 2.2 and 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 19:47:47 +00:00
rob1n
f417e94b89 Don't make useless status_header() call. fixes #4249
git-svn-id: http://svn.automattic.com/wordpress/trunk@5458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 19:30:38 +00:00
matt
a22990a56e The config file has been deliberately CRLF since [2370] to recognize that most people will be editing this file in a crappy windows editor.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 18:29:57 +00:00
rob1n
51ace86089 Don't call the function if it doesn't exist yet. fixes #4249
git-svn-id: http://svn.automattic.com/wordpress/trunk@5455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 16:24:17 +00:00
rob1n
1fb3798eb5 Bring get_pagenum_link() into this century. Props Mark Jaquith. fixes #3930
git-svn-id: http://svn.automattic.com/wordpress/trunk@5454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-12 00:17:34 +00:00
rob1n
65454107d1 git-svn-id: http://svn.automattic.com/wordpress/trunk@5451 1a063a9b-81f0-0310-95a4-ce76da25c4cd 2007-05-11 04:02:30 +00:00
rob1n
492592d5ec Ugh. I thought I had fixed all of these.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 04:01:54 +00:00
rob1n
0b847d9933 Some fixes for the Textpattern importer.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:54:56 +00:00
rob1n
ac72ff2a42 Show authors' logins in alphabetical order. fixes #4232
git-svn-id: http://svn.automattic.com/wordpress/trunk@5448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:51:21 +00:00
rob1n
b354bc3813 Filter get_theme_data() data through KSES to get rid of evil XSS things. fixes #4236
git-svn-id: http://svn.automattic.com/wordpress/trunk@5447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:44:03 +00:00
rob1n
ee7d9e9e18 New status_header code, and WP-DB bail() errors send a 503 Service Unavailable. see #2409
Also, the new header code to text array has 302 as Found. fixes #4183


git-svn-id: http://svn.automattic.com/wordpress/trunk@5446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:34:50 +00:00
rob1n
f432ed648a Fix for PHP version 5.2.2 where $HTTP_RAW_POST_DATA isn't set. fixes #4248
git-svn-id: http://svn.automattic.com/wordpress/trunk@5445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:21:06 +00:00
rob1n
e6c189902c Use wp_parse_args(). fixes #4237
git-svn-id: http://svn.automattic.com/wordpress/trunk@5444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 03:10:05 +00:00
ryan
70c17cc871 Escapage
git-svn-id: http://svn.automattic.com/wordpress/trunk@5441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-11 00:56:12 +00:00
ryan
f7de9ede8a Handle local and remote blogroll imports. Props apokalyptik. fixes #4243 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 21:21:54 +00:00
ryan
272fbe5c8a Left, right, dragChange, hop. s/left/right/. Props Lawrence Pit. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 21:18:21 +00:00
ryan
58b1093938 Use correct var. Props charismabiz. fixes #4246 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 21:08:13 +00:00
ryan
93266da580 Add missing preg delimiter. see #4241
git-svn-id: http://svn.automattic.com/wordpress/trunk@5433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 16:37:44 +00:00
ryan
fec23e1837 Cast to array to avoid warning.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 16:32:11 +00:00
rob1n
b3165ed3c1 Make H2's in the admin wrap nice, and some CSS cleanup. Props JeremyVisser. fixes #4119
git-svn-id: http://svn.automattic.com/wordpress/trunk@5430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 02:52:22 +00:00
rob1n
26dfd309f6 Show WP-Adv TinyMCE button by default. Props johnbillion. fixes #3171
git-svn-id: http://svn.automattic.com/wordpress/trunk@5429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 02:42:00 +00:00
rob1n
56a1232923 Don't discard non-default args in wp_parse_args(). see #4237
git-svn-id: http://svn.automattic.com/wordpress/trunk@5428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 02:33:01 +00:00
ryan
28f3106ee9 Var is an object var. Add missing this.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 02:31:16 +00:00
rob1n
58839706d0 Let WebKit 420 or above get in. And clean up that overgrown ternary. Props Andy. fixes #4241
git-svn-id: http://svn.automattic.com/wordpress/trunk@5425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 01:31:12 +00:00
rob1n
ece3623070 Don't add port if port == 80 (default port). fixes #3993
git-svn-id: http://svn.automattic.com/wordpress/trunk@5424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 01:26:56 +00:00
ryan
17be568a6d Don't preg_match_all when processing items. fixes #4239 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-10 00:05:21 +00:00
ryan
6f6062af97 Obey show_post_count for dropdown.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-09 21:54:30 +00:00
matt
1fbc800c8b Knowing the version of the theme is pretty useless in this context, it's clutter.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-09 17:14:23 +00:00
ryan
a8c91f6c0b Include plugin.php before calling wp_die. fixes #4238 for 2.3.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-09 16:18:11 +00:00
matt
49407420a2 Don't forget to center this cell as well.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-09 08:12:54 +00:00
rob1n
1e30a12eb5 Bit of clean-up.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-09 04:19:19 +00:00
ryan
627725be1a Make sure wp_actions is set before counting.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-08 17:59:52 +00:00
ryan
bbad336b10 Don't send header from wp_die() if admin header already sent. fixes #4234 for 2.3.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-07 23:24:44 +00:00
ryan
481e505d49 Fix did_action to properly account for actions that have no callbacks attached.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-07 23:22:50 +00:00
ryan
ef4ad331e1 Add nonces to importers
git-svn-id: http://svn.automattic.com/wordpress/trunk@5404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-07 15:56:53 +00:00
ryan
9b1b9b2084 attribute_escape for widgets. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-07 02:16:28 +00:00
ryan
9805be9f11 Make sure Widgets menu comes after Themes. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-06 20:36:11 +00:00
ryan
23b99491a2 Fix widget registration back compat by splitting API. Fix feed widget. For 2.3. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-06 07:08:11 +00:00
rob1n
b6fc2cacce Add in missing delimiter. fixes #4226 for 2.0, 2.2 and 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-05 02:51:20 +00:00
rob1n
f7f55f0883 Don't set URL options if WP_HOME and or WP_SITEURL are defined. Props filosofo. fixes #4199
git-svn-id: http://svn.automattic.com/wordpress/trunk@5395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-05 00:19:25 +00:00
rob1n
69f36791f1 Use WP_HOME and WP_SITEURL in upgrading. Props filosofo. fixes #4211
git-svn-id: http://svn.automattic.com/wordpress/trunk@5394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-05 00:17:05 +00:00
rob1n
8638b7ab3a Return based on whether the hook was removed or not. Props mdawaffe. fixes #4223
Note that this will almost definitely *not* affect existing implementations. The way most code is set up now is to just call remove_filter() or remove_action().


git-svn-id: http://svn.automattic.com/wordpress/trunk@5393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 23:27:12 +00:00
rob1n
bc423b6e4c Use correct border order in classic theme's CSS. fixes #4225
git-svn-id: http://svn.automattic.com/wordpress/trunk@5392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 23:23:41 +00:00
ryan
3768d8363d eol-style everywhere
git-svn-id: http://svn.automattic.com/wordpress/trunk@5391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 21:48:43 +00:00
ryan
b33a7e9cfb Set eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 21:28:50 +00:00
ryan
e98183c527 Set eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 21:26:38 +00:00
ryan
b311e786fe Do a cap check at the top of widgets since it won't always inherit the menu cap check.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 17:52:22 +00:00
rob1n
48c85562b8 Don't reference old-style "levels," as they apparently used to call them back in the day.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 04:18:59 +00:00
rob1n
0a8b69c947 Don't take out class attribute for <abbr />, for hReview. fixes #3420
git-svn-id: http://svn.automattic.com/wordpress/trunk@5383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 03:52:11 +00:00
ryan
2cc75dbc63 Add 'Select' text to the dropdowns. Props Joseph Scott.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 02:23:49 +00:00
rob1n
ce488547e8 Sort page templates by name. Props Arrrr. see #2926
git-svn-id: http://svn.automattic.com/wordpress/trunk@5380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-03 04:41:22 +00:00
rob1n
0b1ce5d4f8 Apply get_nested_cats filter. Props davidhouse and Nazgul. fixes #2623
git-svn-id: http://svn.automattic.com/wordpress/trunk@5379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-03 04:34:07 +00:00
rob1n
7db9d9f6b2 Use fancy quotes instead of raw quotes (which should have been &quot; anyways).
git-svn-id: http://svn.automattic.com/wordpress/trunk@5378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-03 01:23:14 +00:00
rob1n
f8b2a63e57 Load order fixed.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-03 00:52:14 +00:00
rob1n
ab530a67d5 Don't show Widgets admin page if core widgets aren't enabled. fixes #4218
git-svn-id: http://svn.automattic.com/wordpress/trunk@5376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-03 00:43:57 +00:00
rob1n
2fff1e5671 Add lang and xml:lang attributes to allowed list for p, div and blockquote. fixes #4128
git-svn-id: http://svn.automattic.com/wordpress/trunk@5375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-02 04:31:30 +00:00
rob1n
37745efcae Spring cleaning, extreme edition.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-02 04:26:57 +00:00
rob1n
e5fb2523b4 Clean that mess up so it's more easily managed.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-02 04:17:43 +00:00
ryan
9e54a128b8 Call get_option('siteurl') outside the loop to save a few dozen get_option calls. Props andissimo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-02 00:32:22 +00:00
ryan
f20cad1508 Fix inline uploader page links. Props mdawaffe. fixes #4217 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 23:33:44 +00:00
ryan
b159bcacff Remove wp_ prefix from default widget class names. For back compat.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 22:51:52 +00:00
ryan
6658364b30 Set eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 17:46:55 +00:00
rob1n
b21f9bdc98 New way of loading widgets that works with PHP 5. Thanks to filosofo for testing. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 01:58:18 +00:00
rob1n
5339481434 Typo.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 01:27:46 +00:00
rob1n
4c26ea65a1 Add clearer to edit-pages.php. Props Nazgul. fixes #4210
git-svn-id: http://svn.automattic.com/wordpress/trunk@5361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 01:19:19 +00:00
rob1n
58d8ed1284 Move widget stuff around. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-01 01:13:06 +00:00
ryan
72a19935ff Widget registration fixes from Andy. For 2.3. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 20:02:02 +00:00
ryan
8efa935340 When using the traditional list view of the categories,
make sure the wp_list_categories() doesn't add in another title. This
was causing a second Categories to show up on the category widget.  Props Jospeh Scott

git-svn-id: http://svn.automattic.com/wordpress/trunk@5356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 17:43:11 +00:00
ryan
6c0b1d6a5f Fix typo breaking recent comment cache deletion for widgets.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 16:45:23 +00:00
ryan
f47ebf8582 unfiltered_upload fix from Nazgul. fixes #4136
git-svn-id: http://svn.automattic.com/wordpress/trunk@5353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 15:54:50 +00:00
ryan
247d22682a Remove debug
git-svn-id: http://svn.automattic.com/wordpress/trunk@5351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 03:47:14 +00:00
ryan
5fe0bd0c61 Don't use deprecated category API.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 03:32:33 +00:00
rob1n
a50e0e4c41 Bring back old behavior for sidebar ID's. Props filosofo. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 02:35:28 +00:00
rob1n
9ddfc38833 Fix stupid error on my part. Props abbaanthony. fixes #4208
git-svn-id: http://svn.automattic.com/wordpress/trunk@5347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-30 02:28:06 +00:00
rob1n
6f0a508666 Filter dashboard URL's. fixes #2177
git-svn-id: http://svn.automattic.com/wordpress/trunk@5346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-29 22:37:37 +00:00
rob1n
61059a3dc7 Check basename(). see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-29 21:00:54 +00:00
rob1n
32c3de1779 Automattically deactivate Automattic Widgets, if activated. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-29 20:53:29 +00:00
rob1n
b06cdd876f Move widgets' JS into the <head> of widgets.php. Should fix text/rss widget controls. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-29 20:16:26 +00:00
ryan
df9d590cbc Fix widget control registration where id is not passed in.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-28 17:04:16 +00:00
ryan
e5ea802c0c Fix edit comment links
git-svn-id: http://svn.automattic.com/wordpress/trunk@5340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-28 16:45:47 +00:00
ryan
72f35d050c Create widget id from widget name when id not specified.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-28 06:08:27 +00:00
ryan
a59fcf3c3a Kick widgets init from init hook.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-28 00:35:47 +00:00
ryan
b028d6eaa3 Some widgets gettext.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-28 00:29:27 +00:00
rob1n
638337cf4a Don't double encode gzip output if gzip is already set in php.ini. Props
welcomb. fixes #4205


git-svn-id: http://svn.automattic.com/wordpress/trunk@5333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 20:55:05 +00:00
matt
05996c589f Link it even if it's zero because it counts approved comments and you might want to go to that page even if there are no approved comments yet.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 05:30:23 +00:00
matt
8a486dfe60 Link that URL!
git-svn-id: http://svn.automattic.com/wordpress/trunk@5330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 05:23:53 +00:00
ryan
8aaa48e041 Use the right field name ya idjit.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 04:34:44 +00:00
ryan
d44752d2ca Consult global comment in get_comment(). Don't show empty edit links.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 03:51:36 +00:00
rob1n
8d6b81e175 Whoops, forgot widgets-rtl.css.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 02:39:22 +00:00
rob1n
007a086bcd Use non-GMT date. fixes #3034
git-svn-id: http://svn.automattic.com/wordpress/trunk@5326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 00:56:12 +00:00
rob1n
9843f9df79 Add Firefox bookmarking instructions. Props abelcheung. fixes #4203
git-svn-id: http://svn.automattic.com/wordpress/trunk@5325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 00:55:11 +00:00
rob1n
1f39b8dce7 Widgets RTL CSS, and a few little widget bugfixes. Props Sewar. fixes #4185
git-svn-id: http://svn.automattic.com/wordpress/trunk@5324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 00:51:19 +00:00
rob1n
44088f5463 Add id attribute where it's only name. fixes #3696
git-svn-id: http://svn.automattic.com/wordpress/trunk@5323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-27 00:47:01 +00:00
matt
93bd5ffe05 I think this got accidentally reverted.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 22:17:13 +00:00
ryan
cb6d5b0c4b Fix text and rss widget registration. fixes #4204 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 17:49:11 +00:00
ryan
6a307367a8 Add dropdown option to archives and categories widgets. Props Joseph Scott. fixes #4194 for 2.2
git-svn-id: http://svn.automattic.com/wordpress/trunk@5319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 17:17:30 +00:00
rob1n
85902939a7 Links widget fixes from Otto42. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 03:43:59 +00:00
rob1n
309491de6d WordPress.com -> .org and change widgetize link to Automattic's site for now. We still need to make a Codex page, just to make it more "WordPressy."
Props foolswisdom. fixes #4200


git-svn-id: http://svn.automattic.com/wordpress/trunk@5316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 02:13:18 +00:00
rob1n
2a03779965 Firefox uses Alt+Shift for access keys. Props johnbillion. fixes #4193
git-svn-id: http://svn.automattic.com/wordpress/trunk@5315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-26 02:02:59 +00:00
rob1n
b3d3d731ac Require once only. Props masquerade. fixes #4192
git-svn-id: http://svn.automattic.com/wordpress/trunk@5313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-25 04:41:12 +00:00
rob1n
1657ad3db3 Housekeeping -- a misspelling.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-25 03:14:11 +00:00
rob1n
bc90e51a2f Variable name fix. Props filosofo. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-25 03:02:28 +00:00
rob1n
129931fdcd Add admin_xml_ns to upload.php's <html>, since it doesn't use admin-header.php.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-25 00:56:22 +00:00
rob1n
d3f52c3b45 Allow number_format to be internationalized. Props nbachiyski. fixes #3677
git-svn-id: http://svn.automattic.com/wordpress/trunk@5308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-25 00:49:57 +00:00
rob1n
56add54053 Housekeeping -- clean out debug calls.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 23:58:51 +00:00
rob1n
559fa91b8d Add ODT to allowed file types. Props Nazgul. fixes #4136
git-svn-id: http://svn.automattic.com/wordpress/trunk@5304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 23:28:39 +00:00
rob1n
ea9d389751 Add unfiltered_upload cap, and allow for admins. Props Nazgul. fixes #4136
git-svn-id: http://svn.automattic.com/wordpress/trunk@5303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 23:27:20 +00:00
rob1n
534eeaf7bc get_edit_*_link() functions. fixes #4153
git-svn-id: http://svn.automattic.com/wordpress/trunk@5302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 23:21:56 +00:00
ryan
c03e74ab48 Update widgets to latest bits. see #4169
git-svn-id: http://svn.automattic.com/wordpress/trunk@5301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 21:36:17 +00:00
ryan
a0985c387b widgets.php be doubling down. Once is enough.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 18:41:42 +00:00
ryan
9426bb5642 Set eol-style on new files.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 18:40:02 +00:00
rob1n
03e6c2ed9a Widgets for 2.3. fixes #4186
git-svn-id: http://svn.automattic.com/wordpress/trunk@5297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-24 01:05:17 +00:00
ryan
c28054301c Fix variable collission in _get_cat_children. see #3985
git-svn-id: http://svn.automattic.com/wordpress/trunk@5295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-23 20:28:38 +00:00
rob1n
2e72244bde has_excerpt() template tag. fixes #4177 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-22 04:25:47 +00:00
ryan
be8f80d6d2 Use GMT in XML-RPC dateCreated fields. Props Joseph Scott. fixes #4158 for 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-22 03:07:34 +00:00
rob1n
eb2b42e800 Properly close the paragraph. Props zeo. fixes #4171 for both 2.2 and 2.3
git-svn-id: http://svn.automattic.com/wordpress/trunk@5290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-20 03:52:41 +00:00
ryan
978cf8aee5 2.3-alpha
git-svn-id: http://svn.automattic.com/wordpress/trunk@5288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-04-19 04:05:39 +00:00
228 changed files with 19621 additions and 12392 deletions

View File

@@ -3,12 +3,12 @@
<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" />
<link rel="stylesheet" href="wp-admin/css/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
<br /> Version 2.3
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
@@ -29,7 +29,7 @@
<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>
<h2>Upgrading from any previous WordPress to 2.3:</h2>
<ol>
<li>Delete your old WP files, saving ones you've modified.</li>
<li>Upload the new files.</li>

View 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'] );

View File

@@ -1,525 +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, EXTR_SKIP);
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, EXTR_SKIP);
$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'");
$wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
do_action('deleted_link', $link_id);
return true;
}
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'");
}
?>

View 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>
</html>

File diff suppressed because it is too large Load Diff

View 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');
}
?>

View 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);

View 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">
<!--

View 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

View File

@@ -91,7 +91,7 @@ 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>
@@ -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='. (int) $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='. (int) $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;

View File

@@ -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; }

View File

@@ -0,0 +1,12 @@
html {
direction: ltr;
}
#uploadoptions, table {
direction: rtl;
}
td {
padding: 1px 6px 0;
}
.submit {
text-align: left;
}

View File

@@ -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;
}

View 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 ul {
list-style-type: none;
width: 240px;
float: left;
margin: 0;
padding: 0;
.dropzone input {
display: none;
}
* .module, #lastmodule {
.dropzone ul {
float: left;
list-style-type: none;
width: 240px;
margin: 0;
min-height: 200px;
padding: 0;
display: block;
}
* .module {
width: 238px;
padding: 0;
margin: 5px 0;
@@ -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,53 +91,67 @@ body {
clear: left;
}
.placematt {
.placemat {
cursor: default;
margin: 10px 0 0;
margin: 0;
padding: 0;
width: 238px;
float:left;
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: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;
@@ -140,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;
}
@@ -211,4 +224,13 @@ body {
top: 0px;
left: 0px;
width: 100%;
}
}
#dragHelper {
position: absolute;
}
#dragHelper li.module {
display: block;
float: left;
}

View 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>

View 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>

View 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
@@ -88,7 +88,7 @@ $comments = array_slice($_comments, 0, 20);
$extra_comments = array_slice($_comments, 20);
$page_links = paginate_links( array(
'base' => add_query_arg( 'apage', '%#%' ),
'base' => add_query_arg( 'apage', '%#%' ),
'format' => '',
'total' => ceil($total / 20),
'current' => $page
@@ -151,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>
@@ -175,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 + '"); ?>')" />

View File

@@ -1,6 +1,6 @@
<?php
if ( isset($_GET['message']) )
$_GET['message'] = (int) $_GET['message'];
$_GET['message'] = (int) $_GET['message'];
$messages[1] = __('Post updated');
$messages[2] = __('Custom field updated');
$messages[3] = __('Custom field deleted.');
@@ -57,7 +57,7 @@ if (empty($post->post_status)) $post->post_status = 'draft';
<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
@@ -84,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>
<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>
<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>
@@ -115,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='" . (int) $o->ID . "' $selected>" . wp_specialchars( $o->display_name ) . "</option>";
endforeach;
?>
</select>
<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
</div>
</fieldset>
<?php endif; ?>
@@ -162,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 )
@@ -193,7 +194,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>';
}
?>

View File

@@ -6,6 +6,7 @@ $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment-
?>
<form name="post" action="comment.php" method="post" id="post">
<h2><?php echo $toprow_title; ?></h2>
<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
<div class="wrap">
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
@@ -32,7 +33,7 @@ addLoadEvent(focusit);
<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 attribute_escape( $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" />

View File

@@ -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>
<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)) {

View File

@@ -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'); ?>

View File

@@ -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>

View 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>

View File

@@ -170,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>';
}
?>

View 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>
<?php
wp('post_type=page&orderby=menu_order&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1&order=asc');
<br style="clear:both;" />
if ( $_GET['s'] )
$all = false;
else
$all = true;
<?php
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");
$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)
?>

117
wp-admin/edit-post-rows.php Normal file
View File

@@ -0,0 +1,117 @@
<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>

View 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'];
$_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'))
);
$drafts = get_users_drafts( $user_ID );
$other_drafts = get_others_drafts( $user_ID);
$avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'");
if ($drafts || $other_drafts) {
?>
<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');
if ( is_month() ) {
single_month_title(' ');
} elseif ( is_search() ) {
printf(__('Search for &#8220;%s&#8221;'), wp_specialchars($_GET['s']) );
} 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');
$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'];
}
?>
</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>
<?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;" />
<div class="wrap">
<?php
if ( 'pending' === $_GET['post_status'] ) {
$order = 'ASC';
$orderby = 'modified';
} elseif ( 'draft' === $_GET['post_status'] ) {
$order = 'DESC';
$orderby = 'modified';
} else {
$order = 'DESC';
$orderby = 'date';
}
wp("what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");
// 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>
<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>
<?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;
$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";
$arc_result = $wpdb->get_results( $arc_query );
$month_count = count($arc_result);
if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
<fieldset><legend><?php _e('Month&hellip;') ?></legend>
<select name='m'>
<option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Any'); ?></option>
<?php
foreach ($arc_result as $arc_row) {
if ( $arc_row->yyear == 0 )
continue;
$arc_row->mmonth = zeroise($arc_row->mmonth, 2);
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
$default = ' selected="selected"';
else
$default = '';
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>
</fieldset>
<?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 ($posts) {
$bgcolor = '';
while (have_posts()) : the_post();
add_filter('the_title','wp_specialchars');
$class = ('alternate' == $class) ? '' : 'alternate';
?>
<tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'>
<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>
<?php
<?php do_action('restrict_manage_posts'); ?>
foreach($posts_columns as $column_name=>$column_display_name) {
<br style="clear:both;" />
switch($column_name) {
case 'id':
?>
<th scope="row" style="text-align: center"><?php echo $id ?></th>
<?php
break;
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;
case 'categories':
?>
<td><?php the_category(','); ?></td>
<?php
break;
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;
case 'author':
?>
<td><?php the_author() ?></td>
<?php
break;
case 'control_view':
?>
<td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?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 ($posts)
?>
</tbody>
</table>
<?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'); ?>

View 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,42 +114,72 @@ 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;
}
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. -->
<!--
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.
-->
<!-- 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"
@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

View File

@@ -14,9 +14,9 @@ require_once ('admin-header.php');
// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
$import_root = ABSPATH.$import_loc;
$imports_dir = @ dir($import_root);
$imports_dir = @ opendir($import_root);
if ($imports_dir) {
while (($file = $imports_dir->read()) !== false) {
while (($file = readdir($imports_dir)) !== false) {
if ($file{0} == '.') {
continue;
} elseif (substr($file, -4) == '.php') {
@@ -24,6 +24,7 @@ if ($imports_dir) {
}
}
}
@closedir($imports_dir);
$importers = get_importers();

View File

@@ -84,7 +84,7 @@ class Blogger_Import {
if ( empty($this->blogs) ) {
$headers = array(
"GET /feeds/default/blogs HTTP/1.0",
"Host: www2.blogger.com",
"Host: www.blogger.com",
"Authorization: AuthSub token=\"$this->token\""
);
$request = join( "\r\n", $headers ) . "\r\n\r\n";
@@ -380,7 +380,9 @@ class Blogger_Import {
$entry = "<feed>$entry</feed>";
$AtomParser = new AtomParser();
$AtomParser->parse( $entry );
$this->import_post($AtomParser->entry);
$result = $this->import_post($AtomParser->entry);
if ( is_wp_error( $result ) )
return $result;
unset($AtomParser);
}
} else break;
@@ -509,15 +511,17 @@ class Blogger_Import {
$post_content = str_replace('<hr>', '<hr />', $post_content);
// Checks for duplicates
if (
isset( $this->blogs[$importing_blog]['posts'][$entry->old_permalink] ) ||
post_exists( $post_title, $post_content, $post_date )
) {
if ( isset( $this->blogs[$importing_blog]['posts'][$entry->old_permalink] ) ) {
++$this->blogs[$importing_blog]['posts_skipped'];
} elseif ( $post_id = post_exists( $post_title, $post_content, $post_date ) ) {
$this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id;
++$this->blogs[$importing_blog]['posts_skipped'];
} else {
$post = compact('post_date', 'post_content', 'post_title', 'post_status');
$post_id = wp_insert_post($post);
if ( is_wp_error( $post_id ) )
return $post_id;
wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id );
@@ -531,6 +535,7 @@ class Blogger_Import {
++$this->blogs[$importing_blog]['posts_done'];
}
$this->save_vars();
return;
}
function import_comment( $entry ) {
@@ -767,7 +772,9 @@ class Blogger_Import {
if ( isset( $_REQUEST['blog'] ) ) {
$blog = is_array($_REQUEST['blog']) ? array_shift( array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog'];
$blog = (int) $blog;
$this->import_blog( $blog );
$result = $this->import_blog( $blog );
if ( is_wp_error( $result ) )
echo $result->get_error_message();
} elseif ( isset($_GET['token']) )
$this->auth();
elseif ( $this->token && $this->token_is_valid() )
@@ -915,11 +922,11 @@ class AtomParser {
if(count($this->in_content) == 2) {
array_push($this->in_content, ">");
}
array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
} else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
$this->in_content = array();
$this->is_xhtml = $attrs['type'] == 'xhtml';
$this->is_xhtml = $attrs['type'] == 'xhtml';
array_push($this->in_content, array($tag,$this->depth));
} else if($tag == 'link') {
array_push($this->entry->links, $attrs);
@@ -935,7 +942,7 @@ class AtomParser {
$tag = array_pop(split(":", $name));
if(!empty($this->in_content)) {
if($this->in_content[0][0] == $tag &&
if($this->in_content[0][0] == $tag &&
$this->in_content[0][1] == $this->depth) {
array_shift($this->in_content);
if($this->is_xhtml) {
@@ -998,14 +1005,14 @@ class AtomParser {
}
}
}
}
}
return $name;
}
function xml_escape($string)
{
return str_replace(array('&','"',"'",'<','>'),
array('&amp;','&quot;','&apos;','&lt;','&gt;'),
return str_replace(array('&','"',"'",'<','>'),
array('&amp;','&quot;','&apos;','&lt;','&gt;'),
$string );
}
}

View File

@@ -91,6 +91,9 @@ class BW_Import {
printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
$postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
$post_id = wp_insert_post($postdata);
if ( is_wp_error( $post_id ) ) {
return $post_id;
}
if (!$post_id) {
_e("Couldn't get post ID");
echo '</li>';
@@ -155,7 +158,9 @@ class BW_Import {
}
$this->file = $file['file'];
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
return $result;
wp_import_cleanup($file['id']);
echo '<h3>';
@@ -176,7 +181,9 @@ class BW_Import {
$this->greet();
break;
case 1 :
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
$result->get_error_message();
break;
}

115
wp-admin/import/btt.php Normal file
View File

@@ -0,0 +1,115 @@
<?php
class BunnyTags_Import {
function header() {
echo '<div class="wrap">';
echo '<h2>'.__('Import Bunny&#8217;s Technorati Tags').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
}
function footer() {
echo '</div>';
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This imports tags from an existing Bunny&#8217;s Technorati Tags installation into this blog using the new WordPress native tagging structure.').'</p>';
echo '<p>'.__('This is suitable for Bunny&#8217;s Technorati Tags version 0.6.').'</p>';
echo '<p><strong>'.__('All existing Bunny&#8217;s Technorati Tags will be removed after import.').'</strong></p>';
echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
echo '<form action="admin.php?import=btt&amp;step=1" method="post">';
wp_nonce_field('import-btt');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Import Tags &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function dispatch() {
if ( empty($_GET['step']) )
$step = 0;
else
$step = abs(intval($_GET['step']));
// load the header
$this->header();
switch ( $step ) {
case 0 :
$this->greet();
break;
case 1 :
check_admin_referer('import-btt');
$this->check_post_keyword( true );
break;
case 2 :
check_admin_referer('import-btt');
$this->check_post_keyword( false );
break;
case 3:
$this->done();
break;
}
// load the footer
$this->footer();
}
function check_post_keyword($precheck = true) {
global $wpdb;
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading Bunny&#8217;s Technorati Tags&#8230;').'</h3></p>';
// import Bunny's Keywords tags
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'");
if ( !is_array($metakeys)) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
} else {
$count = count($metakeys);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> posts with tags were read.'), $count ) . '<br /></p>';
echo '<ul>';
foreach ( $metakeys as $post_meta ) {
if ( $post_meta->meta_value != '' ) {
$post_keys = explode(' ', $post_meta->meta_value);
foreach ( $post_keys as $keyword ) {
$keyword = addslashes(trim(str_replace('+',' ',$keyword)));
if ( '' != $keyword ) {
echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
if ( !$precheck )
wp_add_post_tags($post_meta->post_id, $keyword);
}
}
}
if ( !$precheck )
delete_post_meta($post_meta->post_id, 'tags');
}
echo '</ul>';
}
echo '<form action="admin.php?import=btt&amp;step='.($precheck? 2:3).'" method="post">';
wp_nonce_field('import-btt');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function done() {
echo '<div class="narrow">';
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
echo '</div>';
}
function BunnyTags_Import() {
}
}
// create the import object
$btt_import = new BunnyTags_Import();
// add it to the import page!
register_importer('btt', 'Bunny&#8217;s Technorati Tags', __('Import Bunny&#8217;s Technorati Tags into the new native tagging structure.'), array($btt_import, 'dispatch'));
?>

View File

@@ -7,18 +7,6 @@
/**
Add These Functions to make our lives easier
**/
if(!function_exists('get_catbynicename'))
{
function get_catbynicename($category_nicename)
{
global $wpdb;
$cat_id -= 0; // force numeric
$name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"');
return $name;
}
}
if(!function_exists('get_comment_count'))
{
@@ -29,15 +17,6 @@ if(!function_exists('get_comment_count'))
}
}
if(!function_exists('link_cat_exists'))
{
function link_cat_exists($catname)
{
global $wpdb;
return $wpdb->get_var('SELECT cat_id FROM '.$wpdb->linkcategories.' WHERE cat_name = "'.$wpdb->escape($catname).'"');
}
}
if(!function_exists('link_exists'))
{
function link_exists($linkname)
@@ -130,19 +109,19 @@ function textconv ($s) {
**/
class Dotclear_Import {
function header()
function header()
{
echo '<div class="wrap">';
echo '<h2>'.__('Import DotClear').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'</p>';
}
function footer()
function footer()
{
echo '</div>';
}
function greet()
function greet()
{
echo '<div class="narrow"><p>'.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'</p>';
echo '<p>'.__('Your DotClear Configuration settings are as follows:').'</p>';
@@ -385,6 +364,8 @@ class Dotclear_Import {
'ping_status' => $comment_status_map[$post_open_tb],
'comment_count' => $post_nb_comment + $post_nb_trackback)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
else
{
@@ -403,12 +384,17 @@ class Dotclear_Import {
'ping_status' => $comment_status_map[$post_open_tb],
'comment_count' => $post_nb_comment + $post_nb_trackback)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
$dcposts2wpposts[$post_id] = $ret_id;
// Make Post-to-Category associations
$cats = array();
if($cat1 = get_catbynicename($post_cat_name)) { $cats[1] = $cat1; }
$category1 = get_category_by_slug($post_cat_name);
$category1 = $category1->term_id;
if($cat1 = $category1) { $cats[1] = $cat1; }
if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
}
@@ -509,12 +495,11 @@ class Dotclear_Import {
extract($link);
if ($title != "") {
if ($cinfo = link_cat_exists (csc ($title))) {
$category = $cinfo;
if ($cinfo = is_term(csc ($title), 'link_category')) {
$category = $cinfo['term_id'];
} else {
$wpdb->query ("INSERT INTO $wpdb->linkcategories (cat_name) VALUES ('".
$wpdb->escape (csc ($title))."')");
$category = $wpdb->insert_id;
$category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category');
$category = $category['term_id'];
}
} else {
$linkname = $wpdb->escape(csc ($label));
@@ -581,7 +566,9 @@ class Dotclear_Import {
{
// Post Import
$posts = $this->get_dc_posts();
$this->posts2wp($posts);
$result = $this->posts2wp($posts);
if ( is_wp_error( $result ) )
return $result;
echo '<form action="admin.php?import=dotclear&amp;step=4" method="post">';
wp_nonce_field('import-dotclear');
@@ -729,7 +716,9 @@ class Dotclear_Import {
$this->import_users();
break;
case 3 :
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
case 4 :
$this->import_comments();

View File

@@ -233,6 +233,8 @@ class GM_Import {
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt');
$post_ID = wp_insert_post($postdata);
if ( is_wp_error( $post_ID ) )
return $post_ID;
}
$c=count($entry);
@@ -287,6 +289,7 @@ class GM_Import {
<p><?php _e('Completed GreyMatter import!') ?></p>
<?php
$this->footer();
return;
}
function dispatch() {
@@ -301,7 +304,9 @@ class GM_Import {
break;
case 1:
check_admin_referer('import-greymatter');
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
}
}

178
wp-admin/import/jkw.php Normal file
View File

@@ -0,0 +1,178 @@
<?php
class JeromesKeyword_Import {
function header() {
echo '<div class="wrap">';
echo '<h2>'.__('Import Jerome&#8217;s Keywords').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
}
function footer() {
echo '</div>';
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This imports tags from an existing Jerome&#8217;s Keywords installation into this blog using the new WordPress native tagging structure.').'</p>';
echo '<p>'.__('This is suitable for Jerome&#8217;s Keywords version 1.x and 2.0a.').'</p>';
echo '<p><strong>'.__('All existing Jerome&#8217;s Keywords will be removed after import.').'</strong></p>';
echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
echo '<form action="admin.php?import=jkw&amp;step=1" method="post">';
wp_nonce_field('import-jkw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Import Version 1.x &raquo;').'" /></p>';
echo '</form>';
echo '<form action="admin.php?import=jkw&amp;step=3" method="post">';
wp_nonce_field('import-jkw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Import Version 2.0a &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function dispatch() {
if ( empty($_GET['step']) )
$step = 0;
else
$step = abs(intval($_GET['step']));
// load the header
$this->header();
switch ( $step ) {
case 0 :
$this->greet();
break;
case 1 :
check_admin_referer('import-jkw');
$this->check_V1_post_keyword( true );
break;
case 2 :
check_admin_referer('import-jkw');
$this->check_V1_post_keyword( false );
break;
case 3 :
check_admin_referer('import-jkw');
$this->check_V2_post_keyword( true );
break;
case 4 :
check_admin_referer('import-jkw');
$this->check_V2_post_keyword( false );
break;
case 5:
check_admin_referer('import-jkw');
$this->cleanup_V2_import();
break;
case 6:
$this->done();
break;
}
// load the footer
$this->footer();
}
function check_V1_post_keyword($precheck = true) {
global $wpdb;
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';
// import Jerome's Keywords tags
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'");
if ( !is_array($metakeys)) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
} else {
$count = count($metakeys);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> posts with tags were read.'), $count ) . '<br /></p>';
echo '<ul>';
foreach ( $metakeys as $post_meta ) {
if ( $post_meta->meta_value != '' ) {
$post_keys = explode(',', $post_meta->meta_value);
foreach ( $post_keys as $keyword ) {
$keyword = addslashes(trim($keyword));
if ( '' != $keyword ) {
echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
if ( !$precheck )
wp_add_post_tags($post_meta->post_id, $keyword);
}
}
}
if ( !$precheck )
delete_post_meta($post_meta->post_id, 'keywords');
}
echo '</ul>';
}
echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 2:6).'" method="post">';
wp_nonce_field('import-jkw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function check_V2_post_keyword($precheck = true) {
global $wpdb;
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';
// import Jerome's Keywords tags
$tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1);
$metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename");
if ( !is_array($metakeys) ) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
} else {
$count = count($metakeys);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
echo '<ul>';
foreach ( $metakeys as $post_meta ) {
$keyword = addslashes(trim($post_meta->tag_name));
if ( $keyword != '' ) {
echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
if ( !$precheck )
wp_add_post_tags($post_meta->post_id, $keyword);
}
}
echo '</ul>';
}
echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 4:5).'" method="post">';
wp_nonce_field('import-jkw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function cleanup_V2_import() {
global $wpdb;
/* options from V2.0a (jeromes-keywords.php) */
$options = array('version', 'keywords_table', 'query_varname', 'template', 'meta_always_include', 'meta_includecats', 'meta_autoheader', 'search_strict', 'use_feed_cats', 'post_linkformat', 'post_tagseparator', 'post_includecats', 'post_notagstext', 'cloud_linkformat', 'cloud_tagseparator', 'cloud_includecats', 'cloud_sortorder', 'cloud_displaymax', 'cloud_displaymin', 'cloud_scalemax', 'cloud_scalemin');
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1));
foreach ( $options as $o )
delete_option('jkeywords_' . $o);
$this->done();
}
function done() {
echo '<div class="narrow">';
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
echo '</div>';
}
function JeromesKeyword_Import() {
}
}
// create the import object
$jkw_import = new JeromesKeyword_Import();
// add it to the import page!
register_importer('jkw', 'Jerome&#8217;s Keywords', __('Import Jerome&#8217;s Keywords into the new native tagging structure.'), array($jkw_import, 'dispatch'));
?>

View File

@@ -49,7 +49,7 @@ class LJ_Import {
preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date);
$post_date = strtotime($post_date[1]);
$post_date = gmdate('Y-m-d H:i:s', $post_date);
$post_date = date('Y-m-d H:i:s', $post_date);
preg_match('|<event>(.*?)</event>|is', $post, $post_content);
$post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1]));
@@ -71,6 +71,8 @@ class LJ_Import {
printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
$postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
$post_id = wp_insert_post($postdata);
if ( is_wp_error( $post_id ) )
return $post_id;
if (!$post_id) {
_e("Couldn't get post ID");
echo '</li>';
@@ -132,7 +134,9 @@ class LJ_Import {
}
$this->file = $file['file'];
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
return $result;
wp_import_cleanup($file['id']);
echo '<h3>';
@@ -154,7 +158,9 @@ class LJ_Import {
break;
case 1 :
check_admin_referer('import-upload');
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
}

View File

@@ -22,9 +22,18 @@ class MT_Import {
$this->header();
?>
<div class="narrow">
<p><?php _e('Howdy! We&#8217;re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, choose a file to upload and click Upload file and import.'); ?></p>
<p><?php _e('Howdy! We&#8217;re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
<form method="post" action="<?php echo add_query_arg('step', 1); ?>" class="import-upload-form">
<?php wp_nonce_field('import-upload'); ?>
<p>
<input type="hidden" name="upload_type" value="ftp" />
<?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p>
<p class="submit">
<input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt &raquo;')); ?>" />
</p>
</form>
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
</div>
<?php
$this->footer();
@@ -75,25 +84,27 @@ class MT_Import {
return $user_id;
}
function get_entries() {
set_magic_quotes_runtime(0);
$importdata = file($this->file); // Read the file into an array
$importdata = implode('', $importdata); // squish it
$importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
$importdata = preg_replace("/\n--------\n/", "--MT-ENTRY--\n", $importdata);
$this->posts = explode("--MT-ENTRY--", $importdata);
}
function get_mt_authors() {
$temp = array ();
$i = -1;
foreach ($this->posts as $post) {
if ('' != trim($post)) {
++ $i;
preg_match("|AUTHOR:(.*)|", $post, $thematch);
$thematch = trim($thematch[1]);
array_push($temp, "$thematch"); //store the extracted author names in a temporary array
}
$temp = array();
$authors = array();
$handle = fopen($this->file, 'r');
if ( $handle == null )
return false;
$in_comment = false;
while ( $line = fgets($handle) ) {
$line = trim($line);
if ( 'COMMENT:' == $line )
$in_comment = true;
else if ( '-----' == $line )
$in_comment = false;
if ( $in_comment || 0 !== strpos($line,"AUTHOR:") )
continue;
$temp[] = trim( substr($line, strlen("AUTHOR:")) );
}
//we need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
@@ -105,6 +116,8 @@ class MT_Import {
array_push($authors, "$next");
}
fclose($handle);
return $authors;
}
@@ -138,7 +151,7 @@ class MT_Import {
?>
<div class="wrap">
<h2><?php _e('Assign Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?></p>
<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
<p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p>
<?php
@@ -156,14 +169,20 @@ class MT_Import {
echo '</li>';
}
echo '<input type="submit" value="'.__('Submit').'">'.'<br/>';
echo '<input type="submit" value="'.__('Submit').'">'.'<br />';
echo '</form>';
echo '</ol></div>';
}
function select_authors() {
$file = wp_import_handle_upload();
if ( $_POST['upload_type'] === 'ftp' ) {
$file['file'] = ABSPATH . 'wp-content/mt-export.txt';
if ( !file_exists($file['file']) )
$file['error'] = __('<code>mt-export.txt</code> does not exist');
} else {
$file = wp_import_handle_upload();
}
if ( isset($file['error']) ) {
$this->header();
echo '<p>'.__('Sorry, there has been an error').'.</p>';
@@ -174,237 +193,235 @@ class MT_Import {
$this->file = $file['file'];
$this->id = (int) $file['id'];
$this->get_entries();
$this->mt_authors_form();
}
function save_post(&$post, &$comments, &$pings) {
// Reset the counter
set_time_limit(30);
$post = get_object_vars($post);
$post = add_magic_quotes($post);
$post = (object) $post;
if ( $post_id = post_exists($post->post_title, '', $post->post_date) ) {
echo '<li>';
printf(__('Post <i>%s</i> already exists.'), stripslashes($post->post_title));
} else {
echo '<li>';
printf(__('Importing post <i>%s</i>...'), stripslashes($post->post_title));
if ( '' != trim( $post->extended ) )
$post->post_content .= "\n<!--more-->\n$post->extended";
$post->post_author = $this->checkauthor($post->post_author); //just so that if a post already exists, new users are not created by checkauthor
$post_id = wp_insert_post($post);
if ( is_wp_error( $post_id ) )
return $post_id;
// Add categories.
if ( 0 != count($post->categories) ) {
wp_create_categories($post->categories, $post_id);
}
}
$num_comments = 0;
foreach ( $comments as $comment ) {
$comment = get_object_vars($comment);
$comment = add_magic_quotes($comment);
if ( !comment_exists($comment['comment_author'], $comment['comment_date'])) {
$comment['comment_post_ID'] = $post_id;
$comment = wp_filter_comment($comment);
wp_insert_comment($comment);
$num_comments++;
}
}
if ( $num_comments )
printf(' '.__('(%s comments)'), $num_comments);
$num_pings = 0;
foreach ( $pings as $ping ) {
$ping = get_object_vars($ping);
$ping = add_magic_quotes($ping);
if ( !comment_exists($ping['comment_author'], $ping['comment_date'])) {
$ping['comment_content'] = "<strong>{$ping['title']}</strong>\n\n{$ping['comment_content']}";
$ping['comment_post_ID'] = $post_id;
$ping = wp_filter_comment($ping);
wp_insert_comment($ping);
$num_pings++;
}
}
if ( $num_pings )
printf(' '.__('(%s pings)'), $num_pings);
echo "</li>";
//ob_flush();flush();
}
function process_posts() {
global $wpdb;
$i = -1;
$handle = fopen($this->file, 'r');
if ( $handle == null )
return false;
$context = '';
$post = new StdClass();
$comment = new StdClass();
$comments = array();
$ping = new StdClass();
$pings = array();
echo "<div class='wrap'><ol>";
foreach ($this->posts as $post) {
if ('' != trim($post)) {
++ $i;
unset ($post_categories);
// Take the pings out first
preg_match("|(-----\n\nPING:.*)|s", $post, $pings);
$post = preg_replace("|(-----\n\nPING:.*)|s", '', $post);
while ( $line = fgets($handle) ) {
$line = trim($line);
// Then take the comments out
preg_match("|(-----\nCOMMENT:.*)|s", $post, $comments);
$post = preg_replace("|(-----\nCOMMENT:.*)|s", '', $post);
// We ignore the keywords
$post = preg_replace("|(-----\nKEYWORDS:.*)|s", '', $post);
// We want the excerpt
preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt);
$post_excerpt = $wpdb->escape(trim($excerpt[1]));
$post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post);
// We're going to put extended body into main body with a more tag
preg_match("|-----\nEXTENDED BODY:(.*)|s", $post, $extended);
$extended = trim($extended[1]);
if ('' != $extended)
$extended = "\n<!--more-->\n$extended";
$post = preg_replace("|(-----\nEXTENDED BODY:.*)|s", '', $post);
// Now for the main body
preg_match("|-----\nBODY:(.*)|s", $post, $body);
$body = trim($body[1]);
$post_content = $wpdb->escape($body.$extended);
$post = preg_replace("|(-----\nBODY:.*)|s", '', $post);
// Grab the metadata from what's left
$metadata = explode("\n", $post);
foreach ($metadata as $line) {
preg_match("/^(.*?):(.*)/", $line, $token);
$key = trim($token[1]);
$value = trim($token[2]);
// Now we decide what it is and what to do with it
switch ($key) {
case '' :
break;
case 'AUTHOR' :
$post_author = $value;
break;
case 'TITLE' :
$post_title = $wpdb->escape($value);
break;
case 'STATUS' :
// "publish" and "draft" enumeration items match up; no change required
$post_status = $value;
if (empty ($post_status))
$post_status = 'publish';
break;
case 'ALLOW COMMENTS' :
$post_allow_comments = $value;
if ($post_allow_comments == 1) {
$comment_status = 'open';
} else {
$comment_status = 'closed';
}
break;
case 'CONVERT BREAKS' :
$post_convert_breaks = $value;
break;
case 'ALLOW PINGS' :
$ping_status = trim($meta[2][0]);
if ($ping_status == 1) {
$ping_status = 'open';
} else {
$ping_status = 'closed';
}
break;
case 'PRIMARY CATEGORY' :
if (! empty ($value) )
$post_categories[] = $wpdb->escape($value);
break;
case 'CATEGORY' :
if (! empty ($value) )
$post_categories[] = $wpdb->escape($value);
break;
case 'DATE' :
$post_modified = strtotime($value);
$post_modified = date('Y-m-d H:i:s', $post_modified);
$post_modified_gmt = get_gmt_from_date("$post_modified");
$post_date = $post_modified;
$post_date_gmt = $post_modified_gmt;
break;
default :
// echo "\n$key: $value";
break;
} // end switch
} // End foreach
// Let's check to see if it's in already
if ($post_id = post_exists($post_title, '', $post_date)) {
echo '<li>';
printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
} else {
echo '<li>';
printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt');
$post_id = wp_insert_post($postdata);
// Add categories.
if (0 != count($post_categories)) {
wp_create_categories($post_categories, $post_id);
}
if ( '-----' == $line ) {
// Finishing a multi-line field
if ( 'comment' == $context ) {
$comments[] = $comment;
$comment = new StdClass();
} else if ( 'ping' == $context ) {
$pings[] = $ping;
$ping = new StdClass();
}
$comment_post_ID = (int) $post_id;
$comment_approved = 1;
// Now for comments
$comments = explode("-----\nCOMMENT:", $comments[0]);
$num_comments = 0;
foreach ($comments as $comment) {
if ('' != trim($comment)) {
// Author
preg_match("|AUTHOR:(.*)|", $comment, $comment_author);
$comment_author = $wpdb->escape(trim($comment_author[1]));
$comment = preg_replace('|(\n?AUTHOR:.*)|', '', $comment);
preg_match("|EMAIL:(.*)|", $comment, $comment_author_email);
$comment_author_email = $wpdb->escape(trim($comment_author_email[1]));
$comment = preg_replace('|(\n?EMAIL:.*)|', '', $comment);
preg_match("|IP:(.*)|", $comment, $comment_author_IP);
$comment_author_IP = trim($comment_author_IP[1]);
$comment = preg_replace('|(\n?IP:.*)|', '', $comment);
preg_match("|URL:(.*)|", $comment, $comment_author_url);
$comment_author_url = $wpdb->escape(trim($comment_author_url[1]));
$comment = preg_replace('|(\n?URL:.*)|', '', $comment);
preg_match("|DATE:(.*)|", $comment, $comment_date);
$comment_date = trim($comment_date[1]);
$comment_date = date('Y-m-d H:i:s', strtotime($comment_date));
$comment = preg_replace('|(\n?DATE:.*)|', '', $comment);
$comment_content = $wpdb->escape(trim($comment));
$comment_content = str_replace('-----', '', $comment_content);
// Check if it's already there
if (!comment_exists($comment_author, $comment_date)) {
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
$commentdata = wp_filter_comment($commentdata);
wp_insert_comment($commentdata);
$num_comments++;
}
}
$context = '';
} else if ( '--------' == $line ) {
// Finishing a post.
$context = '';
$result = $this->save_post($post, $comments, $pings);
if ( is_wp_error( $result ) )
return $result;
$post = new StdClass;
$comment = new StdClass();
$ping = new StdClass();
$comments = array();
$pings = array();
} else if ( 'BODY:' == $line ) {
$context = 'body';
} else if ( 'EXTENDED BODY:' == $line ) {
$context = 'extended';
} else if ( 'EXCERPT:' == $line ) {
$context = 'excerpt';
} else if ( 'KEYWORDS:' == $line ) {
$context = 'keywords';
} else if ( 'COMMENT:' == $line ) {
$context = 'comment';
} else if ( 'PING:' == $line ) {
$context = 'ping';
} else if ( 0 === strpos($line, "AUTHOR:") ) {
$author = trim( substr($line, strlen("AUTHOR:")) );
if ( '' == $context )
$post->post_author = $author;
else if ( 'comment' == $context )
$comment->comment_author = $author;
} else if ( 0 === strpos($line, "TITLE:") ) {
$title = trim( substr($line, strlen("TITLE:")) );
if ( '' == $context )
$post->post_title = $title;
else if ( 'ping' == $context )
$ping->title = $title;
} else if ( 0 === strpos($line, "STATUS:") ) {
$status = trim( substr($line, strlen("STATUS:")) );
if ( empty($status) )
$status = 'publish';
$post->post_status = $status;
} else if ( 0 === strpos($line, "ALLOW COMMENTS:") ) {
$allow = trim( substr($line, strlen("ALLOW COMMENTS:")) );
if ( $allow == 1 )
$post->comment_status = 'open';
else
$post->comment_status = 'closed';
} else if ( 0 === strpos($line, "ALLOW PINGS:") ) {
$allow = trim( substr($line, strlen("ALLOW PINGS:")) );
if ( $allow == 1 )
$post->ping_status = 'open';
else
$post->ping_status = 'closed';
} else if ( 0 === strpos($line, "CATEGORY:") ) {
$category = trim( substr($line, strlen("CATEGORY:")) );
if ( '' != $category )
$post->categories[] = $category;
} else if ( 0 === strpos($line, "PRIMARY CATEGORY:") ) {
$category = trim( substr($line, strlen("PRIMARY CATEGORY:")) );
if ( '' != $category )
$post->categories[] = $category;
} else if ( 0 === strpos($line, "DATE:") ) {
$date = trim( substr($line, strlen("DATE:")) );
$date = strtotime($date);
$date = date('Y-m-d H:i:s', $date);
$date_gmt = get_gmt_from_date($date);
if ( '' == $context ) {
$post->post_modified = $date;
$post->post_modified_gmt = $date_gmt;
$post->post_date = $date;
$post->post_date_gmt = $date_gmt;
} else if ( 'comment' == $context ) {
$comment->comment_date = $date;
} else if ( 'ping' == $context ) {
$ping->comment_date = $date;
}
if ( $num_comments )
printf(' '.__('(%s comments)'), $num_comments);
} else if ( 0 === strpos($line, "EMAIL:") ) {
$email = trim( substr($line, strlen("EMAIL:")) );
if ( 'comment' == $context )
$comment->comment_author_email = $email;
else
$ping->comment_author_email = '';
} else if ( 0 === strpos($line, "IP:") ) {
$ip = trim( substr($line, strlen("IP:")) );
if ( 'comment' == $context )
$comment->comment_author_IP = $ip;
else
$ping->comment_author_IP = $ip;
} else if ( 0 === strpos($line, "URL:") ) {
$url = trim( substr($line, strlen("URL:")) );
if ( 'comment' == $context )
$comment->comment_author_url = $url;
else
$ping->comment_author_url = $url;
} else if ( 0 === strpos($line, "BLOG NAME:") ) {
$blog = trim( substr($line, strlen("BLOG NAME:")) );
$ping->comment_author = $blog;
} else {
// Processing multi-line field, check context.
// Finally the pings
// fix the double newline on the first one
$pings[0] = str_replace("-----\n\n", "-----\n", $pings[0]);
$pings = explode("-----\nPING:", $pings[0]);
$num_pings = 0;
foreach ($pings as $ping) {
if ('' != trim($ping)) {
// 'Author'
preg_match("|BLOG NAME:(.*)|", $ping, $comment_author);
$comment_author = $wpdb->escape(trim($comment_author[1]));
$ping = preg_replace('|(\n?BLOG NAME:.*)|', '', $ping);
preg_match("|IP:(.*)|", $ping, $comment_author_IP);
$comment_author_IP = trim($comment_author_IP[1]);
$ping = preg_replace('|(\n?IP:.*)|', '', $ping);
preg_match("|URL:(.*)|", $ping, $comment_author_url);
$comment_author_url = $wpdb->escape(trim($comment_author_url[1]));
$ping = preg_replace('|(\n?URL:.*)|', '', $ping);
preg_match("|DATE:(.*)|", $ping, $comment_date);
$comment_date = trim($comment_date[1]);
$comment_date = date('Y-m-d H:i:s', strtotime($comment_date));
$ping = preg_replace('|(\n?DATE:.*)|', '', $ping);
preg_match("|TITLE:(.*)|", $ping, $ping_title);
$ping_title = $wpdb->escape(trim($ping_title[1]));
$ping = preg_replace('|(\n?TITLE:.*)|', '', $ping);
$comment_content = $wpdb->escape(trim($ping));
$comment_content = str_replace('-----', '', $comment_content);
$comment_content = "<strong>$ping_title</strong>\n\n$comment_content";
$comment_type = 'trackback';
// Check if it's already there
if (!comment_exists($comment_author, $comment_date)) {
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_type', 'comment_approved');
$commentdata = wp_filter_comment($commentdata);
wp_insert_comment($commentdata);
$num_pings++;
}
}
$line .= "\n";
if ( 'body' == $context ) {
$post->post_content .= $line;
} else if ( 'extended' == $context ) {
$post->extended .= $line;
} else if ( 'excerpt' == $context ) {
$post->post_excerpt .= $line;
} else if ( 'comment' == $context ) {
$comment->comment_content .= $line;
} else if ( 'ping' == $context ) {
$ping->comment_content .= $line;
}
if ( $num_pings )
printf(' '.__('(%s pings)'), $num_pings);
echo "</li>";
}
}
echo '</ol>';
wp_import_cleanup($this->id);
do_action('import_done', 'mt');
echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3></div>';
}
function import() {
$this->id = (int) $_GET['id'];
$this->file = get_attached_file($this->id);
if ( $this->id == 0 )
$this->file = ABSPATH . 'wp-content/mt-export.txt';
else
$this->file = get_attached_file($this->id);
$this->get_authors_from_post();
$this->get_entries();
$this->process_posts();
$result = $this->process_posts();
if ( is_wp_error( $result ) )
return $result;
}
function dispatch() {
@@ -423,7 +440,9 @@ class MT_Import {
break;
case 2:
check_admin_referer('import-mt');
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
}
}
@@ -436,4 +455,4 @@ class MT_Import {
$mt_import = new MT_Import();
register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog'), array ($mt_import, 'dispatch'));
?>
?>

View File

@@ -110,6 +110,8 @@ class RSS_Import {
_e('Post already imported');
} else {
$post_id = wp_insert_post($post);
if ( is_wp_error( $post_id ) )
return $post_id;
if (!$post_id) {
_e("Couldn't get post ID");
return;
@@ -135,7 +137,9 @@ class RSS_Import {
$this->file = $file['file'];
$this->get_posts();
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
return $result;
wp_import_cleanup($file['id']);
echo '<h3>';
@@ -157,7 +161,9 @@ class RSS_Import {
break;
case 1 :
check_admin_referer('import-upload');
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
}

155
wp-admin/import/stp.php Normal file
View File

@@ -0,0 +1,155 @@
<?php
class STP_Import {
function header() {
echo '<div class="wrap">';
echo '<h2>'.__('Import Simple Tagging').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
}
function footer() {
echo '</div>';
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This imports tags from an existing Simple Tagging 1.6.2 installation into this blog using the new WordPress native tagging structure.').'</p>';
echo '<p>'.__('This has not been tested on any other versions of Simple Tagging. Mileage may vary.').'</p>';
echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 4-step program to help you kick that nasty Simple Tagging habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
echo '<form action="admin.php?import=stp&amp;step=1" method="post">';
wp_nonce_field('import-stp');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 1 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function dispatch () {
if ( empty( $_GET['step'] ) ) {
$step = 0;
} else {
$step = (int) $_GET['step'];
}
// load the header
$this->header();
switch ( $step ) {
case 0 :
$this->greet();
break;
case 1 :
check_admin_referer('import-stp');
$this->import_posts();
break;
case 2:
check_admin_referer('import-stp');
$this->import_t2p();
break;
case 3:
check_admin_referer('import-stp');
$this->cleanup_import();
break;
}
// load the footer
$this->footer();
}
function import_posts ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading STP Post Tags&#8230;').'</h3></p>';
// read in all the STP tag -> post settings
$posts = $this->get_stp_posts();
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($posts) ) {
echo '<p>' . __('No posts were found to have tags!') . '</p>';
return false;
}
else {
// if there's an existing entry, delete it
if ( get_option('stpimp_posts') ) {
delete_option('stpimp_posts');
}
add_option('stpimp_posts', $posts);
$count = count($posts);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
}
echo '<form action="admin.php?import=stp&amp;step=2" method="post">';
wp_nonce_field('import-stp');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function import_t2p ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Adding Tags to Posts&#8230;').'</h3></p>';
// run that funky magic!
$tags_added = $this->tag2post();
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
echo '<form action="admin.php?import=stp&amp;step=3" method="post">';
wp_nonce_field('import-stp');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 3 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function get_stp_posts ( ) {
global $wpdb;
// read in all the posts from the STP post->tag table: should be wp_post2tag
$posts_query = "SELECT post_id, tag_name FROM " . $wpdb->prefix . "stp_tags";
$posts = $wpdb->get_results($posts_query);
return $posts;
}
function tag2post ( ) {
global $wpdb;
// get the tags and posts we imported in the last 2 steps
$posts = get_option('stpimp_posts');
// null out our results
$tags_added = 0;
// loop through each post and add its tags to the db
foreach ( $posts as $this_post ) {
$the_post = (int) $this_post->post_id;
$the_tag = $wpdb->escape($this_post->tag_name);
// try to add the tag
wp_add_post_tags($the_post, $the_tag);
$tags_added++;
}
// that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
return $tags_added;
}
function cleanup_import ( ) {
delete_option('stpimp_posts');
$this->done();
}
function done ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
echo '<p>' . __('OK, so we lied about this being a 4-step program! You&#8217;re done!') . '</p>';
echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';
echo '</div>';
}
function STP_Import ( ) {
// Nothing.
}
}
// create the import object
$stp_import = new STP_Import();
// add it to the import page!
register_importer('stp', 'Simple Tagging', __('Import Simple Tagging tags into the new native tagging structure.'), array($stp_import, 'dispatch'));
?>

View File

@@ -2,18 +2,6 @@
/**
Add These Functions to make our lives easier
**/
if(!function_exists('get_catbynicename'))
{
function get_catbynicename($category_nicename)
{
global $wpdb;
$cat_id -= 0; // force numeric
$name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"');
return $name;
}
}
if(!function_exists('get_comment_count'))
{
@@ -38,14 +26,14 @@ if(!function_exists('link_exists'))
**/
class Textpattern_Import {
function header()
function header()
{
echo '<div class="wrap">';
echo '<h2>'.__('Import Textpattern').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'</p>';
}
function footer()
function footer()
{
echo '</div>';
}
@@ -317,6 +305,8 @@ class Textpattern_Import {
'post_name' => $url_title,
'comment_count' => $comments_count)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
else
{
@@ -333,13 +323,19 @@ class Textpattern_Import {
'post_name' => $url_title,
'comment_count' => $comments_count)
);
if ( is_wp_error( $ret_id ) )
return $ret_id;
}
$txpposts2wpposts[$ID] = $ret_id;
// Make Post-to-Category associations
$cats = array();
if($cat1 = get_catbynicename($Category1)) { $cats[1] = $cat1; }
if($cat2 = get_catbynicename($Category2)) { $cats[2] = $cat2; }
$category1 = get_category_by_slug($Category1);
$category1 = $category1->term_id;
$category2 = get_category_by_slug($Category2);
$category2 = $category1->term_id;
if($cat1 = $category1) { $cats[1] = $cat1; }
if($cat2 = $category2) { $cats[2] = $cat2; }
if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
}
@@ -506,7 +502,9 @@ class Textpattern_Import {
{
// Post Import
$posts = $this->get_txp_posts();
$this->posts2wp($posts);
$result = $this->posts2wp($posts);
if ( is_wp_error( $result ) )
return $result;
echo '<form action="admin.php?import=textpattern&amp;step=4" method="post">';
wp_nonce_field('import-textpattern');
@@ -559,11 +557,11 @@ class Textpattern_Import {
{
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
echo '<h3>'.__('Users').'</h3>';
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn&#8217;t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
echo '<p>'.__('Also, since you\'re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
echo '<p>'.__('Also, since you&#8217;re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You&#8217;ll want it.').'</p>';
echo '<h3>'.__('WordPress Resources').'</h3>';
echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>';
echo '<ul>';
@@ -571,7 +569,7 @@ class Textpattern_Import {
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>';
echo '<p>'.sprintf(__('That&#8217;s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
}
function db_form()
@@ -646,7 +644,9 @@ class Textpattern_Import {
$this->import_users();
break;
case 3 :
$this->import_posts();
$result = $this->import_posts();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
case 4 :
$this->import_comments();

276
wp-admin/import/utw.php Normal file
View File

@@ -0,0 +1,276 @@
<?php
class UTW_Import {
function header() {
echo '<div class="wrap">';
echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>';
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
}
function footer() {
echo '</div>';
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This imports tags from an existing Ultimate Tag Warrior 3 installation into this blog using the new WordPress native tagging structure.').'</p>';
echo '<p>'.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'</p>';
echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
echo '<form action="admin.php?import=utw&amp;step=1" method="post">';
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 1 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function dispatch () {
if ( empty( $_GET['step'] ) ) {
$step = 0;
} else {
$step = (int) $_GET['step'];
}
if ( $step > 1 )
check_admin_referer('import-utw');
// load the header
$this->header();
switch ( $step ) {
case 0 :
$this->greet();
break;
case 1 :
$this->import_tags();
break;
case 2 :
$this->import_posts();
break;
case 3:
$this->import_t2p();
break;
case 4:
$this->cleanup_import();
break;
}
// load the footer
$this->footer();
}
function import_tags ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>';
$tags = $this->get_utw_tags();
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($tags) ) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
}
else {
// if there's an existing entry, delete it
if ( get_option('utwimp_tags') ) {
delete_option('utwimp_tags');
}
add_option('utwimp_tags', $tags);
$count = count($tags);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
echo '<p>' . __('The following tags were found:') . '</p>';
echo '<ul>';
foreach ( $tags as $tag_id => $tag_name ) {
echo '<li>' . $tag_name . '</li>';
}
echo '</ul>';
echo '<br />';
echo '<p>' . __('If you don&#8217;t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>';
}
echo '<form action="admin.php?import=utw&amp;step=2" method="post">';
wp_nonce_field('import-utw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function import_posts ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Reading UTW Post Tags&#8230;').'</h3></p>';
// read in all the UTW tag -> post settings
$posts = $this->get_utw_posts();
// if we didn't get any tags back, that's all there is folks!
if ( !is_array($posts) ) {
echo '<p>' . __('No posts were found to have tags!') . '</p>';
return false;
}
else {
// if there's an existing entry, delete it
if ( get_option('utwimp_posts') ) {
delete_option('utwimp_posts');
}
add_option('utwimp_posts', $posts);
$count = count($posts);
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
}
echo '<form action="admin.php?import=utw&amp;step=3" method="post">';
wp_nonce_field('import-utw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 3 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function import_t2p ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Adding Tags to Posts&#8230;').'</h3></p>';
// run that funky magic!
$tags_added = $this->tag2post();
echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
wp_nonce_field('import-utw');
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 4 &raquo;').'" /></p>';
echo '</form>';
echo '</div>';
}
function get_utw_tags ( ) {
global $wpdb;
// read in all the tags from the UTW tags table: should be wp_tags
$tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags";
$tags = $wpdb->get_results($tags_query);
// rearrange these tags into something we can actually use
foreach ( $tags as $tag ) {
$new_tags[$tag->tag_id] = $tag->tag;
}
return $new_tags;
}
function get_utw_posts ( ) {
global $wpdb;
// read in all the posts from the UTW post->tag table: should be wp_post2tag
$posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag";
$posts = $wpdb->get_results($posts_query);
return $posts;
}
function tag2post ( ) {
// get the tags and posts we imported in the last 2 steps
$tags = get_option('utwimp_tags');
$posts = get_option('utwimp_posts');
// null out our results
$tags_added = 0;
// loop through each post and add its tags to the db
foreach ( $posts as $this_post ) {
$the_post = (int) $this_post->post_id;
$the_tag = (int) $this_post->tag_id;
// what's the tag name for that id?
$the_tag = $tags[$the_tag];
// screw it, just try to add the tag
wp_add_post_tags($the_post, $the_tag);
$tags_added++;
}
// that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
return $tags_added;
}
function cleanup_import ( ) {
delete_option('utwimp_tags');
delete_option('utwimp_posts');
$this->done();
}
function done ( ) {
echo '<div class="narrow">';
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
echo '<p>' . __('OK, so we lied about this being a 5-step program! You&#8217;re done!') . '</p>';
echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';
echo '</div>';
}
function UTW_Import ( ) {
// Nothing.
}
}
// create the import object
$utw_import = new UTW_Import();
// add it to the import page!
register_importer('utw', 'Ultimate Tag Warrior', __('Import Ultimate Tag Warrior tags into the new native tagging structure.'), array($utw_import, 'dispatch'));
?>

View File

@@ -44,7 +44,7 @@ class WP_Import {
function users_form($n) {
global $wpdb, $testing;
$users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
$users = $wpdb->get_results("SELECT user_login FROM $wpdb->users ORDER BY user_login");
?><select name="userselect[<?php echo $n; ?>]">
<option value="#NONE#">- Select -</option>
<?php
@@ -85,39 +85,52 @@ class WP_Import {
function get_entries() {
set_magic_quotes_runtime(0);
$importdata = array_map('rtrim', file($this->file)); // Read the file into an array
$this->posts = array();
$this->categories = array();
$this->tags = array();
$num = 0;
$doing_entry = false;
foreach ($importdata as $importline) {
if ( false !== strpos($importline, '<wp:category>') ) {
preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
$this->categories[] = $category[1];
continue;
}
if ( false !== strpos($importline, '<item>') ) {
$this->posts[$num] = '';
$doing_entry = true;
continue;
}
if ( false !== strpos($importline, '</item>') ) {
$num++;
$doing_entry = false;
continue;
}
if ( $doing_entry ) {
$this->posts[$num] .= $importline . "\n";
}
}
foreach ($this->posts as $post) {
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ($post_ID) {
$this->posts_processed[$post_ID][0] = &$post;
$this->posts_processed[$post_ID][1] = 0;
$fp = fopen($this->file, 'r');
if ($fp) {
while ( !feof($fp) ) {
$importline = rtrim(fgets($fp));
if ( false !== strpos($importline, '<wp:category>') ) {
preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
$this->categories[] = $category[1];
continue;
}
if ( false !== strpos($importline, '<wp:tag>') ) {
preg_match('|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag);
$this->tags[] = $tag[1];
continue;
}
if ( false !== strpos($importline, '<item>') ) {
$this->posts[$num] = '';
$doing_entry = true;
continue;
}
if ( false !== strpos($importline, '</item>') ) {
$num++;
$doing_entry = false;
continue;
}
if ( $doing_entry ) {
$this->posts[$num] .= $importline . "\n";
}
}
foreach ($this->posts as $post) {
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ($post_ID) {
$this->posts_processed[$post_ID][0] = &$post;
$this->posts_processed[$post_ID][1] = 0;
}
}
fclose($fp);
}
}
@@ -190,7 +203,7 @@ class WP_Import {
echo '</li>';
}
echo '<input type="submit" value="Submit">'.'<br/>';
echo '<input type="submit" value="Submit">'.'<br />';
echo '</form>';
echo '</ol>';
@@ -213,7 +226,7 @@ class WP_Import {
function process_categories() {
global $wpdb;
$cat_names = (array) $wpdb->get_col("SELECT cat_name FROM $wpdb->categories");
$cat_names = (array) get_terms('category', 'fields=names');
while ( $c = array_shift($this->categories) ) {
$cat_name = trim($this->get_tag( $c, 'wp:cat_name' ));
@@ -239,12 +252,36 @@ class WP_Import {
}
}
function process_tags() {
global $wpdb;
$tag_names = (array) get_terms('post_tag', 'fields=names');
while ( $c = array_shift($this->tags) ) {
$tag_name = trim($this->get_tag( $c, 'wp:tag_name' ));
// If the category exists we leave it alone
if ( in_array($tag_name, $tag_names) )
continue;
$slug = $this->get_tag( $c, 'wp:tag_slug' );
$description = $this->get_tag( $c, 'wp:tag_description' );
$tagarr = compact('slug', 'description');
$tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr);
}
}
function process_posts() {
$i = -1;
echo '<ol>';
foreach ($this->posts as $post)
$this->process_post($post);
foreach ($this->posts as $post) {
$result = $this->process_post($post);
if ( is_wp_error( $result ) )
return $result;
}
echo '</ol>';
@@ -252,14 +289,14 @@ class WP_Import {
echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
}
function process_post($post) {
global $wpdb;
$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
if ( $post_ID && !empty($this->posts_processed[$post_ID][1]) ) // Processed already
return 0;
// There are only ever one of these
$post_title = $this->get_tag( $post, 'title' );
$post_date = $this->get_tag( $post, 'wp:post_date' );
@@ -279,6 +316,15 @@ class WP_Import {
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
preg_match_all('|<category domain="tag">(.*?)</category>|is', $post, $tags);
$tags = $tags[1];
$tag_index = 0;
foreach ($tags as $tag) {
$tags[$tag_index] = $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $tag)));
$tag_index++;
}
preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
$categories = $categories[1];
@@ -296,7 +342,11 @@ class WP_Import {
// If it has parent, process parent first.
$post_parent = (int) $post_parent;
if ($parent = $this->posts_processed[$post_parent]) {
if (!$parent[1]) $this->process_post($parent[0]); // If not yet, process the parent first.
if (!$parent[1]) {
$result = $this->process_post($parent[0]); // If not yet, process the parent first.
if ( is_wp_error( $result ) )
return $result;
}
$post_parent = $parent[1]; // New ID of the parent;
}
@@ -307,23 +357,49 @@ class WP_Import {
$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'post_name', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'menu_order', 'post_type');
$comment_post_ID = $post_id = wp_insert_post($postdata);
if ( is_wp_error( $post_id ) )
return $post_id;
// Memorize old and new ID.
if ( $post_id && $post_ID && $this->posts_processed[$post_ID] )
$this->posts_processed[$post_ID][1] = $post_id; // New ID.
// Add categories.
if (count($categories) > 0) {
$post_cats = array();
foreach ($categories as $category) {
$cat_ID = (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name = '$category'");
$slug = sanitize_term_field('slug', $category, 0, 'category', 'db');
$cat = get_term_by('slug', $slug, 'category');
$cat_ID = 0;
if ( ! empty($cat) )
$cat_ID = $cat->term_id;
if ($cat_ID == 0) {
$category = $wpdb->escape($category);
$cat_ID = wp_insert_category(array('cat_name' => $category));
}
$post_cats[] = $cat_ID;
}
wp_set_post_categories($post_id, $post_cats);
}
}
// Add tags.
if (count($tags) > 0) {
$post_tags = array();
foreach ($tags as $tag) {
$slug = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
$tag_obj = get_term_by('slug', $slug, 'post_tag');
$tag_id = 0;
if ( ! empty($tag_obj) )
$tag_id = $tag_obj->term_id;
if ( $tag_id == 0 ) {
$tag = $wpdb->escape($tag);
$tag_id = wp_insert_term($tag, 'post_tag');
$tag_id = $tag_id['term_id'];
}
$post_tags[] = $tag_id;
}
wp_set_post_tags($post_id, $post_tags);
}
}
// Now for comments
@@ -370,7 +446,10 @@ class WP_Import {
$this->get_authors_from_post();
$this->get_entries();
$this->process_categories();
$this->process_posts();
$this->process_tags();
$result = $this->process_posts();
if ( is_wp_error( $result ) )
return $result;
}
function dispatch() {
@@ -390,7 +469,9 @@ class WP_Import {
break;
case 2:
check_admin_referer('import-wordpress');
$this->import();
$result = $this->import();
if ( is_wp_error( $result ) )
echo $result->get_error_message();
break;
}
$this->footer();

View File

@@ -0,0 +1,240 @@
<?php
class WP_Categories_to_Tags {
var $categories_to_convert = array();
var $all_categories = array();
function header() {
print '<div class="wrap">';
print '<h2>' . __('Convert Categories to Tags') . '</h2>';
}
function footer() {
print '</div>';
}
function populate_all_categories() {
global $wpdb;
$categories = get_categories('get=all');
foreach ( $categories as $category ) {
if ( !tag_exists($wpdb->escape($category->name)) )
$this->all_categories[] = $category;
}
}
function welcome() {
$this->populate_all_categories();
print '<div class="narrow">';
if (count($this->all_categories) > 0) {
print '<p>' . __('Howdy! This converter allows you to selectively convert existing categories to tags. To get started, check the checkboxes of the categories you wish to be converted, then click the Convert button.') . '</p>';
print '<p>' . __('Keep in mind that if you convert a category with child categories, those child categories get their parent setting removed, so they\'re in the root.') . '</p>';
$this->categories_form();
} else {
print '<p>'.__('You have no categories to convert!').'</p>';
}
print '</div>';
}
function categories_form() {
print '<form action="admin.php?import=wp-cat2tag&amp;step=2" method="post">';
wp_nonce_field('import-cat2tag');
print '<ul style="list-style:none">';
$hier = _get_term_hierarchy('category');
foreach ($this->all_categories as $category) {
$category = sanitize_term( $category, 'category', 'display' );
if ((int) $category->parent == 0) {
print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
if (isset($hier[$category->term_id])) {
$this->_category_children($category, $hier);
}
print '</li>';
}
}
print '</ul>';
print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
print '</form>';
}
function _category_children($parent, $hier) {
print '<ul style="list-style:none">';
foreach ($hier[$parent->term_id] as $child_id) {
$child =& get_category($child_id);
print '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>';
if (isset($hier[$child->term_id])) {
$this->_category_children($child, $hier);
}
print '</li>';
}
print '</ul>';
}
function _category_exists($cat_id) {
global $wpdb;
$cat_id = (int) $cat_id;
$maybe_exists = category_exists($cat_id);
if ( $maybe_exists ) {
return true;
} else {
return false;
}
}
function convert_them() {
global $wpdb;
if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) {
print '<div class="narrow">';
print '<p>' . sprintf(__('Uh, oh. Something didn\'t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag') . '</p>';
print '</div>';
return;
}
if ( empty($this->categories_to_convert) )
$this->categories_to_convert = $_POST['cats_to_convert'];
$hier = _get_term_hierarchy('category');
print '<ul>';
foreach ( (array) $this->categories_to_convert as $cat_id) {
$cat_id = (int) $cat_id;
print '<li>' . sprintf(__('Converting category #%s ... '), $cat_id);
if (!$this->_category_exists($cat_id)) {
_e('Category doesn\'t exist!');
} else {
$category =& get_category($cat_id);
if ( tag_exists($wpdb->escape($category->name)) ) {
_e('Category is already a tag.');
print '</li>';
continue;
}
// If the category is the default, leave category in place and create tag.
if ( get_option('default_category') == $category->term_id ) {
$id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug));
$id = $id['term_taxonomy_id'];
$posts = get_objects_in_term($category->term_id, 'category');
foreach ( $posts as $post ) {
if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')");
}
} else {
// Change the category to a tag.
$wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
// Set all parents to 0 (root-level) if their parent was the converted tag
$wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
}
// Clean the cache
clean_category_cache($category->term_id);
_e('Converted successfully.');
}
print '</li>';
}
print '</ul>';
}
function convert_all_confirm() {
print '<div class="narrow">';
print '<h3>' . __('Confirm') . '</h3>';
print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>';
print '<form action="admin.php?import=wp-cat2tag" method="post">';
wp_nonce_field('import-cat2tag');
print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>';
print '</form>';
print '</div>';
}
function convert_all() {
global $wpdb;
$this->populate_all_categories();
foreach ( $this->all_categories as $category )
$this->categories_to_convert[] = $category->term_id;
$this->convert_them();
}
function init() {
if (isset($_POST['maybe_convert_all_cats'])) {
$step = 3;
} elseif (isset($_POST['yes_convert_all_cats'])) {
$step = 4;
} elseif (isset($_POST['no_dont_do_it'])) {
die('no_dont_do_it');
} else {
$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
}
$this->header();
if (!current_user_can('manage_categories')) {
print '<div class="narrow">';
print '<p>' . __('Cheatin&#8217; uh?') . '</p>';
print '</div>';
} else {
if ( $step > 1 )
check_admin_referer('import-cat2tag');
switch ($step) {
case 1 :
$this->welcome();
break;
case 2 :
$this->convert_them();
break;
case 3 :
$this->convert_all_confirm();
break;
case 4 :
$this->convert_all();
break;
}
}
$this->footer();
}
function WP_Categories_to_Tags() {
// Do nothing.
}
}
$wp_cat2tag_importer = new WP_Categories_to_Tags();
register_importer('wp-cat2tag', __('Categories to Tags Converter'), __('Convert existing categories to tags, selectively.'), array(&$wp_cat2tag_importer, 'init'));
?>

View File

@@ -0,0 +1,19 @@
<?php
require_once(ABSPATH . 'wp-admin/includes/bookmark.php');
require_once(ABSPATH . 'wp-admin/includes/comment.php');
require_once(ABSPATH . 'wp-admin/includes/file.php');
require_once(ABSPATH . 'wp-admin/includes/image.php');
require_once(ABSPATH . 'wp-admin/includes/import.php');
require_once(ABSPATH . 'wp-admin/includes/misc.php');
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
require_once(ABSPATH . 'wp-admin/includes/post.php');
require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
require_once(ABSPATH . 'wp-admin/includes/template.php');
require_once(ABSPATH . 'wp-admin/includes/theme.php');
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . 'wp-admin/includes/update.php');
require_once(ABSPATH . WPINC . '/registration.php');
?>

View File

@@ -0,0 +1,177 @@
<?php
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']);
if ( !empty( $link_id ) ) {
$_POST['link_id'] = $link_id;
return wp_update_link( $_POST);
} else {
return wp_insert_link( $_POST);
}
}
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 wp_delete_link($link_id) {
global $wpdb;
do_action('delete_link', $link_id);
wp_delete_object_term_relationships($link_id, 'link_category');
$wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
do_action('deleted_link', $link_id);
return true;
}
function wp_get_link_cats($link_id = 0) {
$cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids');
return array_unique($cats);
}
function get_link_to_edit( $link_id ) {
return get_link( $link_id, OBJECT, 'edit' );
}
function wp_insert_link($linkdata) {
global $wpdb, $current_user;
$defaults = array('link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 );
$linkdata = wp_parse_args($linkdata, $defaults);
$linkdata = sanitize_bookmark($linkdata, 'db');
extract($linkdata, EXTR_SKIP);
$update = false;
if ( !empty($link_id) )
$update = true;
if ( trim( $link_name ) == '' )
return 0;
if ( trim( $link_url ) == '' )
return 0;
if ( empty($link_rating) )
$link_rating = 0;
if ( empty($link_image) )
$link_image = '';
if ( empty($link_target) )
$link_target = '';
if ( empty($link_visible) )
$link_visible = 'Y';
if ( empty($link_owner) )
$link_owner = $current_user->id;
if ( empty($link_notes) )
$link_notes = '';
if ( empty($link_description) )
$link_description = '';
if ( empty($link_rss) )
$link_rss = '';
if ( empty($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_set_link_cats($link_id = 0, $link_categories = array()) {
// 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_map('intval', $link_categories);
$link_categories = array_unique($link_categories);
wp_set_object_terms($link_id, $link_categories, 'link_category');
} // wp_set_link_cats()
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);
}
?>

View File

@@ -0,0 +1,68 @@
<?php
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'");
}
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);
}
function get_comment_to_edit( $id ) {
if ( !$comment = get_comment($id) )
return false;
$comment->comment_ID = (int) $comment->comment_ID;
$comment->comment_post_ID = (int) $comment->comment_post_ID;
$comment->comment_content = format_to_edit( $comment->comment_content );
$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content);
$comment->comment_author = format_to_edit( $comment->comment_author );
$comment->comment_author_email = format_to_edit( $comment->comment_author_email );
$comment->comment_author_url = clean_url($comment->comment_author_url);
$comment->comment_author_url = format_to_edit( $comment->comment_author_url );
return $comment;
}
function get_pending_comments_num( $post_id ) {
global $wpdb;
$post_id = (int) $post_id;
$pending = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $post_id AND comment_approved = '0'" );
return $pending;
}
?>

189
wp-admin/includes/file.php Normal file
View File

@@ -0,0 +1,189 @@
<?php
$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 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;
}
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.' ));
}
}
// 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. This error could also be caused by uploads being disabled in your php.ini.' ));
// 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 ) && !current_user_can( 'unfiltered_upload' ) )
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
if ( !$ext )
$ext = ltrim(strrchr($file['name'], '.'), '.');
}
// 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;
}
?>

192
wp-admin/includes/image.php Normal file
View File

@@ -0,0 +1,192 @@
<?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_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 );
}
}
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_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_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_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 );
}
?>

View File

@@ -0,0 +1,45 @@
<?php
function get_importers() {
global $wp_importers;
uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
return $wp_importers;
}
function register_importer( $id, $name, $description, $callback ) {
global $wp_importers;
if ( is_wp_error( $callback ) )
return $callback;
$wp_importers[$id] = array ( $name, $description, $callback );
}
function wp_import_cleanup( $id ) {
wp_delete_attachment( $id );
}
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 );
}
?>

177
wp-admin/includes/misc.php Normal file
View File

@@ -0,0 +1,177 @@
<?php
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;
}
// 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;
}
// 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;
}
}
/**
* Updates the htaccess file with the current rules if it is writable.
*
* Always writes to the file if it exists and is writable to ensure that we blank out old rules.
*/
function save_mod_rewrite_rules() {
global $wp_rewrite;
$home_path = get_home_path();
$htaccess_file = $home_path.'.htaccess';
// If the file doesn't already exists check for write access to the directory and whether of not we have some rules.
// else check for write access to the file.
if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) {
if ( got_mod_rewrite() ) {
$rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() );
return insert_with_markers( $htaccess_file, 'WordPress', $rules );
}
}
return false;
}
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 );
}
// 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 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 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"];
}
}
}
}
?>

View File

@@ -0,0 +1,382 @@
<?php
function get_plugin_data( $plugin_file ) {
$plugin_data = implode( '', file( $plugin_file ));
preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
preg_match( '|Author URI:(.*)$|mi', $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 ('' != trim($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 = @ opendir( $plugin_root);
if ( $plugins_dir ) {
while (($file = readdir( $plugins_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( is_dir( $plugin_root.'/'.$file ) ) {
$plugins_subdir = @ opendir( $plugin_root.'/'.$file );
if ( $plugins_subdir ) {
while (($subfile = readdir( $plugins_subdir ) ) !== 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;
}
}
}
@closedir( $plugins_dir );
@closedir( $plugins_subdir );
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;
}
//
// Menu
//
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_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_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_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 );
}
//
// Pluggable Menu Support -- Private
//
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 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_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 null;
}
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 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;
}
?>

471
wp-admin/includes/post.php Normal file
View File

@@ -0,0 +1,471 @@
<?php
// 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'] = 'pending';
} else {
if ('publish' == $_POST['post_status'] && !current_user_can( 'edit_published_posts' ))
$_POST['post_status'] = 'pending';
}
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;
}
// 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;
}
// Get an existing post and format it for editing.
function get_post_to_edit( $id ) {
$post = get_post( $id, OBJECT, 'edit' );
if ( $post->post_type == 'page' )
$post->page_template = get_post_meta( $id, '_wp_page_template', true );
return $post;
}
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;
}
// 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'] = 'pending';
} else {
if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) )
$_POST['post_status'] = 'pending';
}
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 );
if ( is_wp_error( $post_ID ) )
return $post_ID;
if ( empty($post_ID) )
return 0;
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;
}
function write_post() {
$result = wp_write_post();
if( is_wp_error( $result ) )
wp_die( $result->get_error_message() );
else
return $result;
}
//
// Post Meta
//
function add_meta( $post_ID ) {
global $wpdb;
$post_ID = (int) $post_ID;
$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
$metakeyselect = $wpdb->escape( stripslashes( trim( $_POST['metakeyselect'] ) ) );
$metakeyinput = $wpdb->escape( stripslashes( trim( $_POST['metakeyinput'] ) ) );
$metavalue = maybe_serialize( stripslashes( (trim( $_POST['metavalue'] ) ) ));
$metavalue = $wpdb->escape( $metavalue );
if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
// We have a key/value pair. If both the select and the
// input for the key have data, the input takes precedence:
if ('#NONE#' != $metakeyselect)
$metakey = $metakeyselect;
if ( $metakeyinput)
$metakey = $metakeyinput; // default
if ( in_array($metakey, $protected) )
return false;
$result = $wpdb->query( "
INSERT INTO $wpdb->postmeta
(post_id,meta_key,meta_value )
VALUES ('$post_ID','$metakey','$metavalue' )
" );
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'" );
}
// 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 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;
}
// 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 update_meta( $mid, $mkey, $mvalue ) {
global $wpdb;
$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
if ( in_array($mkey, $protected) )
return false;
$mvalue = maybe_serialize( stripslashes( $mvalue ));
$mvalue = $wpdb->escape( $mvalue );
$mid = (int) $mid;
return $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'" );
}
//
// Private
//
// 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);
}
// 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" );
}
?>

View File

@@ -10,18 +10,29 @@ if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
$charset_collate .= " COLLATE $wpdb->collate";
}
$wp_queries="CREATE TABLE $wpdb->categories (
cat_ID bigint(20) NOT NULL auto_increment,
cat_name varchar(55) NOT NULL default '',
category_nicename varchar(200) NOT NULL default '',
category_description longtext NOT NULL,
category_parent bigint(20) NOT NULL default '0',
category_count bigint(20) NOT NULL default '0',
link_count bigint(20) NOT NULL default '0',
posts_private tinyint(1) NOT NULL default '0',
links_private tinyint(1) NOT NULL default '0',
PRIMARY KEY (cat_ID),
KEY category_nicename (category_nicename)
$wp_queries="CREATE TABLE $wpdb->terms (
term_id bigint(20) NOT NULL auto_increment,
name varchar(55) NOT NULL default '',
slug varchar(200) NOT NULL default '',
term_group bigint(10) NOT NULL default 0,
PRIMARY KEY (term_id),
UNIQUE KEY slug (slug)
) $charset_collate;
CREATE TABLE $wpdb->term_taxonomy (
term_taxonomy_id bigint(20) NOT NULL auto_increment,
term_id bigint(20) NOT NULL default 0,
taxonomy varchar(32) NOT NULL default '',
description longtext NOT NULL,
parent bigint(20) NOT NULL default 0,
count bigint(20) NOT NULL default 0,
PRIMARY KEY (term_taxonomy_id),
UNIQUE KEY term_id_taxonomy (term_id,taxonomy)
) $charset_collate;
CREATE TABLE $wpdb->term_relationships (
object_id bigint(20) NOT NULL default 0,
term_taxonomy_id bigint(20) NOT NULL default 0,
PRIMARY KEY (object_id,term_taxonomy_id),
KEY term_taxonomy_id (term_taxonomy_id)
) $charset_collate;
CREATE TABLE $wpdb->comments (
comment_ID bigint(20) unsigned NOT NULL auto_increment,
@@ -43,13 +54,6 @@ CREATE TABLE $wpdb->comments (
KEY comment_approved (comment_approved),
KEY comment_post_ID (comment_post_ID)
) $charset_collate;
CREATE TABLE $wpdb->link2cat (
rel_id bigint(20) NOT NULL auto_increment,
link_id bigint(20) NOT NULL default '0',
category_id bigint(20) NOT NULL default '0',
PRIMARY KEY (rel_id),
KEY link_id (link_id,category_id)
) $charset_collate;
CREATE TABLE $wpdb->links (
link_id bigint(20) NOT NULL auto_increment,
link_url varchar(255) NOT NULL default '',
@@ -73,24 +77,11 @@ CREATE TABLE $wpdb->options (
option_id bigint(20) NOT NULL auto_increment,
blog_id int(11) NOT NULL default '0',
option_name varchar(64) NOT NULL default '',
option_can_override enum('Y','N') NOT NULL default 'Y',
option_type int(11) NOT NULL default '1',
option_value longtext NOT NULL,
option_width int(11) NOT NULL default '20',
option_height int(11) NOT NULL default '8',
option_description tinytext NOT NULL,
option_admin_level int(11) NOT NULL default '1',
autoload enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (option_id,blog_id,option_name),
KEY option_name (option_name)
) $charset_collate;
CREATE TABLE $wpdb->post2cat (
rel_id bigint(20) NOT NULL auto_increment,
post_id bigint(20) NOT NULL default '0',
category_id bigint(20) NOT NULL default '0',
PRIMARY KEY (rel_id),
KEY post_id (post_id,category_id)
) $charset_collate;
CREATE TABLE $wpdb->postmeta (
meta_id bigint(20) NOT NULL auto_increment,
post_id bigint(20) NOT NULL default '0',
@@ -109,7 +100,7 @@ CREATE TABLE $wpdb->posts (
post_title text NOT NULL,
post_category int(4) NOT NULL default '0',
post_excerpt text NOT NULL,
post_status enum('publish','draft','private','static','object','attachment','inherit','future') NOT NULL default 'publish',
post_status enum('publish','draft','private','static','object','attachment','inherit','future', 'pending') NOT NULL default 'publish',
comment_status enum('open','closed','registered_only') NOT NULL default 'open',
ping_status enum('open','closed') NOT NULL default 'open',
post_password varchar(20) NOT NULL default '',
@@ -141,7 +132,8 @@ CREATE TABLE $wpdb->users (
user_status int(11) NOT NULL default '0',
display_name varchar(250) NOT NULL default '',
PRIMARY KEY (ID),
KEY user_login_key (user_login)
KEY user_login_key (user_login),
KEY user_nicename (user_nicename)
) $charset_collate;
CREATE TABLE $wpdb->usermeta (
umeta_id bigint(20) NOT NULL auto_increment,
@@ -158,10 +150,9 @@ function populate_options() {
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
add_option('siteurl', $guessurl, __('WordPress web address'));
add_option('blogname', __('My Weblog'), __('Blog title'));
add_option('blogdescription', __('Just another WordPress weblog'), __('Short tagline'));
add_option('new_users_can_blog', 0);
add_option('siteurl', $guessurl);
add_option('blogname', __('My Blog'));
add_option('blogdescription', __('Just another WordPress weblog'));
add_option('users_can_register', 0);
add_option('admin_email', 'you@example.com');
add_option('start_of_week', 1);
@@ -206,7 +197,7 @@ function populate_options() {
add_option('comment_max_links', 2);
add_option('gmt_offset', date('Z') / 3600);
// 1.5
add_option('default_email_category', 1, __('Posts by email go to this category'));
add_option('default_email_category', 1);
add_option('recently_edited');
add_option('use_linksupdate', 0);
add_option('template', 'default');
@@ -240,6 +231,9 @@ function populate_options() {
add_option('default_link_category', 2);
add_option('show_on_front', 'posts');
// 2.2
add_option('tag_base');
// Delete unused options
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing');
foreach ($unusedoptions as $option) :
@@ -256,6 +250,7 @@ function populate_options() {
function populate_roles() {
populate_roles_160();
populate_roles_210();
populate_roles_230();
}
function populate_roles_160() {
@@ -389,4 +384,12 @@ function populate_roles_210() {
}
}
?>
function populate_roles_230() {
$role = get_role( 'administrator' );
if ( !empty( $role ) ) {
$role->add_cap( 'unfiltered_upload' );
}
}
?>

View File

@@ -0,0 +1,148 @@
<?php
//
// Category
//
function category_exists($cat_name) {
$id = is_term($cat_name, 'category');
if ( is_array($id) )
$id = $id['term_id'];
return $id;
}
function get_category_to_edit( $id ) {
$category = get_category( $id, OBJECT, 'edit' );
return $category;
}
function wp_create_category($cat_name) {
if ( $id = category_exists($cat_name) )
return $id;
return wp_insert_category( array('cat_name' => $cat_name) );
}
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 wp_delete_category($cat_ID) {
global $wpdb;
$cat_ID = (int) $cat_ID;
$default = get_option('default_category');
// Don't delete the default cat
if ( $cat_ID == $default )
return 0;
return wp_delete_term($cat_ID, 'category', "default=$default");
}
function wp_insert_category($catarr) {
global $wpdb;
extract($catarr, EXTR_SKIP);
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;
$name = $cat_name;
$description = $category_description;
$slug = $category_nicename;
$parent = $category_parent;
$parent = (int) $parent;
if ( empty($parent) || !category_exists( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )
$parent = 0;
$args = compact('name', 'slug', 'parent', 'description');
if ( $update )
$cat_ID = wp_update_term($cat_ID, 'category', $args);
else
$cat_ID = wp_insert_term($cat_name, 'category', $args);
if ( is_wp_error($cat_ID) )
return 0;
return $cat_ID['term_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);
}
//
// Tags
//
function get_tags_to_edit( $post_id ) {
global $wpdb;
$post_id = (int) $post_id;
if ( !$post_id )
return false;
$tags = wp_get_post_tags($post_id);
if ( !$tags )
return false;
foreach ( $tags as $tag )
$tag_names[] = $tag->name;
$tags_to_edit = join( ', ', $tag_names );
$tags_to_edit = attribute_escape( $tags_to_edit );
$tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit );
return $tags_to_edit;
}
function tag_exists($tag_name) {
return is_term($tag_name, 'post_tag');
}
function wp_create_tag($tag_name) {
if ( $id = tag_exists($tag_name) )
return $id;
return wp_insert_term($tag_name, 'post_tag');
}
?>

View File

@@ -0,0 +1,616 @@
<?php
//
// Big Mess
//
// 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_term_hierarchy('category');
if ( $categories ) {
ob_start();
foreach ( $categories as $category ) {
if ( $category->parent == $parent) {
echo "\t" . _cat_row( $category, $level );
if ( isset($children[$category->term_id]) )
cat_rows( $category->term_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->term_id' class='edit'>".__( 'Edit' )."</a></td>";
$default_cat_id = (int) get_option( 'default_category' );
if ( $category->term_id != $default_cat_id )
$edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id ) . "' onclick=\"return deleteSomething( 'cat', $category->term_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->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->count = number_format_i18n( $category->count );
$posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count;
$output = "<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'>$posts_count</td>
<td>$edit</td>\n\t</tr>\n";
return apply_filters('cat_row', $output);
}
function checked( $checked, $current) {
if ( $checked == $current)
echo ' checked="checked"';
}
// TODO: Remove?
function documentation_link( $for ) {
return;
}
function selected( $selected, $current) {
if ( $selected == $current)
echo ' selected="selected"';
}
//
// Nasty Category Stuff
//
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, $mode, $wpdb, $checked_categories;
if ( empty($checked_categories) ) {
if ( $post_ID ) {
$checked_categories = wp_get_post_categories($post_ID);
if ( count( $checked_categories ) == 0 ) {
// No selected categories, strange
$checked_categories[] = $default;
}
} else {
$checked_categories[] = $default;
}
}
$cats = get_categories("parent=$parent&hide_empty=0&fields=ids");
$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);
}
}
$result = apply_filters('get_nested_categories', $result);
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 dropdown_link_categories( $default = 0 ) {
global $link_id;
if ( $link_id ) {
$checked_categories = wp_get_link_cats($link_id);
if ( count( $checked_categories ) == 0 ) {
// No selected categories, strange
$checked_categories[] = $default;
}
} else {
$checked_categories[] = $default;
}
$categories = get_terms('link_category', 'orderby=count&hide_empty=0');
if ( empty($categories) )
return;
foreach ( $categories as $category ) {
$cat_id = $category->term_id;
$name = wp_specialchars( apply_filters('the_category', $category->name));
$checked = in_array( $cat_id, $checked_categories );
echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', ($checked ? ' checked="checked"' : "" ), '/> ', $name, "</label></li>";
}
}
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="view"><?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 = abs( (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" );
}
update_comment_cache($comments);
$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 = '';
$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';
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('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> ";
}
$post = get_post($comment->comment_post_ID, OBJECT, 'display');
$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->term_id && $parent == $category->parent) {
$pad = str_repeat( '&#8211; ', $level );
$category->name = wp_specialchars( $category->name );
echo "\n\t<option value='$category->term_id'";
if ( $currentparent == $category->term_id )
echo " selected='selected'";
echo ">$pad$category->name</option>";
wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
}
}
} else {
return false;
}
}
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']);
$entry['meta_id'] = (int) $entry['meta_id'];
$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>";
}
function meta_form() {
global $wpdb;
$limit = (int) apply_filters( 'postmeta_form_limit', 30 );
$keys = $wpdb->get_col( "
SELECT meta_key
FROM $wpdb->postmeta
WHERE meta_key NOT LIKE '\_%'
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 touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
global $wp_locale, $post, $comment;
if ( $for_post )
$edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;
$tab_index_attribute = '';
if ( (int) $tab_index > 0 )
$tab_index_attribute = " tabindex=\"$tab_index\"";
echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <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\"$tab_index_attribute>\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"<?php echo $tab_index_attribute ?> />
<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> /> @
<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> /> :
<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> />
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
<?php
if ( $edit ) {
printf( _c( 'Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s|1: month, 2: month string, 3: full year, 4: hours, 5: minutes' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
}
?>
</fieldset>
<?php
}
function page_template_dropdown( $default = '' ) {
$templates = get_page_templates();
ksort( $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 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 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 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 wp_convert_hr_to_bytes( $size ) {
$size = strtolower($size);
$bytes = (int) $size;
if ( strpos($size, 'k') !== false )
$bytes = intval($size) * 1024;
elseif ( strpos($size, 'm') !== false )
$bytes = intval($size) * 1024 * 1024;
elseif ( strpos($size, 'g') !== false )
$bytes = intval($size) * 1024 * 1024 * 1024;
return $bytes;
}
function wp_convert_bytes_to_hr( $bytes ) {
$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
$log = log( $bytes, 1024 );
$power = (int) $log;
$size = pow(1024, $log - $power);
return $size . $units[$power];
}
function wp_import_upload_form( $action ) {
$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
$bytes = apply_filters( 'import_upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );
$size = wp_convert_bytes_to_hr( $bytes );
?>
<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_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 . '" />';
}
?>

View File

@@ -0,0 +1,52 @@
<?php
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;
}
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:(.*)$|mi', $template_data, $name );
preg_match( '|Description:(.*)$|mi', $template_data, $description );
$name = $name[1];
$description = $description[1];
if ( !empty( $name ) ) {
$page_templates[trim( $name )] = basename( $template );
}
}
}
return $page_templates;
}
?>

View File

@@ -0,0 +1,122 @@
<?php
// The admin side of our 1.0 update system
function core_update_footer( $msg ) {
if ( !current_user_can('manage_options') )
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
$cur = get_option( 'update_core' );
switch ( $cur->response ) {
case 'development' :
return sprintf( '| '.__( 'You are using a development version (%s). Cool! Please <a href="%s">stay updated</a>.' ), $GLOBALS['wp_version'], 'http://wordpress.org/download/svn/' );
break;
case 'upgrade' :
return sprintf( '| <strong>'.__( 'Your WordPress %s is out of date. <a href="%s">Please update</a>.' ).'</strong>', $GLOBALS['wp_version'], $cur->url );
break;
case 'latest' :
default :
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
break;
}
}
add_filter( 'update_footer', 'core_update_footer' );
function update_nag() {
$cur = get_option( 'update_core' );
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
return false;
if ( current_user_can('manage_options') )
$msg = sprintf( __('A new version of WordPress is available! <a href="%s">Please update now</a>.'), $cur->url );
else
$msg = __('A new version of WordPress is available! Please notify the site administrator.');
echo "<div id='update-nag'>$msg</div>";
}
add_action( 'admin_notices', 'update_nag', 3 );
function wp_update_plugins() {
global $wp_version;
if ( !function_exists('fsockopen') )
return false;
$plugins = get_plugins();
$active = get_option( 'active_plugins' );
$current = get_option( 'update_plugins' );
$new_option = '';
$new_option->last_checked = time();
$plugin_changed = false;
foreach ( $plugins as $file => $p ) {
$new_option->checked[ $file ] = $p['Version'];
if ( !isset( $current->checked[ $file ] ) ) {
$plugin_changed = true;
continue;
}
if ( $current->checked[ $file ] != $p['Version'] )
$plugin_changed = true;
}
if (
isset( $current->last_checked ) &&
43200 > ( time() - $current->last_checked ) &&
!$plugin_changed
)
return false;
$to_send->plugins = $plugins;
$to_send->active = $active;
$send = serialize( $to_send );
$request = 'plugins=' . urlencode( $send );
$http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n";
$http_request .= "Host: api.wordpress.org\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
$http_request .= "Content-Length: " . strlen($request) . "\r\n";
$http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
$http_request .= "\r\n";
$http_request .= $request;
$response = '';
if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) {
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
}
$response = unserialize( $response[1] );
if ( $response )
$new_option->response = $response;
update_option( 'update_plugins', $new_option );
}
add_action( 'load-plugins.php', 'wp_update_plugins' );
function wp_plugin_update_row( $file ) {
global $plugin_data;
$current = get_option( 'update_plugins' );
if ( !isset( $current->response[ $file ] ) )
return false;
$r = $current->response[ $file ];
echo "<tr><td colspan='5' class='plugin-update'>";
printf( __('There is a new version of %s available. <a href="%s">Download version %s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version );
echo "</td></tr>";
}
add_action( 'after_plugin_row', 'wp_plugin_update_row' );
?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,13 @@
<?php
function wp_upload_display( $dims = false, $href = '' ) {
global $post;
$id = get_the_ID();
$attachment_data = wp_get_attachment_metadata( $id );
$is_image = (int) wp_attachment_is_image();
$filesystem_path = get_attached_file( $id );
if ( !isset($attachment_data['width']) && $is_image ) {
if ( $image_data = getimagesize( get_attached_file( $id ) ) ) {
if ( $image_data = getimagesize( $filesystem_path ) ) {
$attachment_data['width'] = $image_data[0];
$attachment_data['height'] = $image_data[1];
wp_update_attachment_metadata( $id, $attachment_data );
@@ -14,10 +16,7 @@ function wp_upload_display( $dims = false, $href = '' ) {
if ( isset($attachment_data['width']) )
list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128);
ob_start();
the_title();
$post_title = attribute_escape(ob_get_contents());
ob_end_clean();
$post_title = attribute_escape( the_title( '', '', false ) );
$post_content = attribute_escape(apply_filters( 'content_edit_pre', $post->post_content ));
$class = 'text';
@@ -40,6 +39,7 @@ function wp_upload_display( $dims = false, $href = '' ) {
$r .= "\t\t\t$innerHTML";
if ( $href )
$r .= "</a>\n";
$r .= "\t\t\t\t<span class='upload-file-size'>".size_format(filesize($filesystem_path))."</span>\n";
$r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-url-base-$id' id='attachment-url-base-$id' value='$src_base' />\n";
@@ -172,7 +172,7 @@ function wp_upload_form() {
<?php endif; ?>
<?php wp_nonce_field( 'inlineuploading' ); ?>
<div class="submit">
<input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> &raquo;" />
<input type="submit" value="<?php $id ? _e('Save &raquo;') : _e('Upload &raquo;'); ?>" />
</div>
</td>
</tr>
@@ -222,7 +222,7 @@ function wp_upload_tab_upload_action() {
// Construct the attachment array
$attachment = array(
'post_title' => $post_title ? $post_title : $filename,
'post_title' => $post_title,
'post_content' => $post_content,
'post_type' => 'attachment',
'post_parent' => $post_id,
@@ -284,7 +284,7 @@ function wp_upload_posts_where( $where ) {
}
function wp_upload_tab_browse() {
global $wpdb, $action, $paged;
global $action, $paged;
$old_vars = compact( 'paged' );
switch ( $action ) :
@@ -301,11 +301,7 @@ function wp_upload_tab_browse() {
add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
if ( 'browse' == $tab && $post_id )
add_filter( 'posts_where', 'wp_upload_posts_where' );
$attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");
$count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'";
if ( $post_id )
$count_query .= " AND post_parent = '$post_id'";
$total = $wpdb->get_var($count_query);
$attachments = query_posts("what_to_show=posts&post_status=any&posts_per_page=10&paged=$paged");
echo "<ul id='upload-files'>\n";
if ( have_posts() ) : while ( have_posts() ) : the_post();
@@ -343,10 +339,7 @@ add_action( 'upload_files_browse', 'wp_upload_tab_browse_action' );
add_action( 'upload_files_browse-all', 'wp_upload_tab_browse_action' );
function wp_upload_admin_head() {
global $wp_locale;
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload.css?version=' . get_bloginfo('version') . "a' type='text/css' />\n";
if ( 'rtl' == $wp_locale->text_direction )
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "a' type='text/css' />\n";
wp_admin_css( 'css/upload' );
if ( 'inline' == @$_GET['style'] ) {
echo "<style type='text/css' media='screen'>\n";
echo "\t#upload-menu { position: absolute; z-index: 2; }\n";
@@ -357,4 +350,4 @@ function wp_upload_admin_head() {
}
}
?>
?>

282
wp-admin/includes/user.php Normal file
View File

@@ -0,0 +1,282 @@
<?php
// 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_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_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_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 get_others_unpublished_posts($user_id, $type='any') {
global $wpdb;
$user = get_userdata( $user_id );
$level_key = $wpdb->prefix . 'user_level';
$editable = get_editable_user_ids( $user_id );
if ( in_array($type, array('draft', 'pending')) )
$type_sql = " post_status = '$type' ";
else
$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
if( !$editable ) {
$other_unpubs = '';
} else {
$editable = join(',', $editable);
$other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != '$user_id' ORDER BY post_modified $dir");
}
return apply_filters('get_others_drafts', $other_unpubs);
}
function get_others_drafts($user_id) {
return get_others_unpublished_posts($user_id, 'draft');
}
function get_others_pending($user_id) {
return get_others_unpublished_posts($user_id, 'pending');
}
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;
}
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 post_modified DESC";
$query = apply_filters('get_users_drafts', $query);
return $wpdb->get_results( $query );
}
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();
}
?>

View File

@@ -2,15 +2,19 @@
require_once('admin.php');
require_once (ABSPATH . WPINC . '/rss.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'));
switch ( $_GET['jax'] ) {
case 'incominglinks' :
$rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
$rss_feed = apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
$more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
$rss = @fetch_rss( $rss_feed );
if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
?>
<h3><?php _e('Incoming Links'); ?> <cite><a href="http://www.technorati.com/search/<?php echo trailingslashit(get_option('home')); ?>?partner=wordpress"><?php _e('More &raquo;'); ?></a></cite></h3>
<h3><?php _e('Incoming Links'); ?> <cite><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('More &raquo;'); ?></a></cite></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 10);
@@ -24,10 +28,10 @@ foreach ($rss->items as $item ) {
break;
case 'devnews' :
$rss = @fetch_rss('http://wordpress.org/development/feed/');
$rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', 'http://wordpress.org/development/feed/' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<h3><?php _e('WordPress Development Blog'); ?></h3>
<h3><?php echo apply_filters( 'dashboard_primary_title', __('WordPress Development Blog') ); ?></h3>
<?php
$rss->items = array_slice($rss->items, 0, 3);
foreach ($rss->items as $item ) {
@@ -43,10 +47,10 @@ foreach ($rss->items as $item ) {
break;
case 'planetnews' :
$rss = @fetch_rss('http://planet.wordpress.org/feed/');
$rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', 'http://planet.wordpress.org/feed/' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<h3><?php _e('Other WordPress News'); ?></h3>
<h3><?php echo apply_filters( 'dashboard_secondary_title', __('Other WordPress News') ); ?></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 20);
@@ -60,7 +64,7 @@ $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
}
?>
</ul>
<p class="readmore"><a href="http://planet.wordpress.org/"><?php _e('Read more'); ?> &raquo;</a></p>
<p class="readmore"><a href="<?php echo apply_filters( 'dashboard_secondary_link', 'http://planet.wordpress.org/' ); ?>"><?php _e('Read more &raquo;'); ?></a></p>
<?php
}
break;

View File

@@ -1,23 +1,22 @@
<?php
require_once('admin.php');
require_once('admin.php');
function index_js() {
?>
<script type="text/javascript">
Event.observe( window, 'load', dashboard_init, false );
function dashboard_init() {
var update1 = new Ajax.Updater( 'incominglinks', 'index-extra.php?jax=incominglinks' );
var update2 = new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews' );
var update3 = new Ajax.Updater( 'planetnews', 'index-extra.php?jax=planetnews' );
}
jQuery(function() {
jQuery('#incominglinks').load('index-extra.php?jax=incominglinks');
jQuery('#devnews').load('index-extra.php?jax=devnews');
jQuery('#planetnews').load('index-extra.php?jax=planetnews');
});
</script>
<?php
}
add_action( 'admin_head', 'index_js' );
wp_enqueue_script('prototype');
wp_enqueue_script('interface');
$title = __('Dashboard');
wp_enqueue_script( 'jquery' );
$title = __('Dashboard');
$parent_file = 'index.php';
require_once('admin-header.php');
@@ -40,17 +39,17 @@ $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE commen
if ( $comments || $numcomments ) :
?>
<div>
<h3><?php _e('Comments'); ?> <a href="edit-comments.php" title="<?php _e('More comments...'); ?>">&raquo;</a></h3>
<h3><?php printf( __( 'Comments <a href="%s" title="More comments&#8230;">&raquo;</a>' ), 'edit-comments.php' ); ?></h3>
<?php if ( $numcomments ) : ?>
<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p>
<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s) &raquo;'), number_format_i18n($numcomments) ); ?></a></strong></p>
<?php endif; ?>
<ul>
<?php
if ( $comments ) {
foreach ($comments as $comment) {
echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . '</a>');
echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
edit_comment_link(__("Edit"), ' <small>(', ')</small>');
echo '</li>';
}
@@ -64,7 +63,7 @@ foreach ($comments as $comment) {
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql('post') . " AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) :
?>
<div>
<h3><?php _e('Posts'); ?> <a href="edit.php" title="<?php _e('More posts...'); ?>">&raquo;</a></h3>
<h3><?php printf( __( 'Posts <a href="%s" title="More posts&#8230;">&raquo;</a>' ), 'edit.php' ); ?></h3>
<ul>
<?php
foreach ($recentposts as $post) {
@@ -101,14 +100,16 @@ foreach ($scheduled as $post) {
<?php
$numposts = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
$numcomms = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
$numcats = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
$numcats = wp_count_terms('category');
$numtags = wp_count_terms('post_tag');
$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format($numposts), 'edit.php');
$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format($numcomms), 'edit-comments.php');
$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format($numcats), 'categories.php');
$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format_i18n($numposts), 'edit.php');
$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format_i18n($numcomms), 'edit-comments.php');
$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format_i18n($numcats), 'categories.php');
$tag_str = sprintf(__ngettext('%1$s tag', '%1$s tags', $numtags), number_format_i18n($numtags));
?>
<p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p>
<p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s and %4$s.'), $post_str, $comm_str, $cat_str, $tag_str); ?></p>
</div>
<?php do_action('activity_box_end'); ?>

View File

@@ -1,5 +0,0 @@
body { font-family: Tahoma, Georgia, "Times New Roman", Times, serif; }
ul, ol { padding: 5px 20px 5px 5px; }
.step, th { text-align: left; }

View File

@@ -1,12 +1,13 @@
<?php
define('WP_INSTALLING', true);
if (!file_exists('../wp-config.php')) {
require_once('../wp-includes/compat.php');
require_once('../wp-includes/functions.php');
wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error");
}
require_once('../wp-config.php');
require_once('./upgrade-functions.php');
require_once('./includes/upgrade.php');
if (isset($_GET['step']))
$step = $_GET['step'];
@@ -19,10 +20,7 @@ header( 'Content-Type: text/html; charset=utf-8' );
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e('WordPress &rsaquo; Installation'); ?></title>
<link rel="stylesheet" href="install.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
<link rel="stylesheet" href="install-rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php endif; ?>
<?php wp_admin_css( 'css/install' ); ?>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
@@ -32,20 +30,19 @@ if ( is_blog_installed() ) die('<h1>'.__('Already Installed').'</h1><p>'.__('You
switch($step) {
case 0:
case 1: // in case people are directly linking to this
?>
<p><?php printf(__('Welcome to WordPress installation. We&#8217;re now going to go through a few steps to get you up and running with the latest in personal publishing platforms. You may want to peruse the <a href="%s">ReadMe documentation</a> at your leisure.'), '../readme.html'); ?></p>
<h2 class="step"><a href="install.php?step=1"><?php _e('First Step &raquo;'); ?></a></h2>
<?php
break;
case 1:
?>
<h1><?php _e('First Step'); ?></h1>
<p><?php _e("Before we begin we need a little bit of information. Don't worry, you can always change these later."); ?></p>
<h1><?php _e('Welcome'); ?></h1>
<p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure. Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?></p>
<!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step &raquo;'); ?></a></h2>-->
<h1><?php _e('Information needed'); ?></h1>
<p><?php _e("Please provide the following information. Don't worry, you can always change these settings later."); ?></p>
<form id="setup" method="post" action="install.php?step=2">
<table width="100%">
<tr>
<th width="33%"><?php _e('Weblog title:'); ?></th>
<th width="33%"><?php _e('Blog title:'); ?></th>
<td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>
</tr>
<tr>
@@ -53,12 +50,12 @@ switch($step) {
<td><input name="admin_email" type="text" id="admin_email" size="25" /></td>
</tr>
<tr>
<th scope="row" valign="top"> <?php __('Privacy:'); ?></th>
<td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('I would like my blog to appear in search engines like Google and Technorati.'); ?></label></td>
<td>&nbsp;</td>
<td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
</tr>
</table>
<p><em><?php _e('Double-check that email address before continuing.'); ?></em></p>
<h2 class="step"><input type="submit" name="Submit" value="<?php _e('Continue to Second Step &raquo;'); ?>" /></h2>
<p><em><?php _e('Double-check your email address before continuing.'); ?></em></p>
<h2 class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress &raquo;'); ?>" /></h2>
</form>
<?php
@@ -70,25 +67,21 @@ switch($step) {
$public = (int) $_POST['blog_public'];
// check e-mail address
if (empty($admin_email)) {
die(__("<strong>ERROR</strong>: please type your e-mail address"));
// TODO: poka-yoke
die(__("<strong>ERROR</strong>: you must provide an e-mail address"));
} else if (!is_email($admin_email)) {
die(__("<strong>ERROR</strong>: the e-mail address isn't correct"));
// TODO: poka-yoke
die(__('<strong>ERROR</strong>: that isn\'t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>'));
}
?>
<h1><?php _e('Second Step'); ?></h1>
<p><?php _e('Now we&#8217;re going to create the database tables and fill them with some default data.'); ?></p>
<?php
$result = wp_install($weblog_title, 'admin', $admin_email, $public);
extract($result, EXTR_SKIP);
?>
<p><em><?php _e('Finished!'); ?></em></p>
<h1><?php _e('Success!'); ?></h1>
<p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $password); ?></p>
<p><?php _e('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you. If you lose it, you will have to delete the tables from the database yourself, and re-install WordPress. So to review:'); ?></p>
<p><?php printf(__('WordPress has been installed. Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $password); ?></p>
<p><?php _e('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.'); ?></p>
<dl>
<dt><?php _e('Username'); ?></dt>
@@ -98,7 +91,7 @@ switch($step) {
<dt><?php _e('Login address'); ?></dt>
<dd><a href="../wp-login.php">wp-login.php</a></dd>
</dl>
<p><?php _e('Were you expecting more steps? Sorry to disappoint. All done! :)'); ?></p>
<p><?php _e('Were you expecting more steps? Sorry to disappoint. :)'); ?></p>
<?php
break;

View File

@@ -4,7 +4,8 @@ function newCatAddIn() {
var jaxcat = $('jaxcat');
if ( !jaxcat )
return false;
Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span>');
// These multiple blank hidden inputs are needed: https://bugzilla.mozilla.org/show_bug.cgi?id=377815 , #3895 , #4664
Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span>');
$('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); };
$('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); };
}

10
wp-admin/js/link-cat.js Normal file
View File

@@ -0,0 +1,10 @@
addLoadEvent(function(){linkcatList=new listMan('linkcategorychecklist');linkcatList.ajaxRespEl='jaxcat';linkcatList.topAdder=1;linkcatList.alt=0;linkcatList.showLink=0;});
addLoadEvent(newLinkCatAddIn);
function newLinkCatAddIn() {
var jaxcat = $('jaxcat');
if ( !jaxcat )
return false;
Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="' + linkcatL10n.add + '"/><input type="hidden"/><span id="howto">' + linkcatL10n.how + '</span></span>');
$('newcat').onkeypress = function(e) { return killSubmit("linkcatList.ajaxAdder('link-category','jaxcat');", e); };
$('catadd').onclick = function() { linkcatList.ajaxAdder('link-category', 'jaxcat'); };
}

View File

@@ -5,18 +5,38 @@ addLoadEvent( function() {
tab: '',
postID: 0,
toQueryParams: function(qryStrOrig) {
var params = new Object();
var qryStr = qryStrOrig;
var i = 0;
do {
params[qryStr.split("=")[0].replace(/&/, "")] = ( qryStr.split("=")[1] ) ? qryStr.split("=")[1].split(/&|$/)[0] : '';
qryStr = ( qryStr.split("=")[1] ) ? qryStr.split(qryStr.split("=")[1].split(/&|$/)[0])[1] : '';
i++;
}
while(i < (qryStrOrig.split("=").length - 1));
return params;
},
toQueryString: function(params) {
var qryStr = '';
for ( var key in params )
qryStr += key + '=' + params[key] + '&';
return qryStr;
},
initializeVars: function() {
this.urlData = document.location.href.split('?');
this.params = this.urlData[1].toQueryParams();
this.params = this.toQueryParams(this.urlData[1]);
this.postID = this.params['post_id'];
this.tab = this.params['tab'];
this.style = this.params['style'];
this.ID = this.params['ID'];
if ( !this.style )
this.style = 'default';
var nonceEl = $('nonce-value');
var nonceEl = jQuery('#nonce-value');
if ( nonceEl )
this.nonce = nonceEl.value;
this.nonce = jQuery(nonceEl).val();
if ( this.ID ) {
this.grabImageData( this.ID );
this.imageView( this.ID );
@@ -26,36 +46,38 @@ addLoadEvent( function() {
initializeLinks: function() {
if ( this.ID )
return;
$$('a.file-link').each( function(i) {
var id = i.id.split('-').pop();
i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }
} );
jQuery('a.file-link').each(function() {
var id = jQuery(this).attr('id').split('-').pop();
jQuery(this).attr('href','javascript:void(0)').click(function(e) {
theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e);
});
});
},
grabImageData: function(id) {
if ( id == this.currentImage.ID )
return;
var thumbEl = $('attachment-thumb-url-' + id);
var thumbEl = jQuery('#attachment-thumb-url-' + id);
if ( thumbEl ) {
this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value );
this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value );
this.currentImage.thumb = ( 0 == id ? '' : jQuery(thumbEl).val() );
this.currentImage.thumbBase = ( 0 == id ? '' : jQuery('#attachment-thumb-url-base-' + id).val() );
} else {
this.currentImage.thumb = false;
}
this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value );
this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value );
this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value );
this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value );
this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value );
var widthEl = $('attachment-width-' + id);
this.currentImage.src = ( 0 == id ? '' : jQuery('#attachment-url-' + id).val() );
this.currentImage.srcBase = ( 0 == id ? '' : jQuery('#attachment-url-base-' + id).val() );
this.currentImage.page = ( 0 == id ? '' : jQuery('#attachment-page-url-' + id).val() );
this.currentImage.title = ( 0 == id ? '' : jQuery('#attachment-title-' + id).val() );
this.currentImage.description = ( 0 == id ? '' : jQuery('#attachment-description-' + id).val() );
var widthEl = jQuery('#attachment-width-' + id);
if ( widthEl ) {
this.currentImage.width = ( 0 == id ? '' : widthEl.value );
this.currentImage.height = ( 0 == id ? '' : $('attachment-height-' + id).value );
this.currentImage.width = ( 0 == id ? '' : jQuery(widthEl).val() );
this.currentImage.height = ( 0 == id ? '' : jQuery('#attachment-height-' + id).val() );
} else {
this.currentImage.width = false;
this.currentImage.height = false;
}
this.currentImage.isImage = ( 0 == id ? 0 : $('attachment-is-image-' + id).value );
this.currentImage.isImage = ( 0 == id ? 0 : jQuery('#attachment-is-image-' + id).val() );
this.currentImage.ID = id;
},
@@ -65,10 +87,10 @@ addLoadEvent( function() {
h += "<div id='upload-file'>"
if ( this.ID ) {
var params = $H(this.params);
var params = this.params;
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
h += "<a href='" + this.urlData[0] + '?' + this.toQueryString(params) + "'";
} else {
h += "<a href='#' onclick='return theFileList.cancelView();'";
}
@@ -108,7 +130,7 @@ addLoadEvent( function() {
if ( display.length ) {
display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> " + this.title + "</label>");
h += "<tr><th style='padding-bottom:.5em'>" + this.show + "</th><td style='padding-bottom:.5em'>";
$A(display).each( function(i) { h += i; } );
jQuery(display).each( function() { h += this; } );
h += "</td></tr>";
}
@@ -125,12 +147,9 @@ addLoadEvent( function() {
h += "</div>";
new Insertion.Top('upload-content', h);
var displayEl = $(checked);
if ( displayEl )
displayEl.checked = true;
if (e) Event.stop(e);
jQuery(h).prependTo('#upload-content');
jQuery('#' + checked).attr('checked','checked');
if (e) return e.stopPropagation();
return false;
},
@@ -144,10 +163,10 @@ addLoadEvent( function() {
h += "<form id='upload-file' method='post' action='" + action + "'>";
if ( this.ID ) {
var params = $H(this.params);
var params = this.params;
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
h += "<a href='" + this.urlData[0] + '?' + this.toQueryString(params) + "'";
} else {
h += "<a href='#' onclick='return theFileList.cancelView();'";
}
@@ -182,23 +201,24 @@ addLoadEvent( function() {
h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
h += "<input type='hidden' name='post_parent' value='" + parseInt(this.postID,10) + "' />";
h += "<input type='hidden' name='action' id='action-value' value='save' />";
h += "<input type='hidden' name='ID' value='" + id + "' />";
h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
h += "<div class='submit'><input type='submit' value='" + this.saveText + "' /></div>";
h += "</td></tr></table></form>";
new Insertion.Top('upload-content', h);
if (e) Event.stop(e);
jQuery(h).prependTo('#upload-content');
if (e) e.stopPropagation();
return false;
},
prepView: function(id) {
this.cancelView( true );
var filesEl = $('upload-files');
var filesEl = jQuery('#upload-files');
if ( filesEl )
filesEl.hide();
var navEl = $('current-tab-nav');
var navEl = jQuery('#current-tab-nav');
if ( navEl )
navEl.hide();
this.grabImageData(id);
@@ -206,18 +226,18 @@ addLoadEvent( function() {
cancelView: function( prep ) {
if ( !prep ) {
var filesEl = $('upload-files');
var filesEl = jQuery('#upload-files');
if ( filesEl )
Element.show(filesEl);
var navEl = $('current-tab-nav');
jQuery(filesEl).show();
var navEl = jQuery('#current-tab-nav');
if ( navEl )
Element.show(navEl);
jQuery(navEl).show();
}
if ( !this.ID )
this.grabImageData(0);
var div = $('upload-file');
var div = jQuery('#upload-file');
if ( div )
Element.remove(div);
jQuery(div).remove();
return false;
},
@@ -227,10 +247,10 @@ addLoadEvent( function() {
var display = '';
var h = '';
link = $A(document.forms.uploadoptions.elements.link).detect( function(i) { return i.checked; } ).value;
displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
link = jQuery('input[@type=radio][@name="link"][@checked]','#uploadoptions').val();
displayEl = jQuery('input[@type=radio][@name="display"][@checked]','#uploadoptions');
if ( displayEl )
display = displayEl.value;
display = jQuery(displayEl).val();
else if ( 1 == this.currentImage.isImage )
display = 'full';
@@ -259,15 +279,17 @@ addLoadEvent( function() {
deleteFile: function(id) {
if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) {
$('action-value').value = 'delete';
$('upload-file').submit();
jQuery('#action-value').attr('value','delete');
jQuery('#upload-file').submit();
return true;
}
return false;
}
};
Object.extend( theFileList, uploadL10n );
for ( var property in uploadL10n )
theFileList[property] = uploadL10n[property];
theFileList.initializeVars();
theFileList.initializeLinks();
} );

View File

@@ -13,7 +13,7 @@ wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') );
if ( current_user_can( 'manage_categories' ) )
wp_enqueue_script( 'ajaxcat' );
wp_enqueue_script( 'ajaxlinkcat' );
require('admin-header.php');
?>

View File

@@ -0,0 +1,71 @@
<?php
require_once('admin.php');
wp_reset_vars(array('action', 'cat'));
switch($action) {
case 'addcat':
check_admin_referer('add-link-category');
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin&#8217; uh?'));
if ( wp_insert_term($_POST['name'], 'link_category', $_POST ) ) {
wp_redirect('edit-link-categories.php?message=1#addcat');
} else {
wp_redirect('edit-link-categories.php?message=4#addcat');
}
exit;
break;
case 'delete':
$cat_ID = (int) $_GET['cat_ID'];
check_admin_referer('delete-link-category_' . $cat_ID);
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin&#8217; uh?'));
$cat_name = get_term_field('name', $cat_ID, 'link_category');
// Don't delete the default cats.
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"), $cat_name));
wp_delete_term($cat_ID, 'link_category');
wp_redirect('edit-link-categories.php?message=2');
exit;
break;
case 'edit':
$title = __('Categories');
$parent_file = 'link-manager.php';
$submenu_file = 'edit-link-categories.php';
require_once ('admin-header.php');
$cat_ID = (int) $_GET['cat_ID'];
$category = get_term_to_edit($cat_ID, 'link_category');
include('edit-link-category-form.php');
include('admin-footer.php');
exit;
break;
case 'editedcat':
$cat_ID = (int) $_POST['cat_ID'];
check_admin_referer('update-link-category_' . $cat_ID);
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin&#8217; uh?'));
if ( wp_update_term($cat_ID, 'link_category', $_POST) )
wp_redirect('edit-link-categories.php?message=3');
else
wp_redirect('edit-link-categories.php?message=5');
exit;
break;
}
?>

View File

@@ -98,7 +98,7 @@ foreach ($categories as $category) {
} else {
$opml = file_get_contents($opml_url);
}
include_once('link-parse-opml.php');
$link_count = count($names);
@@ -123,7 +123,7 @@ else
} // end else
if ( ! $blogrolling )
apply_filters( 'wp_delete_file', $opml_url);
apply_filters( 'wp_delete_file', $opml_url);
@unlink($opml_url);
?>
</div>

View File

@@ -76,11 +76,11 @@ if ( isset($_GET['deleted']) ) {
<p><?php _e('Here you <a href="link-add.php">add links</a> to sites that you visit often and share them on your blog. When you have a list of links in your sidebar to other blogs, it&#8217;s called a &#8220;blogroll.&#8221;'); ?></p>
<form id="cats" method="get" action="">
<p><?php
$categories = get_categories("hide_empty=1&type=link");
$categories = get_terms('link_category', "hide_empty=1");
$select_cat = "<select name=\"cat_id\">\n";
$select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('All') . "</option>\n";
foreach ((array) $categories as $cat)
$select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars(apply_filters('link_category', $cat->cat_name)) . "</option>\n";
$select_cat .= '<option value="' . $cat->term_id . '"' . (($cat->term_id == $cat_id) ? " selected='selected'" : '') . '>' . sanitize_term_field('name', $cat->name, $cat->term_id, 'link_category', 'display') . "</option>\n";
$select_cat .= "</select>\n";
$select_order = "<select name=\"order_by\">\n";
@@ -131,9 +131,8 @@ if ( $links ) {
<tbody id="the-list">
<?php
foreach ($links as $link) {
$link->link_name = attribute_escape(apply_filters('link_title', $link->link_name));
$link->link_description = wp_specialchars(apply_filters('link_description', $link->link_description));
$link->link_url = clean_url($link->link_url);
$link = sanitize_bookmark($link);
$link->link_name = attribute_escape($link->link_name);
$link->link_category = wp_get_link_cats($link->link_id);
$short_url = str_replace('http://', '', $link->link_url);
$short_url = str_replace('www.', '', $short_url);
@@ -159,8 +158,10 @@ if ( $links ) {
?><td><?php
$cat_names = array();
foreach ($link->link_category as $category) {
$cat_name = get_the_category_by_ID($category);
$cat_name = wp_specialchars(apply_filters('link_category', $cat_name));
$cat = get_term($category, 'link_category', OBJECT, 'display');
if ( is_wp_error( $cat ) )
echo $cat->get_error_message();
$cat_name = $cat->name;
if ( $cat_id != $category )
$cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
$cat_names[] = $cat_name;
@@ -195,7 +196,7 @@ if ( $links ) {
<div id="ajax-response"></div>
<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links') ?> &raquo;" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p>
<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links &raquo;') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p>
</form>
<?php } ?>

View File

@@ -93,7 +93,7 @@ switch ($action) {
case 'edit' :
wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') );
if ( current_user_can( 'manage_categories' ) )
wp_enqueue_script( 'ajaxcat' );
wp_enqueue_script( 'ajaxlinkcat' );
$parent_file = 'link-manager.php';
$submenu_file = 'link-manager.php';
$title = __('Edit Link');

View File

@@ -46,6 +46,7 @@ $submenu['edit.php'][40] = array(__('Export'), 'import', 'export.php');
$submenu['link-manager.php'][5] = array(__('Manage Blogroll'), 'manage_links', 'link-manager.php');
$submenu['link-manager.php'][10] = array(__('Add Link'), 'manage_links', 'link-add.php');
$submenu['link-manager.php'][20] = array(__('Import Links'), 'manage_links', 'link-import.php');
$submenu['link-manager.php'][30] = array(__('Categories'), 'manage_links', 'edit-link-categories.php');
if ( current_user_can('edit_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
@@ -95,7 +96,7 @@ foreach ($submenu as $parent => $sub) {
// Menus for which the original parent is not acessible due to lack of privs will have the next
// submenu in line be assigned as the new menu parent.
foreach ( $menu as $id => $data ) {
if ( empty($submenu[$data[2]]) )
if ( empty($submenu[$data[2]]) )
continue;
$subs = $submenu[$data[2]];
$first_sub = array_shift($subs);

View File

@@ -1,206 +1,226 @@
<?php
require_once('admin.php');
$title = __('Moderate comments');
require_once './admin.php';
$title = __( 'Moderate Comments' );
$parent_file = 'edit-comments.php';
wp_enqueue_script( 'admin-comments' );
wp_reset_vars(array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky'));
wp_reset_vars( array( 'action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky' ) );
$comment = array();
if (isset($_POST["comment"])) {
foreach ($_POST["comment"] as $k => $v) {
$comment[intval($k)] = $v;
if ( isset( $_POST['comment'] ) && is_array( $_POST['comment'] ) ) {
foreach ( $_POST['comment'] as $k => $v ) {
$comment[intval( $k )] = $v;
}
}
switch($action) {
if ( $action == 'update' ) {
check_admin_referer( 'moderate-comments' );
case 'update':
check_admin_referer('moderate-comments');
if ( !current_user_can('moderate_comments') )
wp_die(__('Your level is not high enough to moderate comments.'));
if ( !current_user_can( 'moderate_comments' ) ) {
wp_die( __( 'Your level is not high enough to moderate comments.' ) );
}
$item_ignored = 0;
$item_deleted = 0;
$item_approved = 0;
$item_spam = 0;
foreach($comment as $key => $value) {
if ($feelinglucky && 'later' == $value)
$value = 'delete';
switch($value) {
case 'later':
// do nothing with that comment
// wp_set_comment_status($key, "hold");
++$item_ignored;
break;
case 'delete':
wp_set_comment_status($key, 'delete');
++$item_deleted;
break;
case 'spam':
wp_set_comment_status($key, 'spam');
++$item_spam;
break;
case 'approve':
wp_set_comment_status($key, 'approve');
if ( get_option('comments_notify') == true ) {
wp_notify_postauthor($key);
foreach ( $comment as $k => $v ) {
if ( $feelinglucky && $v == 'later' ) {
$v = 'delete';
}
switch ( $v ) {
case 'later' :
$item_ignored++;
break;
case 'delete' :
wp_set_comment_status( $k, 'delete' );
$item_deleted++;
break;
case 'spam' :
wp_set_comment_status( $k, 'spam' );
$item_spam++;
break;
case 'approve' :
wp_set_comment_status( $k, 'approve' );
if ( get_option( 'comments_notify' ) == true ) {
wp_notify_postauthor( $k );
}
++$item_approved;
break;
$item_approved++;
break;
}
}
$file = basename(__FILE__);
wp_redirect("$file?ignored=$item_ignored&deleted=$item_deleted&approved=$item_approved&spam=$item_spam");
exit();
wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam );
exit;
}
break;
require_once './admin-header.php';
default:
if ( !current_user_can( 'moderate_comments' ) ) {
echo '<div class="wrap"><p>' . __( 'Your level is not high enough to moderate comments.' ) . '</p></div>';
include_once './admin-footer.php';
exit;
}
require_once('admin-header.php');
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
$spam = isset( $_GET['ignored'] ) ? (int) $_GET['spam'] : 0;
if ( isset($_GET['deleted']) || isset($_GET['approved']) || isset($_GET['ignored']) ) {
echo "<div id='moderated' class='updated fade'>\n<p>";
$approved = (int) $_GET['approved'];
$deleted = (int) $_GET['deleted'];
$ignored = (int) $_GET['ignored'];
$spam = (int) $_GET['spam'];
if ($approved) {
printf(__ngettext('%s comment approved', '%s comments approved', $approved), $approved);
echo "<br/>\n";
if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
echo '<div id="moderated" class="updated fade"><p>';
if ( $approved > 0 ) {
printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
echo '<br />';
}
if ( $deleted > 0 ) {
printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
echo '<br />';
}
if ( $spam > 0 ) {
printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
echo '<br />';
}
echo '</p></div>';
}
if ($deleted) {
printf(__ngettext('%s comment deleted', '%s comments deleted', $deleted), $deleted);
echo "<br/>\n";
}
if ($spam) {
printf(__ngettext('%s comment marked as spam', '%s comments marked as spam', $spam), $spam);
echo "<br/>\n";
}
if ($ignored) {
printf(__ngettext('%s comment unchanged', '%s comments unchanged', $ignored), $ignored);
echo "<br/>\n";
}
echo "</p></div>\n";
}
?>
<div class="wrap">
<?php
if ( current_user_can('moderate_comments') )
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '0'");
else
$comments = '';
if ($comments) {
// list all comments that are waiting for approval
$file = basename(__FILE__);
?>
<h2><?php _e('Moderation Queue') ?></h2>
<form name="approval" action="moderation.php" method="post">
<?php wp_nonce_field('moderate-comments') ?>
<input type="hidden" name="action" value="update" />
<ol id="the-comment-list" class="commentlist">
<?php
$i = 0;
foreach($comments as $comment) {
++$i;
$comment_date = mysql2date(get_option("date_format") . " @ " . get_option("time_format"), $comment->comment_date);
$post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID='$comment->comment_post_ID'");
if ($i % 2) $class = 'js-unapproved alternate';
else $class = 'js-unapproved';
echo "\n\t<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
echo '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';
echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;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> | "; ?>
<?php
$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;
?>
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ] &#8212;
<?php _e('Bulk action:') ?>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment-<?php echo $comment->comment_ID; ?>-approve"><?php _e('Approve') ?></label> &nbsp;
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment-<?php echo $comment->comment_ID; ?>-spam"><?php _e('Spam') ?></label> &nbsp;
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-delete" value="delete" /> <label for="comment-<?php echo $comment->comment_ID; ?>-delete"><?php _e('Delete') ?></label> &nbsp;
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-nothing" value="later" checked="checked" /> <label for="comment-<?php echo $comment->comment_ID; ?>-nothing"><?php _e('Defer until later') ?></label>
</p>
$comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'" );
</li>
<?php
}
?>
</ol>
<div id="ajax-response"></div>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments &raquo;') ?>" /></p>
<script type="text/javascript">
// <![CDATA[
function markAllForDelete() {
for (var i=0; i< document.approval.length; i++) {
if (document.approval[i].value == "delete") {
document.approval[i].checked = true;
}
}
if ( !$comments ) {
echo '<p>' . __( 'Currently there are no comments for you to moderate.' ) . '</p></div>';
include_once './admin-footer.php';
exit;
}
function markAllForApprove() {
for (var i=0; i< document.approval.length; i++) {
if (document.approval[i].value == "approve") {
document.approval[i].checked = true;
}
}
}
function markAllForDefer() {
for (var i=0; i< document.approval.length; i++) {
if (document.approval[i].value == "later") {
document.approval[i].checked = true;
}
}
}
function markAllAsSpam() {
for (var i=0; i< document.approval.length; i++) {
if (document.approval[i].value == "spam") {
document.approval[i].checked = true;
}
}
}
document.write('<ul><li><a href="javascript:markAllForApprove()"><?php _e('Mark all for approval'); ?></a></li><li><a href="javascript:markAllAsSpam()"><?php _e('Mark all as spam'); ?></a></li><li><a href="javascript:markAllForDelete()"><?php _e('Mark all for deletion'); ?></a></li><li><a href="javascript:markAllForDefer()"><?php _e('Mark all for later'); ?></a></li></ul>');
// ]]>
</script>
<noscript>
<p>
<input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked "defer." <strong>Warning: This can&#8217;t be undone.</strong>'); ?></label>
</p>
</noscript>
</form>
<?php
$total = count( $comments );
$per = 100;
if ( isset( $_GET['paged'] ) ) {
$page = (int) $_GET['paged'];
} else {
// nothing to approve
echo '<p>'.__("Currently there are no comments for you to moderate.") . "</p>\n";
$page = 1;
}
?>
$start = ( $page * $per ) - $per;
$stop = $start + $per;
$page_links = paginate_links( array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
'total' => ceil( $total / $per ),
'current' => $page,
'prev_text' => '&laquo;',
'next_text' => '&raquo;'
) );
$comments = array_slice( $comments, $start, $stop );
?>
<h2><?php _e( 'Moderation Queue' ); ?></h2>
<?php
if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>';
}
?>
<form name="approval" id="approval" action="<?php echo basename( __FILE__ ); ?>" method="post">
<?php wp_nonce_field( 'moderate-comments' ); ?>
<input type="hidden" name="action" value="update" />
<ol id="the-comments-list" class="commentlist">
<?php
$i = 0;
foreach ( $comments as $comment ) {
$class = 'js-unapproved';
if ( $i++ % 2 ) {
$class .= ' alternate';
}
?>
<li id="comment-<?php comment_ID(); ?>" class="<?php echo $class; ?>">
<p>
<strong><?php comment_author(); ?></strong>
<?php if ( !empty( $comment->comment_author_email ) ) { ?>| <?php comment_author_email_link(); ?> <?php } ?>
<?php if ( !empty( $comment->comment_author_url ) && $comment->comment_author_url != 'http://' ) { ?>| <?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>
<?php comment_text(); ?>
</p>
<p><small>
<?php comment_date( __( 'M j, g:i A' ) ); ?> &#8212;
[ <a href="comment.php?action=editcomment&amp;c=<?php comment_ID(); ?>" title="<?php _e( 'Edit this comment' ); ?>"><?php _e( 'Edit' ); ?></a> |
<a href="post.php?action=deletecomment&amp;p=<?php echo $comment->comment_post_ID; ?>" title="<?php _e( 'Delete this comment' ); ?>" onclick="return deleteSomething( 'comment', <?php comment_ID(); ?>, '<?php echo js_escape( sprintf( __( "You are about to delete this comment by '%s'.\n'OK' to delete, 'Cancel' to stop." ), get_comment_author() ) ); ?>', theCommentList );"><?php _e( 'Delete' ); ?></a> ] &#8212;
<a href="<?php echo get_permalink( $comment->comment_post_ID ); ?>" title="<?php _e( 'View the post' ); ?>"><?php printf( __( 'View post &#8220;%s&#8221;' ), get_the_title( $comment->comment_post_ID ) ); ?></a>
</small></p>
<p><small>
<?php _e( 'Bulk action:' ); ?>
<label for="comment-<?php comment_ID(); ?>-approve"><input type="radio" name="comment[<?php comment_ID(); ?>]" id="comment-<?php comment_ID(); ?>-approve" value="approve" /> <?php _e( 'Approve' ); ?></label> &nbsp;
<label for="comment-<?php comment_ID(); ?>-spam"><input type="radio" name="comment[<?php comment_ID(); ?>]" id="comment-<?php comment_ID(); ?>-spam" value="spam" /> <?php _e( 'Spam' ); ?></label> &nbsp;
<label for="comment-<?php comment_ID(); ?>-delete"><input type="radio" name="comment[<?php comment_ID(); ?>]" id="comment-<?php comment_ID(); ?>-delete" value="delete" /> <?php _e( 'Delete' ); ?></label> &nbsp;
<label for="comment-<?php comment_ID(); ?>-nothing"><input type="radio" name="comment[<?php comment_ID(); ?>]" id="comment-<?php comment_ID(); ?>-nothing" value="later" checked="checked" /> <?php _e( 'No action' ); ?></label>
</small></p>
</li>
<?php
}
?>
</ol>
<?php
if ( $page_links ) {
echo '<p class="pagenav">' . $page_links . '</p>';
}
?>
<div id="ajax-response"></div>
<noscript>
<p class="submit">
<label for="feelinglucky"><input name="feelinglucky" id="feelinglucky" type="checkbox" value="true" /> <?php _e( 'Delete every comment marked &#8220;defer.&#8221; <strong>Warning: This can&#8217;t be undone.</strong>' ); ?></label>
</p>
</noscript>
<p class="submit">
<input type="submit" id="submit" name="submit" value="<?php _e( 'Bulk Moderate Comments &raquo;' ); ?>" />
</p>
<script type="text/javascript">
// <![CDATA[
function mark_all_as( what ) {
for ( var i = 0; i < document.approval.length; i++ ) {
if ( document.approval[i].value == what ) {
document.approval[i].checked = true;
}
}
}
document.write( '<p><strong><?php _e( 'Mark all:' ); ?></strong> <a href="javascript:mark_all_as(\'approve\')"><?php _e( 'Approved' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'spam\')"><?php _e( 'Spam' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'delete\')"><?php _e( 'Deleted' ); ?></a> &ndash; <a href="javascript:mark_all_as(\'later\')"><?php _e( 'Later' ); ?></a></p>' );
// ]]>
</script>
</form>
</div>
<?php
break;
}
include('admin-footer.php');
?>
<?php include_once './admin-footer.php'; ?>

View File

@@ -7,80 +7,80 @@ $parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Discussion Options') ?></h2>
<form method="post" action="options.php">
<div class="wrap">
<h2><?php _e('Discussion Options') ?></h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p>
<fieldset class="options">
<legend><?php echo __('Usual settings for an article:').'<br /><small><em>('.__('These settings may be overridden for individual articles.').')</em></small>'; ?></legend>
<ul>
<li>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>
</li>
<li>
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> />
<?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>
</li>
<li>
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />
<?php _e('Allow people to post comments on the article') ?></label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('E-mail me whenever:') ?></legend>
<ul>
<li>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />
<?php _e('Anyone posts a comment') ?> </label>
</li>
<li>
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />
<?php _e('A comment is held for moderation') ?> </label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('Before a comment appears:') ?></legend>
<legend><?php echo __('Usual settings for an article:').'<br /><small><em>('.__('These settings may be overridden for individual articles.').')</em></small>'; ?></legend>
<ul>
<li>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />
<?php _e('An administrator must always approve the comment') ?> </label>
</li>
<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li>
<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li>
</ul>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any blogs linked to from the article (slows down posting.)') ?></label>
</li>
<li>
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> />
<?php _e('Allow link notifications from other blogs (pingbacks and trackbacks.)') ?></label>
</li>
<li>
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />
<?php _e('Allow people to post comments on the article') ?></label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('E-mail me whenever:') ?></legend>
<ul>
<li>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />
<?php _e('Anyone posts a comment') ?> </label>
</li>
<li>
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />
<?php _e('A comment is held for moderation') ?> </label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('Before a comment appears:') ?></legend>
<ul>
<li>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />
<?php _e('An administrator must always approve the comment') ?> </label>
</li>
<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li>
<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('Comment Moderation') ?></legend>
<p><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></p>
<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="moderation.php">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
<p>
<textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>
</p>
<p>
<textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>
</p>
</fieldset>
<fieldset class="options">
<legend><?php _e('Comment Blacklist') ?></legend>
<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
<p>
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
<p>
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
</p>
</fieldset>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys" />
<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys" />
<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>
<?php include('./admin-footer.php'); ?>

View File

@@ -6,65 +6,65 @@ $parent_file = 'options-general.php';
include('./admin-header.php');
?>
<div class="wrap">
<h2><?php _e('General Options') ?></h2>
<form method="post" action="options.php">
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p>
<table class="optiontable">
<tr valign="top">
<th scope="row"><?php _e('Weblog title:') ?></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Tagline:') ?></th>
<table class="optiontable">
<tr valign="top">
<th scope="row"><?php _e('Blog title:') ?></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Tagline:') ?></th>
<td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" />
<br />
<?php _e('In a few words, explain what this weblog is about.') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('WordPress address (URL):') ?></th>
<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code<?php if ( defined( 'WP_SITEURL' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> /></td>
</tr>
<?php _e('In a few words, explain what this blog is about.') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('WordPress address (URL):') ?></th>
<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code<?php if ( defined( 'WP_SITEURL' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Blog address (URL):') ?></th>
<td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code<?php if ( defined( 'WP_HOME' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> /><br /><?php _e('Enter the address here if you want your blog homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('E-mail address:') ?> </th>
<tr valign="top">
<th scope="row"><?php _e('E-mail address:') ?> </th>
<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" />
<br />
<?php _e('This address is used only for admin purposes.') ?></td>
<?php _e('This address is used only for admin purposes.') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Membership:') ?></th>
<td> <label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> />
<tr valign="top">
<th scope="row"><?php _e('Membership:') ?></th>
<td> <label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> />
<?php _e('Anyone can register') ?></label><br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment') ?>
</label>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('New User Default Role:') ?></th>
<td><label for="default_role">
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('New User Default Role:') ?></th>
<td><label for="default_role">
<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select></label>
</td>
</tr>
</table>
<fieldset class="options">
<legend><?php _e('Date and Time') ?></legend>
<table class="optiontable">
<tr>
<th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
<td><code><?php echo gmdate(__('Y-m-d g:i:s a')); ?></code></td>
</td>
</tr>
</table>
<fieldset class="options">
<legend><?php _e('Date and Time') ?></legend>
<table class="optiontable">
<tr>
<th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
<td><code><?php echo gmdate(__('Y-m-d g:i:s a')); ?></code></td>
</tr>
<tr>
<th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th>
<td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" />
<th scope="row"><?php _e('Times in the blog should differ by:') ?> </th>
<td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" />
<?php _e('hours') ?> (<?php _e('Your timezone offset, for example <code>-6</code> for Central Time.'); ?>)</td>
</tr>
<tr>
@@ -76,7 +76,7 @@ include('./admin-header.php');
<th scope="row"><?php _e('Default time format:') ?></th>
<td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br />
<?php _e('Output:') ?> <strong><?php echo gmdate(get_option('time_format'), current_time('timestamp')); ?></strong></td>
</tr>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><?php _e('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click "Update options" to update sample output.') ?> </td>
@@ -93,14 +93,14 @@ endfor;
</select></td>
</tr>
</table>
</fieldset>
</fieldset>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="<?php if ( ! defined( 'WP_SITEURL' ) ) echo 'siteurl,'; if ( ! defined( 'WP_HOME' ) ) echo 'home,'; ?>blogname,blogdescription,admin_email,users_can_register,gmt_offset,date_format,time_format,start_of_week,comment_registration,default_role" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="<?php if ( ! defined( 'WP_SITEURL' ) ) echo 'siteurl,'; if ( ! defined( 'WP_HOME' ) ) echo 'home,'; ?>blogname,blogdescription,admin_email,users_can_register,gmt_offset,date_format,time_format,start_of_week,comment_registration,default_role" />
</p>
</form>
</div>
</div>
<?php include('./admin-footer.php') ?>

View File

@@ -73,10 +73,18 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
$category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
$wp_rewrite->set_category_base($category_base);
}
if ( isset($_POST['tag_base']) ) {
$tag_base = $_POST['tag_base'];
if (! empty($tag_base) )
$tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']);
$wp_rewrite->set_tag_base($tag_base);
}
}
$permalink_structure = get_option('permalink_structure');
$category_base = get_option('category_base');
$tag_base = get_option( 'tag_base' );
if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
$writable = true;
@@ -93,16 +101,16 @@ $wp_rewrite->flush_rules();
<?php if (isset($_POST['submit'])) : ?>
<div id="message" class="updated fade"><p><?php
if ($writable)
_e('Permalink structure updated.');
if ( $permalink_structure && !$usingpi && !$writable )
_e('You should update your .htaccess now.');
else
_e('You should update your .htaccess now.');
_e('Permalink structure updated.');
?></p></div>
<?php endif; ?>
<div class="wrap">
<h2><?php _e('Customize Permalink Structure') ?></h2>
<form name="form" action="options-permalink.php" method="post">
<div class="wrap">
<h2><?php _e('Customize Permalink Structure') ?></h2>
<form name="form" action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /></p>
<p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
@@ -122,20 +130,20 @@ $structures = array(
<h3><?php _e('Common options:'); ?></h3>
<p>
<label>
<input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> />
<?php _e('Default'); ?><br /> <span> &raquo; <code><?php echo get_option('home'); ?>/?p=123</code></span>
<input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> />
<?php _e('Default'); ?><br /> <span> <?php echo _c('&raquo;|Used as a list bullet'); ?> <code><?php echo get_option('home'); ?>/?p=123</code></span>
</label>
</p>
<p>
<label>
<input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> />
<?php _e('Date and name based'); ?><br /> <span> &raquo; <code><?php echo get_option('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
<input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> />
<?php _e('Date and name based'); ?><br /> <span> <?php echo _c('&raquo;|Used as a list bullet'); ?> <code><?php echo get_option('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
</label>
</p>
<p>
<label>
<input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> />
<?php _e('Numeric'); ?><br /> <span> &raquo; <code><?php echo get_option('home') . $prefix ; ?>/archives/123</code></span>
<input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> />
<?php _e('Numeric'); ?><br /> <span> <?php echo _c('&raquo;|Used as a list bullet'); ?> <code><?php echo get_option('home') . $prefix ; ?>/archives/123</code></span>
</label>
</p>
<p>
@@ -153,25 +161,25 @@ checked="checked"
<h3><?php _e('Optional'); ?></h3>
<?php if ($is_apache) : ?>
<p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
<p><?php _e('If you like, you may enter custom bases for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
<?php else : ?>
<p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
<p><?php _e('If you like, you may enter custom bases for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
<?php endif; ?>
<p>
<?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo attribute_escape($category_base); ?>" size="30" />
</p>
<p class="submit">
<input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" />
</p>
</form>
<p>
<?php _e('Category base'); ?>: <input name="category_base" id="category_base" type="text" class="code" value="<?php echo attribute_escape($category_base); ?>" size="30" />
</p>
<p>
<?php _e('Tag base'); ?>: <input name="tag_base" id="tag_base" type="text" class="code" value="<?php echo attribute_escape($tag_base); ?>" size="30" />
</p>
<p class="submit">
<input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" />
</p>
</form>
<?php if ( $permalink_structure && !$usingpi && !$writable ) : ?>
<p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p>
<textarea rows="5" style="width: 98%;" name="rules"><?php echo wp_specialchars($wp_rewrite->mod_rewrite_rules()); ?>
</textarea>
</p>
<p><textarea rows="5" style="width: 98%;" name="rules" id="rules"><?php echo wp_specialchars($wp_rewrite->mod_rewrite_rules()); ?></textarea></p>
</form>
<?php endif; ?>

View File

@@ -7,25 +7,25 @@ $parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Reading Options') ?></h2>
<div class="wrap">
<h2><?php _e('Reading Options') ?></h2>
<form name="form1" method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p>
<?php if ( get_pages() ): ?>
<fieldset class="options">
<legend><?php _e('Front Page') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Front page displays:')?></th>
<fieldset class="options">
<legend><?php _e('Front Page') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Front page displays:')?></th>
<td>
<p><label>
<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> />
<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> />
<?php _e('Your latest posts'); ?>
</label>
</p>
<p><label>
<input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> />
<input name="show_on_front" type="radio" value="page" class="tog" <?php checked('page', get_option('show_on_front')); ?> />
<?php printf(__('A <a href="%s">static page</a> (select below)'), 'edit-pages.php'); ?>
</label>
</p>
@@ -40,30 +40,30 @@ include('admin-header.php');
</p>
</div>
<?php endif; ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<?php endif; ?>
<fieldset class="options">
<legend><?php _e('Blog Pages') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show at most:') ?></th>
<fieldset class="options">
<legend><?php _e('Blog Pages') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show at most:') ?></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> <?php _e('posts') ?>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</fieldset>
<fieldset class="options">
<legend><?php _e('Syndication Feeds') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
<fieldset class="options">
<legend><?php _e('Syndication Feeds') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('For each article, show:') ?> </th>
@@ -72,25 +72,25 @@ include('admin-header.php');
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_option('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label></p>
<p><?php _e('Note: If you use the <code>&lt;!--more--&gt;</code> feature, it will cut off posts in RSS feeds.'); ?></p>
</td>
</tr>
</table>
</fieldset>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br />
<?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
</tr>
</table>
</table>
</fieldset>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br />
<?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
</tr>
</table>
<p>
<label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_option('gzipcompression')); ?> />
<label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_option('gzipcompression')); ?> />
<?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
</p>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" />
<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" />
<input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>

View File

@@ -7,17 +7,17 @@ $parent_file = 'options-general.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Writing Options') ?></h2>
<form method="post" action="options.php">
<div class="wrap">
<h2><?php _e('Writing Options') ?></h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options') ?>
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th>
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />
<?php _e('lines') ?></td>
</tr>
<table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
<tr valign="top">
<th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th>
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />
<?php _e('lines') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Formatting:') ?></th>
<td>
@@ -31,11 +31,12 @@ include('admin-header.php');
<th scope="row"><?php _e('Default post category:') ?></th>
<td><select name="default_category" id="default_category">
<?php
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
$categories = get_categories('get=all');
foreach ($categories as $category) :
if ($category->cat_ID == get_option('default_category')) $selected = " selected='selected'";
$category = sanitize_category($category);
if ($category->term_id == get_option('default_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
endforeach;
?>
</select></td>
@@ -44,10 +45,12 @@ endforeach;
<th scope="row"><?php _e('Default link category:') ?></th>
<td><select name="default_link_category" id="default_link_category">
<?php
foreach ($categories as $category) :
if ($category->cat_ID == get_option('default_link_category')) $selected = " selected='selected'";
$link_categories = get_terms('link_category', 'get=all');
foreach ($link_categories as $category) :
$category = sanitize_term($category, 'link_category');
if ($category->term_id == get_option('default_link_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
echo "\n\t<option value='$category->term_id' $selected>$category->name</option>";
endforeach;
?>
</select></td>
@@ -82,6 +85,7 @@ endforeach;
<?php
//Alreay have $categories from default_category
foreach ($categories as $category) :
$category = sanitize_category($category);
if ($category->cat_ID == get_option('default_email_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";

View File

@@ -10,77 +10,6 @@ wp_reset_vars(array('action'));
if ( !current_user_can('manage_options') )
wp_die(__('Cheatin&#8217; uh?'));
function sanitize_option($option, $value) { // Remember to call stripslashes!
switch ($option) {
case 'admin_email':
$value = stripslashes($value);
$value = sanitize_email($value);
break;
case 'default_post_edit_rows':
case 'mailserver_port':
case 'comment_max_links':
$value = stripslashes($value);
$value = abs((int) $value);
break;
case 'posts_per_page':
case 'posts_per_rss':
$value = stripslashes($value);
$value = (int) $value;
if ( empty($value) ) $value = 1;
if ( $value < -1 ) $value = abs($value);
break;
case 'default_ping_status':
case 'default_comment_status':
$value = stripslashes($value);
// Options that if not there have 0 value but need to be something like "closed"
if ( $value == '0' || $value == '')
$value = 'closed';
break;
case 'blogdescription':
case 'blogname':
if (current_user_can('unfiltered_html') == false)
$value = wp_filter_post_kses( $value ); // calls stripslashes then addslashes
$value = stripslashes($value);
break;
case 'blog_charset':
$value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
break;
case 'date_format':
case 'time_format':
case 'mailserver_url':
case 'mailserver_login':
case 'mailserver_pass':
case 'ping_sites':
case 'upload_path':
$value = strip_tags($value);
$value = wp_filter_kses($value); // calls stripslashes then addslashes
$value = stripslashes($value);
break;
case 'gmt_offset':
$value = preg_replace('/[^0-9:.-]/', '', $value); // strips slashes
break;
case 'siteurl':
case 'home':
$value = stripslashes($value);
$value = clean_url($value);
break;
default :
$value = stripslashes($value);
break;
}
return $value;
}
switch($action) {
case 'update':
@@ -100,15 +29,14 @@ case 'update':
if ($options) {
foreach ($options as $option) {
$option = trim($option);
$value = trim($_POST[$option]);
$value = sanitize_option($option, $value); // This does stripslashes on those that need it
$value = $_POST[$option];
if(!is_array($value)) $value = trim($value);
$value = stripslashes_deep($value);
update_option($option, $value);
}
}
$referred = remove_query_arg('updated' , wp_get_referer());
$goback = add_query_arg('updated', 'true', wp_get_referer());
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
wp_redirect($goback);
break;
@@ -153,7 +81,6 @@ foreach ( (array) $options as $option) :
else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . attribute_escape($value) . "'$disabled />";
echo "</td>
<td>$option->option_description</td>
</tr>";
endforeach;
?>

View File

@@ -10,7 +10,7 @@ require_once('admin-header.php');
?>
<?php if ( (isset($_GET['posted']) && $_GET['posted']) || isset($_GET['saved']) ) : ?>
<div id="message" class="updated fade"><p><strong><?php _e('Page saved.') ?></strong> <a href="edit-pages.php"><?php _e('Manage pages'); ?></a> | <a href="<?php echo get_page_link( isset($_GET['posted']) ? $_GET['posted'] : $_GET['saved'] ); ?>"><?php _e('View page') ; ?> &raquo;</a></p></div>
<div id="message" class="updated fade"><p><strong><?php _e('Page saved.') ?></strong> <a href="edit-pages.php"><?php _e('Manage pages'); ?></a> | <a href="<?php echo get_page_link( isset($_GET['posted']) ? $_GET['posted'] : $_GET['saved'] ); ?>"><?php _e('View page &raquo;') ; ?></a></p></div>
<?php endif; ?>
<?php
@@ -23,4 +23,4 @@ if ( current_user_can('edit_pages') ) {
}
?>
<?php include('admin-footer.php'); ?>
<?php include('admin-footer.php'); ?>

View File

@@ -45,6 +45,8 @@ case 'edit':
$page_ID = $post_ID = $p = (int) $_GET['post'];
$post = get_post_to_edit($page_ID);
if ( empty($post->ID) ) wp_die( __("You attempted to edit a page that doesn't exist. Perhaps it was deleted?") );
if ( 'post' == $post->post_type ) {
wp_redirect("post.php?action=edit&post=$post_ID");
exit();
@@ -137,7 +139,7 @@ case 'delete':
if ( ! wp_delete_attachment($page_id) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($page_id) )
if ( !wp_delete_post($page_id) )
wp_die( __('Error in deleting...') );
}

View File

@@ -11,7 +11,7 @@ if ( isset($_GET['action']) ) {
if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) )
wp_die(__('Plugin file does not exist.'));
if (!in_array($plugin, $current)) {
wp_redirect('plugins.php?error=true'); // we'll override this later if the plugin can be included without fatal error
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), 'plugins.php?error=true&plugin=' . $plugin)); // we'll override this later if the plugin can be included without fatal error
ob_start();
@include(ABSPATH . PLUGINDIR . '/' . $plugin);
$current[] = $plugin;
@@ -21,7 +21,15 @@ if ( isset($_GET['action']) ) {
ob_end_clean();
}
wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above
} else if ('deactivate' == $_GET['action']) {
} elseif ('error_scrape' == $_GET['action']) {
$plugin = trim($_GET['plugin']);
check_admin_referer('plugin-activation-error_' . $plugin);
if ( validate_file($plugin) )
wp_die(__('Invalid plugin.'));
if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) )
wp_die(__('Plugin file does not exist.'));
include(ABSPATH . PLUGINDIR . '/' . $plugin);
} elseif ('deactivate' == $_GET['action']) {
check_admin_referer('deactivate-plugin_' . $_GET['plugin']);
$current = get_option('active_plugins');
array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu!
@@ -31,12 +39,12 @@ if ( isset($_GET['action']) ) {
} elseif ($_GET['action'] == 'deactivate-all') {
check_admin_referer('deactivate-all');
$current = get_option('active_plugins');
foreach ($current as $plugin) {
array_splice($current, array_search($plugin, $current), 1);
do_action('deactivate_' . $plugin);
}
update_option('active_plugins', array());
wp_redirect('plugins.php?deactivate-all=true');
}
@@ -73,7 +81,15 @@ foreach ($check_plugins as $check_plugin) {
?>
<?php if ( isset($_GET['error']) ) : ?>
<div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p></div>
<div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p>
<?php
$plugin = trim($_GET['plugin']);
if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) && 1 == strtolower(ini_get('display_errors'))) { ?>
<iframe style="border:0" width="100%" height="70px" src="<?php bloginfo('wpurl'); ?>/wp-admin/plugins.php?action=error_scrape&amp;plugin=<?php echo attribute_escape($plugin); ?>&amp;_wpnonce=<?php echo attribute_escape($_GET['_error_nonce']); ?>"></iframe>
<?php
}
?>
</div>
<?php elseif ( isset($_GET['activate']) ) : ?>
<div id="message" class="updated fade"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
<?php elseif ( isset($_GET['deactivate']) ) : ?>
@@ -136,17 +152,20 @@ if (empty($plugins)) {
else
$edit = '';
$author = ( empty($plugin_data['Author']) ) ? '' : ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
echo "
<tr $style>
<td class='name'>{$plugin_data['Title']}</td>
<td class='vers'>{$plugin_data['Version']}</td>
<td class='desc'><p>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></p></td>
<td class='desc'><p>{$plugin_data['Description']}$author</p></td>
<td class='togl'>$toggle</td>";
if ( current_user_can('edit_plugins') )
echo "
<td>$edit</td>";
echo"
</tr>";
do_action( 'after_plugin_row', $plugin_file );
}
?>

View File

@@ -10,7 +10,7 @@ require_once ('./admin-header.php');
if ( ! current_user_can('edit_posts') ) { ?>
<div class="wrap">
<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
<p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br />
You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_option('admin_email')); ?>
</p>
@@ -21,34 +21,65 @@ When you&#8217;re promoted, just reload this page and you&#8217;ll be able to bl
}
if ( isset($_GET['posted']) && $_GET['posted'] ) : ?>
<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?> &raquo;</a></p></div>
<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post &raquo;'); ?></a></p></div>
<?php
endif;
?>
if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
<div class="wrap">
<p><strong><?php _e('Your Drafts:') ?></strong>
<?php
// Show drafts.
$num_drafts = count($drafts);
if ( $num_drafts > 15 ) $num_drafts = 15;
for ( $i = 0; $i < $num_drafts; $i++ ) {
$draft = $drafts[$i];
if ( 0 != $i )
echo ', ';
if ( empty($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>";
$my_drafts = get_users_drafts($user_ID);
$pending = get_others_pending($user_ID);
$others_drafts = get_others_drafts($user_ID);
$nag_posts_limit = (int) apply_filters('nag_posts_limit', 3);
$nag_posts = array(
array(
'my_drafts',
__('Your Drafts:'),
'edit.php?post_status=draft&amp;author=' . $user_ID,
count($my_drafts)),
array(
'pending',
__('Pending Review:'),
'edit.php?post_status=pending',
count($pending)),
array(
'others_drafts',
__('Others&#8217; Drafts:'),
'edit.php?post_status=draft&author=-' . $user_ID,
count($others_drafts))
);
if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) {
echo '<div class="wrap" id="draft-nag">';
foreach ( $nag_posts as $nag ) {
if ( ${$nag[0]} ) {
echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> ';
$i = 0;
foreach ( ${$nag[0]} as $post ) {
$i++;
if ( $i > $nag_posts_limit )
break;
echo '<a href="post.php?action=edit&amp;post=' . $post->ID . '">';
( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title();
echo '</a>';
if ( $i < min($nag[3], $nag_posts_limit) )
echo ', ';
}
if ( $nag[3] > $nag_posts_limit )
printf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit);
echo '.</p>';
}
}
if ( 15 < count($drafts) ) { ?>
, <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> &raquo;</a>
<?php } ?>
.</p>
</div>
<?php
echo "</div>\n";
}
?>
<?php
// Show post form.
$post = get_default_post_to_edit();
include('edit-form-advanced.php');
@@ -57,17 +88,17 @@ include('edit-form-advanced.php');
<?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?>
<div id="wp-bookmarklet" class="wrap">
<h3><?php _e('WordPress Bookmarklet'); ?></h3>
<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p>
<p><?php _e('Right click on the following link and choose &#0147;Bookmark This Link...&#0148; or &#0147;Add to Favorites...&#0148; to create a posting shortcut.'); ?></p>
<p>
<?php
if ($is_NS4 || $is_gecko) {
?>
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a>
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), get_bloginfo('name', 'display')); ?></a>
<?php
} else if ($is_winIE) {
?>
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_bloginfo('name', 'display')); ?></a>
<script type="text/javascript">
<!--
function oneclickbookmarklet(blah) {
@@ -78,15 +109,15 @@ window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=50
<br />
<br />
<?php _e('One-click bookmarklet:') ?><br />
<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a>
<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a>
<?php
} else if ($is_opera) {
?>
<a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
<a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
<?php
} else if ($is_macIE) {
?>
<a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
<a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>
<?php
}
?>

View File

@@ -38,6 +38,9 @@ case 'post':
if ( isset($_POST['save']) )
$location = "post.php?action=edit&post=$post_ID";
if ( empty($post_ID) )
$location = 'post-new.php';
wp_redirect($location);
exit();
break;
@@ -48,6 +51,8 @@ case 'edit':
$post_ID = $p = (int) $_GET['post'];
$post = get_post($post_ID);
if ( empty($post->ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") );
if ( 'page' == $post->post_type ) {
wp_redirect("page.php?action=edit&post=$post_ID");
exit();
@@ -149,7 +154,7 @@ case 'delete':
if ( ! wp_delete_attachment($post_id) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($post_id) )
if ( !wp_delete_post($post_id) )
wp_die( __('Error in deleting...') );
}

View File

@@ -39,23 +39,23 @@ $bookmarklet_height= 440;
<p class="submit"><input type="submit" value="<?php _e('Update Profile &raquo;') ?>" name="submit" /></p>
<fieldset>
<fieldset id="information">
<legend><?php _e('Name'); ?></legend>
<p><label><?php _e('Username: (no editing)'); ?><br />
<input type="text" name="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" />
</label></p>
<p><label><?php _e('First name:') ?><br />
<input type="text" name="first_name" value="<?php echo $profileuser->first_name ?>" /></label></p>
<input type="text" name="first_name" id="first_name" value="<?php echo $profileuser->first_name ?>" /></label></p>
<p><label><?php _e('Last name:') ?><br />
<input type="text" name="last_name" value="<?php echo $profileuser->last_name ?>" /></label></p>
<input type="text" name="last_name" id="last_name" value="<?php echo $profileuser->last_name ?>" /></label></p>
<p><label><?php _e('Nickname:') ?><br />
<input type="text" name="nickname" value="<?php echo $profileuser->nickname ?>" /></label></p>
<input type="text" name="nickname" id="nickname" value="<?php echo $profileuser->nickname ?>" /></label></p>
<p><label><?php _e('Display name publicly as:') ?> <br />
<select name="display_name">
<select name="display_name" id="display_name">
<option value="<?php echo $profileuser->display_name; ?>"><?php echo $profileuser->display_name; ?></option>
<option value="<?php echo $profileuser->nickname ?>"><?php echo $profileuser->nickname ?></option>
<option value="<?php echo $profileuser->user_login ?>"><?php echo $profileuser->user_login ?></option>
@@ -72,47 +72,47 @@ $bookmarklet_height= 440;
</select></label></p>
</fieldset>
<fieldset>
<fieldset id="contact-info">
<legend><?php _e('Contact Info'); ?></legend>
<p><label><?php _e('E-mail: (required)') ?><br />
<input type="text" name="email" value="<?php echo $profileuser->user_email ?>" /></label></p>
<input type="text" name="email" id="email" value="<?php echo $profileuser->user_email ?>" /></label></p>
<p><label><?php _e('Website:') ?><br />
<input type="text" name="url" value="<?php echo $profileuser->user_url ?>" />
<input type="text" name="url" id="url" value="<?php echo $profileuser->user_url ?>" />
</label></p>
<p><label><?php _e('AIM:') ?><br />
<input type="text" name="aim" value="<?php echo $profileuser->aim ?>" />
<input type="text" name="aim" id="aim" value="<?php echo $profileuser->aim ?>" />
</label></p>
<p><label><?php _e('Yahoo IM:') ?><br />
<input type="text" name="yim" value="<?php echo $profileuser->yim ?>" />
<input type="text" name="yim" id="yim" value="<?php echo $profileuser->yim ?>" />
</label></p>
<p><label><?php _e('Jabber / Google Talk:') ?><br />
<input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label>
<input type="text" name="jabber" id="jabber" value="<?php echo $profileuser->jabber ?>" /></label>
</p>
</fieldset>
<br clear="all" />
<fieldset>
<fieldset id="about-yourself">
<legend><?php _e('About Yourself'); ?></legend>
<p class="desc"><?php _e('Share a little biographical information. '); ?></p>
<p><textarea name="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p>
<p><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p>
</fieldset>
<?php
$show_password_fields = apply_filters('show_password_fields', true);
if ( $show_password_fields ) :
?>
<fieldset>
<fieldset id="update-password">
<legend><?php _e('Update Your Password'); ?></legend>
<p class="desc"><?php _e('If you would like to change your password type a new one twice below. Otherwise leave this blank.'); ?></p>
<p><label><?php _e('New Password:'); ?><br />
<input type="password" name="pass1" size="16" value="" />
<input type="password" name="pass1" id="pass1" size="16" value="" />
</label></p>
<p><label><?php _e('Type it one more time:'); ?><br />
<input type="password" name="pass2" size="16" value="" />
<input type="password" name="pass2" id="pass2" size="16" value="" />
</label></p>
</fieldset>
<?php endif; ?>

View File

@@ -1,205 +1,133 @@
#viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset,
#footer .logo, .alignleft .available-theme { float: right; }
#templateside, .alignright { float: left; }
#login #send, .readmore, .widefat th { text-align: right; }
#postcustomsubmit, form#upload th, .submit, .editform th { text-align: left; }
#devnews h4, #wphead h1, #your-profile legend, fieldset.options legend,
#planetnews li .post { font-family: Tahoma, Georgia, "Times New Roman", Times, serif; }
#wphead { padding: .8em 2em .8em 19em; }
#wphead h1 { font-size: 2.4em; }
#postdiv, #titlediv, #guiddiv, #tagdiv { margin: 0 0 0 8px; }
#ed_toolbar input { margin: 3px 0 2px 2px; }
#edButtons input, #edButtons input:active { margin: 0px 0 -1px 2px; }
body, td { font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; }
h2 { font: normal 32px/5px serif; }
textarea, input, select { font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif; }
.quicktags, .search { font: 12px Tahoma, Georgia, "Times New Roman", Times, serif; }
.updated, .confirm { padding: 0 3em 0 1em; }
.submit input, .submit input:focus, .button, .button:focus {
border-left-color: #999;
border-right-color: #ccc;
}
.submit input:active, .button:active {
border-left-color: #ccc;
border-right-color: #999;
}
html,
.dbx-handle,
#post_name,
input[name=link_url],
input[name=link_image],
input[name=opml_url],
input[name=file],
input#rss_uri,
#template #newcontent,
#devnews,
#planetnews,
#content,
body.login #login a,
#newcomment_author_url,
#email {
direction: ltr;
}
#adminmenu,
#submenu,
#minisub,
.wrap,
.updated,
.confirm,
#devnews h3,
#planetnews h3,
#wphead,
#user_info,
body.login,
#login_error {
direction: rtl;
}
p.submit,
.dbx-handle {
text-align: left;
}
html *,
select,
input,
table * {
font-family: tahoma, Tahoma, "Times New Roman", Times, serif;
}
#wphead {
padding: .8em 2em .8em 19em;
}
#user_info {
right: auto;
left: 1em;
}
#adminmenu {
padding: .2em 2em .3em .2em;
height: 28px;
}
#adminmenu li { line-height: 160%; }
}
* html #adminmenu {
padding-bottom: 0;
}
#adminmenu a {
margin: 0 0 0 10px;
display: block;
float: right;
}
font: 700 16px/130% "Times New Roman", Times, serif;
}
#adminmenu a.current {
border-right: 0;
border-left: 2px solid #4f96c8;
}
#submenu, #minisub { padding: 1px 3em 0 2em; }
#submenu { height: 28px; }
#submenu li { line-height: 160%; }
}
#submenu, #minisub {
padding: 1px 3em 0 2em;
}
#submenu {
height: 28px;
}
#submenu a {
margin: 0 0 0 10px;
display: block;
float: right;
}
line-height: 155%;
}
#submenu .current {
border-right: 0;
border-left: 2px solid #045290;
}
#currenttheme img {
float: right;
margin-right: auto;
margin-left: 1em;
}
#postdiv #quicktags {
padding-right: 0;
padding-left: 6px;
}
.readmore {
margin-right: auto;
margin-left: 5em;
}
#postexcerpt div, #attachmentlinks div {
margin-right: auto;
margin-left: 8px;
}
* html #postexcerpt .dbx-toggle-open {
padding-right: 0;
padding-left: 8px;
}
#searchform {
float: right;
margin-right: auto;
margin-left: 1em;
}
#poststuff {
margin-right: auto;
margin-left: 16em;
}
#template div {
margin-right: auto;
margin-left: 190px;
}
* html #template div {
margin-right: auto;
margin-left: 0px;
}
#user_info {
right: auto;
left: 1em;
}
#zeitgeist {
float: left;
margin-left: auto;
margin-right: 1em;
}
#zeitgeist ul {
margin: 0 .6em .3em 0;
padding: 0 .6em 0 0;
}
#categorydiv ul {
margin-left: auto;
margin-right: 10px;
}
#moremeta fieldset div { margin: 2px 0px 0 0; }
#moremeta {
margin-right: auto;
margin-left: 15px;
right: auto;
left: 5%;
}
#moremeta .dbx-content {
background: url(images/box-butt.gif) no-repeat bottom left;
padding-right: 0;
padding-left: 2px;
}
#moremeta .dbx-handle { background: #2685af url(images/box-head.gif) no-repeat left; }
#moremeta .dbx-box { background: url(images/box-bg.gif) repeat-y left; }
a.dbx-toggle, a.dbx-toggle:visited {
right: auto;
left: 2px;
}
#advancedstuff a.dbx-toggle, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#advancedstuff a.dbx-toggle-open, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#categorychecklist {
margin-right: auto;
margin-left: 6px;
}
#ajax-response.alignleft {
margin-left: auto;
margin-right: 2em;
}
#postdivrich #edButtons {
padding-left: 0;
padding-right: 3px;
}
}
.dbx-content input, .dbx-content select {
margin-right: 8px;
}
#newcat {
width: 100px;
}
.updated, .confirm {
background-position: 98.5%;
padding: 0 3em 0 1em;
}
.page-numbers {
margin-right: auto;
margin-left: 3px;
}
}
.wrap ul {
margin-right: 45%;
margin-left: 0;
}
* html .wrap ul {
margin-right: 50%;
}
.wrap h2 {
font-family: "Times New Roman", Times, serif;
}
#zeitgeist {
margin-right: 1em;
}
#zeitgeist ul {
margin: 0 .6em .3em 0;
padding: 0 .6em 0 0;
}
#categorydiv ul {
margin-left: auto;
margin-right: 10px;
}
a.view-link {
right:auto;
left:5%;
margin-right:0;
margin-left:220px;
}
left: 6%;
right: auto;
margin-right: auto;
}
#postdiv #quicktags {
padding-right: 0;
padding-left: 6px;
margin-right: 0;
}
.options ul {
margin-right: 0;
}
*form#template > div > textarea#newcontent {
margin-right: -300px;
width: 107%;
}

View File

@@ -1,19 +1,28 @@
<?php
define('WP_INSTALLING', true);
require_once('../wp-includes/compat.php');
require_once('../wp-includes/functions.php');
if (!file_exists('../wp-config-sample.php'))
die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
$configFile = file('../wp-config-sample.php');
if (!is_writable('../')) die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
if ( !is_writable('../'))
wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
// Check if wp-config.php has been created
if (file_exists('../wp-config.php'))
wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
if (isset($_GET['step']))
$step = $_GET['step'];
else
$step = 0;
header( 'Content-Type: text/html; charset=utf-8' );
function display_header(){
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">
@@ -76,12 +85,11 @@ header( 'Content-Type: text/html; charset=utf-8' );
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
<?php
// Check if wp-config.php has been created
if (file_exists('../wp-config.php'))
die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p></body></html>");
}//end function display_header();
switch($step) {
case 0:
display_header();
?>
<p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>
@@ -98,6 +106,7 @@ switch($step) {
break;
case 1:
display_header();
?>
</p>
<form method="post" action="setup-config.php?step=2">
@@ -177,6 +186,8 @@ switch($step) {
}
fclose($handle);
chmod('../wp-config.php', 0666);
display_header();
?>
<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p>
<?php

View File

@@ -13,7 +13,7 @@ if ('b' == $_GET['a']) {
<head>
<title>WordPress &#8250; Posted</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
<?php wp_admin_css(); ?>
</head>
<body>
<p>Posted !</p>
@@ -28,7 +28,7 @@ if ('b' == $_GET['a']) {
<head>
<title>WordPress &#8250; Sidebar</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
<?php wp_admin_css(); ?>
<style type="text/css" media="screen">
form {
padding: 3px;

View File

@@ -97,7 +97,7 @@ default:
</form>
</div>
<div class="wrap">
<div class="wrap">
<?php
if ( is_writeable($real_file) ) {
echo '<h2>' . sprintf(__('Editing <code>%s</code>'), $file_show) . '</h2>';

Some files were not shown because too many files have changed in this diff Show More