index.php0000644013707600007620000000013610530000006010360 0ustar wwwlicense.txt0000644013707600007620000003542707642301062010756 0ustar www GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS readme.html0000644013707600007620000001672310665052340010715 0ustar www WordPress › ReadMe

WordPress
Version 2.3

Semantic Personal Publishing Platform

First Things First

Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I'm proud to be a part of. Thousands of hours have gone into WordPress, and we're dedicated to making it better every day. Thank you for making it part of your world.

— Matt Mullenweg

Installation: Famous 5-minute install

  1. Unzip the package in an empty directory.
  2. Open up wp-config-sample.php with a text editor like WordPad or similar and fill in your database connection details.
  3. Save the file as wp-config.php
  4. Upload everything.
  5. Open /wp-admin/install.php in your browser. This should setup the tables needed for your blog. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the support forums with as much data as you can gather.
  6. Note the password given to you.
  7. The install script should then send you to the login page. Sign in with the username admin and the password generated during the installation. You can then click on 'Profile' to change the password.

Upgrading

Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.

Upgrading from any previous WordPress to 2.3:

  1. Delete your old WP files, saving ones you've modified.
  2. Upload the new files.
  3. Point your browser to /wp-admin/upgrade.php.
  4. You wanted more, perhaps? That's it!

Template Changes

If you have customized your templates you will probably have to make some changes to them. If you're converting your 1.2 or earlier templates, we've created a special guide for you.

Online Resources

If you have any questions that aren't addressed in this document, please take advantage of WordPress' numerous online resources:

The WordPress Codex
The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.
The Development Blog
This is where you'll find the latest updates and news related to WordPress. Bookmark and check often.
WordPress Planet
The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.
WordPress Support Forums
If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.
WordPress IRC Channel
Finally, there is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.freenode.net #wordpress)

System Recommendations

WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

Upgrading from another system

WordPress can import from a number of systems. First you need to get WordPress installed and working as described above.

XML-RPC and Atom Interface

You can now post to your WordPress blog with tools like Windows Live Writer, Ecto, Bloggar, Radio Userland (which means you can use Radio's email-to-blog feature), NewzCrawler, and other tools that support the Blogging APIs! :) You can read more about XML-RPC support on the Codex.

Post via Email

You can post from an email client! To set this up go to your "Writing" options screen and fill in the connection details for your secret POP3 account. Then you need to set up wp-mail.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL.

Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address dicrete. The script will delete emails that are successfully posted.

User Roles

We've eliminated user levels in order to make way for the much more flexible roles system introduced in 2.0. You can read more about Roles and Capabilities on the Codex.

Final notes

Share the Love

WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better—you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgable than yourself, or writing the author of a media article that overlooks us.

Copyright

WordPress is released under the GPL (see license.txt).

wp-admin/0000755013707600007620000000000010706137420010274 5ustar wwwwp-admin/admin-ajax.php0000644013707600007620000002322610673760566013043 0ustar www"; $r .= ""; $r .= ""; $r .= "
"; $r .= ""; return $r; } $id = (int) $_POST['id']; switch ( $_POST['action'] ) : case 'delete-comment' : if ( !$comment = get_comment( $id ) ) die('0'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( wp_delete_comment( $comment->comment_ID ) ) die('1'); else die('0'); break; case 'delete-comment-as-spam' : if ( !$comment = get_comment( $id ) ) die('0'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( wp_set_comment_status( $comment->comment_ID, 'spam' ) ) die('1'); else die('0'); break; case 'delete-cat' : if ( !current_user_can( 'manage_categories' ) ) die('-1'); if ( wp_delete_category( $id ) ) die('1'); else die('0'); break; case 'delete-link' : if ( !current_user_can( 'manage_links' ) ) die('-1'); if ( wp_delete_link( $id ) ) die('1'); else die('0'); break; case 'delete-meta' : if ( !$meta = get_post_meta_by_id( $id ) ) die('0'); if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); if ( delete_meta( $meta->meta_id ) ) die('1'); die('0'); break; case 'delete-post' : if ( !current_user_can( 'delete_post', $id ) ) die('-1'); if ( wp_delete_post( $id ) ) die('1'); else die('0'); break; case 'delete-page' : if ( !current_user_can( 'delete_page', $id ) ) die('-1'); if ( wp_delete_post( $id ) ) die('1'); else die('0'); break; case 'dim-comment' : if ( !$comment = get_comment( $id ) ) die('0'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( !current_user_can( 'moderate_comments' ) ) die('-1'); if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) { if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) die('1'); } else { if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) ) die('1'); } die('0'); break; case 'add-category' : // On the Fly if ( !current_user_can( 'manage_categories' ) ) die('-1'); $names = explode(',', $_POST['newcat']); $x = new WP_Ajax_Response(); foreach ( $names as $cat_name ) { $cat_name = trim($cat_name); if ( !$category_nicename = sanitize_title($cat_name) ) die('0'); if ( !$cat_id = category_exists( $cat_name ) ) $cat_id = wp_create_category( $cat_name ); $cat_name = wp_specialchars(stripslashes($cat_name)); $x->add( array( 'what' => 'category', 'id' => $cat_id, 'data' => "
  • " ) ); } $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' => "" ) ); } $x->send(); break; case 'add-cat' : // From Manage->Categories if ( !current_user_can( 'manage_categories' ) ) die('-1'); if ( !$cat = wp_insert_category( $_POST ) ) die('0'); if ( !$cat = get_category( $cat ) ) die('0'); $level = 0; $cat_full_name = $cat->cat_name; $_cat = $cat; while ( $_cat->category_parent ) { $_cat = get_category( $_cat->category_parent ); $cat_full_name = $_cat->cat_name . ' — ' . $cat_full_name; $level++; } $cat_full_name = attribute_escape($cat_full_name); $x = new WP_Ajax_Response( array( 'what' => 'cat', 'id' => $cat->cat_ID, 'data' => _cat_row( $cat, $level, $cat_full_name ), 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category %s added' ), "cat-$cat->cat_ID", $cat_full_name)) ) ); $x->send(); break; case 'add-comment' : if ( !current_user_can( 'edit_post', $id ) ) die('-1'); $search = isset($_POST['s']) ? $_POST['s'] : false; $start = isset($_POST['page']) ? intval($_POST['page']) * 25 : 25; list($comments, $total) = _wp_get_comment_list( $search, $start, 1 ); if ( !$comments ) die('1'); $x = new WP_Ajax_Response(); foreach ( (array) $comments as $comment ) { get_comment( $comment ); ob_start(); _wp_comment_list_item( $comment->comment_ID ); $comment_list_item = ob_get_contents(); ob_end_clean(); $x->add( array( 'what' => 'comment', 'id' => $comment->comment_ID, 'data' => $comment_list_item ) ); } $x->send(); break; case 'add-meta' : if ( !current_user_can( 'edit_post', $id ) ) die('-1'); if ( $id < 0 ) { $now = current_time('timestamp', 1); if ( $pid = wp_insert_post( array( 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) ) ) ) { if ( is_wp_error( $pid ) ) return $pid; $mid = add_meta( $pid ); } else die('0'); } else if ( !$mid = add_meta( $id ) ) { die('0'); } $meta = get_post_meta_by_id( $mid ); $key = $meta->meta_key; $value = $meta->meta_value; $pid = (int) $meta->post_id; $x = new WP_Ajax_Response( array( 'what' => 'meta', 'id' => $mid, 'data' => wp_ajax_meta_row( $pid, $mid, $key, $value ), 'supplemental' => array('postid' => $pid) ) ); $x->send(); break; case 'update-meta' : $mid = (int) array_pop(array_keys($_POST['meta'])); $key = $_POST['meta'][$mid]['key']; $value = $_POST['meta'][$mid]['value']; if ( !$meta = get_post_meta_by_id( $mid ) ) die('0'); // if meta doesn't exist if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); if ( $u = update_meta( $mid, $key, $value ) ) { $key = stripslashes($key); $value = stripslashes($value); $x = new WP_Ajax_Response( array( 'what' => 'meta', 'id' => $mid, 'data' => wp_ajax_meta_row( $meta->post_id, $mid, $key, $value ), 'supplemental' => array('postid' => $meta->post_id) ) ); $x->send(); } die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). break; case 'add-user' : if ( !current_user_can('edit_users') ) die('-1'); require_once(ABSPATH . WPINC . '/registration.php'); if ( !$user_id = add_user() ) die('0'); elseif ( is_wp_error( $user_id ) ) { foreach( $user_id->get_error_messages() as $message ) echo "

    $message

    "; exit; } $user_object = new WP_User( $user_id ); $x = new WP_Ajax_Response( array( 'what' => 'user', 'id' => $user_id, 'data' => user_row( $user_object ), 'supplemental' => array('show-link' => sprintf(__( 'User %s added' ), "user-$user_id", $user_object->user_login)) ) ); $x->send(); break; case 'autosave' : // The name of this action is hardcoded in edit_post() $_POST['post_content'] = $_POST['content']; $_POST['post_excerpt'] = $_POST['excerpt']; $_POST['post_status'] = 'draft'; $_POST['post_category'] = explode(",", $_POST['catslist']); if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) unset($_POST['post_category']); if($_POST['post_ID'] < 0) { $_POST['temp_ID'] = $_POST['post_ID']; $id = wp_write_post(); if( is_wp_error($id) ) die($id->get_error_message()); else die("$id"); } else { $post_ID = (int) $_POST['post_ID']; $_POST['ID'] = $post_ID; $post = get_post($post_ID); if ( 'page' == $post->post_type ) { if ( !current_user_can('edit_page', $post_ID) ) die(__('You are not allowed to edit this page.')); } else { if ( !current_user_can('edit_post', $post_ID) ) die(__('You are not allowed to edit this post.')); } wp_update_post($_POST); } die('0'); break; case 'autosave-generate-nonces' : $ID = (int) $_POST['post_ID']; if($_POST['post_type'] == 'post') { if(current_user_can('edit_post', $ID)) die(wp_create_nonce('update-post_' . $ID)); } if($_POST['post_type'] == 'page') { if(current_user_can('edit_page', $ID)) { die(wp_create_nonce('update-page_' . $ID)); } } die('0'); break; default : do_action( 'wp_ajax_' . $_POST['action'] ); die('0'); break; endswitch; ?> wp-admin/admin-footer.php0000644013707600007620000000072710667076612013412 0ustar www

    wp-admin/admin-functions.php0000644013707600007620000000014710672775704014124 0ustar wwwwp-admin/admin-header.php0000644013707600007620000000461410667076612013343 0ustar www > <?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress

    %s.'), $user_identity) ?> [, ]

    wp-admin/admin.php0000644013707600007620000000511710672301460012100 0ustar www wp-admin/bookmarklet.php0000644013707600007620000000440010665111132013311 0ustar www post_title = stripslashes($post_title); else $post->post_title = $popuptitle; $content = wp_specialchars($_REQUEST['content']); $popupurl = clean_url($_REQUEST['popupurl']); if ( !empty($content) ) { $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); } else { $post->post_content = ''.$popuptitle.''."\n$text"; } /* /big funky fixes */ ?> <?php bloginfo('name') ?> › Bookmarklet — WordPress wp-admin/categories.php0000644013707600007620000000631510675603526013151 0ustar www%s category: this is the default one"), $cat_name)); wp_delete_category($cat_ID); wp_redirect('categories.php?message=2'); exit; break; case 'edit': require_once ('admin-header.php'); $cat_ID = (int) $_GET['cat_ID']; $category = get_category_to_edit($cat_ID); include('edit-category-form.php'); break; case 'editedcat': $cat_ID = (int) $_POST['cat_ID']; check_admin_referer('update-category_' . $cat_ID); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); if ( wp_update_category($_POST) ) wp_redirect('categories.php?message=3'); else wp_redirect('categories.php?message=5'); exit; break; default: wp_enqueue_script( 'admin-categories' ); require_once ('admin-header.php'); $messages[1] = __('Category added.'); $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); $messages[4] = __('Category not added.'); $messages[5] = __('Category not updated.'); ?>

    add new)'), '#addcat') ?>

    Note:
    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 %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>

    category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

    wp-admin/comment.php0000644013707600007620000001461610625511420012453 0ustar www'.__('Go back').'!', 'javascript:history.go(-1)')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( __('You are not allowed to edit comments on this post.') ); $comment = get_comment_to_edit($comment); include('edit-form-comment.php'); break; case 'cdc': case 'mac': require_once('./admin-header.php'); $comment = (int) $_GET['c']; $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment'; $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_'; $nonce_action .= $comment; if ( ! $comment = get_comment_to_edit($comment) ) wp_die(__('Oops, no comment with this ID.').sprintf(' '.__('Go back').'!', 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); ?>

    '.__('Caution:').' '.__('You are about to mark the following comment as spam:'); ?>

    '.__('Caution:').' '.__('You are about to delete the following comment:'); ?>

    '.__('Caution:').' '.__('You are about to approve the following comment:'); ?>

    /wp-admin/comment.php' method='get'>
    ' onclick="self.location='/wp-admin/edit-comments.php';" /> ' />
    comment_author_email ) { ?> comment_author_url ) { ?>
    comment_author; ?>
    comment_author_email; ?>
    comment_author_url; ?>

    comment_content; ?>
    '.__('Go back').'!', 'edit-comments.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( __('You are not allowed to edit comments on this post.') ); if ( 'spam' == $_REQUEST['dt'] ) wp_set_comment_status($comment->comment_ID, 'spam'); else wp_delete_comment($comment->comment_ID); if ((wp_get_referer() != '') && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { wp_redirect(get_option('siteurl') .'/wp-admin/edit-comments.php'); } exit(); break; case 'unapprovecomment': $comment = (int) $_GET['c']; check_admin_referer('unapprove-comment_' . $comment); if (isset($_GET['noredir'])) { $noredir = true; } else { $noredir = false; } if ( ! $comment = get_comment($comment) ) wp_die(__('Oops, no comment with this ID.').sprintf(' '.__('Go back').'!', 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); wp_set_comment_status($comment->comment_ID, "hold"); if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments'); } exit(); break; case 'approvecomment': $comment = (int) $_GET['c']; check_admin_referer('approve-comment_' . $comment); if (isset($_GET['noredir'])) { $noredir = true; } else { $noredir = false; } if ( ! $comment = get_comment($comment) ) wp_die(__('Oops, no comment with this ID.').sprintf(' '.__('Go back').'!', 'edit.php')); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) wp_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); wp_set_comment_status($comment->comment_ID, "approve"); if (get_option("comments_notify") == true) { wp_notify_postauthor($comment->comment_ID); } if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p=' . (int) $comment->comment_post_ID.'&c=1#comments'); } exit(); break; case 'editedcomment': $comment_ID = (int) $_POST['comment_ID']; $comment_post_ID = (int) $_POST['comment_post_id']; check_admin_referer('update-comment_' . $comment_ID); edit_comment(); $location = ( empty($_POST['referredby']) ? "edit.php?p=$comment_post_ID&c=1" : $_POST['referredby'] ) . '#comment-' . $comment_ID; $location = apply_filters('comment_edit_redirect', $location, $comment_ID); wp_redirect($location); exit(); break; default: break; } // end switch include('admin-footer.php'); ?> wp-admin/css/0000755013707600007620000000000010706137420011064 5ustar wwwwp-admin/css/install-rtl.css0000644013707600007620000000075210660057132014047 0ustar wwwbody { 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; }wp-admin/css/install.css0000644013707600007620000000114510630117700013240 0ustar wwwhtml { background: #eee; } body { background: #fff; color: #000; font-family: Georgia, "Times New Roman", Times, serif; margin-left: 20%; margin-right: 20%; padding: .2em 2em; } h1 { color: #006; font-size: 18px; font-weight: lighter; } h2 { font-size: 16px; } p, li, dt { line-height: 140%; padding-bottom: 2px; } ul, ol { padding: 5px 5px 5px 20px; } #logo { margin-bottom: 2em; } .step a, .step input { font-size: 2em; } td input { font-size: 1.5em; } .step, th { text-align: right; } #footer { text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: italic; }wp-admin/css/upload-rtl.css0000644013707600007620000000020310674563756013677 0ustar wwwhtml { direction: ltr; } #uploadoptions, table { direction: rtl; } td { padding: 1px 6px 0; } .submit { text-align: left; }wp-admin/css/upload.css0000644013707600007620000000626210630117700013063 0ustar wwwbody { background: #f9fcfe; } .upload-file-data { display: none; } #upload-menu { border-top: 2em solid #247fab; margin: 0; padding: 0; height: 0; list-style: none; width: 100%; } body > #upload-menu { border-bottom: 7px solid #fff; } #upload-menu li { margin: 0; position: relative; top: -2em; padding-bottom: 5px; border: none; border-top: 3px solid #247fab; } #upload-menu li a.upload-tab-link { margin-left: 0.75em; padding: 5px 5px 0; display: block; float: left; height: 100%; text-decoration: none; border-bottom: none; color: #fff; } #upload-menu li.current { border-right: 2px solid #448abd; color: #000; } #upload-menu li.current a.upload-tab-link, #upload-menu li a:hover { background: #f9fcfe; color: #000; } #upload-menu li #current-tab-nav { background: #f9fcfe; float: left; padding: 5px 5px 0 0; margin-left: -5px; } #upload-menu li span .page-numbers { padding: 0; border: none; } #upload-menu li span a.page-numbers { color: #00019b; } #upload-menu li span a.page-numbers:hover { text-decoration: underline; } #upload-content { position: relative; clear: both; margin: 0; padding: 0; border: none; width: 100%; height: 100%; background: none; } #upload-file { margin: 0 auto; top: 0; left: 0; width: 95%; height: 100%; background: #f9fcfe; } #upload-file th { width: 8em; } form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; } form#upload-file .submit input { width: auto; } #upload-file-view { padding: 0 0 0 75px; } #file-title { margin: 0 0 .2em 75px; padding: 0; display: block; font-family: Georgia, "Times New Roman", Times, serif; font-size: 16px; } h2 { margin: 0 .2em 0 0; padding: 0; display: inline; border: none; color: #000; font-size: 1.4em; line-height: 1.4em; } .wrap h2 { margin: .4em 0 .5em; display: block; border-bottom: .5em solid #e5f3ff; color: #333; font: normal 32px/5px serif; clear: both; } * html .wrap h2 { margin-top: 1em; } .back { display: block; position: absolute; left: 14px; top: 10px; } #upload-files { list-style-type: none; margin: 0; padding: 15px 0 0; } #upload-files li { margin: 0 0 15px 15px; } #upload-files a, #upload-file-view a, a.file-link { border: none; text-decoration: none; } #upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; } #upload-files a.file-link { display: block; width: 130px; height: 128px; background-color: rgb(209, 226, 239); text-align: center; overflow: hidden; } #upload-files a.text { padding-top: 40px; height: 88px; font-size: 16px; } #upload-files a.file-link.image { font-size: 2px; letter-spacing: 0; } #upload-files a.file-link img { vertical-align: middle; } #the-attachment-links textarea { font-size: 10px; overflow: hidden; } form table { float: none; padding: 0 15px; } table { float: left; margin: 0; padding: 0; } th { text-align: right; vertical-align: text-top; } tr, td, th { margin-top: 0; padding-top: 0; } #uploadoptions th { width: 80px; } #uploadoptions p { margin: 0; padding: 0; } #uploadoptions td { padding-left: 1em; line-height: 140%; } #uploadoptions table { width: 300px; } input.readonly { background-color: #ddd; } wp-admin/css/widgets-rtl.css0000644013707600007620000000107710674563756014073 0ustar www.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; }wp-admin/css/widgets.css0000644013707600007620000000622310663367510013256 0ustar wwwbody { height: 100%; } #sbadmin #zones { -moz-user-select: none; -khtml-user-select: none; user-select: none; } #sbreset { float: left; margin: 1px 0; } .dropzone { border: 1px solid #bbb; float: left; margin-right: 10px; padding: 5px; background-color: #f0f8ff; } .dropzone h3 { text-align: center; color: #333; } .dropzone input { display: none; } .dropzone ul { float: left; list-style-type: none; width: 240px; margin: 0; min-height: 200px; padding: 0; display: block; } * .module { width: 238px; padding: 0; margin: 5px 0; cursor: move; display: block; border: 1px solid #ccc; background-color: #fbfbfb; position: relative; text-align: left; line-height: 25px; } * .handle { display: block; width: 216px; padding: 0 10px; position: relative; border-top: 1px solid #f2f2f2; border-right: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; border-left: 1px solid #f2f2f2; } * .popper { margin: 0; display: inline; position: absolute; top: 3px; right: 3px; overflow: hidden; text-align: center; height: 16px; font-size: 18px; line-height: 14px; cursor: pointer; padding: 0 3px 1px; border-top: 4px solid #6da6d1; background: url( ../images/fade-butt.png ) -5px 0px; } * html .popper { padding: 1px 6px 0; font-size: 16px; } #sbadmin p.submit { padding-right: 10px; clear: left; } .placemat { cursor: default; margin: 0; padding: 0; position: relative; } .placemat h4 { text-align: center; } .placemat span { background-color: #ffe; border: 1px solid #ccc; padding: 0 10px 10px; position: absolute; text-align: justify; } #palettediv { border: 1px solid #bbb; background-color: #f0f8ff; height:auto; margin-top: 10px; padding-bottom: 10px; } #palettediv:after, #zones:after, .dropzone:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #palettediv, #zones, .dropzone { display: block; min-height: 1px; } * html #palettediv, * html #zones, * html .dropzone { height: 1%; } #palettediv h3 { text-align: center; color: #333; min-height: 1px; } #palettediv ul { padding: 0 0 0 10px; } #palettediv .module { margin-right: 10px; float: left; width: 120px; } #palettediv .handle { height: 40px; font-size: 90%; width: 110px; padding: 0 5px; } #palettediv .popper { visibility: hidden; } * html #palettediv ul { margin: 0; padding: 0 0 0 10px; } #controls { height: 0px; } .control { position: absolute; display: block; background: #f9fcfe; padding: 0; } .controlhandle { cursor: move; background-color: #6da6d1; border-bottom: 2px solid #448abd; color: #333; display: block; margin: 0 0 5px; padding: 4px; font-size: 120%; } .controlcloser { cursor: pointer; font-size: 120%; display: block; position: absolute; top: 2px; right: 8px; padding: 0 3px; font-weight: bold; } .controlform { margin: 20px 30px; } .controlform p { text-align: center; } .control .checkbox { border: none; background: transparent; } .hidden { display: none; } #shadow { background: black; display: none; position: absolute; top: 0px; left: 0px; width: 100%; } #dragHelper { position: absolute; } #dragHelper li.module { display: block; float: left; } wp-admin/custom-header.php0000644013707600007620000002500010644570444013552 0ustar wwwadmin_header_callback = $admin_header_callback; } function init() { $page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page')); add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); add_action("admin_head-$page", array(&$this, 'js'), 50); add_action("admin_head-$page", $this->admin_header_callback, 51); } function js_includes() { wp_enqueue_script('cropper'); wp_enqueue_script('colorpicker'); } function js() { if ( isset( $_POST['textcolor'] ) ) { check_admin_referer('custom-header'); if ( 'blank' == $_POST['textcolor'] ) { set_theme_mod('header_textcolor', 'blank'); } else { $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']); if ( strlen($color) == 6 || strlen($color) == 3 ) set_theme_mod('header_textcolor', $color); } } if ( isset($_POST['resetheader']) ) { check_admin_referer('custom-header'); remove_theme_mods(); } ?>

    %1$d x %2$d pixels will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?>


    false); $file = wp_handle_upload($_FILES['import'], $overrides); if ( isset($file['error']) ) die( $file['error'] ); $url = $file['url']; $file = $file['file']; $filename = basename($file); // Construct the object array $object = array( 'post_title' => $filename, 'post_content' => $url, 'post_mime_type' => 'import', 'guid' => $url); // Save the data $id = wp_insert_attachment($object, $file); $upload = array('file' => $file, 'id' => $id); list($width, $height, $type, $attr) = getimagesize( $file ); if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) { set_theme_mod('header_image', clean_url($url)); $header = apply_filters('wp_create_file_in_uploads', $file, $id); // For replication return $this->finished(); } elseif ( $width > HEADER_IMAGE_WIDTH ) { $oitar = $width / HEADER_IMAGE_WIDTH; $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication $url = str_replace(basename($url), basename($image), $url); $width = $width / $oitar; $height = $height / $oitar; } else { $oitar = 1; } ?>

    1 ) { $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; $_POST['y1'] = $_POST['y1'] * $_POST['oitar']; $_POST['width'] = $_POST['width'] * $_POST['oitar']; $_POST['height'] = $_POST['height'] * $_POST['oitar']; } $header = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); $header = apply_filters('wp_create_file_in_uploads', $header); // For replication $parent = get_post($_POST['attachment_id']); $parent_url = $parent->guid; $url = str_replace(basename($parent_url), basename($header), $parent_url); set_theme_mod('header_image', $url); // cleanup $file = get_attached_file( $_POST['attachment_id'] ); $medium = str_replace(basename($file), 'midsize-'.basename($file), $file); @unlink( apply_filters( 'wp_delete_file', $medium ) ); wp_delete_attachment( $_POST['attachment_id'] ); return $this->finished(); } function finished() { ?>

    step_1(); } elseif ( 2 == $step ) { $this->step_2(); } elseif ( 3 == $step ) { $this->step_3(); } } } ?> wp-admin/edit-category-form.php0000644013707600007620000000435510667076612014530 0ustar www'; $action = 'editedcat'; $nonce_action = 'update-category_' . $cat_ID; do_action('edit_category_form_pre', $category); } else { $heading = __('Add Category'); $submit_text = __('Add Category »'); $form = '
    '; $action = 'addcat'; $nonce_action = 'add-category'; do_action('add_category_form_pre', $category); } ?>

    parent . '&hierarchical=1&show_option_none=' . __('None')); ?>

    wp-admin/edit-comments.php0000644013707600007620000001673310667076612013602 0ustar www

    |

    get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); if ( current_user_can('edit_post', $post_id) ) { if ( !empty( $_POST['spam_button'] ) ) wp_set_comment_status($comment, 'spam'); else wp_set_comment_status($comment, 'delete'); ++$i; } endforeach; echo '

    '; if ( !empty( $_POST['spam_button'] ) ) { printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i); } else { printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i); } echo '

    '; endif; if ( isset( $_GET['apage'] ) ) $page = abs( (int) $_GET['apage'] ); else $page = 1; $start = $offset = ( $page - 1 ) * 20; list($_comments, $total) = _wp_get_comment_list( isset($_GET['s']) ? $_GET['s'] : false, $start, 25 ); // Grab a few extra $comments = array_slice($_comments, 0, 20); $extra_comments = array_slice($_comments, 20); $page_links = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', 'total' => ceil($total / 20), 'current' => $page )); if ( $page_links ) echo ""; if ('view' == $mode) { if ($comments) { $offset = $offset + 1; $start = " start='$offset'"; echo "
      \n"; $i = 0; foreach ( $comments as $comment ) { get_comment( $comment ); // Cache it _wp_comment_list_item( $comment->comment_ID, ++$i ); } echo "
    \n\n"; if ( $extra_comments ) : ?>

    '; wp_nonce_field('bulk-comments'); echo ''; foreach ($comments as $comment) { $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' : ''; ?>
    ' . __('Name') . ' ' . __('E-mail') . ' ' . __('IP') . ' ' . __('Comment Excerpt') . ' ' . __('Actions') . '
    comment_post_ID) ) { ?> comment_post_ID) ) { echo "" . __('Edit') . ""; } ?> comment_post_ID) ) { echo "comment_post_ID."&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') . " "; } ?>

    '); return false } return confirm('')" /> '); return false } return confirm('')" />

    $page_links

    "; ?>
    wp-admin/edit-form-advanced.php0000644013707600007620000002527410673254346014462 0ustar www

    "; wp_nonce_field('add-post'); } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = ""; wp_nonce_field('update-post_' . $post_ID); } $form_pingback = ''; $form_prevstatus = ''; $form_trackback = 'to_ping) ) .'" />'; if ('' != $post->pinged) { $pings = '

    '. __('Already pinged:') . '

    '; } $saveasdraft = ''; if (empty($post->post_status)) $post->post_status = 'draft'; ?> post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>

    id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; if ( $authors && count( $authors ) > 1 ) : ?>

    $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
    post_status ) { ?> post_content); ?>

    post_status, array('publish', 'future') ) || 0 == $post_ID ) { ?>

    ' . __('This feature requires iframe support.') . ''; } ?>

    ()

    post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
    wp-admin/edit-form-comment.php0000644013707600007620000000774210671545612014354 0ustar wwwcomment_ID); $form_action = 'editedcomment'; $form_extra = "' />\n\ncomment_ID) ?>
    comment_content, 'content', 'newcomment_author_url'); ?>

    :    
    :
      comment_ID ) . "'; return true; } return false;\""; ?> />
    wp-admin/edit-form.php0000644013707600007620000000605210671553330012701 0ustar www

    post_category); ?>

    100)) { $rows = 10; } ?>

    (Separate multiple URLs with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '
    '; ?>

    '; } ?>

    wp-admin/edit-link-categories.php0000644013707600007620000000711510672775704015033 0ustar wwwterm_id' class='edit'>".__( 'Edit' ).""; $default_cat_id = (int) get_option( 'default_link_category' ); if ( $category->term_id != $default_cat_id ) $edit .= "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' ).""; else $edit .= "".__( "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 ) ? "$category->count" : $category->count; return " $category->term_id " . ( $name_override ? $name_override : $pad . ' ' . $category->name ) . " $category->description $count $edit\n\t\n"; } ?>

    add new)'), '#addcat') ?>

    Note:
    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 %s.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?>

    wp-admin/edit-link-category-form.php0000644013707600007620000000352310672775704015463 0ustar www'; $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 »'); $form = '
    '; $action = 'addcat'; $nonce_action = 'add-link-category'; do_action('add_link_category_form_pre', $category); } ?>

    wp-admin/edit-link-form.php0000644013707600007620000002573110654112526013640 0ustar www'; $nonce_action = 'update-bookmark_' . $link_id; } else { $heading = __('Add Link'); $submit_text = __('Add Link »'); $form = ' wp-admin/edit-page-form.php0000644013707600007620000002032610625511420013604 0ustar www

    "; } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $nonce_action = 'update-page_' . $post_ID; $form_extra = ""; } $temp_ID = (int) $temp_ID; $user_ID = (int) $user_ID; $sendto = clean_url(stripslashes(wp_get_referer())); if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) $sendto = 'redo'; ?>
    '; } ?>

    id ) ) : // TODO: ROLE SYSTEM ?>

    post_status ) { ?> post_content); ?>

    post_status || 0 == $post_ID): ?>

    ' . __('This feature requires iframe support.') . ''; } ?>

    ID) ) ?> post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
    wp-admin/edit-pages.php0000644013707600007620000000700410667342430013035 0ustar www 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']; } ?>

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

    1 ) : ?>
    $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?>

    wp-admin/edit-post-rows.php0000644013707600007620000000613410667607370013725 0ustar wwwID == $post->post_author ? 'self' : 'other' ); ?> post_status ); ?>'> $column_display_name) { switch($column_name) { case 'id': ?>
    post_modified ) _e('Never'); else the_modified_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?> post_date) _e('Unpublished'); else the_time(__('Y-m-d \<\b\r \/\> g:i:s a')); ?> post_status) _e(' - Private'); ?> ID ); $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); if ( $left ) echo ''; ?> ID) ) { echo "" . __('Edit') . ""; } ?> ID) ) { echo "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') . ""; } ?>
    wp-admin/edit.php0000644013707600007620000002274210675115000011734 0ustar www array(__('Published'), __('Published posts')), 'future' => array(__('Scheduled'), __('Scheduled posts')), 'pending' => array(__('Pending Review'), __('Pending posts')), 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 'private' => array(__('Private'), __('Private posts')) ); $avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'"); $post_status_q = ''; $post_status_label = __('Posts'); if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { $post_status_label = $post_stati[$_GET['post_status']][1]; $post_status_q = '&post_status=' . $_GET['post_status']; } ?>
    'display name' $posts_columns = array(); $posts_columns['id'] = '
    ' . __('ID') . '
    '; 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'] = '
    ' . __('Comments') . '
    '; $posts_columns['author'] = __('Author'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); // you can not edit these at the moment $posts_columns['control_view'] = ''; $posts_columns['control_edit'] = ''; $posts_columns['control_delete'] = ''; ?>

    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 “%s”'), wp_specialchars( get_search_query() ) ) : ''; $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), 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 ); } ?>

    1 ) : ?>
    $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0) ); ?>
    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 ) ) { ?>

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

      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 ($i % 2) $class .= ' alternate'; echo "
    1. "; ?>

      comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

      — [ comment_post_ID) ) { echo " " . __('Edit') . ''; echo ' | comment_author)) . "', theCommentList );\">" . __('Delete') . ' '; if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { echo ' | ' . __('Unapprove') . ' '; echo ' | ' . __('Approve') . ' '; } echo " | comment_post_ID . "&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') . " "; } ?> ]

    2. '; }//end if comments ?>
    wp-admin/export.php0000644013707600007620000002334010675225674012346 0ustar www

    get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); $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->term_id] = $category->parent; $parents = array_unique(array_diff($parents, array_keys($parents))); if ( $zero = array_search('0', $parents) ) unset($parents[$zero]); return $parents; } while ( $parents = wxr_missing_parents($categories) ) { $found_parents = get_categories("include=" . join(', ', $parents)); if ( is_array($found_parents) && count($found_parents) ) $categories = array_merge($categories, $found_parents); else break; } // Put them in order to be inserted with no child going before its parent $pass = 0; $passes = 1000 + count($categories); while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) { if ( $cat->parent == 0 || isset($cats[$cat->parent]) ) { $cats[$cat->term_id] = $cat; } else { $categories[] = $cat; } } unset($categories); function wxr_cdata($str) { if ( seems_utf8($str) == false ) $str = utf8_encode($str); // $str = ent2ncr(wp_specialchars($str)); $str = ""; return $str; } function wxr_cat_name($c) { if ( empty($c->name) ) return; echo '' . wxr_cdata($c->name) . ''; } function wxr_category_description($c) { if ( empty($c->description) ) return; echo '' . wxr_cdata($c->description) . ''; } function wxr_tag_name($t) { if ( empty($t->name) ) return; echo '' . wxr_cdata($t->name) . ''; } function wxr_tag_description($t) { if ( empty($t->description) ) return; echo '' . wxr_cdata($t->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\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\n"; } echo $the_list; } echo '\n"; ?> <?php bloginfo_rss('name'); ?> http://wordpress.org/?v= slug; ?>parent ? $cats[$c->parent]->name : ''; ?> slug; ?> 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); ?> <?php the_title_rss() ?> post_content ?>]]> ID; ?> post_date; ?> post_date_gmt; ?> comment_status; ?> ping_status; ?> post_name; ?> post_status; ?> post_parent; ?> menu_order; ?> post_type; ?> get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID"); if ( $postmeta ) { ?> meta_key; ?> meta_value; ?> get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID"); if ( $comments ) { foreach ( $comments as $c ) { ?> comment_ID; ?> comment_author); ?> comment_author_email; ?> comment_author_url; ?> comment_author_IP; ?> comment_date; ?> comment_date_gmt; ?> comment_content; ?> comment_approved; ?> comment_type; ?> comment_parent; ?> wp-admin/images/0000755013707600007620000000000010706137420011541 5ustar wwwwp-admin/images/box-bg-left.gif0000644013707600007620000000004510453107032014330 0ustar wwwGIF87a, ;wp-admin/images/box-bg-right.gif0000644013707600007620000000022710453107032014515 0ustar wwwGIF87a,dH0I8ͻ`(dihlp,ϴ3P|pH,ȤrШtJZجv8uݰxL.z|NJ7~T_ ;wp-admin/images/box-bg.gif0000644013707600007620000000015710333252430013404 0ustar wwwGIF89a!,4A0I8tdih2_8p,ϴӊK|/pH4sŤr;wp-admin/images/box-butt-left.gif0000644013707600007620000000025110453107032014715 0ustar wwwGIF87a , .6ld BInSR̥H20 DH͡H!;wp-admin/images/box-butt-right.gif0000644013707600007620000000170010453107032015100 0ustar wwwGIF89a , &dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~Nk    H*\ȰÇ#JH (PǏ CIɓ(S\ɲ˗0eQ@ɳϟ@ ѣH*]ʴӧPJJիXjʵׯ`ÊKٳhӪ]˶۷pʝKݻx˷߿ LÈ+^̸ǐ#KL˘3k̹ϠCMD D ȞM۲3ͻ Nȓ+_μУKNسkνËOӫ_Ͼ˟OϿ(h& 6F(Vhf%@&$h(,0(4h8<@)DiH&L6PF)TViXf\v`)dihlp)tix|矀*蠄j衈&袌6r8 (?"馜v駠*jjꩨꪬ꫰*무j뭸뮼+k&6F+HVkfv+k覫+k, G#;wp-admin/images/box-butt.gif0000644013707600007620000000053310333252430013770 0ustar wwwGIF89a !, ؠ6ldihlp,t{e BpH !:Шtq$0z`by0EncQP"$=  L%  &  Y)wJ)rD;wp-admin/images/box-head-left.gif0000644013707600007620000000051610453107032014644 0ustar wwwGIF87a4&&%#|$$!w!vd#w.7UW%#{'#}%!x'"x&"z$"y u,s@`, "\"qdH21a00ASUEg IBL"F:򑐌$'IJZ̤&7Nz (GIRL*WJ;1 fIZ̥.w^ 0IbL2f:Ќ4IjZ̦6nz 8IrL:v~ @JЂMBІ:D'JQo2ȨF7юz HGJҒ(MJWҖ0LgJӚ8ͩNwӞ@ PJԢHMRԦ:PTJժZXͪVծz` XJֲhMZֶp\J׺xͫ^zQீ `KMb:d'KZͬf7z hGKҚMjWֺlgKͭnw pKMr:ЍtKZͮvzUm_ @Mz|Kͯ~LN;'L [ΰ7{ GL(NW0gL8αw@L"?/H&;PL*[Xβ.{`L2hN6pL:xγ>πMBЈNF;ѐ'MJ[Ҙδ7N{ӠGMRԨNհgMZָεw^MbNf;ЎMj[ζn{MrNvMzη~NO;&N[ϸ7{ GN(OW0gN8Ϲw@ЇNHOҗ;PԧN[XϺַ{`NhOpNw5xϻOO;񐏼'O[ϼ7{GOқOWֻgOϽwOO;ЏO[Z{OOOϿ8Xx 8Xx؁ "8$X&x(*,؂.0284X6x8:<؃>}B8DXFxHJL؄NPR8TXVxXZ\؅^`b8dXfxhjl؆npr8tXvxxz|؇~8Xx؈8Xx؉8mW-p؊8Xx؋8XxȘʸ،8Xxؘڸ؍8Xx蘎긎؎8Xx؏9Yy)} ِ9Yyّ "9$Y&y(*,ْ.0294Y6y8:<ٓ>@B9DYFyHJLٔNPR9TYVyXZ\ٕ^`b9dYfyhjlٖ7W+r9tYvyxz|ٗ~9Yy٘9Yyٙ9Yyٚ9Yyٛ9Yyșʹٜə}uyؙڹٝ9Yy虞깞ٞ9Yyٟ:ZzK ڠ:Zzڡ ":$Z&z(*,ڢ.02:4Z6zWA;wp-admin/images/box-head.gif0000644013707600007620000000155710333252430013722 0ustar wwwGIF89a&&%#|$$!w!vd#w.7UW%#{'#}%!x'"x&"z$"y u!,@`,Hrl:ШtJZXh4bzn|Nui 22  1C33 ! E}$F  Ftp *\ȰÇ#JHŋP4XIɓ(S\ɲ˗0cLIC d@ JѣH*]t((AÅիXjʵׯ`ÊKٮOĘJÄ۷pʝKݻx˷ߺiʠ:È+^̸ǐ#KL2lQh̹ϠCMӨSy0 c˞M۸sͻoȓ+_μУKN:4 hνËOӫ]˟OϿإ h& 6F(aؕ`fv ($hb,0(4h8cص@)DiH&L6d TViXf\v`)fح`hlp)tig؝|矀*蠄j衈&h;wp-admin/images/browse-happy.gif0000644013707600007620000001045610304120142014641 0ustar wwwGIF89a(MMy3Ȫjjj44mmRRrS 9Ұq$$qqqYY҉݉{kffxzcLLHHJJvv<yy!!((aamuznnn}}<<\\8섄Ɯvvv99EEAxyyyaaɥ8811~~~ĽAAVV--v__qƺN䆆3뮟kkkccvqi}~}zGGqq///??|Ɵ[T񰳷FnᾍK7ߪP@a*թܿ~ ˆ+68q|:9”lX,o_Ο=o},cIаI~-6۳s֍{oϖJF8Ms͟K_IJ$ߣOˣ_}ID1R0EPҧIU>H#Q ? ,A8 N)+C?#蜉BJ$B)#x$ '3䏳 0#BxdF8Eϓ"?E.I% >OAψ8?kf'%I&Pj:J&J$'I衆:i@ 3LEꏥm2饕J*馆>?xg8✪jP $̺&&h(X+첗Rr*:b;%ZO>ُ>?> #,&BɞARS. )2o 7,PX O)qOybdJ\(TBJ&|-?l#dH&R t$"J$HwDG}Q-uX_\g^WMcs|2*B ?hڎtB+J#T6͙h$Ȳ(j?kCSLGg枇l&%q8s#,ȩ)%r,;;Bbw`*QN|D?`VFpb ]\␰xr\؁ LIKS2Us*G q,E**AV4@E(7щW4B ,h( *~aX`8@A8`HؼGsT#0?Z+Mp*1щN#2`h?D#J `,D2ā V셫X[%2 {0|bVQ u D(E`Ѐ"td"Ѓ+8t( Y 7X8x69txD(^ `]ڑ#X8B0mH0@YDB!$6QVlt`G(&%ax@z ;08i A@x?^p 25  3xW_6&qx"D@ HJ U+hl.@ d!ȼ!%怀ABhFA U JLwAذCA8@9,(~@ 6a N6daه)g@U' '0\B ##8%pJ P@ iG(9"c 2 e8Ρ&` p`ܐ Br=]G`"D, 8 &FQl;v&' Mԁ:KXsw+la \"YsPs2:0K`&-OA9_ ZT!P|ЃЧ?! 9H=H45xQuC"pp?Pdf P0 p i @]@P 0_`Rg|P` Up r0bUmDw'H@7Ht@k 7 zXtd=&vM0 {p 0q@ g@F @ `l -# b AHCp^\]NH00e0o=d F@u @ pvK <@^`p 0 &u g@' 5F,g)pXtdf&dujR0yP 0W6k\0pj@6@^ @Aa6ZG– pƒ! m X1 spKp BYPCy| G@Kp E5P PApp5P`Q]ptey aM /PD;` jI!" ˅ 0 qG 0h4@ CD}2K ` `Od/!NXX[`z O` "HPv& ` `_aB  A D 0 P pZT FԠԜgHI  Xd -{L%#a SyH x/ C G3>GeP:HH;Ev:ji  r UA  7`B\ZvzxU2z0z0lP ~ʥAD9A+Kz@}U)  @gJ3@r::%@P% zP0` B gA< ?!  @! G!޺) C,`79 )p?:Zz*PJ!@ iZp 4P4!C0 )@ ;&{(*,۲.{:aJ6 {8:;wp-admin/images/fade-butt.png0000644013707600007620000000142110304117240014110 0ustar wwwPNG  IHDR(*gAMA7tEXtSoftwareAdobe ImageReadyqe<PLTE 2IDATxbpP``"uf Rg $`CM888 eueeeuA]_J]JL]_LDE#e@ <<@GBGH  )f@ |||||V|Ġjh(*i*) dĤjĤdd288CIbT6UV䔖VV0V4 'AAM{A-AM-A%%M-A%bbbaab KE[ |*@X @a U VA*@X @a U VA*@X @a U VAKv%FUIENDB`wp-admin/images/heading-bg.gif0000644013707600007620000000004510620466306014217 0ustar wwwGIF87a, ;wp-admin/images/login-bkg-bottom.gif0000644013707600007620000000130010466552656015414 0ustar wwwGIF89a򧴾>Y!C]o4Q=Zq)JcYr7Sw˪͏ 2O!,@p rl:ШtJZجvz8:BYȀ̪|N~M k. f'|x&f .-jG"_"f-. f#$u$#f k̻k kvk  GKk ok20.0uZ @ ȱ6pI@0˗0cʜI͛8sɳݟ>MR&@ <]ʴӧPJ:u@ -ά,`ÊK٥D(wPzݻxu9 IA B@wǐ#K7 Ъ @X AS^ͺװc˞M۸sͻ߹(B  ZHNسkνËOӗO˟OϿ;wp-admin/images/login-bkg-tile.gif0000644013707600007620000004551710466552656015067 0ustar wwwGIF89a<_R&k\Jt=`%_T*eLx@eO|VLveYTS[!ZN{⁝Hq YPzU~%`X5kKv(bW$]GyPyT~9Z$`GpJtV-eDk!["_T(d'cVOxXP}(`LwNz!^LvNyuZR|WT*hIrS|Lt"^VP|X \mXHqNzP|"]]S~R'aJsYVP|,j"i g=qaVOzUVPQYMv}#`&`S|ZQ~YKuMxNx#^Q{NwZUhNyU_/gY-l 4R 3Q 3PT 5T6UBh7W8X;]T:\:[ 5S?c>b0hFnCiEm7VCjAgEl8YAfSS>a 4S 2P6V?dIsP~QFo;^9YDkDlHrGoP}Fm 6T 4Q7XBi;\Bg@fIrGpMyRQUIr%aItKt%bPIsRJtWQ}XKsZR~SO{W&b#[%_"]Q}T:x+cUVW\ 2O!, H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0"b!8sɳϟ@ JѣH*]ʴӧKm`̚6E#ׯ`ÊKٳhӪ]˶۷pʝKn\04*F& [oÈ+^\fbfbъb `̹Ϡ^I߈ P(װc,T؈i ʹwμE:&,c/ËOۨ_Ͼ{l˟O~|Ͽ(`X{&z 6cLrt6vPjd&@($|0Ƹ(F8aP$ŬaAL"Lh3TV c>`\vkmh6leXgtֹ_`|CA6qBEFR>]>|裐F*餔VjdX駟 ꨢ6aꩨª k#檫ꫯ`+k,&벹J*V{*%v{+%SPieT\k5w3ۂV;B,.,6찱 7Rpگn$_?߱AfP.w[8;r[1:ų<1 ?F|t-A_o%nYJsU3N}0D=)ۈ2>L@VDpIc?=va騛Nz}TMdžg픢kAӮ@+ Akփ wtW 5 >{#/~=92 k">s|_?ltO{bm+|;&0Aɩ@v`ns<.YK FHS7ÙB3Wā fep~A ,z&Lh=pb, x5i[BCM4VuVS6{hMqcU6-ސ@vGap[d X嬧aH|$G=YuOɰ[@pH \;93σS#$8ZJzrUmEMr[ *&JRl!3U teKY d.WX^yYbs :";I&F",hMcaS @YK\6e EE`Q$;LS*3#s3I|aƁ޼e8:NL*Tlh/l)mz/ &#GJ<6Ԧ.*߱+ڑxLg !qᴋ]fWSգCEcŒJ,pN\:PJb-]U5ՀiՓ\+Z \eg4j0"a<:ZVnTr´+{XK-mXk 1Zk?*ْԲl@3{: *h9ЇrJ:-<S8ЍtKZ>'V~BUbܺײeoZ,BYX vwg L`*w}a-`׻x]*lrۇz/}e ujEU0u A86b oLr,ؚ&&{^f[:Z1 ؊[ N 2x] RF6a|s:Yɹ {WYXβ`/3bNmFgw_\V+j^X5l;{C XM^Wj9\g]13ֳY#jI8{w-_hu*QTeF >AY YB<Þ׋g޸\|N]C<, s ȿ~x0 bNe2Ǯq&ϕ'jJ&uS>u+;ub^Yw3uw\?ρ]NE;8Y߭o>p8dcׯcOx9wgO{q꥙u9-maL4~5}/5kqGiW;g?r ]r/ݗfV/p^n6E %~8H{eg~GyvytrGm8`^wnZ7dV:WB&oH*8{8t HBѦoHw_J'|E| z;@B8DXFxHCX;buRPXwsVxvx'l)Ȃ\ hjE'~5H~n*QX^L)Jpr>8vxs؆℧wiV}T}ׅȂ_oKb}vђkȆzGX؉MSnz$8d(x,( dPt|+xAwocȀV+8h胶0XxؘڸhBJX1['=38$WKXlhV`PF@@w8aH fHW5BxWS13<-ҍ&y((*ْ.8hOdhp?؎5yxw("VF (@e8sdbβ 3")%jȒlk#IeēTX( t0| "И *( V0 0 d0yATB)Uy0b*h*f *2Ii nٚirTPxhix}M)p20vdp*Ft`  n :M$cVU9yX)2Iuyw?|TA9* (KpFpzxV``i{R72IY\4jY9I@d!ʛDZYxdiZz IPW\9Dɞ-ꢃs135zpښ: Q@Z^ڛ=9B?  jhY>0Vڨw  7Yٕ6Gɑik C2sJroY3QYAjM )Ù` 2:d \ * yfhe n >x :Zzzbj Ky#CGJ꫾K@:x`UɬκJ9*!jl)Ꚛڱ { $[ɣz*DȫJ@` VKy n n@ |Џ-z|"<ݍJܭ;.S0,ڣ]?nnDHB~  >7t.| *}ݨ FAm瓍z}~~օHԋF觭-=Zh ϗUW~[իyl^V\: \E\},;6M~썾NnRMV`\@y,KUM|`y>4  ]=nSN|p ?lᐐ,OHpnUʹ{ )^6ャ58=E?MNO^R_~Yoՙ =ҵH Y z' w?nq/8:C)>~/0ď۸T/S0PƍYaGJ dn*'a^0Ι "&.Ґ$Nht5f G!E$Y%T;Vlʕ+!M9snx"E qHeBW !(H IbŪDY l3aI%;vR{=`vq嶘.[(Xfݶ]Qʖ k+[ dMt*U,R@$ҤG:'Dyj+[O&͕6_=ruNOZTK>:eʒx1ٳi @\;a{m8Vʖ`s; mAMjmB 3pC; G .5J+(*Q1)-Z$3j3ⱑcƬ#! r. +:{`,2qI'0#P C, z4cG?r2㹊*k*Z")A!#BmċFqO>A\ 4PCEӢ3N]|g|LsK3RAL&L|PXJ'QpXA&'OL1ɴL,\6[S94E-Qjk#47kVE5rH/0JLxxr,Fp2Tc<+2`g.2qF|m 5s?4e<67:VZ5ZlՖܰqecyfkq"D*);G3m7Lsn^4`B`V#g`׻iJ$H>crd>H $+x-*O4d;J '|pS mUځpo\g <8B衉6]xc H@9Ȳ"Z}2Vbp 6aά-g҆&ǛwfeY_z~{p?v"+tJ+ɶDZ$y$a#kp/p1z.* '}%~~#d 1hW,#LxB0z+ RBI39!hk?̏~"@R-[(L-Pֱ "D@N=f 6x|/scVcuc0(8tϒCJ9G?_F{nȟBlF vA2th`%?2ZƌgL>o"K:1&y#0?'#JtxHhF~?!Y,A1Ia `*UvCB0- &8qx`SԈK6*p1 jBa$qzdd"Mh U*7- Nɯ*.3xCxwF`XAY?&<te*:2M(H'fr<,s ipwNxlxaE(A}Gy +p{hO{SĒX?i\"""Tԅ GJȐt sjZ{uG.KYZ> sP!7pJ7,k,CF@8̃\s=_8g1,h1ܞB",B#\;B%\"@ 8=@3d+/õK/;AT@@BALD^Tc` FaFb,Fc=pū8r,KRa7#; \@ r,G˰CpomdlLF?|gHgTFHHEHHH BtDd9ƃdn,CGrFM ]R-QLM,Q<ѺdOUL0}J/5EPpLOu#$L'&SRQ+F,҂R.5@5XMHTE]D}'@2}L4=!]S6P$-@(SSOK;jQ-O?]{xC]G{ BC}0|U3 mP5lS7T UUhQ5)S=ҔdR  G ŜNhױHW0@Z "T!=ȄT'`V ΔVH5HXU*hX'Xi4L8XX`M}-wPY}HZ}_uTx%TG2mO-YHcPu<TX}‡u؅}ڃZZZZګ=Fu[ ۦUZy E[tX[tXj|8Z=ϞYp,Y@vYa݊ pTM\E{%GB\4Y۞[ Z[]e[tH[5ۦ۱=F=]M]եک]]}5Fۦ]u[=G[\ Y5ԁ`-G?(TUWۿUGś%Gx0^(GɝܒQ]r݇ݰ5F}_֍__ڽ]e[1ݍ޼^v(Gxh0ޛB^ Fv5WE ޝ%`ܡ%_OܴUe__~maF%UZ]l[ (~`3h#n?^b&ց"6b"ކ Y `\E_vX^.c}a3N]_\`%` >xx*KN1(>bA~`wb1(a0VbTcMZ44a.[㶕9[XcDDc0q3YeeF\-b6R/^JKdbdhdhaf7&RQdofN堵cd偄w%[,>DbpJg affb ㆵjMffanclagr`V/ȓʜ%YXeLgp|E~6f耮hJ>a݆Vci抶苦cqg% f&ޑvgGEd+G jiHoNI&hf%j3j~_]>ꉎ^jX~js۪j.lG>OZNNkm湎2m.mvX/h־ah]qmm.5l6laqmhlrp֦lMm>ўnnl̾nnn^en/f6Gm6~o%FG@n>_&]npp7~XVwp%p%0kf[qm~pq Nj WwpN>pqnOm_p>og6l#mq-q6_qEhGq-ξqgn) Nr6os]'Gr*sr>l.s>seOq '"wsG7r8' s:p;gn[A/m@tksOMsCpD?o.V~tWHoIJK*rAu@u^Q_p.uE0sTOEgVG_r&Y?[onq=u>um7Jvp#wr'wtOwb/S(xwipzgg_r7XX{wixwnq_qNwropJ.<xxxxx&?.PxOwhrv7x ({gt~yvxyKro_y?yoxzzxzo_Oz?zyww|yo~N/{[_qWxyzz/|W{{{y{{o{g|t{>||O}֗zƿ/G{͗wvw}9 __}'7~/sȧy}^l}|g|OӇ~x~oxr7~9H%b ?0l!ć&R8."ƌ *ye;.b2V%p.BM,PR箿p¦Lbdž))2-sB59s}<':rKM;4QK=5U[t{h5׃da"em5 a_3=wb۝eyox5}H ~8YvMh3:Xy6y@;6ދs⥛n*魻8{3cC"ی9:[a^7^OsjWOv>s.tW(e/`0x#^T \ L@z,A/maGC*4! CP.^cȽ* ,L7@ j>H8,&+C%>Pbh<"nбv#=~ģ8)A2<$"9"0t# (Rl#3&$$(QՋU|%,c)YҲ %.=6j2$K2mԥ'qJ[2|,Si,hRּ2ANq|0)_~f"Ikϔ)yRD"yYF>M|~Ҟ'B τ2T$AȀ2$EAD=hCCjͅh ;jȍz3E(LR4(IsL괧iMcҖ4t&7ԛ'5*թRV*Vխjj !ֱcZӪֵըc+\jֹ7*^׽|+`U=k\*h=aURg22r,hC+ђ=-jSZ(}k Ҷ,nsڶ-p᪖=.r\*}ni+]p-virװ+^(Lw=/z-p+^=,}+_W/; O>03~p! S|]sp0Cb յ0S .~1 ӸV1'l X"p{6>2,$3.r S2b's ^e-S25l,b~ 9׸e^uӬٺv2]cx І>4E3ю~4-PҖ43>cXӞQԦ>u Uգv2c-Mxֶ]]5j.ߺ>63ea3ٌl1'NmgC{-qSz>wuZ 7?nvӛT}7..p}p8#{K8+[8C.&?9S򕳼.9c.sW69s>9Ѓ.tϼF?:ғ>+N:W>SVzϣs]L:.vfӮvón;.ӽv;~.?|+ڎ3;#SG/s|;/ы>?=5z_/7^=Of=/?>3>/S|s>/??ӯ?ӿ?埿  . 6> <V^ fn v~   Ơ ֠ `  !&.! <FN!V^!fn!v~!!!~!!ơ!a0!!  "!!""&"."#6#>"$F""$V%^"&f&n"'v'"<р("))"**"++",Ƣ,"-֢-"..b(/"00#11+"2.#363>#4F#1*4V5^#6f6"<ł7~#88#99#::#;;#<ƣ<#=֣=c7ޣ>#??#@@:#A$B&B.$C6$@CFDN$EVE#%TFT$&dFdN&eVe^_6&fn&gvg~&h&ejhi&jj&ik&lƦlFfkΦm&nl“4o&pp'qq'r&r.'s6s>'tFtN'uV'sJS Ȃvn'wvw~'xx'yy'zz'{{'|Ƨ|'vΧ}'~~''z'((&h 6>(F'vւ^(fn(v~((((h(֨(樎(())&.)6(vNN)V^)fn)v~))))=HR)֩)橞))**&.铼(2*V^*fn*v*:*@ĩ**jL**֪*" *+bꮒ˨j.+6:jV^+jjf~+nk)/+++ƫ++櫾+*,&.,6֫jQV^,fnlFlƩ*Ȏ,ɖɞ,ʦʮ,˶˾,Ƭ,֬,,zlN,--Ҿ,j6>-FN.R-fn-v-Zz؎-ٖ-*-۶۾-ƭ-֭---ަ.&..6>.FnJ^.fn.B.C t.閮鞮~n.붮.:֮...//&./6/FN/V^/fo>v~/n///Ư/֯///00'/0ӯ70GO0W'_o0wf00 0 0 0 ǰ 0/0ðrk'/17?1GO1W_1go1w1_111DZ1ױ111 w2!!2" '2#7#?r"/2$O2%W%$_&o2'wrn0(2))2**2++2,Dz,2-ײ-2.2,./200311ꖂ2/3373?34G4O35W5_36g6o37w7388gs293::3;;53<3=׳=3>3;˳>?3@@{3?A4B'BsA/C?4DGBn4TE_4FgFo4GwG4HH4II4JJ4K4I)ĴL4M״M4NN4OO4PP5QQ5R'5PôR7S?5TGTO5UWU4S_Vo5WwW5XOuV5YY5ZuQZ[5\5T.*Ե]5^^5__5``6aa6b'b/6c76aӵcGdO6eWe_6fgf 6dog6hh6i_vg6jj6kvbkǶl6m6e n6oo6pp7qq7r'r/7s7s?7tG7rtWu_7vgvo7www7ux7yy7zowx7{{7|ws|׷}7~7vӷ~778xv0,87?8GO8W_8go8w8+8888c׸8縎8899'/979GO9W_9gy?w9s999#ǹ9׹9繞99::':7?:GO:Wz/go:wc:::::?:׺:3::;;'/;7?;GOn go;w;;;;;;׻;绾;ϻ<>ⷽ?}?>GO>W/~6~Q@(t>臾>闾>ꧾ>뷾>Ǿ>>cj?p>?>7??GO'? So?w[*M?~?ǿ?o>?D( 4x ;VlEÆ+!XYF9vdH#I4yeJ+YtfL >(E KhPC5ziRK6ujTSVڔ&C8sVxlXcɖ5{mZYBZsֵ{Y[qp` m_ 7vrdoJ˰d͛9wLb̞I6}Z-h;1rvlٳi׶}wnݻyxpÉ7[eJwztөW~w˛c|xW2ٷw~]Y~O_" <\|% - !; =EMam N~W;=-5ޘ=EM>U^YdY~emg]Ι}蠅y硍>餕^䢙~ꨥZf묵ꭽgZ>ԅ~垛ޛ._>\-5q;EM?U_]emuqߝ}xu/_祟ꭿ~ߞw^_O域G_8hw? @>t )@ V5AB3a YB2Y iXCІ9ԡ`A^W@!aH%6(|b)Vb-v$xF3gT#ҸF7Ưo8G;w#G?p24 I>7 $zHGIAN݋d&9IMvd(IJd(Uбҕe,U9KZҖ e.uI^2$9GӘDf2 Lfљc4yGjVs5vӛgg88Nrvќb:YEv3g9$ӞGg>O~Пa@ZCԅE( P)eC%:BVԊ!F[yQjУբF/)]&%J1ҕLKAR:Ц7U`Nu*FƐ)1Yʜ%8*&y6թjT٘T:rW_V Gv\+$:iլDkZVrӭof\*Nֵw+:uկl`9XӰgbO6,@%;فVֲlfY2Գ}O}XR.Ei(V.ϵM^le[EKژ8ά-@nKH:PJZXNz`J櫚h楺p{Jgx]g٤?Jh%h:zF JiZ槦i{zzIju&jozƦIkifkcz{Il]{MfٲTNdnxW Z6=;~wjn&Omw[8-wgoT[(+p= 9Iq\j5>=3ljw&7r/men[<79o]ړ\=Wʁ>Ky{t.ʅzԛ;uCW}kTavDc'{Ծvn'v,wo>_+zux>D|?Gwh.ۀ;wp-admin/images/logo-ghost.png0000644013707600007620000000174010661303702014331 0ustar wwwPNG  IHDRDz5gAMA7tEXtSoftwareAdobe ImageReadyqe<PLTEn.m:tRNS7 rIDATxdSi0 @+ o"yMg7COOnr};np>>6Ǔ>ˊ|3r$}44 NFg,"l-Kx3ip,Ʌb̼+a\ PSo4;Y$$!{]5{ϒpp$gr-ݼkmZe<30b;zg,R|-VJ3aTI< +,>E(2D=A5z큍S/br(b O8u־X.;R nXsdh-vtb\i;e˧-b=v*`7)Oqܗ~{i!xVѧJ@AӦ/C6 KF͌qM."Q2daX\nc ¹lii) s+f R '%k&:NB|T+EQ훁#lT 5-Lqr E5 pKhLns~2]H~/7Zs/-e&uXGu+I `\Ju= /R4:-R57^}m2;%UFǎC&͏ Mac%u7{MIENDB`wp-admin/images/notice.gif0000644013707600007620000000023410333241120013475 0ustar wwwGIF89a :z JY;zy!, IIu=Jꄖ lW 9g!gR0Z<A`s Ju9hDAM''L*$;wp-admin/images/toggle.gif0000644013707600007620000000033010337305736013514 0ustar wwwGIF89a2BB&~^>=D?)?!,2I8ͻ`(`9`R s`HBS8"tj*>C!(e!<-8Qf@HHJMUUWZ`bdiek;wp-admin/images/wordpress-logo.png0000644013707600007620000000445110343057302015236 0ustar wwwPNG  IHDRD gAMA7tEXtSoftwareAdobe ImageReadyqe<iPLTE@@@000 ```PPPppp܏R_&7}CR5E`m}oz*t\#tRNSf)IDATx[ْ( 싻{&?r@HBtuKG'.KoY3]E\ Zك+z81WS;_^եi2Iu[®yg~2+sQۂykJaMA/M[N+߱=Aе)pkʌbΝYQ\b?Kz"Gh'p8헋L_84rXŨ/ q\?[n[l[úU)ީ1ɤYXa񆗎#nG{~ϯW刍{ t-]Hc\mSsxp}5'Oc0eM^0ve'T17Qt4}ă}vs3/Xt/GOBk[R0O)tYAp5i`=UPѫUM(9:{Bckc?z`|d|MZ-ɑ $zx0vLMJ/^ H A)Vћ^lE4y}?wy: Ɂ;:H⿃ >n-ЕN;@)OҪ%9LXlnߍɘ.;71zd--\zև ~D#DL03DKxvԿDڹ!_}X-i[F @J?{Jg#/W!;--; N.ûdV/}ypDebtXb^J aӐ %yZCA$i`[YwI]bx !/,L$Ws-+7@a_cMݭ2JBBx?B7q蟉S;A>uUs ]zσFG~$ WQM.3r,UB1'm*{~YЛzNwx} 0 wiAo4,t{jLU+uwS*=j¬уt\ Z%)]R 'XC\!V sD9E 3݂9%9O1+G~ *_>J_Ga9%DʴqGZSZM1n%CqPIEb#+Ͳ҅{BBE|H҇H(dHC+8Us3QPd3>-"NpEBD }tl>_YQ.~ & A:$(*D.<Сsta %ҵw^oXIgNw{xt>2 )I.Y55A{U t,ej(Ywsys(Qb,{|}txDgUF5ʛ<%} FUwL Rd1(MQ";Lヒw_F}4ޛ#K).^kjo%bb˒Y=YdD?.^2/4{e;b=_ .r$j,)DE1:5RK"#U(FƋ"Km&/$W$,~ {l9G[ lz^xrR]hˍmEn^#+E?ZPLmrC ;Yթ2|kJ6Gվ2mm<;W981eZQtkHQ4lW|agۃa œm FYsi ? =,3KI%IENDB`wp-admin/import/0000755013707600007620000000000010706137420011606 5ustar wwwwp-admin/import/blogger.php0000644013707600007620000011006410673760566013762 0ustar www

    $title

    $welcome

    $prereqs

    $stepone

    \n"; } function uh_oh($title, $message, $info) { echo "

    $title

    $message

    $info
    "; } function auth() { // We have a single-use token that must be upgraded to a session token. $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] ); $headers = array( "GET /accounts/AuthSubSessionToken HTTP/1.0", "Authorization: AuthSub token=\"$token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return false; $response = $this->_txrx( $sock, $request ); preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches ); if ( empty( $matches[1] ) ) { $this->uh_oh( __( 'Authorization failed' ), __( 'Something went wrong. If the problem persists, send this info to support:' ), htmlspecialchars($response) ); return false; } $this->token = $matches[1]; wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) ); } function get_token_info() { $headers = array( "GET /accounts/AuthSubTokenInfo HTTP/1.0", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); return $this->parse_response($response); } function token_is_valid() { $info = $this->get_token_info(); if ( $info['code'] == 200 ) return true; return false; } function show_blogs($iter = 0) { if ( empty($this->blogs) ) { $headers = array( "GET /feeds/default/blogs HTTP/1.0", "Host: www.blogger.com", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); // Quick and dirty XML mining. list( $headers, $xml ) = explode( "\r\n\r\n", $response ); $p = xml_parser_create(); xml_parse_into_struct($p, $xml, $vals, $index); xml_parser_free($p); $this->title = $vals[$index['TITLE'][0]]['value']; // Give it a few retries... this step often flakes out the first time. if ( empty( $index['ENTRY'] ) ) { if ( $iter < 3 ) { return $this->show_blogs($iter + 1); } else { $this->uh_oh( __('Trouble signing in'), __('We were not able to gain access to your account. Try starting over.'), '' ); return false; } } foreach ( $index['ENTRY'] as $i ) { $blog = array(); while ( ( $tag = $vals[$i] ) && ! ( $tag['tag'] == 'ENTRY' && $tag['type'] == 'close' ) ) { if ( $tag['tag'] == 'TITLE' ) { $blog['title'] = $tag['value']; } elseif ( $tag['tag'] == 'SUMMARY' ) { $blog['summary'] == $tag['value']; } elseif ( $tag['tag'] == 'LINK' ) { if ( $tag['attributes']['REL'] == 'alternate' && $tag['attributes']['TYPE'] == 'text/html' ) { $parts = parse_url( $tag['attributes']['HREF'] ); $blog['host'] = $parts['host']; } elseif ( $tag['attributes']['REL'] == 'edit' ) $blog['gateway'] = $tag['attributes']['HREF']; } ++$i; } if ( ! empty ( $blog ) ) { $blog['total_posts'] = $this->get_total_results('posts', $blog['host']); $blog['total_comments'] = $this->get_total_results('comments', $blog['host']); $blog['mode'] = 'init'; $this->blogs[] = $blog; } } if ( empty( $this->blogs ) ) { $this->uh_oh( __('No blogs found'), __('We were able to log in but there were no blogs. Try a different account next time.'), '' ); return false; } } //echo '
    '.print_r($this,1).'
    '; $start = js_escape( __('Import') ); $continue = js_escape( __('Continue') ); $stop = js_escape( __('Importing...') ); $authors = js_escape( __('Set Authors') ); $loadauth = js_escape( __('Preparing author mapping form...') ); $authhead = js_escape( __('Final Step: Author Mapping') ); $nothing = js_escape( __('Nothing was imported. Had you already imported this blog?') ); $title = __('Blogger Blogs'); $name = __('Blog Name'); $url = __('Blog URL'); $action = __('The Magic Button'); $posts = __('Posts'); $comments = __('Comments'); $noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don\'t worry, you can turn it back off when you\'re done.'); $interval = STATUS_INTERVAL * 1000; foreach ( $this->blogs as $i => $blog ) { if ( $blog['mode'] == 'init' ) $value = $start; elseif ( $blog['mode'] == 'posts' || $blog['mode'] == 'comments' ) $value = $continue; else $value = $authors; $blogtitle = js_escape( $blog['title'] ); $pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0; $cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0; $init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');'; $pstat = "
     
    $pdone/{$blog['total_posts']}
    "; $cstat = "
     
    $cdone/{$blog['total_comments']}
    "; $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; } echo "

    $title

    \n$rows
    $name$url$posts$comments$action
    "; echo " \n"; } // Handy function for stopping the script after a number of seconds. function have_time() { global $importer_started; if ( time() - $importer_started > MAX_EXECUTION_TIME ) die('continue'); return true; } function get_total_results($type, $host) { $headers = array( "GET /feeds/$type/default?max-results=1&start-index=2 HTTP/1.0", "Host: $host", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $host ); if ( ! $sock ) return; $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); $parser = xml_parser_create(); xml_parse_into_struct($parser, $response['body'], $struct, $index); xml_parser_free($parser); $total_results = $struct[$index['OPENSEARCH:TOTALRESULTS'][0]]['value']; return (int) $total_results; } function import_blog($blogID) { global $importing_blog; $importing_blog = $blogID; if ( isset($_GET['authors']) ) return print($this->get_author_form()); header('Content-Type: text/plain'); if ( isset($_GET['status']) ) die($this->get_js_status()); if ( isset($_GET['saveauthors']) ) die($this->save_authors()); $blog = $this->blogs[$blogID]; $total_results = $this->get_total_results('posts', $blog['host']); $this->blogs[$importing_blog]['total_posts'] = $total_results; $start_index = $total_results - MAX_RESULTS + 1; if ( isset( $this->blogs[$importing_blog]['posts_start_index'] ) ) $start_index = (int) $this->blogs[$importing_blog]['posts_start_index']; elseif ( $total_results > MAX_RESULTS ) $start_index = $total_results - MAX_RESULTS + 1; else $start_index = 1; // This will be positive until we have finished importing posts if ( $start_index > 0 ) { // Grab all the posts $this->blogs[$importing_blog]['mode'] = 'posts'; $query = "start-index=$start_index&max-results=" . MAX_RESULTS; do { $index = $struct = $entries = array(); $headers = array( "GET /feeds/posts/default?$query HTTP/1.0", "Host: {$blog['host']}", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $blog['host'] ); if ( ! $sock ) return; // TODO: Error handling $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); // Extract the entries and send for insertion preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); if ( count( $matches[0] ) ) { $entries = array_reverse($matches[0]); foreach ( $entries as $entry ) { $entry = "$entry"; $AtomParser = new AtomParser(); $AtomParser->parse( $entry ); $result = $this->import_post($AtomParser->entry); if ( is_wp_error( $result ) ) return $result; unset($AtomParser); } } else break; // Get the 'previous' query string which we'll use on the next iteration $query = ''; $links = preg_match_all('/]*)>/', $response['body'], $matches); if ( count( $matches[1] ) ) foreach ( $matches[1] as $match ) if ( preg_match('/rel=.previous./', $match) ) $query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) ); if ( $query ) { parse_str($query, $q); $this->blogs[$importing_blog]['posts_start_index'] = (int) $q['start-index']; } else $this->blogs[$importing_blog]['posts_start_index'] = 0; $this->save_vars(); } while ( !empty( $query ) && $this->have_time() ); } $total_results = $this->get_total_results( 'comments', $blog['host'] ); $this->blogs[$importing_blog]['total_comments'] = $total_results; if ( isset( $this->blogs[$importing_blog]['comments_start_index'] ) ) $start_index = (int) $this->blogs[$importing_blog]['comments_start_index']; elseif ( $total_results > MAX_RESULTS ) $start_index = $total_results - MAX_RESULTS + 1; else $start_index = 1; if ( $start_index > 0 ) { // Grab all the comments $this->blogs[$importing_blog]['mode'] = 'comments'; $query = "start-index=$start_index&max-results=" . MAX_RESULTS; do { $index = $struct = $entries = array(); $headers = array( "GET /feeds/comments/default?$query HTTP/1.0", "Host: {$blog['host']}", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_blogger_sock( $blog['host'] ); if ( ! $sock ) return; // TODO: Error handling $response = $this->_txrx( $sock, $request ); $response = $this->parse_response( $response ); // Extract the comments and send for insertion preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); if ( count( $matches[0] ) ) { $entries = array_reverse( $matches[0] ); foreach ( $entries as $entry ) { $entry = "$entry"; $AtomParser = new AtomParser(); $AtomParser->parse( $entry ); $this->import_comment($AtomParser->entry); unset($AtomParser); } } // Get the 'previous' query string which we'll use on the next iteration $query = ''; $links = preg_match_all('/]*)>/', $response['body'], $matches); if ( count( $matches[1] ) ) foreach ( $matches[1] as $match ) if ( preg_match('/rel=.previous./', $match) ) $query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) ); parse_str($query, $q); $this->blogs[$importing_blog]['comments_start_index'] = (int) $q['start-index']; $this->save_vars(); } while ( !empty( $query ) && $this->have_time() ); } $this->blogs[$importing_blog]['mode'] = 'authors'; $this->save_vars(); if ( !$this->blogs[$importing_blog]['posts_done'] && !$this->blogs[$importing_blog]['comments_done'] ) die('nothing'); do_action('import_done', 'blogger'); die('done'); } function convert_date( $date ) { preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]+)?(Z|[\+|\-][0-9]{2,4}){0,1}#', $date, $date_bits); $offset = iso8601_timezone_to_offset( $date_bits[7] ); $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); $timestamp -= $offset; // Convert from Blogger local time to GMT $timestamp += get_option('gmt_offset') * 3600; // Convert from GMT to WP local time return gmdate('Y-m-d H:i:s', $timestamp); } function no_apos( $string ) { return str_replace( ''', "'", $string); } function min_whitespace( $string ) { return preg_replace( '|\s+|', ' ', $string ); } function import_post( $entry ) { global $wpdb, $importing_blog; // The old permalink is all Blogger gives us to link comments to their posts. if ( isset( $entry->draft ) ) $rel = 'self'; else $rel = 'alternate'; foreach ( $entry->links as $link ) { if ( $link['rel'] == $rel ) { $parts = parse_url( $link['href'] ); $entry->old_permalink = $parts['path']; break; } } $post_date = $this->convert_date( $entry->published ); $post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ) ); $post_title = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) ); $post_status = isset( $entry->draft ) ? 'draft' : 'publish'; // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_content = str_replace('
    ', '
    ', $post_content); // Checks for duplicates 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 ); $author = $this->no_apos( strip_tags( $entry->author ) ); add_post_meta( $post_id, 'blogger_blog', $this->blogs[$importing_blog]['host'], true ); add_post_meta( $post_id, 'blogger_author', $author, true ); add_post_meta( $post_id, 'blogger_permalink', $entry->old_permalink, true ); $this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id; ++$this->blogs[$importing_blog]['posts_done']; } $this->save_vars(); return; } function import_comment( $entry ) { global $importing_blog; // Drop the #fragment and we have the comment's old post permalink. foreach ( $entry->links as $link ) { if ( $link['rel'] == 'alternate' ) { $parts = parse_url( $link['href'] ); $entry->old_permalink = $parts['fragment']; $entry->old_post_permalink = $parts['path']; break; } } $comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; preg_match('#(.+?).*(?:\(.+?))?#', $entry->author, $matches); $comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) ); $comment_date = $this->convert_date( $entry->updated ); $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
    ', '
    ', $comment_content); $comment_content = str_replace('
    ', '
    ', $comment_content); // Checks for duplicates if ( isset( $this->blogs[$importing_blog]['comments'][$entry->old_permalink] ) || comment_exists( $comment_author, $comment_date ) ) { ++$this->blogs[$importing_blog]['comments_skipped']; } else { $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); $comment_id = wp_insert_comment($comment); $this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id; ++$this->blogs[$importing_blog]['comments_done']; } $this->save_vars(); } function get_js_status($blog = false) { global $importing_blog; if ( $blog === false ) $blog = $this->blogs[$importing_blog]; else $blog = $this->blogs[$blog]; $p1 = isset( $blog['posts_done'] ) ? (int) $blog['posts_done'] : 0; $p2 = isset( $blog['total_posts'] ) ? (int) $blog['total_posts'] : 0; $c1 = isset( $blog['comments_done'] ) ? (int) $blog['comments_done'] : 0; $c2 = isset( $blog['total_comments'] ) ? (int) $blog['total_comments'] : 0; return "{p1:$p1,p2:$p2,c1:$c1,c2:$c2}"; } function get_author_form($blog = false) { global $importing_blog, $wpdb, $current_user; if ( $blog === false ) $blog = & $this->blogs[$importing_blog]; else $blog = & $this->blogs[$blog]; if ( !isset( $blog['authors'] ) ) { $post_ids = array_values($blog['posts']); $authors = (array) $wpdb->get_col("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN (" . join( ',', $post_ids ) . ")"); $blog['authors'] = array_map(null, $authors, array_fill(0, count($authors), $current_user->ID)); $this->save_vars(); } $directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user\'s posts to a different WordPress user. You may add users and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the "Restart" function below.'); $heading = __('Author mapping'); $blogtitle = "{$blog['title']} ({$blog['host']})"; $mapthis = __('Blogger username'); $tothis = __('WordPress login'); $submit = js_escape( __('Save Changes »') ); foreach ( $blog['authors'] as $i => $author ) $rows .= ""; return "

    $heading

    $blogtitle

    $directions

    $rows
    $mapthis$tothis
    "; } function get_user_options($current) { global $wpdb, $importer_users; if ( ! isset( $importer_users ) ) $importer_users = (array) get_users_of_blog(); foreach ( $importer_users as $user ) { $sel = ( $user->user_id == $current ) ? " selected='selected'" : ''; $options .= ""; } return $options; } function save_authors() { global $importing_blog, $wpdb; $authors = (array) $_POST['authors']; $host = $this->blogs[$importing_blog]['host']; // Get an array of posts => authors $post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'"); $post_ids = join( ',', $post_ids ); $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)"); foreach ( $results as $row ) $authors_posts[$row->post_id] = $row->meta_value; foreach ( $authors as $author => $user_id ) { $user_id = (int) $user_id; // Skip authors that haven't been changed if ( $user_id == $this->blogs[$importing_blog]['authors'][$author][1] ) continue; // Get a list of the selected author's posts $post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] ); $post_ids = join( ',', $post_ids); $wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)"); $this->blogs[$importing_blog]['authors'][$author][1] = $user_id; } $this->save_vars(); wp_redirect('edit.php'); } function _get_auth_sock() { // Connect to https://www.google.com if ( !$sock = @ fsockopen('ssl://www.google.com', 443, $errno, $errstr) ) { $this->uh_oh( __('Could not connect to https://www.google.com'), __('There was a problem opening a secure connection to Google. This is what went wrong:'), "$errstr ($errno)" ); return false; } return $sock; } function _get_blogger_sock($host = 'www2.blogger.com') { if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) { $this->uh_oh( sprintf( __('Could not connect to %s'), $host ), __('There was a problem opening a connection to Blogger. This is what went wrong:'), "$errstr ($errno)" ); return false; } return $sock; } function _txrx( $sock, $request ) { fwrite( $sock, $request ); while ( ! feof( $sock ) ) $response .= @ fread ( $sock, 8192 ); fclose( $sock ); return $response; } function revoke($token) { $headers = array( "GET /accounts/AuthSubRevokeToken HTTP/1.0", "Authorization: AuthSub token=\"$token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; $sock = $this->_get_auth_sock( ); if ( ! $sock ) return false; $this->_txrx( $sock, $request ); } function restart() { global $wpdb; $options = get_option( 'blogger_importer' ); if ( isset( $options['token'] ) ) $this->revoke( $options['token'] ); delete_option('blogger_importer'); $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = 'blogger_author'"); wp_redirect('?import=blogger'); } // Returns associative array of code, header, cookies, body. Based on code from php.net. function parse_response($this_response) { // Split response into header and body sections list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); $response_header_lines = explode("\r\n", $response_headers); // First line of headers is the HTTP response code $http_response_line = array_shift($response_header_lines); if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } // put the rest of the headers in an array $response_header_array = array(); foreach($response_header_lines as $header_line) { list($header,$value) = explode(': ', $header_line, 2); $response_header_array[$header] .= $value."\n"; } $cookie_array = array(); $cookies = explode("\n", $response_header_array["Set-Cookie"]); foreach($cookies as $this_cookie) { array_push($cookie_array, "Cookie: ".$this_cookie); } return array("code" => $response_code, "header" => $response_header_array, "cookies" => $cookie_array, "body" => $response_body); } // Step 9: Congratulate the user function congrats() { $blog = (int) $_GET['blog']; echo '

    '.__('Congratulations!').'

    '.__('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:').'

    • '.__('That was hard work! Take a break.').'
    • '; if ( count($this->import['blogs']) > 1 ) echo '
    • '.__('In case you haven\'t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '
    • '; if ( $n = count($this->import['blogs'][$blog]['newusers']) ) echo '
    • '.sprintf(__('Go to Authors & Users, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'
    • '; echo '
    • '.__('For security, click the link below to reset this importer.').'
    • '; echo '
    '; } // Figures out what to do, then does it. function start() { if ( isset($_POST['restart']) ) $this->restart(); $options = get_option('blogger_importer'); if ( is_array($options) ) foreach ( $options as $key => $value ) $this->$key = $value; if ( isset( $_REQUEST['blog'] ) ) { $blog = is_array($_REQUEST['blog']) ? array_shift( array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog']; $blog = (int) $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() ) $this->show_blogs(); else $this->greet(); $saved = $this->save_vars(); if ( $saved && !isset($_GET['noheader']) ) { $restart = __('Restart'); $message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.'); $submit = __('Clear account information'); echo "

    $restart

    $message

    "; } } function save_vars() { $vars = get_object_vars($this); update_option( 'blogger_importer', $vars ); return !empty($vars); } function admin_head() { ?> entry = new AtomEntry(); $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); } function parse($xml) { global $app_logging; array_unshift($this->ns_contexts, array()); $parser = xml_parser_create_ns(); xml_set_object($parser, $this); xml_set_element_handler($parser, "start_element", "end_element"); xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0); xml_set_character_data_handler($parser, "cdata"); xml_set_default_handler($parser, "_default"); xml_set_start_namespace_decl_handler($parser, "start_ns"); xml_set_end_namespace_decl_handler($parser, "end_ns"); $contents = ""; xml_parse($parser, $xml); xml_parser_free($parser); return true; } function start_element($parser, $name, $attrs) { $tag = array_pop(split(":", $name)); array_unshift($this->ns_contexts, $this->ns_decls); $this->depth++; if(!empty($this->in_content)) { $attrs_prefix = array(); // resolve prefixes for attributes foreach($attrs as $key => $value) { $attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value); } $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix))); if(strlen($attrs_str) > 0) { $attrs_str = " " . $attrs_str; } $xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); if(strlen($xmlns_str) > 0) { $xmlns_str = " " . $xmlns_str; } // handle self-closing tags (case: a new child found right-away, no text node) 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'; array_push($this->in_content, array($tag,$this->depth)); } else if($tag == 'link') { array_push($this->entry->links, $attrs); } else if($tag == 'category') { array_push($this->entry->categories, $attrs['term']); } $this->ns_decls = array(); } function end_element($parser, $name) { $tag = array_pop(split(":", $name)); if(!empty($this->in_content)) { if($this->in_content[0][0] == $tag && $this->in_content[0][1] == $this->depth) { array_shift($this->in_content); if($this->is_xhtml) { $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3); } $this->entry->$tag = join('',$this->in_content); $this->in_content = array(); } else { $endtag = $this->ns_to_prefix($name); if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { array_push($this->in_content, "/>"); } else { array_push($this->in_content, ""); } } } array_shift($this->ns_contexts); #print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n"; $this->depth--; } function start_ns($parser, $prefix, $uri) { #print str_repeat(" ", $this->depth * $this->indent) . "starting: " . $prefix . ":" . $uri . "\n"; array_push($this->ns_decls, array($prefix,$uri)); } function end_ns($parser, $prefix) { #print str_repeat(" ", $this->depth * $this->indent) . "ending: #" . $prefix . "#\n"; } function cdata($parser, $data) { #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; if(!empty($this->in_content)) { // handle self-closing tags (case: text node found, need to close element started) if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { array_push($this->in_content, ">"); } array_push($this->in_content, $this->xml_escape($data)); } } function _default($parser, $data) { # when does this gets called? } function ns_to_prefix($qname) { $components = split(":", $qname); $name = array_pop($components); if(!empty($components)) { $ns = join(":",$components); foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if($mapping[1] == $ns && strlen($mapping[0]) > 0) { return "$mapping[0]:$name"; } } } } return $name; } function xml_escape($string) { return str_replace(array('&','"',"'",'<','>'), array('&','"',''','<','>'), $string ); } } ?> wp-admin/import/blogware.php0000644013707600007620000001404710673760566014147 0ustar www'; echo '

    '.__('Import Blogware').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.').'

    '; wp_import_upload_form("admin.php?import=blogware&step=1"); echo '
    '; } function import_posts() { global $wpdb, $current_user; set_magic_quotes_runtime(0); $importdata = file($this->file); // Read the file into an array $importdata = implode('', $importdata); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(]+>(.*?))|is', $importdata, $posts); $posts = $posts[1]; unset($importdata); echo '
      '; foreach ($posts as $post) { flush(); preg_match('||is', $post, $post_type); $post_type = $post_type[1]; if($post_type == "photo") { preg_match('|(.*?)|is', $post, $post_title); } else { preg_match('|(.*?)|is', $post, $post_title); } $post_title = $wpdb->escape(trim($post_title[1])); preg_match('|(.*?)|is', $post, $post_date); $post_date = strtotime($post_date[1]); $post_date = gmdate('Y-m-d H:i:s', $post_date); preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); $cat_index++; } if(strcasecmp($post_type, "photo") === 0) { preg_match('|(.*?)|is', $post, $post_content); $post_content = ''; $post_content = $this->unhtmlentities($post_content); } else { preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', trim($post_content[1])); $post_content = $this->unhtmlentities($post_content); } // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = $wpdb->escape($post_content); $post_author = $current_user->ID; preg_match('|(.*?)|is', $post, $post_status); $post_status = trim($post_status[1]); echo '
    1. '; if ($post_id = post_exists($post_title, $post_content, $post_date)) { printf(__('Post %s already exists.'), stripslashes($post_title)); } else { printf(__('Importing post %s...'), 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 '
    2. '; break; } if(0 != count($categories)) wp_create_categories($categories, $post_id); } preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; if ( $comments ) { $comment_post_ID = (int) $post_id; $num_comments = 0; foreach ($comments as $comment) { preg_match('|(.*?)|is', $comment, $comment_content); $comment_content = str_replace(array (''), '', trim($comment_content[1])); $comment_content = $this->unhtmlentities($comment_content); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = $wpdb->escape($comment_content); preg_match('|(.*?)|is', $comment, $comment_date); $comment_date = trim($comment_date[1]); $comment_date = date('Y-m-d H:i:s', strtotime($comment_date)); preg_match('|(.*?)|is', $comment, $comment_author); $comment_author = $wpdb->escape(trim($comment_author[1])); $comment_author_email = NULL; $comment_approved = 1; // Check if it's already there if (!comment_exists($comment_author, $comment_date)) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved'); $commentdata = wp_filter_comment($commentdata); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) { echo ' '; printf(__('(%s comments)'), $num_comments); } echo ''; flush(); ob_flush(); } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : $result = $this->import(); if ( is_wp_error( $result ) ) $result->get_error_message(); break; } $this->footer(); } function BW_Import() { // Nothing. } } $blogware_import = new BW_Import(); register_importer('blogware', __('Blogware'), __('Import posts from Blogware'), array ($blogware_import, 'dispatch')); ?> wp-admin/import/btt.php0000644013707600007620000000666710672775704013146 0ustar www'; echo '

    '.__('Import Bunny’s Technorati Tags').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from an existing Bunny’s Technorati Tags installation into this blog using the new WordPress native tagging structure.').'

    '; echo '

    '.__('This is suitable for Bunny’s Technorati Tags version 0.6.').'

    '; echo '

    '.__('All existing Bunny’s Technorati Tags will be removed after import.').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-btt'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Reading Bunny’s Technorati Tags…').'

    '; // 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 '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __('Done! %s posts with tags were read.'), $count ) . '

    '; echo '
      '; 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 '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } } if ( !$precheck ) delete_post_meta($post_meta->post_id, 'tags'); } echo '
    '; } echo '
    '; wp_nonce_field('import-btt'); echo '

    '; echo '
    '; echo '
    '; } function done() { echo '
    '; echo '

    '.__('Import Complete!').'

    '; echo '
    '; } function BunnyTags_Import() { } } // create the import object $btt_import = new BunnyTags_Import(); // add it to the import page! register_importer('btt', 'Bunny’s Technorati Tags', __('Import Bunny’s Technorati Tags into the new native tagging structure.'), array($btt_import, 'dispatch')); ?> wp-admin/import/dotclear.php0000644013707600007620000005473310673760566014150 0ustar wwwget_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID); } } if(!function_exists('link_exists')) { function link_exists($linkname) { global $wpdb; return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$linkname.'"'); } } /* Identify UTF-8 text Taken from http://www.php.net/manual/fr/function.mb-detect-encoding.php#50087 */ // // utf8 encoding validation developed based on Wikipedia entry at: // http://en.wikipedia.org/wiki/UTF-8 // // Implemented as a recursive descent parser based on a simple state machine // copyright 2005 Maarten Meijer // // This cries out for a C-implementation to be included in PHP core // function valid_1byte($char) { if(!is_int($char)) return false; return ($char & 0x80) == 0x00; } function valid_2byte($char) { if(!is_int($char)) return false; return ($char & 0xE0) == 0xC0; } function valid_3byte($char) { if(!is_int($char)) return false; return ($char & 0xF0) == 0xE0; } function valid_4byte($char) { if(!is_int($char)) return false; return ($char & 0xF8) == 0xF0; } function valid_nextbyte($char) { if(!is_int($char)) return false; return ($char & 0xC0) == 0x80; } function valid_utf8($string) { $len = strlen($string); $i = 0; while( $i < $len ) { $char = ord(substr($string, $i++, 1)); if(valid_1byte($char)) { // continue continue; } else if(valid_2byte($char)) { // check 1 byte if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } else if(valid_3byte($char)) { // check 2 bytes if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } else if(valid_4byte($char)) { // check 3 bytes if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; if(!valid_nextbyte(ord(substr($string, $i++, 1)))) return false; } // goto next char } return true; // done } function csc ($s) { if (valid_utf8 ($s)) { return $s; } else { return iconv(get_option ("dccharset"),"UTF-8",$s); } } function textconv ($s) { return csc (preg_replace ('|(?)\s*\n|', ' ', $s)); } /** The Main Importer Class **/ class Dotclear_Import { function header() { echo '
    '; echo '

    '.__('Import DotClear').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo '
    '; } function greet() { echo '

    '.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'

    '; echo '

    '.__('Your DotClear Configuration settings are as follows:').'

    '; echo '
    '; wp_nonce_field('import-dotclear'); $this->db_form(); echo '

    '; echo '
    '; } function get_dc_cats() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Categories return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A); } function get_dc_users() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Users return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A); } function get_dc_posts() { // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Posts return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A); } function get_dc_comments() { global $wpdb; // General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); // Get Comments return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A); } function get_dc_links() { //General Housekeeping $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); set_magic_quotes_runtime(0); $dbprefix = get_option('dcdbprefix'); return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A); } function cat2wp($categories='') { // General Housekeeping global $wpdb; $count = 0; $dccat2wpcat = array(); // Do the Magic if(is_array($categories)) { echo '

    '.__('Importing Categories...').'

    '; foreach ($categories as $category) { $count++; extract($category); // Make Nice Variables $name = $wpdb->escape($cat_libelle_url); $title = $wpdb->escape(csc ($cat_libelle)); $desc = $wpdb->escape(csc ($cat_desc)); if($cinfo = category_exists($name)) { $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); } else { $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); } $dccat2wpcat[$id] = $ret_id; } // Store category translation for future use add_option('dccat2wpcat',$dccat2wpcat); echo '

    '.sprintf(__('Done! %1$s categories imported.'), $count).'

    '; return true; } echo __('No Categories to Import!'); return false; } function users2wp($users='') { // General Housekeeping global $wpdb; $count = 0; $dcid2wpid = array(); // Midnight Mojo if(is_array($users)) { echo '

    '.__('Importing Users...').'

    '; foreach($users as $user) { $count++; extract($user); // Make Nice Variables $name = $wpdb->escape(csc ($name)); $RealName = $wpdb->escape(csc ($user_pseudo)); if($uinfo = get_userdatabylogin($name)) { $ret_id = wp_insert_user(array( 'ID' => $uinfo->ID, 'user_login' => $user_id, 'user_nicename' => $Realname, 'user_email' => $user_email, 'user_url' => 'http://', 'display_name' => $Realname) ); } else { $ret_id = wp_insert_user(array( 'user_login' => $user_id, 'user_nicename' => csc ($user_pseudo), 'user_email' => $user_email, 'user_url' => 'http://', 'display_name' => $Realname) ); } $dcid2wpid[$user_id] = $ret_id; // Set DotClear-to-WordPress permissions translation // Update Usermeta Data $user = new WP_User($ret_id); $wp_perms = $user_level + 1; if(10 == $wp_perms) { $user->set_role('administrator'); } else if(9 == $wp_perms) { $user->set_role('editor'); } else if(5 <= $wp_perms) { $user->set_role('editor'); } else if(4 <= $wp_perms) { $user->set_role('author'); } else if(3 <= $wp_perms) { $user->set_role('contributor'); } else if(2 <= $wp_perms) { $user->set_role('contributor'); } else { $user->set_role('subscriber'); } update_usermeta( $ret_id, 'wp_user_level', $wp_perms); update_usermeta( $ret_id, 'rich_editing', 'false'); update_usermeta( $ret_id, 'first_name', csc ($user_prenom)); update_usermeta( $ret_id, 'last_name', csc ($user_nom)); }// End foreach($users as $user) // Store id translation array for future use add_option('dcid2wpid',$dcid2wpid); echo '

    '.sprintf(__('Done! %1$s users imported.'), $count).'

    '; return true; }// End if(is_array($users) echo __('No Users to Import!'); return false; }// End function user2wp() function posts2wp($posts='') { // General Housekeeping global $wpdb; $count = 0; $dcposts2wpposts = array(); $cats = array(); // Do the Magic if(is_array($posts)) { echo '

    '.__('Importing Posts...').'

    '; foreach($posts as $post) { $count++; extract($post); // Set DotClear-to-WordPress status translation $stattrans = array(0 => 'draft', 1 => 'publish'); $comment_status_map = array (0 => 'closed', 1 => 'open'); //Can we do this more efficiently? $uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1; $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; $Title = $wpdb->escape(csc ($post_titre)); $post_content = textconv ($post_content); $post_excerpt = ""; if ($post_chapo != "") { $post_excerpt = textconv ($post_chapo); $post_content = $post_excerpt ."\n\n".$post_content; } $post_excerpt = $wpdb->escape ($post_excerpt); $post_content = $wpdb->escape ($post_content); $post_status = $stattrans[$post_pub]; // Import Post data into WordPress if($pinfo = post_exists($Title,$post_content)) { $ret_id = wp_insert_post(array( 'ID' => $pinfo, 'post_author' => $authorid, 'post_date' => $post_dt, 'post_date_gmt' => $post_dt, 'post_modified' => $post_upddt, 'post_modified_gmt' => $post_upddt, 'post_title' => $Title, 'post_content' => $post_content, 'post_excerpt' => $post_excerpt, 'post_status' => $post_status, 'post_name' => $post_titre_url, 'comment_status' => $comment_status_map[$post_open_comment], '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 { $ret_id = wp_insert_post(array( 'post_author' => $authorid, 'post_date' => $post_dt, 'post_date_gmt' => $post_dt, 'post_modified' => $post_modified_gmt, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $post_content, 'post_excerpt' => $post_excerpt, 'post_status' => $post_status, 'post_name' => $post_titre_url, 'comment_status' => $comment_status_map[$post_open_comment], '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(); $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); } } } // Store ID translation for later use add_option('dcposts2wpposts',$dcposts2wpposts); echo '

    '.sprintf(__('Done! %1$s posts imported.'), $count).'

    '; return true; } function comments2wp($comments='') { // General Housekeeping global $wpdb; $count = 0; $dccm2wpcm = array(); $postarr = get_option('dcposts2wpposts'); // Magic Mojo if(is_array($comments)) { echo '

    '.__('Importing Comments...').'

    '; foreach($comments as $comment) { $count++; extract($comment); // WordPressify Data $comment_ID = (int) ltrim($comment_id, '0'); $comment_post_ID = (int) $postarr[$post_id]; $comment_approved = "$comment_pub"; $name = $wpdb->escape(csc ($comment_auteur)); $email = $wpdb->escape($comment_email); $web = "http://".$wpdb->escape($comment_site); $message = $wpdb->escape(textconv ($comment_content)); if($cinfo = comment_exists($name, $comment_dt)) { // Update comments $ret_id = wp_update_comment(array( 'comment_ID' => $cinfo, 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $comment_ip, 'comment_date' => $comment_dt, 'comment_date_gmt' => $comment_dt, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } else { // Insert comments $ret_id = wp_insert_comment(array( 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $comment_ip, 'comment_date' => $comment_dt, 'comment_date_gmt' => $comment_dt, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } $dccm2wpcm[$comment_ID] = $ret_id; } // Store Comment ID translation for future use add_option('dccm2wpcm', $dccm2wpcm); // Associate newly formed categories with posts get_comment_count($ret_id); echo '

    '.sprintf(__('Done! %1$s comments imported.'), $count).'

    '; return true; } echo __('No Comments to Import!'); return false; } function links2wp($links='') { // General Housekeeping global $wpdb; $count = 0; // Deal with the links if(is_array($links)) { echo '

    '.__('Importing Links...').'

    '; foreach($links as $link) { $count++; extract($link); if ($title != "") { if ($cinfo = is_term(csc ($title), 'link_category')) { $category = $cinfo['term_id']; } else { $category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category'); $category = $category['term_id']; } } else { $linkname = $wpdb->escape(csc ($label)); $description = $wpdb->escape(csc ($title)); if($linfo = link_exists($linkname)) { $ret_id = wp_insert_link(array( 'link_id' => $linfo, 'link_url' => $href, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description) ); } else { $ret_id = wp_insert_link(array( 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description) ); } $dclinks2wplinks[$link_id] = $ret_id; } } add_option('dclinks2wplinks',$dclinks2wplinks); echo '

    '; printf(__('Done! %s links or link categories imported'), $count); echo '

    '; return true; } echo __('No Links to Import!'); return false; } function import_categories() { // Category Import $cats = $this->get_dc_cats(); $this->cat2wp($cats); add_option('dc_cats', $cats); echo '
    '; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Users'))); echo '
    '; } function import_users() { // User Import $users = $this->get_dc_users(); $this->users2wp($users); echo '
    '; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Posts'))); echo '
    '; } function import_posts() { // Post Import $posts = $this->get_dc_posts(); $result = $this->posts2wp($posts); if ( is_wp_error( $result ) ) return $result; echo '
    '; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Comments'))); echo '
    '; } function import_comments() { // Comment Import $comments = $this->get_dc_comments(); $this->comments2wp($comments); echo '
    '; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Import Links'))); echo '
    '; } function import_links() { //Link Import $links = $this->get_dc_links(); $this->links2wp($links); add_option('dc_links', $links); echo '
    '; wp_nonce_field('import-dotclear'); printf('', attribute_escape(__('Finish'))); echo '
    '; } function cleanup_dcimport() { delete_option('dcdbprefix'); delete_option('dc_cats'); delete_option('dcid2wpid'); delete_option('dccat2wpcat'); delete_option('dcposts2wpposts'); delete_option('dccm2wpcm'); delete_option('dclinks2wplinks'); delete_option('dcuser'); delete_option('dcpass'); delete_option('dcname'); delete_option('dchost'); delete_option('dccharset'); $this->tips(); } function tips() { echo '

    '.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

    '; echo '

    '.__('Users').'

    '; echo '

    '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in DotClear, 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 DotClear 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. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), '/wp-login.php').'

    '; echo '

    '.__('Preserving Authors').'

    '; echo '

    '.__('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.').'

    '; echo '

    '.__('Textile').'

    '; echo '

    '.__('Also, since you\'re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You\'ll want it.').'

    '; echo '

    '.__('WordPress Resources').'

    '; echo '

    '.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

    '; echo ''; echo '

    '.sprintf(__('That\'s it! What are you waiting for? Go login!'), '../wp-login.php').'

    '; } function db_form() { echo ''; printf('', __('DotClear Database User:')); printf('', __('DotClear Database Password:')); printf('', __('DotClear Database Name:')); printf('', __('DotClear Database Host:')); printf('', __('DotClear Table prefix:')); printf('', __('Originating character set:')); echo '
    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); if ( $step > 0 ) { check_admin_referer('import-dotclear'); if($_POST['dbuser']) { if(get_option('dcuser')) delete_option('dcuser'); add_option('dcuser', sanitize_user($_POST['dbuser'], true)); } if($_POST['dbpass']) { if(get_option('dcpass')) delete_option('dcpass'); add_option('dcpass', sanitize_user($_POST['dbpass'], true)); } if($_POST['dbname']) { if(get_option('dcname')) delete_option('dcname'); add_option('dcname', sanitize_user($_POST['dbname'], true)); } if($_POST['dbhost']) { if(get_option('dchost')) delete_option('dchost'); add_option('dchost', sanitize_user($_POST['dbhost'], true)); } if($_POST['dccharset']) { if(get_option('dccharset')) delete_option('dccharset'); add_option('dccharset', sanitize_user($_POST['dccharset'], true)); } if($_POST['dbprefix']) { if(get_option('dcdbprefix')) delete_option('dcdbprefix'); add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true)); } } switch ($step) { default: case 0 : $this->greet(); break; case 1 : $this->import_categories(); break; case 2 : $this->import_users(); break; case 3 : $result = $this->import_posts(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; case 4 : $this->import_comments(); break; case 5 : $this->import_links(); break; case 6 : $this->cleanup_dcimport(); break; } $this->footer(); } function Dotclear_Import() { // Nothing. } } $dc_import = new Dotclear_Import(); register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog'), array ($dc_import, 'dispatch')); ?> wp-admin/import/greymatter.php0000644013707600007620000002471510673760566014533 0ustar www'; echo '

    '.__('Import GreyMatter').'

    '; } function footer() { echo ''; } function greet() { $this->header(); ?>

    • If authors are found not to be in gm-authors.cgi, imports them at level 0.') ?>

     


    so you need to enter the number of the last GM post here.
    (if you don't know that number, just log into your FTP and look it out
    in the entries' folder)") ?>

     

    footer(); } function gm2autobr($string) { // transforms GM's |*| into b2's
    \n $string = str_replace("|*|","
    \n",$string); return($string); } function import() { global $wpdb; $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); for ($i=0; $iheader(); ?>

      • escape($userdata[0]); $pass1=$wpdb->escape($userdata[1]); $user_nickname=$wpdb->escape($userdata[0]); $user_email=$wpdb->escape($userdata[2]); $user_url=$wpdb->escape($userdata[3]); $user_joindate=$wpdb->escape($user_joindate); $user_id = username_exists($user_login); if ($user_id) { printf('
      • '.__('user %s').''.__('Already exists').'
      • ', "$user_login"); $this->gmnames[$userdata[0]] = $user_id; continue; } $user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$userdata[0]] = $user_id; printf('
      • '.__('user %s...').' '.__('Done').'
      • ', "$user_login"); } ?>

      • gm2autobr($entry[2]); $postmorecontent=$this->gm2autobr($entry[3]); $post_author=trim($wpdb->escape($postinfo[1])); $post_title=$this->gm2autobr($postinfo[2]); printf('
      • '.__('entry # %s : %s : by %s'), $entryfile, $post_title, $postinfo[1]); $post_title=$wpdb->escape($post_title); $postyear=$postinfo[6]; $postmonth=zeroise($postinfo[4],2); $postday=zeroise($postinfo[5],2); $posthour=zeroise($postinfo[7],2); $postminute=zeroise($postinfo[8],2); $postsecond=zeroise($postinfo[9],2); if (($postinfo[10]=="PM") && ($posthour!="12")) $posthour=$posthour+12; $post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond"; $post_content=$postmaincontent; if (strlen($postmorecontent)>3) $post_content .= "

        ".$postmorecontent; $post_content=$wpdb->escape($post_content); $post_karma=$postinfo[12]; $post_status = 'publish'; //in greymatter, there are no drafts $comment_status = 'open'; $ping_status = 'closed'; if ($post_ID = post_exists($post_title, '', $post_date)) { echo ' '; _e('(already exists)'); } else { //just so that if a post already exists, new users are not created by checkauthor // we'll check the author is registered, or if it's a deleted author $user_id = username_exists($post_author); if (!$user_id) { // if deleted from GM, we register the author as a level 0 user $user_ip="127.0.0.1"; $user_domain="localhost"; $user_browser="server"; $user_joindate="1979-06-06 00:41:00"; $user_login=$wpdb->escape($post_author); $pass1=$wpdb->escape("password"); $user_nickname=$wpdb->escape($post_author); $user_email=$wpdb->escape("user@deleted.com"); $user_url=$wpdb->escape(""); $user_joindate=$wpdb->escape($user_joindate); $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$postinfo[1]] = $user_id; echo ': '; printf(__('registered deleted user %s at level 0 '), "$user_login"); } if (array_key_exists($postinfo[1], $this->gmnames)) { $post_author = $this->gmnames[$postinfo[1]]; } else { $post_author = $user_id; } $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); if ($c>4) { $numAddedComments = 0; $numComments = 0; for ($j=4;$j<$c;$j++) { $entry[$j]=$this->gm2autobr($entry[$j]); $commentinfo=explode("|",$entry[$j]); $comment_post_ID=$post_ID; $comment_author=$wpdb->escape($commentinfo[0]); $comment_author_email=$wpdb->escape($commentinfo[2]); $comment_author_url=$wpdb->escape($commentinfo[3]); $comment_author_IP=$wpdb->escape($commentinfo[1]); $commentyear=$commentinfo[7]; $commentmonth=zeroise($commentinfo[5],2); $commentday=zeroise($commentinfo[6],2); $commenthour=zeroise($commentinfo[8],2); $commentminute=zeroise($commentinfo[9],2); $commentsecond=zeroise($commentinfo[10],2); if (($commentinfo[11]=="PM") && ($commenthour!="12")) $commenthour=$commenthour+12; $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond"; $comment_content=$wpdb->escape($commentinfo[12]); 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); $numAddedComments++; } $numComments++; } if ($numAddedComments > 0) { echo ': '; printf(__('imported %d comment(s)'), $numAddedComments); } $preExisting = $numComments - numAddedComments; if ($preExisting > 0) { echo ' '; printf(__('ignored %d pre-existing comments'), $preExisting); } } echo '... '.__('Done').'
      • '; } } ?>

     

    footer(); return; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; switch ($step) { case 0 : $this->greet(); break; case 1: check_admin_referer('import-greymatter'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } } function GM_Import() { // Nothing. } } $gm_import = new GM_Import(); register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array ($gm_import, 'dispatch')); ?> wp-admin/import/jkw.php0000644013707600007620000001351310672775704013134 0ustar www'; echo '

    '.__('Import Jerome’s Keywords').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from an existing Jerome’s Keywords installation into this blog using the new WordPress native tagging structure.').'

    '; echo '

    '.__('This is suitable for Jerome’s Keywords version 1.x and 2.0a.').'

    '; echo '

    '.__('All existing Jerome’s Keywords will be removed after import.').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Reading Jerome’s Keywords Tags…').'

    '; // 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 '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __('Done! %s posts with tags were read.'), $count ) . '

    '; echo '
      '; 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 '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } } if ( !$precheck ) delete_post_meta($post_meta->post_id, 'keywords'); } echo '
    '; } echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } function check_V2_post_keyword($precheck = true) { global $wpdb; echo '
    '; echo '

    '.__('Reading Jerome’s Keywords Tags…').'

    '; // 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 '

    ' . __('No Tags Found!') . '

    '; return false; } else { $count = count($metakeys); echo '

    ' . sprintf( __('Done! %s tags were read.'), $count ) . '

    '; echo '
      '; foreach ( $metakeys as $post_meta ) { $keyword = addslashes(trim($post_meta->tag_name)); if ( $keyword != '' ) { echo '
    • ' . $post_meta->post_id . ' - ' . $keyword . '
    • '; if ( !$precheck ) wp_add_post_tags($post_meta->post_id, $keyword); } } echo '
    '; } echo '
    '; wp_nonce_field('import-jkw'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Import Complete!').'

    '; echo '
    '; } function JeromesKeyword_Import() { } } // create the import object $jkw_import = new JeromesKeyword_Import(); // add it to the import page! register_importer('jkw', 'Jerome’s Keywords', __('Import Jerome’s Keywords into the new native tagging structure.'), array($jkw_import, 'dispatch')); ?> wp-admin/import/livejournal.php0000644013707600007620000001270510673760566014676 0ustar www'; echo '

    '.__('Import LiveJournal').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! Upload your LiveJournal XML export file and we’ll import the posts into this blog.').'

    '; echo '

    '.__('Choose a LiveJournal XML file to upload, then click Upload file and import.').'

    '; wp_import_upload_form("admin.php?import=livejournal&step=1"); echo '
    '; } function import_posts() { global $wpdb, $current_user; set_magic_quotes_runtime(0); $importdata = file($this->file); // Read the file into an array $importdata = implode('', $importdata); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(.*?)|is', $importdata, $posts); $posts = $posts[1]; unset($importdata); echo '
      '; foreach ($posts as $post) { preg_match('|(.*?)|is', $post, $post_title); $post_title = $wpdb->escape(trim($post_title[1])); if ( empty($post_title) ) { preg_match('|(.*?)|is', $post, $post_title); $post_title = $wpdb->escape(trim($post_title[1])); } preg_match('|(.*?)|is', $post, $post_date); $post_date = strtotime($post_date[1]); $post_date = date('Y-m-d H:i:s', $post_date); preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', trim($post_content[1])); $post_content = $this->unhtmlentities($post_content); // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = str_replace('
      ', '
      ', $post_content); $post_content = $wpdb->escape($post_content); $post_author = $current_user->ID; $post_status = 'publish'; echo '
    1. '; if ($post_id = post_exists($post_title, $post_content, $post_date)) { printf(__('Post %s already exists.'), stripslashes($post_title)); } else { printf(__('Importing post %s...'), 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 '
    2. '; break; } } preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; if ( $comments ) { $comment_post_ID = (int) $post_id; $num_comments = 0; foreach ($comments as $comment) { preg_match('|(.*?)|is', $comment, $comment_content); $comment_content = str_replace(array (''), '', trim($comment_content[1])); $comment_content = $this->unhtmlentities($comment_content); // Clean up content $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = str_replace('
      ', '
      ', $comment_content); $comment_content = $wpdb->escape($comment_content); preg_match('|(.*?)|is', $comment, $comment_date); $comment_date = trim($comment_date[1]); $comment_date = date('Y-m-d H:i:s', strtotime($comment_date)); preg_match('|(.*?)|is', $comment, $comment_author); $comment_author = $wpdb->escape(trim($comment_author[1])); preg_match('|(.*?)|is', $comment, $comment_author_email); $comment_author_email = $wpdb->escape(trim($comment_author_email[1])); $comment_approved = 1; // Check if it's already there if (!comment_exists($comment_author, $comment_date)) { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved'); $commentdata = wp_filter_comment($commentdata); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) { echo ' '; printf(__('(%s comments)'), $num_comments); } echo ''; } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function LJ_Import() { // Nothing. } } $livejournal_import = new LJ_Import(); register_importer('livejournal', __('LiveJournal'), __('Import posts from a LiveJournal XML export file'), array ($livejournal_import, 'dispatch')); ?> wp-admin/import/mt.php0000644013707600007620000003454210673760566012767 0ustar www'; echo '

    '.__('Import Movable Type or TypePad').'

    '; } function footer() { echo ''; } function greet() { $this->header(); ?>

    mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

    mt-export.txt in your /wp-content/ directory'); ?>

    out of memory error try splitting up the import file into pieces.'); ?>

    footer(); } function users_form($n) { global $wpdb, $testing; $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); ?> mtnames))) { //a new mt author name is found ++ $this->j; $this->mtnames[$this->j] = $author; //add that new mt author name to an array $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user if (!$user_id) { //banging my head against the desk now. if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname $user_id = wp_create_user($author, $pass); $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. } else { $user_id = wp_create_user($this->newauthornames[$this->j], $pass); } } else { return $user_id; // return pre-existing wp username if it exists } } else { $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames } return $user_id; } function get_mt_authors() { $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. $authors[0] = array_shift($temp); $y = count($temp) + 1; for ($x = 1; $x < $y; $x ++) { $next = array_shift($temp); if (!(in_array($next, $authors))) array_push($authors, "$next"); } fclose($handle); return $authors; } function get_authors_from_post() { $formnames = array (); $selectnames = array (); foreach ($_POST['user'] as $key => $line) { $newname = trim(stripslashes($line)); if ($newname == '') $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. array_push($formnames, "$newname"); } // $formnames is the array with the form entered names foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); } $count = count($formnames); for ($i = 0; $i < $count; $i ++) { if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form array_push($this->newauthornames, "$selectnames[$i]"); } else { array_push($this->newauthornames, "$formnames[$i]"); } } } function mt_authors_form() { ?>

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

    get_mt_authors(); echo '
      '; echo '
      '; wp_nonce_field('import-mt'); $j = -1; foreach ($authors as $author) { ++ $j; echo '
    1. '.__('Current author:').' '.$author.'
      '.sprintf(__('Create user %1$s or map to existing'), '
      '); $this->users_form($j); echo '
    2. '; } echo ''.'
      '; echo '
      '; echo '
    '; } function select_authors() { if ( $_POST['upload_type'] === 'ftp' ) { $file['file'] = ABSPATH . 'wp-content/mt-export.txt'; if ( !file_exists($file['file']) ) $file['error'] = __('mt-export.txt does not exist'); } else { $file = wp_import_handle_upload(); } if ( isset($file['error']) ) { $this->header(); echo '

    '.__('Sorry, there has been an error').'.

    '; echo '

    ' . $file['error'] . '

    '; $this->footer(); return; } $this->file = $file['file']; $this->id = (int) $file['id']; $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 '
  • '; printf(__('Post %s already exists.'), stripslashes($post->post_title)); } else { echo '
  • '; printf(__('Importing post %s...'), stripslashes($post->post_title)); if ( '' != trim( $post->extended ) ) $post->post_content .= "\n\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'] = "{$ping['title']}\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 "
  • "; //ob_flush();flush(); } function process_posts() { global $wpdb; $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 "
      "; while ( $line = fgets($handle) ) { $line = trim($line); if ( '-----' == $line ) { // Finishing a multi-line field if ( 'comment' == $context ) { $comments[] = $comment; $comment = new StdClass(); } else if ( 'ping' == $context ) { $pings[] = $ping; $ping = new StdClass(); } $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; } } 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. $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; } } } echo '
    '; wp_import_cleanup($this->id); do_action('import_done', 'mt'); echo '

    '.sprintf(__('All done. Have fun!'), get_option('home')).'

    '; } function import() { $this->id = (int) $_GET['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(); $result = $this->process_posts(); if ( is_wp_error( $result ) ) return $result; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $this->select_authors(); break; case 2: check_admin_referer('import-mt'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } } function MT_Import() { // Nothing. } } $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')); ?> wp-admin/import/rss.php0000644013707600007620000001161610673760566013153 0ustar www'; echo '

    '.__('Import RSS').'

    '; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'

    '; wp_import_upload_form("admin.php?import=rss&step=1"); echo '
    '; } function get_posts() { global $wpdb; set_magic_quotes_runtime(0); $datalines = file($this->file); // Read the file into an array $importdata = implode('', $datalines); // squish it $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); preg_match_all('|(.*?)|is', $importdata, $this->posts); $this->posts = $this->posts[1]; $index = 0; foreach ($this->posts as $post) { preg_match('|(.*?)|is', $post, $post_title); $post_title = str_replace(array(''), '', $wpdb->escape( trim($post_title[1]) )); preg_match('|(.*?)|is', $post, $post_date_gmt); if ($post_date_gmt) { $post_date_gmt = strtotime($post_date_gmt[1]); } else { // if we don't already have something from pubDate preg_match('|(.*?)|is', $post, $post_date_gmt); $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]); $post_date_gmt = str_replace('T', ' ', $post_date_gmt); $post_date_gmt = strtotime($post_date_gmt); } $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt); $post_date = get_date_from_gmt( $post_date_gmt ); preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; if (!$categories) { preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; } $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); $cat_index++; } preg_match('|(.*?)|is', $post, $guid); if ($guid) $guid = $wpdb->escape(trim($guid[1])); else $guid = ''; preg_match('|(.*?)|is', $post, $post_content); $post_content = str_replace(array (''), '', $wpdb->escape(trim($post_content[1]))); if (!$post_content) { // This is for feeds that put content in description preg_match('|(.*?)|is', $post, $post_content); $post_content = $wpdb->escape($this->unhtmlentities(trim($post_content[1]))); } // Clean up content $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_author = 1; $post_status = 'publish'; $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); $index++; } } function import_posts() { echo '
      '; foreach ($this->posts as $post) { echo "
    1. ".__('Importing post...'); extract($post); if ($post_id = post_exists($post_title, $post_content, $post_date)) { _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; } if (0 != count($categories)) wp_create_categories($categories, $post_id); _e('Done !'); } echo '
    2. '; } echo '
    '; } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $this->get_posts(); $result = $this->import_posts(); if ( is_wp_error( $result ) ) return $result; wp_import_cleanup($file['id']); echo '

    '; printf(__('All done. Have fun!'), get_option('home')); echo '

    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function RSS_Import() { // Nothing. } } $rss_import = new RSS_Import(); register_importer('rss', __('RSS'), __('Import posts from an RSS feed'), array ($rss_import, 'dispatch')); ?> wp-admin/import/stp.php0000644013707600007620000001132410675576604013146 0ustar www'; echo '

    '.__('Import Simple Tagging').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from an existing Simple Tagging 1.6.2 installation into this blog using the new WordPress native tagging structure.').'

    '; echo '

    '.__('This has not been tested on any other versions of Simple Tagging. Mileage may vary.').'

    '; echo '

    '.__('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!').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Reading STP Post Tags…').'

    '; // 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 '

    ' . __('No posts were found to have tags!') . '

    '; 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 '

    ' . sprintf( __('Done! %s tag to post relationships were read.'), $count ) . '

    '; } echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } function import_t2p ( ) { echo '
    '; echo '

    '.__('Adding Tags to Posts…').'

    '; // run that funky magic! $tags_added = $this->tag2post(); echo '

    ' . sprintf( __('Done! %s tags where added!'), $tags_added ) . '

    '; echo '
    '; wp_nonce_field('import-stp'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Import Complete!').'

    '; echo '

    ' . __('OK, so we lied about this being a 4-step program! You’re done!') . '

    '; echo '

    ' . __('Now wasn’t that easy?') . '

    '; echo '
    '; } 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')); ?>wp-admin/import/textpattern.php0000644013707600007620000004713010673760566014726 0ustar wwwget_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID); } } if(!function_exists('link_exists')) { function link_exists($linkname) { global $wpdb; return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$wpdb->escape($linkname).'"'); } } /** The Main Importer Class **/ class Textpattern_Import { function header() { echo '
    '; echo '

    '.__('Import Textpattern').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo '
    '; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'

    '; echo '

    '.__('This has not been tested on previous versions of Textpattern. Mileage may vary.').'

    '; echo '

    '.__('Your Textpattern Configuration settings are as follows:').'

    '; echo '
    '; wp_nonce_field('import-textpattern'); $this->db_form(); echo '

    '; echo '
    '; echo '
    '; } function get_txp_cats() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Categories return $txpdb->get_results('SELECT id, name, title FROM '.$prefix.'txp_category WHERE type = "article"', ARRAY_A); } function get_txp_users() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Users return $txpdb->get_results('SELECT user_id, name, RealName, email, privs FROM '.$prefix.'txp_users', ARRAY_A); } function get_txp_posts() { // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Posts return $txpdb->get_results('SELECT ID, Posted, AuthorID, LastMod, Title, Body, Excerpt, Category1, Category2, Status, Keywords, url_title, comments_count FROM '.$prefix.'textpattern ', ARRAY_A); } function get_txp_comments() { global $wpdb; // General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); // Get Comments return $txpdb->get_results('SELECT * FROM '.$prefix.'txp_discuss', ARRAY_A); } function get_txp_links() { //General Housekeeping $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); set_magic_quotes_runtime(0); $prefix = get_option('tpre'); return $txpdb->get_results('SELECT id, date, category, url, linkname, description FROM '.$prefix.'txp_link', ARRAY_A); } function cat2wp($categories='') { // General Housekeeping global $wpdb; $count = 0; $txpcat2wpcat = array(); // Do the Magic if(is_array($categories)) { echo '

    '.__('Importing Categories...').'

    '; foreach ($categories as $category) { $count++; extract($category); // Make Nice Variables $name = $wpdb->escape($name); $title = $wpdb->escape($title); if($cinfo = category_exists($name)) { $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title)); } else { $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title)); } $txpcat2wpcat[$id] = $ret_id; } // Store category translation for future use add_option('txpcat2wpcat',$txpcat2wpcat); echo '

    '.sprintf(__('Done! %1$s categories imported.'), $count).'

    '; return true; } echo __('No Categories to Import!'); return false; } function users2wp($users='') { // General Housekeeping global $wpdb; $count = 0; $txpid2wpid = array(); // Midnight Mojo if(is_array($users)) { echo '

    '.__('Importing Users...').'

    '; foreach($users as $user) { $count++; extract($user); // Make Nice Variables $name = $wpdb->escape($name); $RealName = $wpdb->escape($RealName); if($uinfo = get_userdatabylogin($name)) { $ret_id = wp_insert_user(array( 'ID' => $uinfo->ID, 'user_login' => $name, 'user_nicename' => $RealName, 'user_email' => $email, 'user_url' => 'http://', 'display_name' => $name) ); } else { $ret_id = wp_insert_user(array( 'user_login' => $name, 'user_nicename' => $RealName, 'user_email' => $email, 'user_url' => 'http://', 'display_name' => $name) ); } $txpid2wpid[$user_id] = $ret_id; // Set Textpattern-to-WordPress permissions translation $transperms = array(1 => '10', 2 => '9', 3 => '5', 4 => '4', 5 => '3', 6 => '2', 7 => '0'); // Update Usermeta Data $user = new WP_User($ret_id); if('10' == $transperms[$privs]) { $user->set_role('administrator'); } if('9' == $transperms[$privs]) { $user->set_role('editor'); } if('5' == $transperms[$privs]) { $user->set_role('editor'); } if('4' == $transperms[$privs]) { $user->set_role('author'); } if('3' == $transperms[$privs]) { $user->set_role('contributor'); } if('2' == $transperms[$privs]) { $user->set_role('contributor'); } if('0' == $transperms[$privs]) { $user->set_role('subscriber'); } update_usermeta( $ret_id, 'wp_user_level', $transperms[$privs] ); update_usermeta( $ret_id, 'rich_editing', 'false'); }// End foreach($users as $user) // Store id translation array for future use add_option('txpid2wpid',$txpid2wpid); echo '

    '.sprintf(__('Done! %1$s users imported.'), $count).'

    '; return true; }// End if(is_array($users) echo __('No Users to Import!'); return false; }// End function user2wp() function posts2wp($posts='') { // General Housekeeping global $wpdb; $count = 0; $txpposts2wpposts = array(); $cats = array(); // Do the Magic if(is_array($posts)) { echo '

    '.__('Importing Posts...').'

    '; foreach($posts as $post) { $count++; extract($post); // Set Textpattern-to-WordPress status translation $stattrans = array(1 => 'draft', 2 => 'private', 3 => 'draft', 4 => 'publish', 5 => 'publish'); //Can we do this more efficiently? $uinfo = ( get_userdatabylogin( $AuthorID ) ) ? get_userdatabylogin( $AuthorID ) : 1; $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; $Title = $wpdb->escape($Title); $Body = $wpdb->escape($Body); $Excerpt = $wpdb->escape($Excerpt); $post_status = $stattrans[$Status]; // Import Post data into WordPress if($pinfo = post_exists($Title,$Body)) { $ret_id = wp_insert_post(array( 'ID' => $pinfo, 'post_date' => $Posted, 'post_date_gmt' => $post_date_gmt, 'post_author' => $authorid, 'post_modified' => $LastMod, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $Body, 'post_excerpt' => $Excerpt, 'post_status' => $post_status, 'post_name' => $url_title, 'comment_count' => $comments_count) ); if ( is_wp_error( $ret_id ) ) return $ret_id; } else { $ret_id = wp_insert_post(array( 'post_date' => $Posted, 'post_date_gmt' => $post_date_gmt, 'post_author' => $authorid, 'post_modified' => $LastMod, 'post_modified_gmt' => $post_modified_gmt, 'post_title' => $Title, 'post_content' => $Body, 'post_excerpt' => $Excerpt, 'post_status' => $post_status, '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(); $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); } } } // Store ID translation for later use add_option('txpposts2wpposts',$txpposts2wpposts); echo '

    '.sprintf(__('Done! %1$s posts imported.'), $count).'

    '; return true; } function comments2wp($comments='') { // General Housekeeping global $wpdb; $count = 0; $txpcm2wpcm = array(); $postarr = get_option('txpposts2wpposts'); // Magic Mojo if(is_array($comments)) { echo '

    '.__('Importing Comments...').'

    '; foreach($comments as $comment) { $count++; extract($comment); // WordPressify Data $comment_ID = ltrim($discussid, '0'); $comment_post_ID = $postarr[$parentid]; $comment_approved = (1 == $visible) ? 1 : 0; $name = $wpdb->escape($name); $email = $wpdb->escape($email); $web = $wpdb->escape($web); $message = $wpdb->escape($message); if($cinfo = comment_exists($name, $posted)) { // Update comments $ret_id = wp_update_comment(array( 'comment_ID' => $cinfo, 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_date' => $posted, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } else { // Insert comments $ret_id = wp_insert_comment(array( 'comment_post_ID' => $comment_post_ID, 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $web, 'comment_author_IP' => $ip, 'comment_date' => $posted, 'comment_content' => $message, 'comment_approved' => $comment_approved) ); } $txpcm2wpcm[$comment_ID] = $ret_id; } // Store Comment ID translation for future use add_option('txpcm2wpcm', $txpcm2wpcm); // Associate newly formed categories with posts get_comment_count($ret_id); echo '

    '.sprintf(__('Done! %1$s comments imported.'), $count).'

    '; return true; } echo __('No Comments to Import!'); return false; } function links2wp($links='') { // General Housekeeping global $wpdb; $count = 0; // Deal with the links if(is_array($links)) { echo '

    '.__('Importing Links...').'

    '; foreach($links as $link) { $count++; extract($link); // Make nice vars $category = $wpdb->escape($category); $linkname = $wpdb->escape($linkname); $description = $wpdb->escape($description); if($linfo = link_exists($linkname)) { $ret_id = wp_insert_link(array( 'link_id' => $linfo, 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description, 'link_updated' => $date) ); } else { $ret_id = wp_insert_link(array( 'link_url' => $url, 'link_name' => $linkname, 'link_category' => $category, 'link_description' => $description, 'link_updated' => $date) ); } $txplinks2wplinks[$link_id] = $ret_id; } add_option('txplinks2wplinks',$txplinks2wplinks); echo '

    '; printf(__('Done! %s Links imported'), $count); echo '

    '; return true; } echo __('No Links to Import!'); return false; } function import_categories() { // Category Import $cats = $this->get_txp_cats(); $this->cat2wp($cats); add_option('txp_cats', $cats); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Users'))); echo '
    '; } function import_users() { // User Import $users = $this->get_txp_users(); $this->users2wp($users); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Posts'))); echo '
    '; } function import_posts() { // Post Import $posts = $this->get_txp_posts(); $result = $this->posts2wp($posts); if ( is_wp_error( $result ) ) return $result; echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Comments'))); echo '
    '; } function import_comments() { // Comment Import $comments = $this->get_txp_comments(); $this->comments2wp($comments); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Import Links'))); echo '
    '; } function import_links() { //Link Import $links = $this->get_txp_links(); $this->links2wp($links); add_option('txp_links', $links); echo '
    '; wp_nonce_field('import-textpattern'); printf('', attribute_escape(__('Finish'))); echo '
    '; } function cleanup_txpimport() { delete_option('tpre'); delete_option('txp_cats'); delete_option('txpid2wpid'); delete_option('txpcat2wpcat'); delete_option('txpposts2wpposts'); delete_option('txpcm2wpcm'); delete_option('txplinks2wplinks'); delete_option('txpuser'); delete_option('txppass'); delete_option('txpname'); delete_option('txphost'); $this->tips(); } function tips() { echo '

    '.__('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.').'

    '; echo '

    '.__('Users').'

    '; echo '

    '.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. Every user has the same username, but their passwords are reset to password123. So Login and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; echo '

    '.__('Preserving Authors').'

    '; echo '

    '.__('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.').'

    '; echo '

    '.__('Textile').'

    '; echo '

    '.__('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 Textile for WordPress. Trust me... You’ll want it.').'

    '; echo '

    '.__('WordPress Resources').'

    '; echo '

    '.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

    '; echo ''; echo '

    '.sprintf(__('That’s it! What are you waiting for? Go login!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; } function db_form() { echo ''; printf('', __('Textpattern Database User:')); printf('', __('Textpattern Database Password:')); printf('', __('Textpattern Database Name:')); printf('', __('Textpattern Database Host:')); printf('', __('Textpattern Table prefix (if any):')); echo '
    '; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); if ( $step > 0 ) { check_admin_referer('import-textpattern'); if($_POST['dbuser']) { if(get_option('txpuser')) delete_option('txpuser'); add_option('txpuser', sanitize_user($_POST['dbuser'], true)); } if($_POST['dbpass']) { if(get_option('txppass')) delete_option('txppass'); add_option('txppass', sanitize_user($_POST['dbpass'], true)); } if($_POST['dbname']) { if(get_option('txpname')) delete_option('txpname'); add_option('txpname', sanitize_user($_POST['dbname'], true)); } if($_POST['dbhost']) { if(get_option('txphost')) delete_option('txphost'); add_option('txphost', sanitize_user($_POST['dbhost'], true)); } if($_POST['dbprefix']) { if(get_option('tpre')) delete_option('tpre'); add_option('tpre', sanitize_user($_POST['dbprefix'])); } } switch ($step) { default: case 0 : $this->greet(); break; case 1 : $this->import_categories(); break; case 2 : $this->import_users(); break; case 3 : $result = $this->import_posts(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; case 4 : $this->import_comments(); break; case 5 : $this->import_links(); break; case 6 : $this->cleanup_txpimport(); break; } $this->footer(); } function Textpattern_Import() { // Nothing. } } $txp_import = new Textpattern_Import(); register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog'), array ($txp_import, 'dispatch')); ?> wp-admin/import/utw.php0000644013707600007620000001470610667075130013153 0ustar www'; echo '

    '.__('Import Ultimate Tag Warrior').'

    '; echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; } function footer() { echo ''; } function greet() { echo '
    '; echo '

    '.__('Howdy! This imports tags from an existing Ultimate Tag Warrior 3 installation into this blog using the new WordPress native tagging structure.').'

    '; echo '

    '.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'

    '; echo '

    '.__('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!').'

    '; echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; echo '
    '; echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Reading UTW Tags…').'

    '; $tags = $this->get_utw_tags(); // if we didn't get any tags back, that's all there is folks! if ( !is_array($tags) ) { echo '

    ' . __('No Tags Found!') . '

    '; 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 '

    ' . sprintf( __('Done! %s tags were read.'), $count ) . '

    '; echo '

    ' . __('The following tags were found:') . '

    '; echo '
      '; foreach ( $tags as $tag_id => $tag_name ) { echo '
    • ' . $tag_name . '
    • '; } echo '
    '; echo '
    '; echo '

    ' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '

    '; } echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } function import_posts ( ) { echo '
    '; echo '

    '.__('Reading UTW Post Tags…').'

    '; // 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 '

    ' . __('No posts were found to have tags!') . '

    '; 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 '

    ' . sprintf( __('Done! %s tag to post relationships were read.'), $count ) . '

    '; } echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } function import_t2p ( ) { echo '
    '; echo '

    '.__('Adding Tags to Posts…').'

    '; // run that funky magic! $tags_added = $this->tag2post(); echo '

    ' . sprintf( __('Done! %s tags where added!'), $tags_added ) . '

    '; echo '
    '; wp_nonce_field('import-utw'); echo '

    '; echo '
    '; echo '
    '; } 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 '
    '; echo '

    '.__('Import Complete!').'

    '; echo '

    ' . __('OK, so we lied about this being a 5-step program! You’re done!') . '

    '; echo '

    ' . __('Now wasn’t that easy?') . '

    '; echo '
    '; } 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')); ?>wp-admin/import/wordpress.php0000644013707600007620000003731310674771224014370 0ustar www XML fragment, [1] => New post ID] var $file; var $id; var $mtnames = array (); var $newauthornames = array (); var $j = -1; function header() { echo '
    '; echo '

    '.__('Import WordPress').'

    '; } function footer() { echo '
    '; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '
    '; echo '

    '.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'

    '; echo '

    '.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'

    '; wp_import_upload_form("admin.php?import=wordpress&step=1"); echo '
    '; } function get_tag( $string, $tag ) { global $wpdb; preg_match("|<$tag.*?>(.*?)|is", $string, $return); $return = preg_replace('|^$|s', '$1', $return[1]); $return = $wpdb->escape( trim( $return ) ); return $return; } function users_form($n) { global $wpdb, $testing; $users = $wpdb->get_results("SELECT user_login FROM $wpdb->users ORDER BY user_login"); ?> mtnames))) { //a new mt author name is found ++ $this->j; $this->mtnames[$this->j] = $author; //add that new mt author name to an array $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user if (!$user_id) { //banging my head against the desk now. if ($this->newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname $user_id = wp_create_user($author, $pass); $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. } else { $user_id = wp_create_user($this->newauthornames[$this->j], $pass); } } else { return $user_id; // return pre-existing wp username if it exists } } else { $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames } return $user_id; } function get_entries() { set_magic_quotes_runtime(0); $this->posts = array(); $this->categories = array(); $this->tags = array(); $num = 0; $doing_entry = false; $fp = fopen($this->file, 'r'); if ($fp) { while ( !feof($fp) ) { $importline = rtrim(fgets($fp)); if ( false !== strpos($importline, '') ) { preg_match('|(.*?)|is', $importline, $category); $this->categories[] = $category[1]; continue; } if ( false !== strpos($importline, '') ) { preg_match('|(.*?)|is', $importline, $tag); $this->tags[] = $tag[1]; continue; } if ( false !== strpos($importline, '') ) { $this->posts[$num] = ''; $doing_entry = true; continue; } if ( false !== strpos($importline, '') ) { $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); } } function get_wp_authors() { $temp = array (); $i = -1; foreach ($this->posts as $post) { if ('' != trim($post)) { ++ $i; $author = $this->get_tag( $post, 'dc:creator' ); array_push($temp, "$author"); //store the extracted author names in a temporary array } } // 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. $authors[0] = array_shift($temp); $y = count($temp) + 1; for ($x = 1; $x < $y; $x ++) { $next = array_shift($temp); if (!(in_array($next, $authors))) array_push($authors, "$next"); } return $authors; } function get_authors_from_post() { $formnames = array (); $selectnames = array (); foreach ($_POST['user'] as $key => $line) { $newname = trim(stripslashes($line)); if ($newname == '') $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. array_push($formnames, "$newname"); } // $formnames is the array with the form entered names foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); } $count = count($formnames); for ($i = 0; $i < $count; $i ++) { if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form array_push($this->newauthornames, "$selectnames[$i]"); } else { array_push($this->newauthornames, "$formnames[$i]"); } } } function wp_authors_form() { ?>

    admins entries.'); ?>

    get_wp_authors(); echo '
      '; echo '
      '; wp_nonce_field('import-wordpress'); $j = -1; foreach ($authors as $author) { ++ $j; echo '
    1. '.__('Current author:').' '.$author.'
      '.sprintf(__('Create user %1$s or map to existing'), '
      '); $this->users_form($j); echo '
    2. '; } echo ''.'
      '; echo '
      '; echo '
    '; } function select_authors() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo '

    '.__('Sorry, there has been an error.').'

    '; echo '

    ' . $file['error'] . '

    '; return; } $this->file = $file['file']; $this->id = (int) $file['id']; $this->get_entries(); $this->wp_authors_form(); } function process_categories() { global $wpdb; $cat_names = (array) get_terms('category', 'fields=names'); while ( $c = array_shift($this->categories) ) { $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); // If the category exists we leave it alone if ( in_array($cat_name, $cat_names) ) continue; $category_nicename = $this->get_tag( $c, 'wp:category_nicename' ); $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' ); $links_private = (int) $this->get_tag( $c, 'wp:links_private' ); $parent = $this->get_tag( $c, 'wp:category_parent' ); if ( empty($parent) ) $category_parent = '0'; else $category_parent = category_exists($parent); $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name'); $cat_ID = wp_insert_category($catarr); } } 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 '
      '; foreach ($this->posts as $post) { $result = $this->process_post($post); if ( is_wp_error( $result ) ) return $result; } echo '
    '; wp_import_cleanup($this->id); echo '

    '.sprintf(__('All done.').' '.__('Have fun!').'', get_option('home')).'

    '; } 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' ); $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' ); $comment_status = $this->get_tag( $post, 'wp:comment_status' ); $ping_status = $this->get_tag( $post, 'wp:ping_status' ); $post_status = $this->get_tag( $post, 'wp:status' ); $post_name = $this->get_tag( $post, 'wp:post_name' ); $post_parent = $this->get_tag( $post, 'wp:post_parent' ); $menu_order = $this->get_tag( $post, 'wp:menu_order' ); $post_type = $this->get_tag( $post, 'wp:post_type' ); $guid = $this->get_tag( $post, 'guid' ); $post_author = $this->get_tag( $post, 'dc:creator' ); $post_content = $this->get_tag( $post, 'content:encoded' ); $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); $post_content = str_replace('
    ', '
    ', $post_content); $post_content = str_replace('
    ', '
    ', $post_content); preg_match_all('|(.*?)|is', $post, $tags); $tags = $tags[1]; $tag_index = 0; foreach ($tags as $tag) { $tags[$tag_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $tag))); $tag_index++; } preg_match_all('|(.*?)|is', $post, $categories); $categories = $categories[1]; $cat_index = 0; foreach ($categories as $category) { $categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $category))); $cat_index++; } if ($post_id = post_exists($post_title, '', $post_date)) { echo '
  • '; printf(__('Post %s already exists.'), stripslashes($post_title)); } else { // If it has parent, process parent first. $post_parent = (int) $post_parent; if ($parent = $this->posts_processed[$post_parent]) { 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; } echo '
  • '; printf(__('Importing post %s...'), 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', '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) { $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 preg_match_all('|(.*?)|is', $post, $comments); $comments = $comments[1]; $num_comments = 0; if ( $comments) { foreach ($comments as $comment) { $comment_author = $this->get_tag( $comment, 'wp:comment_author'); $comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email'); $comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP'); $comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url'); $comment_date = $this->get_tag( $comment, 'wp:comment_date'); $comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt'); $comment_content = $this->get_tag( $comment, 'wp:comment_content'); $comment_approved = $this->get_tag( $comment, 'wp:comment_approved'); $comment_type = $this->get_tag( $comment, 'wp:comment_type'); $comment_parent = $this->get_tag( $comment, 'wp:comment_parent'); 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_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent'); wp_insert_comment($commentdata); $num_comments++; } } } if ( $num_comments ) printf(' '.__('(%s comments)'), $num_comments); // Now for post meta preg_match_all('|(.*?)|is', $post, $postmeta); $postmeta = $postmeta[1]; if ( $postmeta) { foreach ($postmeta as $p) { $key = $this->get_tag( $p, 'wp:meta_key' ); $value = $this->get_tag( $p, 'wp:meta_value' ); $value = stripslashes($value); // add_post_meta() will escape. add_post_meta( $post_id, $key, $value ); } } } function import() { $this->id = (int) $_GET['id']; $this->file = get_attached_file($this->id); $this->get_authors_from_post(); $this->get_entries(); $this->process_categories(); $this->process_tags(); $result = $this->process_posts(); if ( is_wp_error( $result ) ) return $result; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : check_admin_referer('import-upload'); $this->select_authors(); break; case 2: check_admin_referer('import-wordpress'); $result = $this->import(); if ( is_wp_error( $result ) ) echo $result->get_error_message(); break; } $this->footer(); } function WP_Import() { // Nothing. } } $wp_import = new WP_Import(); register_importer('wordpress', 'WordPress', __('Import posts, comments, custom fields, pages, and categories from a WordPress export file'), array ($wp_import, 'dispatch')); ?> wp-admin/import/wp-cat2tag.php0000644013707600007620000001537510674740516014315 0ustar www'; print '

    ' . __('Convert Categories to Tags') . '

    '; } function footer() { print ''; } 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 '
    '; if (count($this->all_categories) > 0) { print '

    ' . __('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.') . '

    '; print '

    ' . __('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.') . '

    '; $this->categories_form(); } else { print '

    '.__('You have no categories to convert!').'

    '; } print '
    '; } function categories_form() { print '
    '; wp_nonce_field('import-cat2tag'); print '
      '; $hier = _get_term_hierarchy('category'); foreach ($this->all_categories as $category) { $category = sanitize_term( $category, 'category', 'display' ); if ((int) $category->parent == 0) { print '
    • '; if (isset($hier[$category->term_id])) { $this->_category_children($category, $hier); } print '
    • '; } } print '
    '; print '

    '; print '
    '; } function _category_children($parent, $hier) { print '
      '; foreach ($hier[$parent->term_id] as $child_id) { $child =& get_category($child_id); print '
    • '; if (isset($hier[$child->term_id])) { $this->_category_children($child, $hier); } print '
    • '; } print '
    '; } 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 '
    '; print '

    ' . sprintf(__('Uh, oh. Something didn\'t work. Please try again.'), 'admin.php?import=wp-cat2tag') . '

    '; print '
    '; return; } if ( empty($this->categories_to_convert) ) $this->categories_to_convert = $_POST['cats_to_convert']; $hier = _get_term_hierarchy('category'); print '
      '; foreach ( (array) $this->categories_to_convert as $cat_id) { $cat_id = (int) $cat_id; print '
    • ' . 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 '
    • '; 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 ''; } print '
    '; } function convert_all_confirm() { print '
    '; print '

    ' . __('Confirm') . '

    '; print '

    ' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '

    '; print '
    '; wp_nonce_field('import-cat2tag'); print '

        

    '; print '
    '; print '
    '; } 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 '
    '; print '

    ' . __('Cheatin’ uh?') . '

    '; print '
    '; } 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')); ?> wp-admin/import.php0000644013707600007620000000263310661162352012325 0ustar www

    '.__('No importers are available.').'

    '; // TODO: make more helpful } else { ?> $data) { $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; $action = "{$data[0]}"; if ($style != '') $style = 'class="'.$style.'"'; echo " "; } ?>
    $action {$data[1]}
    wp-admin/includes/0000755013707600007620000000000010706137420012102 5ustar wwwwp-admin/includes/admin.php0000644013707600007620000000142610661256560013715 0ustar www wp-admin/includes/bookmark.php0000644013707600007620000001101610662377174014434 0ustar wwwlink_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); } ?>wp-admin/includes/comment.php0000644013707600007620000000427710653152350014267 0ustar wwwget_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; } ?>wp-admin/includes/file.php0000644013707600007620000001654210672556524013556 0ustar www __( '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’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’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 upload_max_filesize directive in php.ini." ), __( "The uploaded file exceeds the MAX_FILE_SIZE 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; } ?> wp-admin/includes/image.php0000644013707600007620000001313210634105372013676 0ustar www 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 ); } ?> wp-admin/includes/import.php0000644013707600007620000000203110673760566014141 0ustar www 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 ); } ?> wp-admin/includes/misc.php0000644013707600007620000001140610667075130013555 0ustar www $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 wp-admin/includes/plugin.php0000644013707600007620000002500210667076612014123 0ustar www'.$plugin.''; } if ('' == $author_uri[1] ) { $author = trim( $author_name[1] ); } else { $author = '' . trim( $author_name[1] ) . ''; } 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; } ?> wp-admin/includes/post.php0000644013707600007620000003366410673760566013634 0ustar wwwpost_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 = ''.$post_title.''."\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 = "#]+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" ); } ?>wp-admin/includes/schema.php0000644013707600007620000003433310671537304014067 0ustar www=') ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate"; } $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, comment_post_ID int(11) NOT NULL default '0', comment_author tinytext NOT NULL, comment_author_email varchar(100) NOT NULL default '', comment_author_url varchar(200) NOT NULL default '', comment_author_IP varchar(100) NOT NULL default '', comment_date datetime NOT NULL default '0000-00-00 00:00:00', comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', comment_content text NOT NULL, comment_karma int(11) NOT NULL default '0', comment_approved enum('0','1','spam') NOT NULL default '1', comment_agent varchar(255) NOT NULL default '', comment_type varchar(20) NOT NULL default '', comment_parent bigint(20) NOT NULL default '0', user_id bigint(20) NOT NULL default '0', PRIMARY KEY (comment_ID), KEY comment_approved (comment_approved), KEY comment_post_ID (comment_post_ID) ) $charset_collate; CREATE TABLE $wpdb->links ( link_id bigint(20) NOT NULL auto_increment, link_url varchar(255) NOT NULL default '', link_name varchar(255) NOT NULL default '', link_image varchar(255) NOT NULL default '', link_target varchar(25) NOT NULL default '', link_category bigint(20) NOT NULL default '0', link_description varchar(255) NOT NULL default '', link_visible enum('Y','N') NOT NULL default 'Y', link_owner int(11) NOT NULL default '1', link_rating int(11) NOT NULL default '0', link_updated datetime NOT NULL default '0000-00-00 00:00:00', link_rel varchar(255) NOT NULL default '', link_notes mediumtext NOT NULL, link_rss varchar(255) NOT NULL default '', PRIMARY KEY (link_id), KEY link_category (link_category), KEY link_visible (link_visible) ) $charset_collate; 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_value longtext NOT NULL, 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->postmeta ( meta_id bigint(20) NOT NULL auto_increment, post_id bigint(20) NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (meta_id), KEY post_id (post_id), KEY meta_key (meta_key) ) $charset_collate; CREATE TABLE $wpdb->posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) NOT NULL default '0', post_date datetime NOT NULL default '0000-00-00 00:00:00', post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content longtext NOT NULL, 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', '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 '', post_name varchar(200) NOT NULL default '', to_ping text NOT NULL, pinged text NOT NULL, post_modified datetime NOT NULL default '0000-00-00 00:00:00', post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00', post_content_filtered text NOT NULL, post_parent bigint(20) NOT NULL default '0', guid varchar(255) NOT NULL default '', menu_order int(11) NOT NULL default '0', post_type varchar(20) NOT NULL default 'post', post_mime_type varchar(100) NOT NULL default '', comment_count bigint(20) NOT NULL default '0', PRIMARY KEY (ID), KEY post_name (post_name), KEY type_status_date (post_type,post_status,post_date,ID) ) $charset_collate; CREATE TABLE $wpdb->users ( ID bigint(20) unsigned NOT NULL auto_increment, user_login varchar(60) NOT NULL default '', user_pass varchar(64) NOT NULL default '', user_nicename varchar(50) NOT NULL default '', user_email varchar(100) NOT NULL default '', user_url varchar(100) NOT NULL default '', user_registered datetime NOT NULL default '0000-00-00 00:00:00', user_activation_key varchar(60) NOT NULL default '', 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_nicename (user_nicename) ) $charset_collate; CREATE TABLE $wpdb->usermeta ( umeta_id bigint(20) NOT NULL auto_increment, user_id bigint(20) NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (umeta_id), KEY user_id (user_id), KEY meta_key (meta_key) ) $charset_collate;"; function populate_options() { global $wpdb, $wp_db_version; $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); 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); add_option('use_balanceTags', 0); add_option('use_smilies', 1); add_option('require_name_email', 1); add_option('comments_notify', 1); add_option('posts_per_rss', 10); add_option('rss_excerpt_length', 50); add_option('rss_use_excerpt', 0); add_option('mailserver_url', 'mail.example.com'); add_option('mailserver_login', 'login@example.com'); add_option('mailserver_pass', 'password'); add_option('mailserver_port', 110); add_option('default_category', 1); add_option('default_comment_status', 'open'); add_option('default_ping_status', 'open'); add_option('default_pingback_flag', 1); add_option('default_post_edit_rows', 10); add_option('posts_per_page', 10); add_option('what_to_show', 'posts'); add_option('date_format', __('F j, Y')); add_option('time_format', __('g:i a')); add_option('links_updated_date_format', __('F j, Y g:i a')); add_option('links_recently_updated_prepend', ''); add_option('links_recently_updated_append', ''); add_option('links_recently_updated_time', 120); add_option('comment_moderation', 0); add_option('moderation_notify', 1); add_option('permalink_structure'); add_option('gzipcompression', 0); add_option('hack_file', 0); add_option('blog_charset', 'UTF-8'); add_option('moderation_keys'); add_option('active_plugins'); add_option('home', $guessurl); // in case it is set, but blank, update "home" if ( !__get_option('home') ) update_option('home', $guessurl); add_option('category_base'); add_option('ping_sites', 'http://rpc.pingomatic.com/'); add_option('advanced_edit', 0); add_option('comment_max_links', 2); add_option('gmt_offset', date('Z') / 3600); // 1.5 add_option('default_email_category', 1); add_option('recently_edited'); add_option('use_linksupdate', 0); add_option('template', 'default'); add_option('stylesheet', 'default'); add_option('comment_whitelist', 1); add_option('page_uris'); add_option('blacklist_keys'); add_option('comment_registration', 0); add_option('rss_language', 'en'); add_option('html_type', 'text/html'); // 1.5.1 add_option('use_trackback', 0); // 2.0 add_option('default_role', 'subscriber'); add_option('db_version', $wp_db_version); // 2.0.1 if ( ini_get('safe_mode') ) { // Safe mode screws up mkdir(), so we must use a flat structure. add_option('uploads_use_yearmonth_folders', 0); add_option('upload_path', 'wp-content'); } else { add_option('uploads_use_yearmonth_folders', 1); add_option('upload_path', 'wp-content/uploads'); } // 2.0.3 add_option('secret', md5(uniqid(microtime()))); // 2.1 add_option('blog_public', '1'); 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) : delete_option($option); endforeach; // Set up a few options not to load by default $fatoptions = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' ); foreach ($fatoptions as $fatoption) : $wpdb->query("UPDATE $wpdb->options SET `autoload` = 'no' WHERE option_name = '$fatoption'"); endforeach; } function populate_roles() { populate_roles_160(); populate_roles_210(); populate_roles_230(); } function populate_roles_160() { global $wp_roles; // Add roles add_role('administrator', __('Administrator')); add_role('editor', __('Editor')); add_role('author', __('Author')); add_role('contributor', __('Contributor')); add_role('subscriber', __('Subscriber')); // Add caps for Administrator role $role = get_role('administrator'); $role->add_cap('switch_themes'); $role->add_cap('edit_themes'); $role->add_cap('activate_plugins'); $role->add_cap('edit_plugins'); $role->add_cap('edit_users'); $role->add_cap('edit_files'); $role->add_cap('manage_options'); $role->add_cap('moderate_comments'); $role->add_cap('manage_categories'); $role->add_cap('manage_links'); $role->add_cap('upload_files'); $role->add_cap('import'); $role->add_cap('unfiltered_html'); $role->add_cap('edit_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('edit_pages'); $role->add_cap('read'); $role->add_cap('level_10'); $role->add_cap('level_9'); $role->add_cap('level_8'); $role->add_cap('level_7'); $role->add_cap('level_6'); $role->add_cap('level_5'); $role->add_cap('level_4'); $role->add_cap('level_3'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Editor role $role = get_role('editor'); $role->add_cap('moderate_comments'); $role->add_cap('manage_categories'); $role->add_cap('manage_links'); $role->add_cap('upload_files'); $role->add_cap('unfiltered_html'); $role->add_cap('edit_posts'); $role->add_cap('edit_others_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('edit_pages'); $role->add_cap('read'); $role->add_cap('level_7'); $role->add_cap('level_6'); $role->add_cap('level_5'); $role->add_cap('level_4'); $role->add_cap('level_3'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Author role $role = get_role('author'); $role->add_cap('upload_files'); $role->add_cap('edit_posts'); $role->add_cap('edit_published_posts'); $role->add_cap('publish_posts'); $role->add_cap('read'); $role->add_cap('level_2'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Contributor role $role = get_role('contributor'); $role->add_cap('edit_posts'); $role->add_cap('read'); $role->add_cap('level_1'); $role->add_cap('level_0'); // Add caps for Subscriber role $role = get_role('subscriber'); $role->add_cap('read'); $role->add_cap('level_0'); } function populate_roles_210() { $roles = array('administrator', 'editor'); foreach ($roles as $role) { $role = get_role($role); if ( empty($role) ) continue; $role->add_cap('edit_others_pages'); $role->add_cap('edit_published_pages'); $role->add_cap('publish_pages'); $role->add_cap('delete_pages'); $role->add_cap('delete_others_pages'); $role->add_cap('delete_published_pages'); $role->add_cap('delete_posts'); $role->add_cap('delete_others_posts'); $role->add_cap('delete_published_posts'); $role->add_cap('delete_private_posts'); $role->add_cap('edit_private_posts'); $role->add_cap('read_private_posts'); $role->add_cap('delete_private_pages'); $role->add_cap('edit_private_pages'); $role->add_cap('read_private_pages'); } $role = get_role('administrator'); if ( ! empty($role) ) { $role->add_cap('delete_users'); $role->add_cap('create_users'); } $role = get_role('author'); if ( ! empty($role) ) { $role->add_cap('delete_posts'); $role->add_cap('delete_published_posts'); } $role = get_role('contributor'); if ( ! empty($role) ) { $role->add_cap('delete_posts'); } } function populate_roles_230() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( 'unfiltered_upload' ); } } ?> wp-admin/includes/taxonomy.php0000644013707600007620000000564010675236104014502 0ustar www $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'); } ?>wp-admin/includes/template.php0000644013707600007620000006115510671617744014453 0ustar wwwparent == $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( '— ', $level ); if ( current_user_can( 'manage_categories' ) ) { $edit = "".__( 'Edit' ).""; $default_cat_id = (int) get_option( 'default_category' ); if ( $category->term_id != $default_cat_id ) $edit .= "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' ).""; else $edit .= "".__( "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 ) ? "$category->count" : $category->count; $output = " $category->term_id " . ( $name_override ? $name_override : $pad . ' ' . $category->name ) . " $category->description $posts_count $edit\n\t\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 '
  • "; if ( $category['children'] ) { echo "
      \n"; write_nested_categories( $category['children'] ); echo "
    \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 '"; } } 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( '— ', $level ); $id = (int) $post->ID; $class = ('alternate' == $class ) ? '' : 'alternate'; ?> ID; ?> post_modified ) _e('Unpublished'); else echo mysql2date( __('Y-m-d g:i a'), $post->post_modified ); ?> " . __( 'Edit' ) . ""; } ?> " . __( 'Delete' ) . ""; } ?> 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 = " $email $short_url"; $r .= "\n\t\t"; if ( $numposts > 0 ) { $r .= ""; $r .= sprintf(__ngettext( 'View %s post', 'View %s posts', $numposts ), $numposts); $r .= ''; } $r .= "\n\t\t"; 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 .= "".__( 'Edit' ).""; } $r .= "\n\t"; 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 "
  • "; ?>

    comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

    — [ comment_post_ID) ) { echo " " . __('Edit') . ''; echo ' | comment_author)) . "', theCommentList );\">" . __('Delete') . ' '; if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { echo ' | ' . __('Unapprove') . ' '; echo ' | ' . __('Approve') . ' '; } echo " | comment_post_ID . "&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') . " "; } $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; ?> ] —

  • term_id && $parent == $category->parent) { $pad = str_repeat( '– ', $level ); $category->name = wp_specialchars( $category->name ); echo "\n\t"; 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 needed for list-manipulation JS return; } $count = 0; ?> "; 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"; $r .= "\n\t\t"; $r .= "\n\t\t"; $r .= "\n\t\t
    "; $r .= "\n\t\t"; $r .= "\n\t"; } echo $r; echo "\n\t"; } 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); ?>

    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 '
    '; $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 " /> /> @ /> : /> get_month( $mm ), $jj, $aa, $hh, $mn ); } ?>
    $template"; 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( ' ', $level * 3 ); if ( $item->ID == $default) $current = ' selected="selected"'; else $current = ''; echo "\n\t"; parent_dropdown( $default, $item->ID, $level +1 ); } } else { return false; } } function browse_happy() { $getit = __( 'WordPress recommends a better browser' ); echo '

    Browse Happy

    '; } 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'] ); ?> role_names as $role => $name ) if ( $default == $role ) // Make default first in list $p = "\n\t"; else $r .= "\n\t"; 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 ); ?>

    ()

    post_name); // just in case if ( strlen($name) ) echo ''; } ?> wp-admin/includes/theme.php0000644013707600007620000000265510634105372013726 0ustar wwwname = $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; } ?> wp-admin/includes/update.php0000644013707600007620000000703410675040362014104 0ustar wwwresponse ) { case 'development' : return sprintf( '| '.__( 'You are using a development version (%s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], 'http://wordpress.org/download/svn/' ); break; case 'upgrade' : return sprintf( '| '.__( 'Your WordPress %s is out of date. Please update.' ).'', $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! Please update now.'), $cur->url ); else $msg = __('A new version of WordPress is available! Please notify the site administrator.'); echo "
    $msg
    "; } 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 ""; printf( __('There is a new version of %s available. Download version %s here.'), $plugin_data['Name'], $r->url, $r->new_version ); echo ""; } add_action( 'after_plugin_row', 'wp_plugin_update_row' ); ?> wp-admin/includes/upgrade.php0000644013707600007620000013703510706121556014256 0ustar wwwset_role('administrator'); wp_install_defaults($user_id); $wp_rewrite->flush_rules(); wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password); wp_cache_flush(); return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password); } endif; if ( !function_exists('wp_install_defaults') ) : function wp_install_defaults($user_id) { global $wpdb; // Default category $cat_name = $wpdb->escape(__('Uncategorized')); $cat_slug = sanitize_title(__('Uncategorized')); $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')"); $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')"); // Default link category $cat_name = $wpdb->escape(__('Blogroll')); $cat_slug = sanitize_title(__('Blogroll')); $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')"); $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('2', 'link_category', '', '0', '7')"); // Now drop in some default links $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://codex.wordpress.org/', 'Documentation', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/development/', 'Development Blog', 0, 'http://wordpress.org/development/feed/', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (2, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/ideas/', 'Suggest Ideas', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (3, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/support/', 'Support Forum', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (4, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/plugins/', 'Plugins', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (5, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/themes/', 'Themes', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (6, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://planet.wordpress.org/', 'WordPress Planet', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (7, 2)" ); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress-polska.org/', 'Polski WordPress', 0, '', '');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (8, 2)" ); // First post $now = date('Y-m-d H:i:s'); $now_gmt = gmdate('Y-m-d H:i:s'); $first_post_guid = get_option('home') . '/?p=1'; $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt', '$first_post_guid', '1', '', '', '')"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 1)" ); // Default comment $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org/', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.'))."')"); // First Page $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')"); } endif; if ( !function_exists('wp_new_blog_notification') ) : function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { $user = new WP_User($user_id); $email = $user->user_email; $name = $user->user_login; $message_headers = 'From: "' . $blog_title . '" '; $message = sprintf(__("Your new WordPress blog has been successfully set up at: %1\$s You can log in to the administrator account with the following information: Username: %2\$s Password: %3\$s We hope you enjoy your new blog. Thanks! --The WordPress Team http://wordpress.org/ "), $blog_url, $name, $password); @wp_mail($email, __('New WordPress Blog'), $message, $message_headers); } endif; if ( !function_exists('wp_upgrade') ) : function wp_upgrade() { global $wp_current_db_version, $wp_db_version; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ( $wp_db_version == $wp_current_db_version ) return; wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); } endif; // Functions to be called in install and upgrade scripts function upgrade_all() { global $wp_current_db_version, $wp_db_version, $wp_rewrite; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ( $wp_db_version == $wp_current_db_version ) return; // If the version is not set in the DB, try to guess the version. if ( empty($wp_current_db_version) ) { $wp_current_db_version = 0; // If the template option exists, we have 1.5. $template = __get_option('template'); if ( !empty($template) ) $wp_current_db_version = 2541; } if ( $wp_current_db_version < 6039 ) upgrade_230_options_table(); populate_options(); if ( $wp_current_db_version < 2541 ) { upgrade_100(); upgrade_101(); upgrade_110(); upgrade_130(); } if ( $wp_current_db_version < 3308 ) upgrade_160(); if ( $wp_current_db_version < 4772 ) upgrade_210(); if ( $wp_current_db_version < 4351 ) upgrade_old_slugs(); if ( $wp_current_db_version < 5539 ) upgrade_230(); if ( $wp_current_db_version < 6124 ) upgrade_230_old_tables(); maybe_disable_automattic_widgets(); $wp_rewrite->flush_rules(); update_option('db_version', $wp_db_version); } function upgrade_100() { global $wpdb; // Get the title and ID of every post, post_name to check if it already has a value $posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''"); if ($posts) { foreach($posts as $post) { if ('' == $post->post_name) { $newtitle = sanitize_title($post->post_title); $wpdb->query("UPDATE $wpdb->posts SET post_name = '$newtitle' WHERE ID = '$post->ID'"); } } } $categories = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories"); foreach ($categories as $category) { if ('' == $category->category_nicename) { $newtitle = sanitize_title($category->cat_name); $wpdb->query("UPDATE $wpdb->categories SET category_nicename = '$newtitle' WHERE cat_ID = '$category->cat_ID'"); } } $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') WHERE option_name LIKE 'links_rating_image%' AND option_value LIKE 'wp-links/links-images/%'"); $done_ids = $wpdb->get_results("SELECT DISTINCT post_id FROM $wpdb->post2cat"); if ($done_ids) : foreach ($done_ids as $done_id) : $done_posts[] = $done_id->post_id; endforeach; $catwhere = ' AND ID NOT IN (' . implode(',', $done_posts) . ')'; else: $catwhere = ''; endif; $allposts = $wpdb->get_results("SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere"); if ($allposts) : foreach ($allposts as $post) { // Check to see if it's already been imported $cat = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post->ID AND category_id = $post->post_category"); if (!$cat && 0 != $post->post_category) { // If there's no result $wpdb->query(" INSERT INTO $wpdb->post2cat (post_id, category_id) VALUES ('$post->ID', '$post->post_category') "); } } endif; } function upgrade_101() { global $wpdb; // Clean up indices, add a few add_clean_index($wpdb->posts, 'post_name'); add_clean_index($wpdb->posts, 'post_status'); add_clean_index($wpdb->categories, 'category_nicename'); add_clean_index($wpdb->comments, 'comment_approved'); add_clean_index($wpdb->comments, 'comment_post_ID'); add_clean_index($wpdb->links , 'link_category'); add_clean_index($wpdb->links , 'link_visible'); } function upgrade_110() { global $wpdb; // Set user_nicename. $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users"); foreach ($users as $user) { if ('' == $user->user_nicename) { $newname = sanitize_title($user->user_nickname); $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'"); } } $users = $wpdb->get_results("SELECT ID, user_pass from $wpdb->users"); foreach ($users as $row) { if (!preg_match('/^[A-Fa-f0-9]{32}$/', $row->user_pass)) { $wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\''); } } // Get the GMT offset, we'll use that later on $all_options = get_alloptions_110(); $time_difference = $all_options->time_difference; $server_time = time()+date('Z'); $weblogger_time = $server_time + $time_difference*3600; $gmt_time = time(); $diff_gmt_server = ($gmt_time - $server_time) / 3600; $diff_weblogger_server = ($weblogger_time - $server_time) / 3600; $diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server; $gmt_offset = -$diff_gmt_weblogger; // Add a gmt_offset option, with value $gmt_offset add_option('gmt_offset', $gmt_offset); // Check if we already set the GMT fields (if we did, then // MAX(post_date_gmt) can't be '0000-00-00 00:00:00' // I just slapped myself silly for not thinking about it earlier $got_gmt_fields = ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00') ? false : true; if (!$got_gmt_fields) { // Add or substract time to all dates, to get GMT dates $add_hours = intval($diff_gmt_weblogger); $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); $wpdb->query("UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); $wpdb->query("UPDATE $wpdb->posts SET post_modified = post_date"); $wpdb->query("UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'"); $wpdb->query("UPDATE $wpdb->comments SET comment_date_gmt = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); $wpdb->query("UPDATE $wpdb->users SET user_registered = DATE_ADD(user_registered, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); } } function upgrade_130() { global $wpdb; // Remove extraneous backslashes. $posts = $wpdb->get_results("SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts"); if ($posts) { foreach($posts as $post) { $post_content = addslashes(deslash($post->post_content)); $post_title = addslashes(deslash($post->post_title)); $post_excerpt = addslashes(deslash($post->post_excerpt)); if ( empty($post->guid) ) $guid = get_permalink($post->ID); else $guid = $post->guid; $wpdb->query("UPDATE $wpdb->posts SET post_title = '$post_title', post_content = '$post_content', post_excerpt = '$post_excerpt', guid = '$guid' WHERE ID = '$post->ID'"); } } // Remove extraneous backslashes. $comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments"); if ($comments) { foreach($comments as $comment) { $comment_content = addslashes(deslash($comment->comment_content)); $comment_author = addslashes(deslash($comment->comment_author)); $wpdb->query("UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author' WHERE comment_ID = '$comment->comment_ID'"); } } // Remove extraneous backslashes. $links = $wpdb->get_results("SELECT link_id, link_name, link_description FROM $wpdb->links"); if ($links) { foreach($links as $link) { $link_name = addslashes(deslash($link->link_name)); $link_description = addslashes(deslash($link->link_description)); $wpdb->query("UPDATE $wpdb->links SET link_name = '$link_name', link_description = '$link_description' WHERE link_id = '$link->link_id'"); } } // The "paged" option for what_to_show is no more. if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged') { $wpdb->query("UPDATE $wpdb->options SET option_value = 'posts' WHERE option_name = 'what_to_show'"); } $active_plugins = __get_option('active_plugins'); // If plugins are not stored in an array, they're stored in the old // newline separated format. Convert to new format. if ( !is_array( $active_plugins ) ) { $active_plugins = explode("\n", trim($active_plugins)); update_option('active_plugins', $active_plugins); } // Obsolete tables $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiontypes'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroups'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroup_options'); // Update comments table to use comment_type $wpdb->query("UPDATE $wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '', '') WHERE comment_content LIKE '%'"); $wpdb->query("UPDATE $wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '', '') WHERE comment_content LIKE '%'"); // Some versions have multiple duplicate option_name rows with the same values $options = $wpdb->get_results("SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name"); foreach ( $options as $option ) { if ( 1 != $option->dupes ) { // Could this be done in the query? $limit = $option->dupes - 1; $dupe_ids = $wpdb->get_col("SELECT option_id FROM $wpdb->options WHERE option_name = '$option->option_name' LIMIT $limit"); $dupe_ids = join($dupe_ids, ','); $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)"); } } make_site_theme(); } function upgrade_160() { global $wpdb, $wp_current_db_version; populate_roles_160(); $users = $wpdb->get_results("SELECT * FROM $wpdb->users"); foreach ( $users as $user ) : if ( !empty( $user->user_firstname ) ) update_usermeta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) ); if ( !empty( $user->user_lastname ) ) update_usermeta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) ); if ( !empty( $user->user_nickname ) ) update_usermeta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) ); if ( !empty( $user->user_level ) ) update_usermeta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level ); if ( !empty( $user->user_icq ) ) update_usermeta( $user->ID, 'icq', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_aim ) ) update_usermeta( $user->ID, 'aim', $wpdb->escape($user->user_aim) ); if ( !empty( $user->user_msn ) ) update_usermeta( $user->ID, 'msn', $wpdb->escape($user->user_msn) ); if ( !empty( $user->user_yim ) ) update_usermeta( $user->ID, 'yim', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_description ) ) update_usermeta( $user->ID, 'description', $wpdb->escape($user->user_description) ); if ( isset( $user->user_idmode ) ): $idmode = $user->user_idmode; if ($idmode == 'nickname') $id = $user->user_nickname; if ($idmode == 'login') $id = $user->user_login; if ($idmode == 'firstname') $id = $user->user_firstname; if ($idmode == 'lastname') $id = $user->user_lastname; if ($idmode == 'namefl') $id = $user->user_firstname.' '.$user->user_lastname; if ($idmode == 'namelf') $id = $user->user_lastname.' '.$user->user_firstname; if (!$idmode) $id = $user->user_nickname; $id = $wpdb->escape( $id ); $wpdb->query("UPDATE $wpdb->users SET display_name = '$id' WHERE ID = '$user->ID'"); endif; // FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set. $caps = get_usermeta( $user->ID, $wpdb->prefix . 'capabilities'); if ( empty($caps) || defined('RESET_CAPS') ) { $level = get_usermeta($user->ID, $wpdb->prefix . 'user_level'); $role = translate_level_to_role($level); update_usermeta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) ); } endforeach; $old_user_fields = array( 'user_firstname', 'user_lastname', 'user_icq', 'user_aim', 'user_msn', 'user_yim', 'user_idmode', 'user_ip', 'user_domain', 'user_browser', 'user_description', 'user_nickname', 'user_level' ); $wpdb->hide_errors(); foreach ( $old_user_fields as $old ) $wpdb->query("ALTER TABLE $wpdb->users DROP $old"); $wpdb->show_errors(); // populate comment_count field of posts table $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" ); if( is_array( $comments ) ) { foreach ($comments as $comment) { $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID'" ); } } // Some alpha versions used a post status of object instead of attachment and put // the mime type in post_type instead of post_mime_type. if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) { $objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'"); foreach ($objects as $object) { $wpdb->query("UPDATE $wpdb->posts SET post_status = 'attachment', post_mime_type = '$object->post_type', post_type = '' WHERE ID = $object->ID"); $meta = get_post_meta($object->ID, 'imagedata', true); if ( ! empty($meta['file']) ) update_attached_file( $object->ID, $meta['file'] ); } } } function upgrade_210() { global $wpdb, $wp_current_db_version; if ( $wp_current_db_version < 3506 ) { // Update status and type. $posts = $wpdb->get_results("SELECT ID, post_status FROM $wpdb->posts"); if ( ! empty($posts) ) foreach ($posts as $post) { $status = $post->post_status; $type = 'post'; if ( 'static' == $status ) { $status = 'publish'; $type = 'page'; } else if ( 'attachment' == $status ) { $status = 'inherit'; $type = 'attachment'; } $wpdb->query("UPDATE $wpdb->posts SET post_status = '$status', post_type = '$type' WHERE ID = '$post->ID'"); } } if ( $wp_current_db_version < 3845 ) { populate_roles_210(); } if ( $wp_current_db_version < 3531 ) { // Give future posts a post_status of future. $now = gmdate('Y-m-d H:i:59'); $wpdb->query ("UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'"); $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); if ( !empty($posts) ) foreach ( $posts as $post ) wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); } } function upgrade_230() { global $wp_current_db_version, $wpdb; if ( $wp_current_db_version < 5200 ) { populate_roles_230(); } // Convert categories to terms. $tt_ids = array(); $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID"); foreach ($categories as $category) { $term_id = (int) $category->cat_ID; $name = $wpdb->escape($category->cat_name); $description = $wpdb->escape($category->category_description); $slug = $wpdb->escape($category->category_nicename); $parent = $wpdb->escape($category->category_parent); $term_group = 0; // Associate terms with the same slug in a term group and make slugs unique. if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) { $term_group = $exists[0]->term_group; $id = $exists[0]->term_id; $num = 2; do { $alt_slug = $slug . "-$num"; $num++; $slug_check = $wpdb->get_var("SELECT slug FROM $wpdb->terms WHERE slug = '$alt_slug'"); } while ( $slug_check ); $slug = $alt_slug; if ( empty( $term_group ) ) { $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1; $wpdb->query("UPDATE $wpdb->terms SET term_group = '$term_group' WHERE term_id = '$id'"); } } $wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')"); $count = 0; if ( !empty($category->category_count) ) { $count = (int) $category->category_count; $taxonomy = 'category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( !empty($category->link_count) ) { $count = (int) $category->link_count; $taxonomy = 'link_category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( !empty($category->tag_count) ) { $count = (int) $category->tag_count; $taxonomy = 'post_tag'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } if ( empty($count) ) { $count = 0; $taxonomy = 'category'; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')"); $tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id; } } $posts = $wpdb->get_results("SELECT * FROM $wpdb->post2cat"); foreach ( $posts as $post ) { $post_id = (int) $post->post_id; $term_id = (int) $post->category_id; $taxonomy = 'category'; if ( !empty($post->rel_type) && 'tag' == $post->rel_type) $taxonomy = 'tag'; $tt_id = $tt_ids[$term_id][$taxonomy]; if ( empty($tt_id) ) continue; $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post_id', '$tt_id')"); } // < 3570 we used linkcategories. >= 3570 we used categories and link2cat. if ( $wp_current_db_version < 3570 ) { // Create link_category terms for link categories. Create a map of link cat IDs // to link_category terms. $link_cat_id_map = array(); $default_link_cat = 0; $tt_ids = array(); $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories'); foreach ( $link_cats as $category) { $cat_id = (int) $category->cat_id; $term_id = 0; $name = $wpdb->escape($category->cat_name); $slug = sanitize_title($name); $term_group = 0; // Associate terms with the same slug in a term group and make slugs unique. if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) { $term_group = $exists[0]->term_group; $term_id = $exists[0]->term_id; } if ( empty($term_id) ) { $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$name', '$slug', '$term_group')"); $term_id = (int) $wpdb->insert_id; } $link_cat_id_map[$cat_id] = $term_id; $default_link_cat = $term_id; $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', 'link_category', '', '0', '0')"); $tt_ids[$term_id] = (int) $wpdb->insert_id; } // Associate links to cats. $links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links"); if ( !empty($links) ) foreach ( $links as $link ) { if ( 0 == $link->link_category ) continue; if ( ! isset($link_cat_id_map[$link->link_category]) ) continue; $term_id = $link_cat_id_map[$link->link_category]; $tt_id = $tt_ids[$term_id]; if ( empty($tt_id) ) continue; $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link->link_id', '$tt_id')"); } // Set default to the last category we grabbed during the upgrade loop. update_option('default_link_category', $default_link_cat); } else { $links = $wpdb->get_results("SELECT * FROM $wpdb->link2cat"); foreach ( $links as $link ) { $link_id = (int) $link->link_id; $term_id = (int) $link->category_id; $taxonomy = 'link_category'; $tt_id = $tt_ids[$term_id][$taxonomy]; if ( empty($tt_id) ) continue; $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link_id', '$tt_id')"); } } if ( $wp_current_db_version < 4772 ) { // Obsolete linkcategories table $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories'); } // Recalculate all counts $terms = $wpdb->get_results("SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy"); foreach ( (array) $terms as $term ) { if ( ('post_tag' == $term->taxonomy) || ('category' == $term->taxonomy) ) $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = '$term->term_taxonomy_id'"); else $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term->term_taxonomy_id'"); $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term->term_taxonomy_id'"); } } function upgrade_230_options_table() { global $wpdb; $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' ); $wpdb->hide_errors(); foreach ( $old_options_fields as $old ) $wpdb->query("ALTER TABLE $wpdb->options DROP $old"); $wpdb->show_errors(); } function upgrade_230_old_tables() { global $wpdb; $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'link2cat'); $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat'); } function upgrade_old_slugs() { // upgrade people who were using the Redirect Old Slugs plugin global $wpdb; $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); } // The functions we use to actually do stuff // General function maybe_create_table($table_name, $create_ddl) { global $wpdb; foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } return false; } function drop_index($table, $index) { global $wpdb; $wpdb->hide_errors(); $wpdb->query("ALTER TABLE `$table` DROP INDEX `$index`"); // Now we need to take out all the extra ones we may have created for ($i = 0; $i < 25; $i++) { $wpdb->query("ALTER TABLE `$table` DROP INDEX `{$index}_$i`"); } $wpdb->show_errors(); return true; } function add_clean_index($table, $index) { global $wpdb; drop_index($table, $index); $wpdb->query("ALTER TABLE `$table` ADD INDEX ( `$index` )"); return true; } /** ** maybe_add_column() ** Add column to db table if it doesn't exist. ** Returns: true if already exists or on successful completion ** false on error */ function maybe_add_column($table_name, $column_name, $create_ddl) { global $wpdb, $debug; foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { if ($debug) echo("checking $column == $column_name
    "); if ($column == $column_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { if ($column == $column_name) { return true; } } return false; } // get_alloptions as it was for 1.2. function get_alloptions_110() { global $wpdb; if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) { foreach ($options as $option) { // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" -- Dougal if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); $all_options->{$option->option_name} = stripslashes($option->option_value); } } return $all_options; } // Version of get_option that is private to install/upgrade. function __get_option($setting) { global $wpdb; if ( $setting == 'home' && defined( 'WP_HOME' ) ) { return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); } if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); } $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); if ( 'home' == $setting && '' == $option ) return __get_option('siteurl'); if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting ) $option = preg_replace('|/+$|', '', $option); @ $kellogs = unserialize($option); if ($kellogs !== FALSE) return $kellogs; else return $option; } function deslash($content) { // Note: \\\ inside a regex denotes a single backslash. // Replace one or more backslashes followed by a single quote with // a single quote. $content = preg_replace("/\\\+'/", "'", $content); // Replace one or more backslashes followed by a double quote with // a double quote. $content = preg_replace('/\\\+"/', '"', $content); // Replace one or more backslashes with one backslash. $content = preg_replace("/\\\+/", "\\", $content); return $content; } function dbDelta($queries, $execute = true) { global $wpdb; // Seperate individual queries into an array if( !is_array($queries) ) { $queries = explode( ';', $queries ); if('' == $queries[count($queries) - 1]) array_pop($queries); } $cqueries = array(); // Creation Queries $iqueries = array(); // Insertion Queries $for_update = array(); // Create a tablename index for an array ($cqueries) of queries foreach($queries as $qry) { if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { $cqueries[strtolower($matches[1])] = $qry; $for_update[$matches[1]] = 'Created table '.$matches[1]; } else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { array_unshift($cqueries, $qry); } else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; } else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; } else { // Unrecognized query type } } // Check to see which tables and fields exist if($tables = $wpdb->get_col('SHOW TABLES;')) { // For every table in the database foreach($tables as $table) { // If a table query exists for the database table... if( array_key_exists(strtolower($table), $cqueries) ) { // Clear the field and index arrays unset($cfields); unset($indices); // Get all of the field names in the query from between the parens preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2); $qryline = trim($match2[1]); // Separate field lines into an array $flds = explode("\n", $qryline); //echo "
    \n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."

    "; // For every field line specified in the query foreach($flds as $fld) { // Extract the field name preg_match("|^([^ ]*)|", trim($fld), $fvals); $fieldname = $fvals[1]; // Verify the found field name $validfield = true; switch(strtolower($fieldname)) { case '': case 'primary': case 'index': case 'fulltext': case 'unique': case 'key': $validfield = false; $indices[] = trim(trim($fld), ", \n"); break; } $fld = trim($fld); // If it's a valid field, add it to the field array if($validfield) { $cfields[strtolower($fieldname)] = trim($fld, ", \n"); } } // Fetch the table column structure from the database $tablefields = $wpdb->get_results("DESCRIBE {$table};"); // For every field in the table foreach($tablefields as $tablefield) { // If the table field exists in the field array... if(array_key_exists(strtolower($tablefield->Field), $cfields)) { // Get the field type from the query preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); $fieldtype = $matches[1]; // Is actual field type different from the field type in query? if($tablefield->Type != $fieldtype) { // Add a query to change the column type $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; } // Get the default value from the array //echo "{$cfields[strtolower($tablefield->Field)]}
    "; if(preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { $default_value = $matches[1]; if($tablefield->Default != $default_value) { // Add a query to change the column's default value $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'"; $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}"; } } // Remove the field from the array (so it's not added) unset($cfields[strtolower($tablefield->Field)]); } else { // This field exists in the table, but not in the creation queries? } } // For every remaining field specified for the table foreach($cfields as $fieldname => $fielddef) { // Push a query line into $cqueries that adds the field to that table $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname; } // Index stuff goes here // Fetch the table index structure from the database $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); if($tableindices) { // Clear the index array unset($index_ary); // For every index in the table foreach($tableindices as $tableindex) { // Add the index to the index data array $keyname = $tableindex->Key_name; $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part); $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false; } // For each actual index in the index array foreach($index_ary as $index_name => $index_data) { // Build a create string to compare to the query $index_string = ''; if($index_name == 'PRIMARY') { $index_string .= 'PRIMARY '; } else if($index_data['unique']) { $index_string .= 'UNIQUE '; } $index_string .= 'KEY '; if($index_name != 'PRIMARY') { $index_string .= $index_name; } $index_columns = ''; // For each column in the index foreach($index_data['columns'] as $column_data) { if($index_columns != '') $index_columns .= ','; // Add the field to the column list string $index_columns .= $column_data['fieldname']; if($column_data['subpart'] != '') { $index_columns .= '('.$column_data['subpart'].')'; } } // Add the column list to the index create string $index_string .= ' ('.$index_columns.')'; error_log("Index string: $index_string", 0); if(!(($aindex = array_search($index_string, $indices)) === false)) { unset($indices[$aindex]); //echo "
    {$table}:
    Found index:".$index_string."
    \n"; } //else echo "
    {$table}:
    Did not find index:".$index_string."
    ".print_r($indices, true)."
    \n"; } } // For every remaining index specified for the table foreach ( (array) $indices as $index ) { // Push a query line into $cqueries that adds the index to that table $cqueries[] = "ALTER TABLE {$table} ADD $index"; $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index; } // Remove the original table creation query from processing unset($cqueries[strtolower($table)]); unset($for_update[strtolower($table)]); } else { // This table exists in the database, but not in the creation queries? } } } $allqueries = array_merge($cqueries, $iqueries); if($execute) { foreach($allqueries as $query) { //echo "
    ".print_r($query, true)."
    \n"; $wpdb->query($query); } } return $for_update; } function make_db_current() { global $wp_queries; $alterations = dbDelta($wp_queries); echo "
      \n"; foreach($alterations as $alteration) echo "
    1. $alteration
    2. \n"; echo "
    \n"; } function make_db_current_silent() { global $wp_queries; $alterations = dbDelta($wp_queries); } function make_site_theme_from_oldschool($theme_name, $template) { $home_path = get_home_path(); $site_dir = ABSPATH . "wp-content/themes/$template"; if (! file_exists("$home_path/index.php")) return false; // Copy files from the old locations to the site theme. // TODO: This does not copy arbitarary include dependencies. Only the // standard WP files are copied. $files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php'); foreach ($files as $oldfile => $newfile) { if ($oldfile == 'index.php') $oldpath = $home_path; else $oldpath = ABSPATH; if ($oldfile == 'index.php') { // Check to make sure it's not a new index $index = implode('', file("$oldpath/$oldfile")); if (strpos($index, 'WP_USE_THEMES') !== false) { if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile")) return false; continue; // Don't copy anything } } if (! @copy("$oldpath/$oldfile", "$site_dir/$newfile")) return false; chmod("$site_dir/$newfile", 0777); // Update the blog header include in each file. $lines = explode("\n", implode('', file("$site_dir/$newfile"))); if ($lines) { $f = fopen("$site_dir/$newfile", 'w'); foreach ($lines as $line) { if (preg_match('/require.*wp-blog-header/', $line)) $line = '//' . $line; // Update stylesheet references. $line = str_replace("/wp-layout.css", "", $line); // Update comments template inclusion. $line = str_replace("", "", $line); fwrite($f, "{$line}\n"); } fclose($f); } } // Add a theme header. $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n"; $stylelines = file_get_contents("$site_dir/style.css"); if ($stylelines) { $f = fopen("$site_dir/style.css", 'w'); fwrite($f, $header); fwrite($f, $stylelines); fclose($f); } return true; } function make_site_theme_from_default($theme_name, $template) { $site_dir = ABSPATH . "wp-content/themes/$template"; $default_dir = ABSPATH . 'wp-content/themes/default'; // Copy files from the default theme to the site theme. //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css'); $theme_dir = @ opendir("$default_dir"); if ($theme_dir) { while(($theme_file = readdir( $theme_dir )) !== false) { if (is_dir("$default_dir/$theme_file")) continue; if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file")) return; chmod("$site_dir/$theme_file", 0777); } } @closedir($theme_dir); // Rewrite the theme header. $stylelines = explode("\n", implode('', file("$site_dir/style.css"))); if ($stylelines) { $f = fopen("$site_dir/style.css", 'w'); foreach ($stylelines as $line) { if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name; elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url'); elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.'; elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1'; elseif (strpos($line, 'Author:') !== false) $line = 'Author: You'; fwrite($f, $line . "\n"); } fclose($f); } // Copy the images. umask(0); if (! mkdir("$site_dir/images", 0777)) { return false; } $images_dir = @ opendir("$default_dir/images"); if ($images_dir) { while(($image = readdir($images_dir)) !== false) { if (is_dir("$default_dir/images/$image")) continue; if (! @copy("$default_dir/images/$image", "$site_dir/images/$image")) return; chmod("$site_dir/images/$image", 0777); } } @closedir($images_dir); } // Create a site theme from the default theme. function make_site_theme() { // Name the theme after the blog. $theme_name = __get_option('blogname'); $template = sanitize_title($theme_name); $site_dir = ABSPATH . "wp-content/themes/$template"; // If the theme already exists, nothing to do. if ( is_dir($site_dir)) { return false; } // We must be able to write to the themes dir. if (! is_writable(ABSPATH . "wp-content/themes")) { return false; } umask(0); if (! mkdir($site_dir, 0777)) { return false; } if (file_exists(ABSPATH . 'wp-layout.css')) { if (! make_site_theme_from_oldschool($theme_name, $template)) { // TODO: rm -rf the site theme directory. return false; } } else { if (! make_site_theme_from_default($theme_name, $template)) // TODO: rm -rf the site theme directory. return false; } // Make the new site theme active. $current_template = __get_option('template'); if ($current_template == 'default') { update_option('template', $template); update_option('stylesheet', $template); } return $template; } function translate_level_to_role($level) { switch ($level) { case 10: case 9: case 8: return 'administrator'; case 7: case 6: case 5: return 'editor'; case 4: case 3: case 2: return 'author'; case 1: return 'contributor'; case 0: return 'subscriber'; } } function wp_check_mysql_version() { global $wp_version; // Make sure the server has MySQL 4.0 $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info()); if ( version_compare($mysql_version, '4.0.0', '<') ) die(sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); } function maybe_disable_automattic_widgets() { $plugins = __get_option( 'active_plugins' ); foreach ( (array) $plugins as $plugin ) { if ( basename( $plugin ) == 'widgets.php' ) { array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); update_option( 'active_plugins', $plugins ); break; } } } ?>wp-admin/includes/upload.php0000644013707600007620000003115510665111132014100 0ustar wwwpost_content )); $class = 'text'; $innerHTML = get_attachment_innerHTML( $id, false, $dims ); if ( $image_src = get_attachment_icon_src() ) { $image_rel = wp_make_link_relative($image_src); $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); $class = 'image'; } $src_base = wp_get_attachment_url(); $src = wp_make_link_relative( $src_base ); $src_base = str_replace($src, '', $src_base); $r = ''; if ( $href ) $r .= "\n"; if ( $href || $image_src ) $r .= "\t\t\t$innerHTML"; if ( $href ) $r .= "\n"; $r .= "\t\t\t\t".size_format(filesize($filesystem_path))."\n"; $r .= "\n\t\t
    \n\t\t\t

    \n"; $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; if ( !$thumb_base = wp_get_attachment_thumb_url() ) $thumb_base = wp_mime_type_icon(); if ( $thumb_base ) { $thumb_rel = wp_make_link_relative( $thumb_base ); $thumb_base = str_replace( $thumb_rel, '', $thumb_base ); $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; } $r .= "\t\t\t\t\n"; if ( isset($width) ) { $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; } $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; $r .= "\t\t\t

    \n\t\t
    \n"; return $r; } function wp_upload_view() { global $style, $post_id, $style; $id = get_the_ID(); $attachment_data = wp_get_attachment_metadata( $id ); ?>

    "; the_title(); if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>

    ' . __('view') . ''; echo ' | '; echo '' . __('edit') . ''; echo ' | '; echo '' . __('cancel') . ''; echo ' ]'; ?>
    "; echo wp_upload_display( array(171, 128) ); if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>
    \n"; } function wp_upload_form() { $id = get_the_ID(); global $post_id, $tab, $style; $enctype = $id ? '' : ' enctype="multipart/form-data"'; $post_id = (int) $post_id; ?> id="upload-file" method="post" action="">

    "; the_title(); if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>

    ' . __('view') . ''; echo ' | '; echo '' . __('links') . ''; echo ' | '; echo '' . __('cancel') . ''; echo ' ]'; ?>
    "; echo wp_upload_display( array(171, 128) ); if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>
    " . __('Browse Files') . '' ); $overrides = array('action'=>'upload'); $file = wp_handle_upload($_FILES['image'], $overrides); if ( isset($file['error']) ) wp_die($file['error'] . "
    " . __('Back to Image Uploading') . '' ); $url = $file['url']; $type = $file['type']; $file = $file['file']; $filename = basename($file); // Construct the attachment array $attachment = array( 'post_title' => $post_title, 'post_content' => $post_content, 'post_type' => 'attachment', 'post_parent' => $post_id, 'post_mime_type' => $type, 'guid' => $url ); // Save the data $id = wp_insert_attachment($attachment, $file, $post_id); wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=browse&action=view&ID=$id&post_id=$post_id"); die; break; case 'save' : global $from_tab, $post_id, $style; if ( !$from_tab ) $from_tab = 'upload'; check_admin_referer( 'inlineuploading' ); wp_update_post($_POST); wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id"); die; break; case 'delete' : global $ID, $post_id, $from_tab, $style; if ( !$from_tab ) $from_tab = 'upload'; check_admin_referer( 'inlineuploading' ); if ( !current_user_can('edit_post', (int) $ID) ) wp_die( __('You are not allowed to delete this attachment.') . " " . __('Go back') . '' ); wp_delete_attachment($ID); wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id" ); die; break; endswitch; } add_action( 'upload_files_upload', 'wp_upload_tab_upload_action' ); function wp_upload_grab_attachments( $obj ) { $obj->is_attachment = true; } function wp_upload_posts_where( $where ) { global $post_id; return $where . " AND post_parent = '" . (int) $post_id . "'"; } function wp_upload_tab_browse() { global $action, $paged; $old_vars = compact( 'paged' ); switch ( $action ) : case 'edit' : case 'view' : global $ID; $attachments = query_posts("attachment_id=$ID"); if ( have_posts() ) : while ( have_posts() ) : the_post(); 'edit' == $action ? wp_upload_form() : wp_upload_view(); endwhile; endif; break; default : global $tab, $post_id, $style; 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&post_status=any&posts_per_page=10&paged=$paged"); echo "
      \n"; if ( have_posts() ) : while ( have_posts() ) : the_post(); $href = wp_specialchars( add_query_arg( array( 'action' => 'inline' == $style ? 'view' : 'edit', 'ID' => get_the_ID()) ), 1 ); echo "\t
    • \n"; echo wp_upload_display( array(128,128), $href ); echo "\t
    • \n"; endwhile; else : echo "\t
    • " . __('There are no attachments to show.') . "
    • \n"; endif; echo "
    \n\n"; echo "
    \n"; break; endswitch; extract($old_vars); } function wp_upload_tab_browse_action() { global $style; if ( 'inline' == $style ) wp_enqueue_script('upload'); } 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() { wp_admin_css( 'css/upload' ); if ( 'inline' == @$_GET['style'] ) { echo ""; } } ?> wp-admin/includes/user.php0000644013707600007620000002173110667076612013610 0ustar wwwid || $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', __( 'ERROR: 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', __( 'ERROR: Please enter your password twice.' )); } else { if ((empty ( $pass1 ) && !empty ( $pass2 ) ) || (empty ( $pass2 ) && !empty ( $pass1 ) ) ) $errors->add( 'pass', __( "ERROR: you typed your new password only once." )); } /* Check for "\" in password */ if( strpos( " ".$pass1, "\\" ) ) $errors->add( 'pass', __( 'ERROR: Passwords may not contain the character "\\".' )); /* checking the password has been typed twice the same */ if ( $pass1 != $pass2 ) $errors->add( 'pass', __( 'ERROR: 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', __( 'ERROR: This username is invalid. Please enter a valid username.' )); if (!$update && username_exists( $user->user_login )) $errors->add( 'user_login', __( 'ERROR: This username is already registered, please choose another one.' )); /* checking e-mail address */ if ( empty ( $user->user_email ) ) { $errors->add( 'user_email', __( "ERROR: please type an e-mail address" )); } else if (!is_email( $user->user_email ) ) { $errors->add( 'user_email', __( "ERROR: 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(); } ?>wp-admin/index-extra.php0000644013707600007620000000530310667076612013251 0ustar wwwitems) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results ?>

      items = array_slice($rss->items, 0, 10); foreach ($rss->items as $item ) { ?>
    items) && 0 != count($rss->items) ) { ?>

    items = array_slice($rss->items, 0, 3); foreach ($rss->items as $item ) { ?>

    '>

    items) && 0 != count($rss->items) ) { ?>

      items = array_slice($rss->items, 0, 20); foreach ($rss->items as $item ) { $title = wp_specialchars($item['title']); $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] ); $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] ); ?>
    • '>

    wp-admin/index.php0000644013707600007620000001212710667076612012132 0ustar www

    get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5"); $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); if ( $comments || $numcomments ) : ?>

    »' ), 'edit-comments.php' ); ?>

    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") ) : ?>

    »' ), 'edit.php' ); ?>

      post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID); echo "
    • "; the_title(); echo '
    • '; } ?>
    get_results("SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'future' ORDER BY post_date ASC") ) : ?>

      post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID); echo "
    • " . sprintf(__('%1$s in %2$s'), "$post->post_title", human_time_diff( current_time('timestamp', 1), strtotime($post->post_date_gmt. ' GMT') )) . "
    • "; } ?>

    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 = wp_count_terms('category'); $numtags = wp_count_terms('post_tag'); $post_str = sprintf(__ngettext('%1$s post', '%1$s posts', $numposts), number_format_i18n($numposts), 'edit.php'); $comm_str = sprintf(__ngettext('%1$s comment', '%1$s comments', $numcomms), number_format_i18n($numcomms), 'edit-comments.php'); $cat_str = sprintf(__ngettext('%1$s category', '%1$s categories', $numcats), number_format_i18n($numcats), 'categories.php'); $tag_str = sprintf(__ngettext('%1$s tag', '%1$s tags', $numtags), number_format_i18n($numtags)); ?>

    documentation or visit the support forums."); ?>

     
    wp-admin/install-helper.php0000644013707600007620000000764510530000006013724 0ustar wwwget_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { if ($table == $table_name) { return true; } } return false; } /** ** maybe_add_column() ** Add column to db table if it doesn't exist. ** Returns: true if already exists or on successful completion ** false on error */ function maybe_add_column($table_name, $column_name, $create_ddl) { global $wpdb, $debug; foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($debug) echo("checking $column == $column_name
    "); if ($column == $column_name) { return true; } } //didn't find it try to create it. $q = $wpdb->query($create_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { return true; } } return false; } /** ** maybe_drop_column() ** Drop column from db table if it exists. ** Returns: true if it doesn't already exist or on successful drop ** false on error */ function maybe_drop_column($table_name, $column_name, $drop_ddl) { global $wpdb; foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { //found it try to drop it. $q = $wpdb->query($drop_ddl); // we cannot directly tell that whether this succeeded! foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { if ($column == $column_name) { return false; } } } } // else didn't find it return true; } /** ** check_column() ** Check column matches passed in criteria. ** Pass in null to skip checking that criteria ** Returns: true if it matches ** false otherwise ** (case sensitive) Column names returned from DESC table are: ** Field ** Type ** Null ** Key ** Default ** Extra */ function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { global $wpdb, $debug; $diffs = 0; $results = $wpdb->get_results("DESC $table_name"); foreach ($results as $row ) { if ($debug > 1) print_r($row); if ($row->Field == $col_name) { // got our column, check the params if ($debug) echo ("checking $row->Type against $col_type\n"); if (($col_type != null) && ($row->Type != $col_type)) { ++$diffs; } if (($is_null != null) && ($row->Null != $is_null)) { ++$diffs; } if (($key != null) && ($row->Key != $key)) { ++$diffs; } if (($default != null) && ($row->Default != $default)) { ++$diffs; } if (($extra != null) && ($row->Extra != $extra)) { ++$diffs; } if ($diffs > 0) { if ($debug) echo ("diffs = $diffs returning false\n"); return false; } return true; } // end if found our column } return false; } /* echo "

    testing

    "; echo "
    ";
    
    //check_column('wp_links', 'link_description', 'mediumtext');
    //if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
    //    echo "ok\n";
    $error_count = 0;
    $tablename = $wpdb->links;
    // check the column
    if (!check_column($wpdb->links, 'link_description', 'varchar(255)'))
    {
    	$ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
    	$q = $wpdb->query($ddl);
    }
    if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
    	$res .= $tablename . ' - ok 
    '; } else { $res .= 'There was a problem with ' . $tablename . '
    '; ++$error_count; } echo "
    "; */ ?>wp-admin/install.php0000644013707600007620000001121710706104550012453 0ustar wwwwp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress › Error"); } require_once('../wp-config.php'); require_once('./includes/upgrade.php'); if (isset($_GET['step'])) $step = $_GET['step']; else $step = 0; header( 'Content-Type: text/html; charset=utf-8' ); ?> > <?php _e('WordPress › Installation'); ?>

    WordPress

    '.__('Already Installed').'

    '.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

    '); switch($step) { case 0: case 1: // in case people are directly linking to this ?>

    ReadMe documentation 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.'), '../CzytajTo.html'); ?>

     

    ERROR: you must provide an e-mail address")); } else if (!is_email($admin_email)) { // TODO: poka-yoke die(__('ERROR: that isn\'t a valid e-mail address. E-mail addresses look like: username@example.com')); } $result = wp_install($weblog_title, 'admin', $admin_email, $public); extract($result, EXTR_SKIP); ?>

    log in with the username "admin" and password "%2$s".'), '../wp-login.php', $password); ?>

    Note that password carefully! It is a random password that was generated just for you.'); ?>

    admin
    wp-login.php

    wp-admin/js/0000755013707600007620000000000010706137420010710 5ustar wwwwp-admin/js/cat.js0000644013707600007620000000153510651452712012024 0ustar wwwaddLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); addLoadEvent(newCatAddIn); function newCatAddIn() { var jaxcat = $('jaxcat'); if ( !jaxcat ) return false; // These multiple blank hidden inputs are needed: https://bugzilla.mozilla.org/show_bug.cgi?id=377815 , #3895 , #4664 Element.update(jaxcat,'' + catL10n.how + ''); $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); }; $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); }; } wp-admin/js/categories.js0000644013707600007620000000134510630117700013371 0ustar wwwaddLoadEvent(function() { if (!theList.theList) return false; document.forms.addcat.submit.onclick = function(e) {return killSubmit('theList.ajaxAdder("cat", "addcat");', e); }; theList.addComplete = function(what, where, update, transport) { var name = getNodeValue(transport.responseXML, 'name').unescapeHTML(); var id = transport.responseXML.getElementsByTagName(what)[0].getAttribute('id'); var options = document.forms['addcat'].category_parent.options; options[options.length] = new Option(name, id); }; theList.delComplete = function(what, id) { var options = document.forms['addcat'].category_parent.options; for ( var o = 0; o < options.length; o++ ) if ( id == options[o].value ) options[o] = null; }; }); wp-admin/js/custom-fields.js0000644013707600007620000000242010630117700014015 0ustar wwwfunction customFieldsOnComplete( what, where, update, transport ) { var pidEl = $('post_ID'); pidEl.name = 'post_ID'; pidEl.value = getNodeValue(transport.responseXML, 'postid'); var aEl = $('hiddenaction') if ( aEl.value == 'post' ) aEl.value = 'postajaxpost'; } addLoadEvent(customFieldsAddIn); function customFieldsAddIn() { theList.showLink=0; theList.addComplete = customFieldsOnComplete; if (!theList.theList) return false; inputs = theList.theList.getElementsByTagName('input'); for ( var i=0; i < inputs.length; i++ ) { if ('text' == inputs[i].type) { inputs[i].setAttribute('autocomplete', 'off'); inputs[i].onkeypress = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.name.slice(5),10) + '");', e); }; } if ('updatemeta' == inputs[i].className) { inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); }; } } $('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); }; $('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); }; } wp-admin/js/dbx-admin-key.js0000644013707600007620000000340610630117700013675 0ustar wwwaddLoadEvent( function() {var manager = new dbxManager( dbxL10n.manager );} ); addLoadEvent( function() { //create new docking boxes group var meta = new dbxGroup( 'grabit', // container ID [/-_a-zA-Z0-9/] 'vertical', // orientation ['vertical'|'horizontal'] '10', // drag threshold ['n' pixels] 'no', // restrict drag movement to container axis ['yes'|'no'] '10', // animate re-ordering [frames per transition, or '0' for no effect] 'yes', // include open/close toggle buttons ['yes'|'no'] 'closed', // default state ['open'|'closed'] dbxL10n.open, // word for "open", as in "open this box" dbxL10n.close, // word for "close", as in "close this box" dbxL10n.moveMouse, // sentence for "move this box" by mouse dbxL10n.toggleMouse, // pattern-match sentence for "(open|close) this box" by mouse dbxL10n.moveKey, // sentence for "move this box" by keyboard dbxL10n.toggleKey, // pattern-match sentence-fragment for "(open|close) this box" by keyboard '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts ); // Boxes are closed by default. Open the Category box if the cookie isn't already set. var catdiv = document.getElementById('categorydiv'); if ( catdiv ) { var button = catdiv.getElementsByTagName('A')[0]; if ( dbx.cookiestate == null && /dbx\-toggle\-closed/.test(button.className) ) meta.toggleBoxState(button, true); } var advanced = new dbxGroup( 'advancedstuff', 'vertical', '10', 'yes', // restrict drag movement to container axis ['yes'|'no'] '10', 'yes', 'closed', dbxL10n.open, dbxL10n.close, dbxL10n.moveMouse, dbxL10n.toggleMouse, dbxL10n.moveKey, dbxL10n.toggleKey, '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts ); }); wp-admin/js/edit-comments.js0000644013707600007620000000447210630117700014020 0ustar wwwaddLoadEvent(function() { theCommentList = new listMan('the-comment-list'); if ( !theCommentList ) return false; theExtraCommentList = new listMan('the-extra-comment-list'); if ( theExtraCommentList ) { theExtraCommentList.showLink = 0; theExtraCommentList.altOffset = 1; if ( theExtraCommentList.theList && theExtraCommentList.theList.childNodes ) var commentNum = $A(theExtraCommentList.theList.childNodes).findAll( function(i) { return Element.visible(i) } ).length; else var commentNum = 0; var urlQ = document.location.href.split('?'); var params = urlQ[1] ? urlQ[1].toQueryParams() : []; var search = params['s'] ? params['s'] : ''; var page = params['apage'] ? params['apage'] : 1; } theCommentList.dimComplete = function(what,id,dimClass) { var m = document.getElementById('awaitmod'); if ( document.getElementById(what + '-' + id).className.match(dimClass) ) m.innerHTML = parseInt(m.innerHTML,10) + 1; else m.innerHTML = parseInt(m.innerHTML,10) - 1; } theCommentList.delComplete = function(what,id) { var m = document.getElementById('awaitmod'); what = what.split('-')[0]; if ( document.getElementById(what + '-' + id).className.match('unapproved') ) m.innerHTML = parseInt(m.innerHTML,10) - 1; if ( theExtraCommentList && commentNum ) { var theMover = theExtraCommentList.theList.childNodes[0]; Element.removeClassName(theMover,'alternate'); theCommentList.theList.appendChild(theMover); theExtraCommentList.inputData += '&page=' + page; if ( search ) theExtraCommentList.inputData += '&s=' + search; // trust the URL not the search box theExtraCommentList.addComplete = function() { if ( theExtraCommentList.theList.childNodes ) var commentNum = $A(theExtraCommentList.theList.childNodes).findAll( function(i) { return Element.visible(i) } ).length; else var commentNum = 0; } theExtraCommentList.ajaxAdder( 'comment', 'ajax-response' ); // Dummy Request } } if ( theList ) // the post list: edit.php theList.delComplete = function() { var comments = document.getElementById('comments'); var commdel = encloseFunc(function(a){a.parentNode.removeChild(a);},comments); var listdel = encloseFunc(function(a){a.parentNode.removeChild(a);},theCommentList.theList); setTimeout(commdel,705); setTimeout(listdel,705); } }); wp-admin/js/link-cat.js0000644013707600007620000000141210630137566012755 0ustar wwwaddLoadEvent(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,'' + linkcatL10n.how + ''); $('newcat').onkeypress = function(e) { return killSubmit("linkcatList.ajaxAdder('link-category','jaxcat');", e); }; $('catadd').onclick = function() { linkcatList.ajaxAdder('link-category', 'jaxcat'); }; } wp-admin/js/upload.js0000644013707600007620000002734710675223420012550 0ustar wwwaddLoadEvent( function() { theFileList = { currentImage: {ID: 0}, nonce: '', 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.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 = jQuery('#nonce-value'); if ( nonceEl ) this.nonce = jQuery(nonceEl).val(); if ( this.ID ) { this.grabImageData( this.ID ); this.imageView( this.ID ); } }, initializeLinks: function() { if ( this.ID ) return; 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 = jQuery('#attachment-thumb-url-' + id); if ( thumbEl ) { 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 ? '' : 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 ? '' : 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 : jQuery('#attachment-is-image-' + id).val() ); this.currentImage.ID = id; }, imageView: function(id, e) { this.prepView(id); var h = ''; h += "
    " if ( this.ID ) { var params = this.params; params.ID = ''; params.action = ''; h += "" + this.back + ""; h += "
    " if ( 0 == this.currentImage.isImage ) h += "

    " + this.currentImage.title + "

    "; else h += "

    " + this.currentImage.title + "

    "; h += " — "; h += "" + this.edit + "" h += ""; h += '
    ' h += "
    "; if ( 1 == this.currentImage.isImage ) { h += ""; h += "" + this.currentImage.title + ""; h += ""; } else h += ' '; h += "
    "; h += "
    "; h += ""; var display = []; var checked = 'display-title'; if ( 1 == this.currentImage.isImage ) { checked = 'display-full'; if ( this.currentImage.thumb ) { display.push("
    "); checked = 'display-thumb'; } display.push(""); } else if ( this.currentImage.thumb ) { display.push(""); } if ( display.length ) { display.push("
    "); h += ""; } h += ""; h += "
    " + this.show + ""; jQuery(display).each( function() { h += this; } ); h += "
    " + this.link + ""; h += "
    "; h += "
    "; h += ""; h += "

    "; h += ""; h += "

    "; h += "
    "; h += "
    "; jQuery(h).prependTo('#upload-content'); jQuery('#' + checked).attr('checked','checked'); if (e) return e.stopPropagation(); return false; }, editView: function(id, e) { this.prepView(id); var h = ''; var action = 'upload.php?style=' + this.style + '&tab=upload'; if ( this.postID ) action += '&post_id=' + this.postID; h += "
    "; if ( this.ID ) { var params = this.params; params.ID = ''; params.action = ''; h += "" + this.back + ""; h += "
    " if ( 0 == this.currentImage.isImage ) h += "

    " + this.currentImage.title + "

    "; else h += "

    " + this.currentImage.title + "

    "; h += " — "; h += "" + this.insert + ""; h += ""; h += '
    ' h += "
    "; if ( 1 == this.currentImage.isImage ) { h += ""; h += "" + this.currentImage.title + ""; h += ""; } else h += ' '; h += "
    "; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += ""; h += "
    "; h += ""; h += ""; h += ""; h += ""; h += ""; h += "
    "; h += "
    "; jQuery(h).prependTo('#upload-content'); if (e) e.stopPropagation(); return false; }, prepView: function(id) { this.cancelView( true ); var filesEl = jQuery('#upload-files'); if ( filesEl ) filesEl.hide(); var navEl = jQuery('#current-tab-nav'); if ( navEl ) navEl.hide(); this.grabImageData(id); }, cancelView: function( prep ) { if ( !prep ) { var filesEl = jQuery('#upload-files'); if ( filesEl ) jQuery(filesEl).show(); var navEl = jQuery('#current-tab-nav'); if ( navEl ) jQuery(navEl).show(); } if ( !this.ID ) this.grabImageData(0); var div = jQuery('#upload-file'); if ( div ) jQuery(div).remove(); return false; }, sendToEditor: function(id) { this.grabImageData(id); var link = ''; var display = ''; var h = ''; link = jQuery('input[@type=radio][@name="link"][@checked]','#uploadoptions').val(); displayEl = jQuery('input[@type=radio][@name="display"][@checked]','#uploadoptions'); if ( displayEl ) display = jQuery(displayEl).val(); else if ( 1 == this.currentImage.isImage ) display = 'full'; if ( 'none' != link ) h += ""; if ( display && 'title' != display ) h += "" + this.currentImage.title + ""; else h += this.currentImage.title; if ( 'none' != link ) h += ""; var win = window.opener ? window.opener : window.dialogArguments; if ( !win ) win = top; tinyMCE = win.tinyMCE; if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) { tinyMCE.selectedInstance.getWin().focus(); tinyMCE.execCommand('mceInsertContent', false, h); } else win.edInsertContent(win.edCanvas, h); if ( !this.ID ) this.cancelView(); return false; }, deleteFile: function(id) { if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) { jQuery('#action-value').attr('value','delete'); jQuery('#upload-file').submit(); return true; } return false; } }; for ( var property in uploadL10n ) theFileList[property] = uploadL10n[property]; theFileList.initializeVars(); theFileList.initializeLinks(); } ); wp-admin/js/users.js0000644013707600007620000000151510630117700012404 0ustar wwwaddLoadEvent(function() { theListEls = document.getElementsByTagName('tbody'); theUserLists = new Array(); for ( var l = 0; l < theListEls.length; l++ ) { if ( theListEls[l].id ) theUserLists[theListEls[l].id] = new listMan(theListEls[l].id); } addUserInputs = document.getElementById('adduser').getElementsByTagName('input'); for ( var i = 0; i < addUserInputs.length; i++ ) { addUserInputs[i].onkeypress = function(e) { return killSubmit('addUserSubmit();', e); } } document.getElementById('addusersub').onclick = function(e) { return killSubmit('addUserSubmit();', e); } } ); function addUserSubmit() { var roleEl = document.getElementById('role'); var role = roleEl.options[roleEl.selectedIndex].value; if ( !theUserLists['role-' + role] ) return true; return theUserLists['role-' + role].ajaxAdder('user', 'adduser'); } wp-admin/js/xfn.js0000644013707600007620000000241510630117700012036 0ustar wwwfunction GetElementsWithClassName(elementName, className) { var allElements = document.getElementsByTagName(elementName); var elemColl = new Array(); for (i = 0; i < allElements.length; i++) { if (allElements[i].className == className) { elemColl[elemColl.length] = allElements[i]; } } return elemColl; } function meChecked() { var undefined; var eMe = document.getElementById('me'); if (eMe == undefined) return false; else return eMe.checked; } function upit() { var isMe = meChecked(); //document.getElementById('me').checked; var inputColl = GetElementsWithClassName('input', 'valinp'); var results = document.getElementById('link_rel'); var linkText, linkUrl, inputs = ''; for (i = 0; i < inputColl.length; i++) { inputColl[i].disabled = isMe; inputColl[i].parentNode.className = isMe ? 'disabled' : ''; if (!isMe && inputColl[i].checked && inputColl[i].value != '') { inputs += inputColl[i].value + ' '; } } inputs = inputs.substr(0,inputs.length - 1); if (isMe) inputs='me'; results.value = inputs; } function blurry() { if (!document.getElementById) return; var aInputs = document.getElementsByTagName('input'); for (var i = 0; i < aInputs.length; i++) { aInputs[i].onclick = aInputs[i].onkeyup = upit; } } addLoadEvent(blurry);wp-admin/link-add.php0000644013707600007620000000275210630137566012505 0ustar www

    wp-admin/link-category.php0000644013707600007620000000332410672775704013576 0ustar www%s 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’ 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; } ?> wp-admin/link-import.php0000644013707600007620000000756210667076612013277 0ustar www


    false, 'test_type' => false); $file = wp_handle_upload($_FILES['userfile'], $overrides); if ( isset($file['error']) ) wp_die($file['error']); $url = $file['url']; $opml_url = $file['file']; $blogrolling = false; } if ( isset($opml_url) && $opml_url != '' ) { if ( $blogrolling === true ) { $opml = wp_remote_fopen($opml_url); } else { $opml = file_get_contents($opml_url); } include_once('link-parse-opml.php'); $link_count = count($names); for ( $i = 0; $i < $link_count; $i++ ) { if ('Last' == substr($titles[$i], 0, 4)) $titles[$i] = ''; if ( 'http' == substr($titles[$i], 0, 4) ) $titles[$i] = ''; $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); wp_insert_link($link); echo sprintf('

    '.__('Inserted %s').'

    ', $names[$i]); } ?>

    manage those links.'), $link_count, $cat_id, 'link-manager.php') ?>

    " . __("You need to supply your OPML url. Press back on your browser and try again") . "

    \n"; } // end else if ( ! $blogrolling ) apply_filters( 'wp_delete_file', $opml_url); @unlink($opml_url); ?>
    wp-admin/link-manager.php0000644013707600007620000001674010673760566013402 0ustar www

    '; $deleted = (int) $_GET['deleted']; printf(__ngettext('%s link deleted.', '%s links deleted', $deleted), $deleted); echo '

    '; } ?>

    add links 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’s called a “blogroll.”'); ?>

    \n"; $select_cat .= '\n"; foreach ((array) $categories as $cat) $select_cat .= '\n"; $select_cat .= "\n"; $select_order = "\n"; printf(__('Currently showing %1$s links ordered by %2$s'), $select_cat, $select_order); ?>

    '' . __('Name') . '', 'url' => '' . __('URL') . '', 'categories' => '' . __('Categories') . '', 'rel' => '' . __('rel') . '', 'visible' => '' . __('Visible') . '', 'action' => '' . __('Action') . '', ); $link_columns = apply_filters('manage_link_columns', $link_columns); ?>
    wp-admin/link-parse-opml.php0000644013707600007620000000334210530000006014001 0ustar www 'link_url', 'HTMLURL' => 'link_url', 'TEXT' => 'link_name', 'TITLE' => 'link_name', 'TARGET' => 'link_target', 'DESCRIPTION' => 'link_description', 'XMLURL' => 'link_rss' ); $map = $opml_map; /** ** startElement() ** Callback function. Called at the start of a new xml tag. **/ function startElement($parser, $tagName, $attrs) { global $updated_timestamp, $all_links, $map; global $names, $urls, $targets, $descriptions, $feeds; if ($tagName == 'OUTLINE') { foreach (array_keys($map) as $key) { if (isset($attrs[$key])) { $$map[$key] = $attrs[$key]; } } //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]
    \n"); // save the data away. $names[] = $link_name; $urls[] = $link_url; $targets[] = $link_target; $feeds[] = $link_rss; $descriptions[] = $link_description; } // end if outline } /** ** endElement() ** Callback function. Called at the end of an xml tag. **/ function endElement($parser, $tagName) { // nothing to do. } // Create an XML parser $xml_parser = xml_parser_create(); // Set the functions to handle opening and closing tags xml_set_element_handler($xml_parser, "startElement", "endElement"); if (!xml_parse($xml_parser, $opml, true)) { echo(sprintf(__('XML error: %1$s at line %2$s'), xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } // Free up memory used by the XML parser xml_parser_free($xml_parser); ?> wp-admin/link.php0000644013707600007620000000541010630137566011751 0ustar wwwquery("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); wp_redirect($this_file); exit; break; case 'add' : check_admin_referer('add-bookmark'); add_link(); wp_redirect(wp_get_referer().'?added=true'); exit; break; case 'save' : $link_id = (int) $_POST['link_id']; check_admin_referer('update-bookmark_' . $link_id); edit_link($link_id); wp_redirect($this_file); exit; break; case 'delete' : $link_id = (int) $_GET['link_id']; check_admin_referer('delete-bookmark_' . $link_id); if (!current_user_can('manage_links')) wp_die(__('Cheatin’ uh?')); wp_delete_link($link_id); wp_redirect($this_file); exit; break; case 'edit' : wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') ); if ( current_user_can( 'manage_categories' ) ) wp_enqueue_script( 'ajaxlinkcat' ); $parent_file = 'link-manager.php'; $submenu_file = 'link-manager.php'; $title = __('Edit Link'); include_once ('admin-header.php'); if (!current_user_can('manage_links')) wp_die(__('You do not have sufficient permissions to edit the links for this blog.')); $link_id = (int) $_GET['link_id']; if (!$link = get_link_to_edit($link_id)) wp_die(__('Link not found.')); include ('edit-link-form.php'); break; default : break; } include ('admin-footer.php'); ?> wp-admin/menu-header.php0000644013707600007620000000407610530000006013166 0ustar www
    wp-admin/menu.php0000644013707600007620000001413010667076612011763 0ustar wwwget_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); $submenu['edit-comments.php'][25] = array(sprintf(__("Awaiting Moderation (%s)"), "$awaiting_mod"), 'edit_posts', 'moderation.php'); $submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php'); $submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php'); $submenu['edit.php'][12] = array(__('Uploads'), 'upload_files', 'upload.php'); $submenu['edit.php'][15] = array(__('Categories'), 'manage_categories', 'categories.php'); $submenu['edit.php'][30] = array(__('Files'), 'edit_files', 'templates.php'); $submenu['edit.php'][35] = array(__('Import'), 'import', 'import.php'); $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. $submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php'); $submenu['users.php'][10] = array(__('Your Profile'), 'read', 'profile.php'); } else { $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); } $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php'); $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php'); $submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php'); $submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php'); $submenu['options-general.php'][30] = array(__('Privacy'), 'manage_options', 'options-privacy.php'); $submenu['options-general.php'][35] = array(__('Permalinks'), 'manage_options', 'options-permalink.php'); $submenu['options-general.php'][40] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php'); $submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); $submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php'); $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); do_action('_admin_menu'); // Create list of page plugin hook names. foreach ($menu as $menu_page) { $admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]); } $_wp_submenu_nopriv = array(); $_wp_menu_nopriv = array(); // Loop over submenus and remove pages for which the user does not have privs. foreach ($submenu as $parent => $sub) { foreach ($sub as $index => $data) { if ( ! current_user_can($data[1]) ) { unset($submenu[$parent][$index]); $_wp_submenu_nopriv[$parent][$data[2]] = true; } } if ( empty($submenu[$parent]) ) unset($submenu[$parent]); } // Loop over the top-level menu. // 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]]) ) continue; $subs = $submenu[$data[2]]; $first_sub = array_shift($subs); $old_parent = $data[2]; $new_parent = $first_sub[2]; // If the first submenu is not the same as the assigned parent, // make the first submenu the new parent. if ( $new_parent != $old_parent ) { $_wp_real_parent_file[$old_parent] = $new_parent; $menu[$id][2] = $new_parent; foreach ($submenu[$old_parent] as $index => $data) { $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; unset($submenu[$old_parent][$index]); } unset($submenu[$old_parent]); $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent]; } } do_action('admin_menu', ''); // Remove menus that have no accessible submenus and require privs that the user does not have. // Run re-parent loop again. foreach ( $menu as $id => $data ) { // If submenu is empty... if ( empty($submenu[$data[2]]) ) { // And user doesn't have privs, remove menu. if ( ! current_user_can($data[1]) ) { $_wp_menu_nopriv[$data[2]] = true; unset($menu[$id]); } } } unset($id); uksort($menu, "strnatcasecmp"); // make it all pretty if (! user_can_access_admin_page()) { wp_die( __('You do not have sufficient permissions to access this page.') ); } ?> wp-admin/moderation.php0000644013707600007620000001660510667076612013171 0ustar www $v ) { $comment[intval( $k )] = $v; } } if ( $action == 'update' ) { check_admin_referer( '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 $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; } } wp_redirect( basename( __FILE__ ) . '?ignored=' . $item_ignored . '&deleted=' . $item_deleted . '&approved=' . $item_approved . '&spam=' . $item_spam ); exit; } require_once './admin-header.php'; if ( !current_user_can( 'moderate_comments' ) ) { echo '

    ' . __( 'Your level is not high enough to moderate comments.' ) . '

    '; include_once './admin-footer.php'; exit; } 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 ( $approved > 0 || $deleted > 0 || $spam > 0 ) { echo '

    '; if ( $approved > 0 ) { printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved ); echo '
    '; } if ( $deleted > 0 ) { printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted ); echo '
    '; } if ( $spam > 0 ) { printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); echo '
    '; } echo '

    '; } } ?>
    get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'" ); if ( !$comments ) { echo '

    ' . __( 'Currently there are no comments for you to moderate.' ) . '

    '; include_once './admin-footer.php'; exit; } $total = count( $comments ); $per = 100; if ( isset( $_GET['paged'] ) ) { $page = (int) $_GET['paged']; } else { $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' => '«', 'next_text' => '»' ) ); $comments = array_slice( $comments, $start, $stop ); ?>

    ' . $page_links . '

    '; } ?>
    1. comment_author_email ) ) { ?>| comment_author_url ) && $comment->comment_author_url != 'http://' ) { ?>| |

      — [ | ', theCommentList );"> ] — comment_post_ID ) ); ?>

           

    ' . $page_links . '

    '; } ?>

    wp-admin/options-discussion.php0000644013707600007620000001116310667076612014676 0ustar www

    ('.__('These settings may be overridden for individual articles.').')'; ?>

    ' ) ?>

    moderation queue. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?>

    wp-admin/options-general.php0000644013707600007620000001206110667076612014126 0ustar www


    " />
    " />
    to be different from the directory you installed WordPress.'); ?>


    UTC time is:') ?>
    (-6 for Central Time.'); ?>)


      Documentation on date formatting. Click "Update options" to update sample output.') ?>

    wp-admin/options-head.php0000644013707600007620000000034510576441312013404 0ustar www

    wp-admin/options-misc.php0000644013707600007620000000364210573404334013441 0ustar www

    :
    wp-content/uploads'); ?>

    />

    wp-admin/options-permalink.php0000644013707600007620000001661210667076612014501 0ustar www set_permalink_structure($permalink_structure); } if ( isset($_POST['category_base']) ) { $category_base = $_POST['category_base']; if (! empty($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; else $writable = false; if ($wp_rewrite->using_index_permalinks()) $usingpi = true; else $usingpi = false; $wp_rewrite->flush_rules(); ?>

    URLs 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 number of tags are available, and here are some examples to get you started.'); ?>


    :

    URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

    URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

    :

    :

    .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.') ?>

    wp-admin/options-privacy.php0000644013707600007620000000237310530000006014140 0ustar www

    />

    />

    wp-admin/options-reading.php0000644013707600007620000001033710667076612014126 0ustar www

    Warning: these pages should not be the same!'); ?>


    <!--more--> feature, it will cut off posts in RSS feeds.'); ?>


    recommended)') ?>

    wp-admin/options-writing.php0000644013707600007620000001303210667076612014173 0ustar www


    %s, %s, %s.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?>

    Update Services on the Codex. Separate multiple service URLs with line breaks.') ?>

    Update Services because of your blog\'s privacy settings.'), 'options-privacy.php'); ?>

    wp-admin/options.php0000644013707600007620000000553410667612512012515 0ustar www $value) { if ( !in_array($key, array('_wpnonce', '_wp_http_referer')) ) $options[] = $key; } } else { $options = explode(',', stripslashes($_POST['page_options'])); } if ($options) { foreach ($options as $option) { $option = trim($option); $value = $_POST[$option]; if(!is_array($value)) $value = trim($value); $value = stripslashes_deep($value); update_option($option, $value); } } $goback = add_query_arg('updated', 'true', wp_get_referer()); wp_redirect($goback); break; default: include('admin-header.php'); ?>

    get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); foreach ( (array) $options as $option) : $disabled = ''; $option->option_name = attribute_escape($option->option_name); if ( is_serialized($option->option_value) ) { if ( is_serialized_string($option->option_value) ) { // this is a serialized string, so we should display it $value = maybe_unserialize($option->option_value); $options_to_update[] = $option->option_name; $class = 'all-options'; } else { $value = 'SERIALIZED DATA'; $disabled = ' disabled="disabled"'; $class = 'all-options disabled'; } } else { $value = $option->option_value; $options_to_update[] = $option->option_name; $class = 'all-options'; } echo " "; endforeach; ?>
    "; if (strpos($value, "\n") !== false) echo ""; else echo ""; echo "

    wp-admin/page-new.php0000644013707600007620000000151710667076612012527 0ustar www

    |

    post_type = 'page'; include('edit-page-form.php'); } ?> wp-admin/page.php0000644013707600007620000000775310667076612011750 0ustar wwwID) ) 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(); } if($post->post_status == 'draft') { wp_enqueue_script('prototype'); wp_enqueue_script('interface'); wp_enqueue_script('autosave'); } require_once('admin-header.php'); if ( !current_user_can('edit_page', $page_ID) ) die ( __('You are not allowed to edit this page.') ); include('edit-page-form.php'); break; case 'editattachment': $page_id = $post_ID = (int) $_POST['post_ID']; check_admin_referer('update-attachment_' . $page_id); // Don't let these be changed unset($_POST['guid']); $_POST['post_type'] = 'attachment'; // Update the thumbnail filename $newmeta = wp_get_attachment_metadata( $page_id, true ); $newmeta['thumb'] = $_POST['thumb']; wp_update_attachment_metadata( $newmeta ); case 'editpost': $page_ID = (int) $_POST['post_ID']; check_admin_referer('update-page_' . $page_ID); $page_ID = edit_post(); if ( 'post' == $_POST['originalaction'] ) { if (!empty($_POST['mode'])) { switch($_POST['mode']) { case 'bookmarklet': $location = $_POST['referredby']; break; case 'sidebar': $location = 'sidebar.php?a=b'; break; default: $location = 'page-new.php'; break; } } else { $location = "page-new.php?posted=$page_ID"; } if ( isset($_POST['save']) ) $location = "page.php?action=edit&post=$page_ID"; } else { if ($_POST['save']) { $location = "page.php?action=edit&post=$page_ID"; } elseif ($_POST['updatemeta']) { $location = wp_get_referer() . '&message=2#postcustom'; } elseif ($_POST['deletemeta']) { $location = wp_get_referer() . '&message=3#postcustom'; } elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) { $location = $_POST['referredby']; if ( $_POST['referredby'] == 'redo' ) $location = get_permalink( $page_ID ); } elseif ($action == 'editattachment') { $location = 'attachments.php'; } else { $location = 'page-new.php'; } } wp_redirect($location); // Send user on their way while we keep working exit(); break; case 'delete': $page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-page_' . $page_id); $page = & get_post($page_id); if ( !current_user_can('delete_page', $page_id) ) wp_die( __('You are not allowed to delete this page.') ); if ( $page->post_type == 'attachment' ) { if ( ! wp_delete_attachment($page_id) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($page_id) ) wp_die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page.php'; elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); break; default: wp_redirect('edit-pages.php'); exit(); break; } // end switch include('admin-footer.php'); ?> wp-admin/plugin-editor.php0000644013707600007620000001206610564515332013600 0ustar www'.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); $newcontent = stripslashes($_POST['newcontent']); if (is_writeable($real_file)) { $f = fopen($real_file, 'w+'); fwrite($f, $newcontent); fclose($f); // Deactivate so we can test it. $current = get_option('active_plugins'); if ( in_array($file, $current) || isset($_POST['phperror']) ) { if ( in_array($file, $current) ) { array_splice($current, array_search( $file, $current), 1 ); // Array-fu! update_option('active_plugins', $current); } wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1")); exit(); } wp_redirect("plugin-editor.php?file=$file&a=te"); } else { wp_redirect("plugin-editor.php?file=$file"); } exit(); break; default: if ( !current_user_can('edit_plugins') ) wp_die('

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

    '); if ( $_GET['liveupdate'] ) { check_admin_referer('edit-plugin-test_' . $file); $current = get_option('active_plugins'); $plugin = $file; if ( validate_file($plugin) ) wp_die(__('Invalid plugin.')); if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) wp_die(__('Plugin file does not exist.')); if (!in_array($plugin, $current)) { wp_redirect("plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error @include(ABSPATH . PLUGINDIR . '/' . $plugin); $current[] = $plugin; sort($current); update_option('active_plugins', $current); } wp_redirect("plugin-editor.php?file=$file&a=te"); } require_once('admin-header.php'); update_recently_edited(PLUGINDIR . "/$file"); if (!is_file($real_file)) $error = 1; if (!$error) { $f = fopen($real_file, 'r'); $content = fread($f, filesize($real_file)); $content = htmlspecialchars($content); } ?>

    fatal error.') ?>

    ' . sprintf(__('Editing %s (active)'), $file) . ''; } else { echo '

    ' . sprintf(__('Browsing %s (active)'), $file) . '

    '; } } else { if (is_writeable($real_file)) { echo '

    ' . sprintf(__('Editing %s (inactive)'), $file) . '

    '; } else { echo '

    ' . sprintf(__('Browsing %s (inactive)'), $file) . '

    '; } } ?>

    Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?>

    "; else echo ""; ?>

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; } ?>
     
    wp-admin/plugins.php0000644013707600007620000001747510670301044012477 0ustar www

    fatal error.') ?>

    activated.') ?>

    deactivated.') ?>

    deactivated.'); ?>

    '; _e("Couldn’t open plugins directory or there are no plugins available."); // TODO: make more helpful echo '

    '; } else { ?> $plugin_data) { $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) { $toggle = "".__('Deactivate').""; $plugin_data['Title'] = "{$plugin_data['Title']}"; $style .= $style == 'alternate' ? ' active' : 'active'; } else { $toggle = "".__('Activate').""; } $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); // Sanitize all displayed data $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags); $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags); $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags); $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags); if ( $style != '' ) $style = 'class="' . $style . '"'; if ( is_writable(ABSPATH . PLUGINDIR . '/' . $plugin_file) ) $edit = "".__('Edit').""; else $edit = ''; $author = ( empty($plugin_data['Author']) ) ? '' : ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; echo " "; if ( current_user_can('edit_plugins') ) echo " "; echo" "; do_action( 'after_plugin_row', $plugin_file ); } ?>
    >
    {$plugin_data['Title']} {$plugin_data['Version']}

    {$plugin_data['Description']}$author

    $toggle$edit
     

    %s directory and it will be automatically deactivated.'), PLUGINDIR); ?>

    WordPress plugin directory.'); ?>

    %s directory. Once a plugin is uploaded, you may activate it here.'), PLUGINDIR); ?>

    wp-admin/post-new.php0000644013707600007620000001131510674740516012574 0ustar www

    edit_posts capability to your user, in order to be authorized to post.
    You can also e-mail the admin to ask for a promotion.
    When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?>

    '; foreach ( $nag_posts as $nag ) { if ( ${$nag[0]} ) { echo '

    ' . wp_specialchars($nag[1]) . ' '; $i = 0; foreach ( ${$nag[0]} as $post ) { $i++; if ( $i > $nag_posts_limit ) break; echo ''; ( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title(); echo ''; if ( $i < min($nag[3], $nag_posts_limit) ) echo ', '; } if ( $nag[3] > $nag_posts_limit ) printf(__(', and %d more'), $nag[2], $nag[3] - $nag_posts_limit); echo '.

    '; } } echo "\n"; } ?>




    wp-admin/post.php0000644013707600007620000001077310667076612012015 0ustar wwwID) ) 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(); } if($post->post_status == 'draft') { wp_enqueue_script('prototype'); wp_enqueue_script('autosave'); } require_once('admin-header.php'); if ( !current_user_can('edit_post', $post_ID) ) die ( __('You are not allowed to edit this post.') ); $post = get_post_to_edit($post_ID); include('edit-form-advanced.php'); break; case 'editattachment': $post_id = (int) $_POST['post_ID']; check_admin_referer('update-attachment_' . $post_id); // Don't let these be changed unset($_POST['guid']); $_POST['post_type'] = 'attachment'; // Update the thumbnail filename $newmeta = wp_get_attachment_metadata( $post_id, true ); $newmeta['thumb'] = $_POST['thumb']; wp_update_attachment_metadata( $post_id, $newmeta ); case 'editpost': $post_ID = (int) $_POST['post_ID']; check_admin_referer('update-post_' . $post_ID); $post_ID = edit_post(); if ( 'post' == $_POST['originalaction'] ) { if (!empty($_POST['mode'])) { switch($_POST['mode']) { case 'bookmarklet': $location = $_POST['referredby']; break; case 'sidebar': $location = 'sidebar.php?a=b'; break; default: $location = 'post-new.php'; break; } } else { $location = "post-new.php?posted=$post_ID"; } if ( isset($_POST['save']) ) $location = "post.php?action=edit&post=$post_ID"; } else { $referredby = ''; if ( !empty($_POST['referredby']) ) $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); if ($_POST['save']) { $location = "post.php?action=edit&post=$post_ID"; } elseif ($_POST['updatemeta']) { $location = wp_get_referer() . '&message=2#postcustom'; } elseif ($_POST['deletemeta']) { $location = wp_get_referer() . '&message=3#postcustom'; } elseif (!empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; if ( $_POST['referredby'] == 'redo' ) $location = get_permalink( $post_ID ); } elseif ($action == 'editattachment') { $location = 'attachments.php'; } else { $location = 'post-new.php'; } } wp_redirect($location); // Send user on their way while we keep working exit(); break; case 'delete': $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); check_admin_referer('delete-post_' . $post_id); $post = & get_post($post_id); if ( !current_user_can('delete_post', $post_id) ) wp_die( __('You are not allowed to delete this post.') ); if ( $post->post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) wp_die( __('Error in deleting...') ); } else { if ( !wp_delete_post($post_id) ) wp_die( __('Error in deleting...') ); } $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); break; default: wp_redirect('edit.php'); exit(); break; } // end switch include('admin-footer.php'); ?> wp-admin/profile-update.php0000644013707600007620000000101410542062540013717 0ustar wwwget_error_messages() as $message ) echo "$message
    "; exit; } do_action('personal_options_update'); if ( 'profile' == $_POST['from'] ) $to = 'profile.php?updated=true'; else $to = 'profile.php?updated=true'; wp_redirect( $to ); exit; ?> wp-admin/profile.php0000644013707600007620000001315510633574622012462 0ustar www



    caps) > count($profileuser->roles)): ?>
    caps as $cap => $value) { if(!$wp_roles->is_role($cap)) { if($output != '') $output .= ', '; $output .= $value ? $cap : "Denied: {$cap}"; } } echo $output; ?>

    wp-admin/rtl.css0000644013707600007620000000372310674563756011637 0ustar wwwhtml, .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; } * 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 a { margin: 0 0 0 10px; display: block; float: right; line-height: 155%; } #submenu .current { border-right: 0; border-left: 2px solid #045290; } .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 { 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%; }wp-admin/setup-config.php0000644013707600007620000001350010674104454013414 0ustar wwwThe file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

    "); if (isset($_GET['step'])) $step = $_GET['step']; else $step = 0; function display_header(){ header( 'Content-Type: text/html; charset=utf-8' ); ?> WordPress › Setup Configuration File

    WordPress

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

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

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

    In all likelihood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready, let’s go!

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

    Database Name The name of the database you want to run WP in.
    User Name Your MySQL username
    Password ...and MySQL password.
    Database Host 99% chance you won't need to change this value.
    Table Prefix If you want to run multiple WordPress installations in a single database, change this.

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

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

    wp-admin/sidebar.php0000644013707600007620000000421210665111132012411 0ustar www WordPress › Posted

    Posted !

    Click here to post again.

    WordPress › Sidebar

    WordPress

    Title:

    Categories:

    Post:

    wp-admin/templates.php0000644013707600007620000001121310573437634013015 0ustar www'.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); $newcontent = stripslashes($_POST['newcontent']); if (is_writeable($real_file)) { $f = @ fopen($real_file, 'w+'); if ( $f ) { fwrite($f, $newcontent); fclose($f); wp_redirect("templates.php?file=$file&a=te"); } else { wp_redirect("templates.php?file=$file&a=err"); } } else { wp_redirect("templates.php?file=$file&a=err"); } exit(); break; default: require_once('./admin-header.php'); if ( ! current_user_can('edit_files') ) wp_die('

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

    '); if (strpos($file, 'wp-config.php') !== false) wp_die('

    '.__('The config file cannot be edited or viewed through the web interface. Sorry!').'

    '); update_recently_edited($file); if (!is_file($real_file)) $error = true; if (!$error) { $f = @ fopen($real_file, 'r'); if ( $f ) { if ( filesize($real_file ) > 0 ) { $content = fread($f, filesize($real_file)); $content = htmlspecialchars($content); } else { $content = ''; } } else { $error = true; } } ?>

    ' . sprintf(__('Editing %s'), wp_specialchars($file) ) . ''; } else { echo '

    ' . sprintf(__('Browsing %s'), wp_specialchars($file) ) . '

    '; } ?>

    '; foreach ($recents as $recent) : echo "
  • " . wp_specialchars(get_file_description(basename($recent))) . "
  • "; endforeach; echo ''; endif; ?>

    "; ?>

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; } ?>
     

    writable by the server, e.g. CHMOD 666.') ?>

    wp-admin/theme-editor.php0000644013707600007620000001017710667076612013414 0ustar www'.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); $newcontent = stripslashes($_POST['newcontent']); $theme = urlencode($theme); if (is_writeable($real_file)) { $f = fopen($real_file, 'w+'); fwrite($f, $newcontent); fclose($f); $location = "theme-editor.php?file=$file&theme=$theme&a=te"; } else { $location = "theme-editor.php?file=$file&theme=$theme"; } $location = wp_kses_no_null($location); $strip = array('%0d', '%0a'); $location = str_replace($strip, '', $location); header("Location: $location"); exit(); break; default: if ( !current_user_can('edit_themes') ) wp_die('

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

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

    ' . sprintf(__('Editing %s'), $file_show) . ''; } else { echo '

    ' . sprintf(__('Browsing %s'), $file_show) . '

    '; } ?>

    '%s' theme files"), $theme) ?>

    "; ?>

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; } ?>
     
    wp-admin/themes.php0000644013707600007620000001063210667325110012275 0ustar www

    View site »'), get_bloginfo('url') . '/'); ?>

    screenshot ) : ?> <?php _e('Current theme preview'); ?>

    title, $ct->version, $ct->author) ; ?>

    description; ?>

    parent_theme) { ?>

    %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?>

    %2$s.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?>

    name ) continue; $template = $themes[$theme_name]['Template']; $stylesheet = $themes[$theme_name]['Stylesheet']; $title = $themes[$theme_name]['Title']; $version = $themes[$theme_name]['Version']; $description = $themes[$theme_name]['Description']; $author = $themes[$theme_name]['Author']; $screenshot = $themes[$theme_name]['Screenshot']; $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir']; $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); ?>

    "; } ?>
    $title $description

    WordPress theme directory. To install a theme you generally just need to upload the theme folder into your wp-content/themes directory. Once a theme is uploaded, you should see it on this page.'); ?>

    wp-admin/update-links.php0000644013707600007620000000264010654457162013421 0ustar wwwget_col("SELECT link_url FROM $wpdb->links"); if ( !$link_uris ) wp_die(__('No links')); $link_uris = urlencode( join( $link_uris, "\n" ) ); $query_string = "uris=$link_uris"; $http_request = "POST /updated-batch/ HTTP/1.0\r\n"; $http_request .= "Host: api.pingomatic.com\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n"; $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $wp_version . "\r\n"; $http_request .= "\r\n"; $http_request .= $query_string; $response = ''; if ( false !== ( $fs = @fsockopen('api.pingomatic.com', 80, $errno, $errstr, 5) ) ) { 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); $body = trim( $response[1] ); $body = str_replace(array("\r\n", "\r"), "\n", $body); $returns = explode("\n", $body); foreach ($returns as $return) : $time = $wpdb->escape( substr($return, 0, 19) ); $uri = $wpdb->escape( preg_replace('/(.*?) | (.*?)/', '$2', $return) ); $wpdb->query("UPDATE $wpdb->links SET link_updated = '$time' WHERE link_url = '$uri'"); endforeach; } ?> wp-admin/upgrade-functions.php0000644013707600007620000000015310672775704014460 0ustar wwwwp-admin/upgrade.php0000644013707600007620000000510410667076612012447 0ustar wwwwp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file."); require('../wp-config.php'); timer_start(); require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); if (isset($_GET['step'])) $step = (int) $_GET['step']; else $step = 0; @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); ?> > <?php _e('WordPress › Upgrade'); ?>

    WordPress

    wp-admin/upload.php0000644013707600007620000001116010665111132012264 0ustar wwwget_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'"); $post_atts = 0; if ( $pid ) { // 0 => tab display name, 1 => required cap, 2 => function that produces tab content, 3 => total number objects OR array(total, objects per page), 4 => add_query_args $wp_upload_tabs['upload'] = array(__('Upload'), 'upload_files', 'wp_upload_tab_upload', 0); if ( $all_atts && $post_atts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = '$post_id'") ) $wp_upload_tabs['browse'] = array(__('Browse'), 'upload_files', "wp_upload_tab_browse", $action ? 0 : $post_atts); if ( $post_atts < $all_atts ) $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse', $action ? 0 : $all_atts); } else $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse', $action ? 0 : $all_atts); $wp_upload_tabs = array_merge($wp_upload_tabs, apply_filters( 'wp_upload_tabs', array() )); if ( !is_callable($wp_upload_tabs[$tab][2]) ) { $to_tab = isset($wp_upload_tabs['upload']) ? 'upload' : 'browse-all'; wp_redirect( add_query_arg( 'tab', $to_tab ) ); exit; } foreach ( $wp_upload_tabs as $t => $tab_array ) { if ( !current_user_can( $tab_array[1] ) ) { unset($wp_upload_tabs[$t]); if ( $tab == $t ) wp_die(__("You are not allowed to be here")); } } if ( 'inline' == $style ) : ?> > <?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — WordPress

    \n"; foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the current_user_can check $href = add_query_arg( array('tab' => $t, 'ID' => '', 'action' => '', 'paged' => '') ); if ( isset($tab_array[4]) && is_array($tab_array[4]) ) $href = add_query_arg( $tab_array[4], $href ); $_href = clean_url( $href); $page_links = ''; $class = 'upload-tab alignleft'; if ( $tab == $t ) { $class .= ' current'; if ( $tab_array[3] ) { if ( is_array($tab_array[3]) ) { $total = $tab_array[3][0]; $per = $tab_array[3][1]; } else { $total = $tab_array[3]; $per = 10; } $page_links = paginate_links( array( 'base' => add_query_arg( 'paged', '%#%' ), 'format' => '', 'total' => ceil($total / $per), 'current' => $paged ? $paged : 1, 'prev_text' => '«', 'next_text' => '»' )); if ( $page_links ) $page_links = ": $page_links"; } } echo "\t
  • {$tab_array[0]}$page_links
  • \n"; } unset($t, $tab_array, $href, $_href, $page_links, $total, $per, $class); echo "\n\n"; echo "
    \n"; call_user_func( $wp_upload_tabs[$tab][2] ); echo "
    \n"; if ( 'inline' != $style ) : echo "
    "; include_once('admin-footer.php'); else : ?> wp-admin/user-edit.php0000644013707600007620000001662010626710554012721 0ustar www

      get_error_messages() as $message ) echo "
    • $message
    • "; ?>



    caps) > count($profileuser->roles)): ?>
    caps as $cap => $value) { if(!$wp_roles->is_role($cap)) { if($output != '') $output .= ', '; $output .= $value ? $cap : "Denied: {$cap}"; } } echo $output; ?>

    wp-admin/users.php0000644013707600007620000003723510667076612012173 0ustar www'; } elseif ( isset($_POST['wp_http_referer']) ) { $redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_POST['wp_http_referer'])); $referer = ''; } else { $redirect = 'users.php'; } // WP_User_Search class // by Mark Jaquith class WP_User_Search { var $results; var $search_term; var $page; var $raw_page; var $users_per_page = 50; var $first_user; var $last_user; var $query_limit; var $query_from_where; var $total_users_for_query = 0; var $too_many_total_users = false; var $search_errors; function WP_User_Search ($search_term = '', $page = '') { // constructor $this->search_term = $search_term; $this->raw_page = ( '' == $page ) ? false : (int) $page; $this->page = (int) ( '' == $page ) ? 1 : $page; $this->prepare_query(); $this->query(); $this->prepare_vars_for_template_usage(); $this->do_paging(); } function prepare_query() { global $wpdb; $this->first_user = ($this->page - 1) * $this->users_per_page; $this->query_limit = 'LIMIT ' . $this->first_user . ',' . $this->users_per_page; if ( $this->search_term ) { $searches = array(); $search_sql = 'AND ('; foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col ) $searches[] = $col . " LIKE '%$this->search_term%'"; $search_sql .= implode(' OR ', $searches); $search_sql .= ')'; } $this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql"; } function query() { global $wpdb; $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_limit); if ( $this->results ) $this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit else $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); } function prepare_vars_for_template_usage() { $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone } function do_paging() { if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results $this->paging_text = paginate_links( array( 'total' => ceil($this->total_users_for_query / $this->users_per_page), 'current' => $this->page, 'prev_text' => __('« Previous Page'), 'next_text' => __('Next Page »'), 'base' => 'users.php?%_%', 'format' => 'userspage=%#%', 'add_args' => array( 'usersearch' => urlencode($this->search_term) ) ) ); } } function get_results() { return (array) $this->results; } function page_links() { echo $this->paging_text; } function results_are_paged() { if ( $this->paging_text ) return true; return false; } function is_search() { if ( $this->search_term ) return true; return false; } } switch ($action) { case 'promote': check_admin_referer('bulk-users'); if (empty($_POST['users'])) { wp_redirect($redirect); exit(); } if ( !current_user_can('edit_users') ) wp_die(__('You can’t edit users.')); $userids = $_POST['users']; $update = 'promote'; foreach($userids as $id) { if ( ! current_user_can('edit_user', $id) ) wp_die(__('You can’t edit that user.')); // The new role of the current user must also have edit_users caps if($id == $current_user->ID && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { $update = 'err_admin_role'; continue; } $user = new WP_User($id); $user->set_role($_POST['new_role']); } wp_redirect(add_query_arg('update', $update, $redirect)); exit(); break; case 'dodelete': check_admin_referer('delete-users'); if ( empty($_POST['users']) ) { wp_redirect($redirect); exit(); } if ( !current_user_can('delete_users') ) wp_die(__('You can’t delete users.')); $userids = $_POST['users']; $update = 'del'; $delete_count = 0; foreach ( (array) $userids as $id) { if ( ! current_user_can('delete_user', $id) ) wp_die(__('You can’t delete that user.')); if($id == $current_user->ID) { $update = 'err_admin_del'; continue; } switch($_POST['delete_option']) { case 'delete': wp_delete_user($id); break; case 'reassign': wp_delete_user($id, $_POST['reassign_user']); break; } ++$delete_count; } $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect); wp_redirect($redirect); exit(); break; case 'delete': check_admin_referer('bulk-users'); if ( empty($_POST['users']) ) { wp_redirect($redirect); exit(); } if ( !current_user_can('delete_users') ) $errors = new WP_Error('edit_users', __('You can’t delete users.')); $userids = $_POST['users']; include ('admin-header.php'); ?>

      ID ) { echo "
    • " . sprintf(__('ID #%1s: %2s The current user will not be deleted.'), $id, $user->user_login) . "
    • \n"; } else { echo "
    • " . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "
    • \n"; $go_delete = true; } } $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); $user_dropdown = ''; ?>

    • '.__('Attribute all posts and links to:')." $user_dropdown"; ?>

    urlencode($new_user_login), 'update' => $update), $redirect ); wp_redirect( $redirect . '#user-' . $user_id ); die(); } default: wp_enqueue_script('admin-users'); include('admin-header.php'); // Query the users $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage']); // Make the user objects foreach ( $wp_user_search->get_results() as $userid ) { $tmp_user = new WP_User($userid); $roles = $tmp_user->roles; $role = array_shift($roles); $roleclasses[$role][$tmp_user->user_login] = $tmp_user; } if ( isset($_GET['update']) ) : switch($_GET['update']) { case 'del': case 'del_many': ?>

      get_error_messages() as $message ) echo "
    • $message
    • "; ?>
    is_search() ) : ?>

    search_term)); ?>

    search_errors ) ) : ?>
      search_errors->get_error_messages() as $message ) echo "
    • $message
    • "; ?>
    get_results() ) : ?> is_search() ) : ?>

    first_user && $wp_user_search->total_users_for_query <= 50 ) printf(__('%3$s shown below'), $wp_user_search->first_user + 1, min($wp_user_search->first_user + $wp_user_search->users_per_page, $wp_user_search->total_users_for_query), $wp_user_search->total_users_for_query); else printf(__('%1$s – %2$s of %3$s shown below'), $wp_user_search->first_user + 1, min($wp_user_search->first_user + $wp_user_search->users_per_page, $wp_user_search->total_users_for_query), $wp_user_search->total_users_for_query); ?>

    results_are_paged() ) : ?>

    page_links(); ?>

    $roleclass) { uksort($roleclass, "strnatcasecmp"); ?>

    role_names[$role]; ?>

    results_are_paged() ) : ?>

    page_links(); ?>

    'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { $var = 'new_' . $var; $$var = attribute_escape(stripslashes($_POST[$formpost])); } unset($name); } ?>

    get_error_messages() as $message ) echo "

    $message

    "; ?>
    ' . sprintf(__('Users can register themselves or you can manually create users here.'), get_option('siteurl').'/wp-register.php') . '

    '; else echo '

    ' . sprintf(__('Users cannot currently register themselves, but you can manually create users here.'), get_option('siteurl').'/wp-admin/options-general.php#users_can_register') . '

    '; ?>

    wp-admin/widgets.php0000644013707600007620000002605010667076612012471 0ustar www $sidebar ) { $cols[] = '\'' . $index . '\''; } $cols = implode( ', ', $cols ); $widgets = array(); foreach ( $wp_registered_widgets as $name => $widget ) { $widgets[] = '\'' . $widget['id'] . '\''; } $widgets = implode( ', ', $widgets ); ?> ≡' : ''; $output = '
  • %2$s
  • '; printf( $output, $sanitized_name, $wp_registered_widgets[$name]['name'] . $popper ); } $title = __( 'Widgets' ); $parent_file = 'themes.php'; require_once 'admin-header.php'; if ( count( $wp_registered_sidebars ) < 1 ) { ?>

    follow these instructions.' ); /* TODO: article on codex */; ?>

    $sidebar ) { $postindex = $index . 'order'; parse_str( $_POST[$postindex], $order ); $new_order = $order[$index]; if ( is_array( $new_order ) ) { foreach ( $new_order as $sanitized_name ) { foreach ( $wp_registered_widgets as $name => $widget ) { if ( $sanitized_name == $widget['id'] ) { $sidebars_widgets[$index][] = $name; } } } } } wp_set_sidebars_widgets( $sidebars_widgets ); break; } } ksort( $wp_registered_widgets ); $inactive_widgets = array(); foreach ( $wp_registered_widgets as $name => $widget ) { $is_active = false; foreach ( $wp_registered_sidebars as $index => $sidebar ) { if ( is_array( $sidebars_widgets[$index] ) && in_array( $name, $sidebars_widgets[$index] ) ) { $is_active = true; break; } } if ( !$is_active ) { $inactive_widgets[] = $name; } } $containers = array( 'palette' ); foreach ( $wp_registered_sidebars as $index => $sidebar ) { $containers[] = $index; } $c_string = ''; foreach ( $containers as $container ) { $c_string .= '"' . $container . '",'; } $c_string = substr( $c_string, 0, -1 ); if ( isset( $_POST['action'] ) ) { ?>

    View site »' ), get_bloginfo( 'url' ) . '/' ); ?>

    $sidebar ) { ?>

    $widget ) { ?>

    wp-admin/wp-admin.css0000644013707600007620000004652210665311476012544 0ustar www* html #poststuff { height: 100%; /* kill peekaboo bug in IE */ } /* This is the Holly Hack \*/ * html .wrap { height: 1% } /* For Win IE's eyes only */ body { border: none; } a { border-bottom: 1px solid #69c; color: #00019b; text-decoration: none; } a.delete:hover { background: #c00; color: #fff; } #devnews h4 { font-family: Georgia, "Times New Roman", Times, serif; font-size: 18px; font-weight: normal; } #planetnews ul { list-style: none; margin: 0; padding: 0; } #planetnews li { width: 17%; margin: 1%; float: left; } #planetnews li a { display: block; padding: .5em; background: #ddd; height: 6em; overflow: hidden; } #planetnews cite { font-size: 11px; } #planetnews li .post { font-family: Georgia, "Times New Roman", Times, serif; font-size: 18px; display: block; height: 60px; overflow: hidden; } #planetnews .hidden { display: none; } .readmore { clear: both; text-align: right; margin-right: 5em; } .widefat { width: 100%; } .widefat td, .widefat th { padding: 5px 6px; } .widefat th { text-align: left; } .plugins p { margin: 4px; padding: 0; } .plugins .name { font-size: 16px; } .import-system { font-size: 16px; } thead, .thead { background: #dfdfdf } #import-upload-form { margin: auto; background: #eee; padding: 1em; } a.view, a.edit, a.delete, a.view:hover, a.edit:hover, a.delete:hover { border-bottom: none; display: block; padding: 5px 0; text-align: center; } a.view:hover, a.edit:hover { background: #ccc; color: #036; } a:visited { color: #004; } a:hover { color: #069; } body { background: #f9fcfe; color: #000; margin: 0; padding: 0; } body, td { font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; } fieldset { border: none; padding: 3px; } fieldset label.selectit { display: block; font-size: 11px; padding: 0 2px; } fieldset label.selectit:hover { background: #e9e9e9; } fieldset legend { padding: .1em .3em; } fieldset.options { padding: 1em; } fieldset.options legend { font-size: 1.5em; font-weight: bold; font-family: Georgia, "Times New Roman", Times, serif; } form, label input { margin: 0; padding: 0; } h2 { color: #333; font: normal 32px Georgia, "Times New Roman", Times, serif; margin: 5px 10px; background: url( images/heading-bg.gif ) repeat-x bottom; } img { border: 0; } input:focus, textarea:focus, label:focus { background: #fff; border: 1px solid #686868; } label { cursor: pointer; } li, dd { margin-bottom: 6px; } p, li, dl, dd, dt { line-height: 140%; } textarea, input, select { background: #f4f4f4; border: 1px solid #b2b2b2; color: #000; font: 13px Verdana, Arial, Helvetica, sans-serif; margin: 1px; padding: 3px; } #uploading { border-style: none; padding: 0; margin-bottom: 16px; height: 18em; width: 100%; } form#upload th { text-align: right; } form#upload #post_content, form#upload #post_title { width: 250px; } form#upload #post_content { height: 50px; } .attpreview { width: 1px; /* hug */ text-align: center; } .alignleft { float: left } .alignright { float: right; } .alternate { background: #f1f1f1; } .anchors { margin: 10px 20px 10px 20px; } .available-theme { width: 30%; margin: 0 1em; float: left; text-align: center; height: 28em; overflow: hidden; } .available-theme a.screenshot { width: 250px; height: 200px; display: block; margin: auto; background: #f1f1f1; border: 1px solid #ccc; margin-bottom: 10px; overflow: hidden; } .available-theme a.screenshot:hover { /* border: 1px solid #666;*/ } .available-theme img { width: 100%; } .checkbox { background: #fff; border: none; margin: 0; padding: 0; } .code { font-family: "Courier New", Courier, monospace; } .commentlist li { border-bottom: 1px solid #ccc; padding: 1em 1em .2em; margin: 0; } .commentlist li li { border-bottom: 0px; padding: 0; } .commentlist p { padding: 0; margin: 0 0 .8em; } .clear { clear: both; height: 2px; } .hidden { display: none; } .navigation { display: block; text-align: center; margin-top: 10px; margin-bottom: 30px; } .post-categories { display: inline; margin: 0; padding: 0; } .post-categories li, #ed_toolbar { display: inline; } .quicktags, .search { background: #ccc; color: #000; font: 12px Georgia, "Times New Roman", Times, serif; } .submit input, .submit input:focus, .button, .button:focus { background: url( images/fade-butt.png ); border: 3px double #999; border-left-color: #ccc; border-top-color: #ccc; color: #333; padding: 0.25em; } .submit input:active, .button:active { background: #f4f4f4; border: 3px double #ccc; border-left-color: #999; border-top-color: #999; } .button, .button:focus { padding: 0.15em; } * html .button { padding: 0; } .submit, .editform th, #postcustomsubmit { text-align: right; } .optiontable { width: 100%; } .optiontable td, .optiontable th { padding: .5em; } .optiontable th { width: 33%; text-align: right; font-size: 1.3em; font-weight: normal; } .unapproved { color: #888; } .unapproved a:link { color: #b9bcff; } .unapproved a:visited { color: #696dff; } .unapproved a:hover { color: #009ef0; } .approve { display: none; } .unapproved .approve { display: inline; } .unapproved .unapprove { display: none; } .updated, .confirm { background: #CFEBF7 url(images/notice.gif) no-repeat 1em; border: 1px solid #2580B2; margin: 1em 5% 10px; padding: 0 1em 0 3em; } .error { background: #FFEFF7; border: 1px solid #c69; margin: 1em 5% 10px; padding: 0 1em 0 1em; } .wrap { background: #fff; border: 1px solid #ccc; clear: both; margin: 15px 5%; padding: 1em; } .narrow { width: 450px; margin: auto; } .narrow p { line-height: 150%; } .wrap h2 { margin: 0 0 .5em; clear: both; } * html .wrap h2 { margin-top: 1em; } table .vers { text-align: center; } textarea.all-options, input.all-options { width: 250px; } input.disabled, textarea.disabled { background: #ccc; } #adminmenu { background: #83B4D8; border-top: 3px solid #448abd; margin: 0; padding: .2em .2em .3em 2em; } #adminmenu .current, #submenu .current { font-weight: bold; text-decoration: none; } #adminmenu a { color: #000; font-size: 14px; font-weight: normal; margin: 0; padding: 3px 5px; border-bottom: none; } #adminmenu a:hover, #adminmenu a.current { background: #ddeaf4; color: #333; } #adminmenu li, #submenu li { display: inline; line-height: 200%; list-style: none; text-align: center; white-space: nowrap; } #adminmenu a.current { background: #0d324f; border-right: 2px solid #4f96c8; border-top: 1px solid #96c0de; color: #fff; padding-bottom: 8px; } #submenu, #minisub { background: #0d324f; border-bottom: none; margin: 0; padding: 3px 2em 0 3em; } #minisub { height: 6px; } #submenu .current { background: #f9fcfe; border-top: 1px solid #045290; border-right: 2px solid #045290; color: #000; } #submenu a { border: none; color: #fff; font-size: 12px; padding: .3em .4em .4em; } #submenu a:hover { background: #ddeaf4; color: #393939; } #submenu li { line-height: 180%; height: 25px; } #categorydiv input, #poststatusdiv input, #commentstatusdiv input, #pingstatusdiv input { border: none; } #postdiv, #titlediv, #guiddiv, #tagdiv { margin: 0 8px 0 0; padding: 0; } #postdivrich { margin: 0; padding: 0; } #content { margin: 0; width: 100%; } #postdivrich #content { padding: 5px; line-height: 140%; } #titlediv input, #guiddiv input, #tagdiv input { margin: 0; width: 100%; } #currenttheme img { float: left; border: 1px solid #666; margin-right: 1em; margin-bottom: 1.5em; width: 300px; } input.delete:hover { background: #ce0000; color: #fff; } #deletebookmarks:hover { background: #ce0000; color: #fff; } #postdivrich #quicktags { background: #f0f0ee; padding: 0; border: 1px solid #ccc; border-bottom: none; } #postdiv #quicktags { padding-right: 6px; } #postdivrich #quicktags { display: none; } #quicktags #ed_toolbar { padding: 0 2px; } #ed_toolbar input { background: #fff url( images/fade-butt.png ) repeat-x 0 -2px; margin: 3px 2px 2px; } #quicktags #ed_strong { font-weight: bold; } #quicktags #ed_link { color: blue; text-decoration: underline; } #quicktags #ed_del { text-decoration: line-through; } #quicktags #ed_em { font-style: italic; } #quicktags #ed_code { font-family: "Courier New", Courier, mono; margin-bottom: 3px; } #title { font-size: 1.7em; padding: 4px 3px; } #postexcerpt div, #attachmentlinks div { margin-right: 8px; } #attachmentlinks textarea { width: 100%; height: 2.5em; margin-bottom: 6px; } * html #postexcerpt .dbx-toggle-open, * html #postexcerpt .dbx-toggle-open { padding-right: 8px; } #excerpt, .attachmentlinks { margin: 0; height: 4em; width: 100%; } #footer { clear: both; height: 35px; padding-left: 40px; margin: 15px 5%; background: url('images/logo-ghost.png') no-repeat top left; } #footer p { margin: 0; padding: 5px 0; } #login { position: relative; background: url('images/login-bkg-tile.gif') no-repeat top center; color: #fff; margin: 5em auto 1em; padding: 20px 0 0; width: 425px; _width: 390px; } #login form { background: url('images/login-bkg-bottom.gif') no-repeat bottom center; padding: 0 50px 25px; _width: 325px; _margin: 0 auto; min-height: 200px; height: auto !important; /* min-height fast hack */ height: 200px; } #login #login_error { background: #0e3350; border: 1px solid #2571ab; color: #ebcd4e; font-size: 11px; font-weight: bold; padding: .6em; width: 310px; margin: 0 50px; text-align: center; } #login p { font-size: 12px; } #login p.message { width: 310px; margin: 0 auto 1em; } #login #login_error a { color: #ebcd4e; border-color: #ebcd4e; } #login #send { color: #fff; text-align: left; font-weight: normal; font-size: 1.1em; _width: 325px; _margin: 0 auto 15px; } #login h1 a { margin: 0 auto; height: 88px; width: 320px; display: block; border-bottom: none; text-indent: -9999px; } #login .message { font-size: 10pt; text-align: center; } #login .register { font-size: 20px; } #login input { padding: 4px; } .login ul, #protected #login .bottom { list-style: none; width: 325px; margin: 0 auto; padding: 0; line-height: 1.2; } .login ul li { font-size: 11px; } .login ul li a { color: #0d324f; border: none; } #login ul li a:hover { color: #fff; } #login .input { font-size: 1.8em; margin-top: 3px; width: 97%; } #login p label { font-size: 11px; } #login #submit { margin: 0; font-size: 15px; } .plugins p { } #login .fullwidth { width: 320px; } #searchform fieldset { float: left; margin: 0 1.5ex 1em 0; padding: 0; } #searchform fieldset legend { padding: 0 0 .2em 1px; } #searchform #s { padding: 4px 3px; } #searchform #post-query-submit { float: left; margin: 14px 0 1em; position: relative; top: .35em; } #postcustom .updatemeta, #postcustom .deletemeta { margin: auto; } #postcustom table { border: 1px solid #ccc; margin: 0; width: 100%; } #postcustom table input, #postcustom table textarea { width: 95%; } #poststuff { margin-right: 16em; } #save { width: 15em; } #template div { margin-right: 190px; } * html #template div { margin-right: 0; } #template, #template div, #editcat, #addcat { zoom: 1; } #template textarea { font: small 'Courier New', Courier, monospace; width: 97%; } #templateside { float: right; width: 170px; overflow: hidden; } #templateside h3, #postcustom p.submit { margin: 0; } #templateside ol, #templateside ul { list-style: none; margin: .5em; padding: 0; } #user_info { position: absolute; right: 1em; top: 0; color: #fff; font-size: .9em; } #user_info a { color: #fff; } #wphead { background: #14568a; padding: .8em 19em .8em 2em; color: #c3def1; } #wphead a { color: #fff; } #wphead h1 { font-size: 2.5em; font-weight: normal; letter-spacing: -.05em; margin: 0; font-family: Georgia, "Times New Roman", Times, serif; } #wphead h1 span#viewsite { font-size: .4em; letter-spacing: 0; } #zeitgeist { background: #eee; border: 1px solid #c5c5c5; float: right; font-size: 90%; margin-bottom: .5em; margin-left: 1em; margin-top: .5em; padding: 1em; width: 40%; } #zeitgeist h2, fieldset legend a { background: none; } * html #zeitgeist h2 { padding-top: 10px; } #zeitgeist h3 { border-bottom: 1px solid #ccc; font-size: 16px; margin: 1em 0 0; } #zeitgeist h3 cite { font-size: 12px; font-style: normal; } #zeitgeist li, #zeitgeist p { margin: .2em 0; } #zeitgeist ul { margin: 0 0 .3em .6em; padding: 0 0 0 .6em; } .active td { background: #BEB; } .active .name { background: #9C9; } .alternate.active td { background: #ADA; } .alternate.active .name { background: #8B8; } #namediv, #emaildiv, #uridiv { float: left; } #ajax-response { padding: .5em; } /* A handy div class for hiding controls. Some browsers will disable them when you set display:none; */ .zerosize { height: 0; width: 0; margin: 0; border: 0; padding: 0; overflow: hidden; position: absolute; } /* Box stuff */ .dbx-clone { position: absolute; visibility: hidden; } .dbx-clone, .dbx-clone .dbx-handle-cursor { cursor: move !important; } .dbx-dummy { display: block; width: 0; height: 0; overflow: hidden; } .dbx-group, .dbx-box, .dbx-handle { position: relative; display: block; } #grabit { width: 188px; } * html #themeselect { padding: 0 3px; height: 22px; } /**************************************************************** avoid padding, margins or borders on dbx-box, to reduce visual discrepancies between it and the clone. overall, dbx-box is best left as visually unstyled as possible *****************************************************************/ .dbx-box { margin: 0; padding: 0; border: none; } /* Can change this */ #moremeta fieldset, #advancedstuff fieldset { margin-bottom: 1em; } #moremeta fieldset div { margin: 2px 0 0 0; padding: 7px; } #moremeta { line-height: 130%; margin-right: 15px; position: absolute; right: 5%; width: 14.5em; } #moremeta select { width: 96%; } #slugdiv input, #passworddiv input, #authordiv select, #thumbdiv input, #parentdiv input { margin-top: .5em; width: 90%; } #moremeta h3, #advancedstuff h3 { padding: 3px; font-weight: normal; font-size: 13px; } #advancedstuff div { margin-top: .5em; } #categorydiv ul { list-style: none; padding: 0; margin-left: 10px; } #categorychecklist { height: 12em; overflow: auto; margin-top: 8px; } #categorychecklist li { margin: 0; padding: 0; } #ajaxcat input { border: 1px solid #ccc; } #your-profile #rich_editing { border: none; background: #fff; } #your-profile fieldset { border: 1px solid #ccc; float: left; width: 40%; padding: .5em 2em 1em; margin: 1em 1em 1em 0; } #your-profile fieldset input { width: 100%; font-size: 20px; padding: 2px; } #your-profile fieldset textarea { width: 100%; padding: 2px; } #your-profile legend { font-family: Georgia, "Times New Roman", Times, serif; font-size: 22px; } /* default box styles */ /* toggle state of inner content area */ .dbx-box-open .dbx-content { display: block; } .dbx-box-closed .dbx-content { display: none; } #moremeta .dbx-content { background: url(images/box-butt.gif) no-repeat bottom right; padding-bottom: 15px; padding-right: 2px; } #moremeta fieldset.dbx-box-closed { background: url(images/box-butt.gif) no-repeat bottom; padding-bottom: 9px; } /* handles */ .dbx-handle { background: #2685af; padding: 6px 1em 2px; font-size: 12px; margin: 0; color: #E3EFF5; } #moremeta .dbx-handle { padding: 6px 1em 2px; font-size: 12px; background: #2685af url(images/box-head.gif) no-repeat right; } #moremeta .dbx-box { background: url(images/box-bg.gif) repeat-y right; } #advancedstuff h3.dbx-handle { margin-left: 7px; margin-bottom: -7px; padding: 6px 1em 0 3px; height: 19px; font-size: 12px; background: #2685af url(images/box-head-right.gif) no-repeat top right; } #advancedstuff div.dbx-h-andle-wrapper { margin: 0 0 0 -7px; background: #fff url(images/box-head-left.gif) no-repeat top left; } #advancedstuff div.dbx-content { margin-left: 8px; background: url(images/box-bg-right.gif) repeat-y right; padding: 10px 10px 15px 0; } #postexcerpt div.dbx-content { margin-right: 0; padding-right: 17px; } #advancedstuff div.dbx-c-ontent-wrapper { margin-left: -7px; margin-right: 0; background: url(images/box-bg-left.gif) repeat-y left; } #advancedstuff fieldset.dbx-box { padding-bottom: 9px; margin-left: 6px; background: url(images/box-butt-right.gif) no-repeat bottom right; } #advancedstuff div.dbx-b-ox-wrapper { background: url(images/box-butt-left.gif) no-repeat bottom left; } #advancedstuff .dbx-box-closed div.dbx-c-ontent-wrapper { padding-bottom: 2px; background: url(images/box-butt-left.gif) no-repeat bottom left; } #advancedstuff .dbx-box { background: url(images/box-butt-right.gif) no-repeat bottom right; } /* handle cursors */ .dbx-handle-cursor { cursor: move; } /* toggle images */ a.dbx-toggle, a.dbx-toggle:visited { display: block; overflow: hidden; background-image: url( images/toggle.gif ); position: absolute; top: 0; right: 0; background-repeat: no-repeat; border: 0; margin: 0; padding: 0; } #moremeta a.dbx-toggle, #moremeta a.dbx-toggle-open:visited { height: 25px; width: 27px; background-position: 0 0; } #moremeta a.dbx-toggle-open, #moremeta a.dbx-toggle-open:visited { height: 25px; width: 27px; background-position: 0 -25px; } #advancedstuff a.dbx-toggle, #advancedstuff a.dbx-toggle-open:visited { height: 22px; width: 22px; top: 3px; right: 5px; background-position: 0 -3px; } #advancedstuff a.dbx-toggle-open, #advancedstuff a.dbx-toggle-open:visited { height: 22px; width: 22px; top: 3px; right: 5px; background-position: 0 -28px; } #categorychecklist { margin-right: 6px; } /* additional clone styles */ .dbx-clone { opacity: 0.8; -moz-opacity: 0.8; -khtml-opacity: 0.8; filter: alpha(opacity=80); } #newcat { width: 120px; margin-right: 5px; } input #catadd { background: #a4a4a4; border-bottom: 1px solid #898989; border-left: 1px solid #bcbcbc; border-right: 1px solid #898989; border-top: 1px solid #bcbcbc; color: #fff; font-size: 10px; padding: 0; margin: 0; font-weight: bold; height: 20px; margin-bottom: 2px; text-align: center; width: 37px; } #howto { font-size: 11px; margin: 0 5px; display: block; } #jaxcat { margin: 0; padding: 0; } #ajax-response.alignleft { margin-left: 2em; } #postdivrich #edButtons { padding-left: 3px; } #postdivrich #content, #postdivrich #content:active { border: 1px solid #ccc; } #edButtons input, #edButtons input:active { margin: 0 2px -1px; } #edButtons input.edButtonFore, #edButtons input.edButtonFore:active { background: #f0f0ee; border-bottom: 1px solid #f0f0ee; } #edButtons input.edButtonBack, #edButtons input.edButtonBack:active { background: #fff url( images/fade-butt.png ) repeat-x 0 15px; border-bottom: 1px solid #ccc; } .page-numbers { padding: 4px 7px; border: 1px solid #fff; margin-right: 3px; } a.page-numbers { border: 1px solid #ccc; } a.page-numbers:hover { border: 1px solid #999; } .page-numbers.current { border: 1px solid #999; font-weight: bold; } .pagenav span { font-weight: bold; margin: 0 6px; } a.view-link { position: absolute; right: 5%; margin-right: 220px; text-decoration:underline; } #update-nag, .plugin-update { border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; background: #fffeeb; line-height: 29px; font-size: 12px; color: #555; text-align: center; } #update-nag a, .plugin-update a { font-size: 1.1em; } #update-nag a:link, .plugin-update a:link { color: #036; }wp-app.php0000644013707600007620000007777510673760566010544 0ustar wwwID) ) return $current_user; $current_user = new WP_User($id, $name); return $current_user; } endif; function wa_posts_where_include_drafts_filter($where) { $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where); return $where; } add_filter('posts_where', 'wa_posts_where_include_drafts_filter'); class AtomServer { var $ATOM_CONTENT_TYPE = 'application/atom+xml'; var $CATEGORIES_CONTENT_TYPE = 'application/atomcat+xml'; var $SERVICE_CONTENT_TYPE = 'application/atomsvc+xml'; var $ATOM_NS = 'http://www.w3.org/2005/Atom'; var $ATOMPUB_NS = 'http://www.w3.org/2007/app'; var $ENTRIES_PATH = "posts"; var $CATEGORIES_PATH = "categories"; var $MEDIA_PATH = "attachments"; var $ENTRY_PATH = "post"; var $SERVICE_PATH = "service"; var $MEDIA_SINGLE_PATH = "attachment"; var $params = array(); var $script_name = "wp-app.php"; var $media_content_types = array('image/*','audio/*','video/*'); var $atom_content_types = array('application/atom+xml'); var $selectors = array(); // support for head var $do_output = true; function AtomServer() { $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); $this->selectors = array( '@/service$@' => array('GET' => 'get_service'), '@/categories$@' => array('GET' => 'get_categories_xml'), '@/post/(\d+)$@' => array('GET' => 'get_post', 'PUT' => 'put_post', 'DELETE' => 'delete_post'), '@/posts/?(\d+)?$@' => array('GET' => 'get_posts', 'POST' => 'create_post'), '@/attachments/?(\d+)?$@' => array('GET' => 'get_attachment', 'POST' => 'create_attachment'), '@/attachment/file/(\d+)$@' => array('GET' => 'get_file', 'PUT' => 'put_file', 'DELETE' => 'delete_file'), '@/attachment/(\d+)$@' => array('GET' => 'get_attachment', 'PUT' => 'put_attachment', 'DELETE' => 'delete_attachment'), ); } function handle_request() { global $always_authenticate; $path = $_SERVER['PATH_INFO']; $method = $_SERVER['REQUEST_METHOD']; log_app('REQUEST',"$method $path\n================"); $this->process_conditionals(); //$this->process_conditionals(); // exception case for HEAD (treat exactly as GET, but don't output) if($method == 'HEAD') { $this->do_output = false; $method = 'GET'; } // redirect to /service in case no path is found. if(strlen($path) == 0 || $path == '/') { $this->redirect($this->get_service_url()); } // dispatch foreach($this->selectors as $regex => $funcs) { if(preg_match($regex, $path, $matches)) { if(isset($funcs[$method])) { // authenticate regardless of the operation and set the current // user. each handler will decide if auth is required or not. $this->authenticate(); $u = wp_get_current_user(); if(!isset($u) || $u->ID == 0) { if ($always_authenticate) { $this->auth_required('Credentials required.'); } } array_shift($matches); call_user_func_array(array(&$this,$funcs[$method]), $matches); exit(); } else { // only allow what we have handlers for... $this->not_allowed(array_keys($funcs)); } } } // oops, nothing found $this->not_found(); } function get_service() { log_app('function','get_service()'); $entries_url = attribute_escape($this->get_entries_url()); $categories_url = attribute_escape($this->get_categories_url()); $media_url = attribute_escape($this->get_attachments_url()); foreach ($this->media_content_types as $med) { $accepted_media_types = $accepted_media_types . "" . $med . ""; } $atom_prefix="atom"; $service_doc = << <$atom_prefix:title>WordPress Workspace <$atom_prefix:title>WordPress Posts $this->ATOM_CONTENT_TYPE;type=entry <$atom_prefix:title>WordPress Media $accepted_media_types EOD; $this->output($service_doc, $this->SERVICE_CONTENT_TYPE); } function get_categories_xml() { log_app('function','get_categories_xml()'); $home = attribute_escape(get_bloginfo_rss('home')); $categories = ""; $cats = get_categories("hierarchical=0&hide_empty=0"); foreach ((array) $cats as $cat) { $categories .= " name) . "\" />\n"; } $output = << $categories EOD; $this->output($output, $this->CATEGORIES_CONTENT_TYPE); } /* * Create Post (No arguments) */ function create_post() { global $blog_id, $wpdb; $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->client_error(); } $entry = array_pop($parser->feed->entries); log_app('Received entry:', print_r($entry,true)); $catnames = array(); foreach($entry->categories as $cat) array_push($catnames, $cat["term"]); $wp_cats = get_categories(array('hide_empty' => false)); $post_category = array(); foreach($wp_cats as $cat) { if(in_array($cat->name, $catnames)) array_push($post_category, $cat->term_id); } $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true; $cap = ($publish) ? 'publish_posts' : 'edit_posts'; if(!current_user_can($cap)) $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.')); $blog_ID = (int ) $blog_id; $post_status = ($publish) ? 'publish' : 'draft'; $post_author = (int) $user->ID; $post_title = $entry->title[1]; $post_content = $entry->content[1]; $post_excerpt = $entry->summary[1]; $pubtimes = $this->get_publish_time($entry); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; if ( isset( $_SERVER['HTTP_SLUG'] ) ) $post_name = $_SERVER['HTTP_SLUG']; $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_name'); $this->escape($post_data); log_app('Inserting Post. Data:', print_r($post_data,true)); $postID = wp_insert_post($post_data); if ( is_wp_error( $postID ) ) $this->internal_error($postID->get_error_message()); if (!$postID) { $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); } // getting warning here about unable to set headers // because something in the cache is printing to the buffer // could we clean up wp_set_post_categories or cache to not print // this could affect our ability to send back the right headers @wp_set_post_categories($postID, $post_category); $output = $this->get_entry($postID); log_app('function',"create_post($postID)"); $this->created($postID, $output); } function get_post($postID) { global $entry; $this->set_current_entry($postID); $output = $this->get_entry($postID); log_app('function',"get_post($postID)"); $this->output($output); } function put_post($postID) { global $wpdb; // checked for valid content-types (atom+xml) // quick check and exit $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->bad_request(); } $parsed = array_pop($parser->feed->entries); log_app('Received UPDATED entry:', print_r($parsed,true)); // check for not found global $entry; $entry = $GLOBALS['entry']; $this->set_current_entry($postID); if(!current_user_can('edit_post', $entry['ID'])) $this->auth_required(__('Sorry, you do not have the right to edit this post.')); $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true; extract($entry); $post_title = $parsed->title[1]; $post_content = $parsed->content[1]; $post_excerpt = $parsed->summary[1]; $pubtimes = $this->get_publish_time($entry); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; // let's not go backwards and make something draft again. if(!$publish && $post_status == 'draft') { $post_status = ($publish) ? 'publish' : 'draft'; } elseif($publish) { $post_status = 'publish'; } $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_date', 'post_date_gmt'); $this->escape($postdata); $result = wp_update_post($postdata); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); } log_app('function',"put_post($postID)"); $this->ok(); } function delete_post($postID) { // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to delete this post.')); } if ($entry['post_type'] == 'attachment') { $this->delete_attachment($postID); } else { $result = wp_delete_post($postID); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); } log_app('function',"delete_post($postID)"); $this->ok(); } } function get_attachment($postID = NULL) { global $entry; if (!isset($postID)) { $this->get_attachments(); } else { $this->set_current_entry($postID); $output = $this->get_entry($postID, 'attachment'); log_app('function',"get_attachment($postID)"); $this->output($output); } } function create_attachment() { global $wp, $wpdb, $wp_query, $blog_id; $type = $this->get_accepted_content_type(); if(!current_user_can('upload_files')) $this->auth_required(__('You do not have permission to upload files.')); $fp = fopen("php://input", "rb"); $bits = NULL; while(!feof($fp)) { $bits .= fread($fp, 4096); } fclose($fp); $slug = ''; if ( isset( $_SERVER['HTTP_SLUG'] ) ) $slug = sanitize_file_name( $_SERVER['HTTP_SLUG'] ); elseif ( isset( $_SERVER['HTTP_TITLE'] ) ) $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] ); elseif ( empty( $slug ) ) // just make a random name $slug = substr( md5( uniqid( microtime() ) ), 0, 7); $ext = preg_replace( '|.*/([a-z]+)|', '$1', $_SERVER['CONTENT_TYPE'] ); $slug = "$slug.$ext"; $file = wp_upload_bits( $slug, NULL, $bits); log_app('wp_upload_bits returns:',print_r($file,true)); $url = $file['url']; $file = $file['file']; $filename = basename($file); $header = apply_filters('wp_create_file_in_uploads', $file); // replicate // Construct the attachment array $attachment = array( 'post_title' => $slug, 'post_content' => $slug, 'post_status' => 'attachment', 'post_parent' => 0, 'post_mime_type' => $type, 'guid' => $url ); // Save the data $postID = wp_insert_attachment($attachment, $file, $post); if (!$postID) { $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); } $output = $this->get_entry($postID, 'attachment'); $this->created($postID, $output, 'attachment'); log_app('function',"create_attachment($postID)"); } function put_attachment($postID) { global $wpdb; // checked for valid content-types (atom+xml) // quick check and exit $this->get_accepted_content_type($this->atom_content_types); $parser = new AtomParser(); if(!$parser->parse()) { $this->bad_request(); } $parsed = array_pop($parser->feed->entries); // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $entry['ID'])) $this->auth_required(__('Sorry, you do not have the right to edit this post.')); $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true; extract($entry); $post_title = $parsed->title[1]; $post_content = $parsed->content[1]; $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt'); $this->escape($postdata); $result = wp_update_post($postdata); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be edited.')); } log_app('function',"put_attachment($postID)"); $this->ok(); } function delete_attachment($postID) { log_app('function',"delete_attachment($postID). File '$location' deleted."); // check for not found global $entry; $this->set_current_entry($postID); if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to delete this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); // delete file @unlink($location); // delete attachment $result = wp_delete_post($postID); if (!$result) { $this->internal_error(__('For some strange yet very annoying reason, this post could not be deleted.')); } log_app('function',"delete_attachment($postID). File '$location' deleted."); $this->ok(); } function get_file($postID) { // check for not found global $entry; $this->set_current_entry($postID); // then whether user can edit the specific post if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to edit this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); status_header('200'); header('Content-Type: ' . $entry['post_mime_type']); header('Connection: close'); $fp = fopen($location, "rb"); while(!feof($fp)) { echo fread($fp, 4096); } fclose($fp); log_app('function',"get_file($postID)"); exit; } function put_file($postID) { $type = $this->get_accepted_content_type(); // first check if user can upload if(!current_user_can('upload_files')) $this->auth_required(__('You do not have permission to upload files.')); // check for not found global $entry; $this->set_current_entry($postID); // then whether user can edit the specific post if(!current_user_can('edit_post', $postID)) { $this->auth_required(__('Sorry, you do not have the right to edit this post.')); } $location = get_post_meta($entry['ID'], '_wp_attached_file', true); $filetype = wp_check_filetype($location); if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); $fp = fopen("php://input", "rb"); $localfp = fopen($location, "w+"); while(!feof($fp)) { fwrite($localfp,fread($fp, 4096)); } fclose($fp); fclose($localfp); $ID = $entry['ID']; $pubtimes = $this->get_publish_time($entry); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; $post_data = compact('ID', 'post_date', 'post_date_gmt'); $result = wp_update_post($post_data); if (!$result) { $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); } log_app('function',"put_file($postID)"); $this->ok(); } function get_entries_url($page = NULL) { if($GLOBALS['post_type'] == 'attachment') { $path = $this->MEDIA_PATH; } else { $path = $this->ENTRIES_PATH; } $url = get_bloginfo('url') . '/' . $this->script_name . '/' . $path; if(isset($page) && is_int($page)) { $url .= "/$page"; } return $url; } function the_entries_url($page = NULL) { $url = $this->get_entries_url($page); echo $url; } function get_categories_url($page = NULL) { return get_bloginfo('url') . '/' . $this->script_name . '/' . $this->CATEGORIES_PATH; } function the_categories_url() { $url = $this->get_categories_url(); echo $url; } function get_attachments_url($page = NULL) { $url = get_bloginfo('url') . '/' . $this->script_name . '/' . $this->MEDIA_PATH; if(isset($page) && is_int($page)) { $url .= "/$page"; } return $url; } function the_attachments_url($page = NULL) { $url = $this->get_attachments_url($page); echo $url; } function get_service_url() { return get_bloginfo('url') . '/' . $this->script_name . '/' . $this->SERVICE_PATH; } function get_entry_url($postID = NULL) { if(!isset($postID)) { global $post; $postID = (int) $GLOBALS['post']->ID; } $url = get_bloginfo('url') . '/' . $this->script_name . '/' . $this->ENTRY_PATH . "/$postID"; log_app('function',"get_entry_url() = $url"); return $url; } function the_entry_url($postID = NULL) { $url = $this->get_entry_url($postID); echo $url; } function get_media_url($postID = NULL) { if(!isset($postID)) { global $post; $postID = (int) $GLOBALS['post']->ID; } $url = get_bloginfo('url') . '/' . $this->script_name . '/' . $this->MEDIA_SINGLE_PATH ."/file/$postID"; log_app('function',"get_media_url() = $url"); return $url; } function the_media_url($postID = NULL) { $url = $this->get_media_url($postID); echo $url; } function set_current_entry($postID) { global $entry; log_app('function',"set_current_entry($postID)"); if(!isset($postID)) { // $this->bad_request(); $this->not_found(); } $entry = wp_get_single_post($postID,ARRAY_A); if(!isset($entry) || !isset($entry['ID'])) $this->not_found(); return; } function get_posts($page = 1, $post_type = 'post') { log_app('function',"get_posts($page, '$post_type')"); $feed = $this->get_feed($page, $post_type); $this->output($feed); } function get_attachments($page = 1, $post_type = 'attachment') { log_app('function',"get_attachments($page, '$post_type')"); $GLOBALS['post_type'] = $post_type; $feed = $this->get_feed($page, $post_type); $this->output($feed); } function get_feed($page = 1, $post_type = 'post') { global $post, $wp, $wp_query, $posts, $wpdb, $blog_id, $post_cache; log_app('function',"get_feed($page, '$post_type')"); ob_start(); if(!isset($page)) { $page = 1; } $page = (int) $page; $count = get_option('posts_per_rss'); wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) )); $post = $GLOBALS['post']; $posts = $GLOBALS['posts']; $wp = $GLOBALS['wp']; $wp_query = $GLOBALS['wp_query']; $wpdb = $GLOBALS['wpdb']; $blog_id = (int) $GLOBALS['blog_id']; $post_cache = $GLOBALS['post_cache']; log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); log_app('function',"total_count(# $wp_query->max_num_pages #)"); $last_page = $wp_query->max_num_pages; $next_page = (($page + 1) > $last_page) ? NULL : $page + 1; $prev_page = ($page - 1) < 1 ? NULL : $page - 1; $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page; $self_page = $page > 1 ? $page : NULL; ?> the_entries_url() ?> <?php bloginfo_rss('name') ?> Copyright WordPress.com Atom API echo_entry(); } } ?> echo_entry(); log_app('$post',print_r($GLOBALS['post'],true)); $entry = ob_get_contents(); break; } } ob_end_clean(); log_app('get_entry returning:',$entry); return $entry; } function echo_entry() { ?> ID); ?> prep_content(get_the_title()); ?> <?php echo $content ?> post_status == 'draft' ? 'yes' : 'no') ?> post_type == 'attachment') { ?> post_content ) ) : list($content_type, $content) = $this->prep_content(get_the_content()); ?> prep_content(get_the_excerpt()); ?> ' . $data . '', true); $code = xml_get_error_code($parser); xml_parser_free($parser); if (!$code) { if (strpos($data, '<') === false) { return array('text', $data); } else { $data = "
    $data
    "; return array('xhtml', $data); } } if (strpos($data, ']]>') == false) { return array('html', ""); } else { return array('html', htmlspecialchars($data)); } } function ok() { log_app('Status','200: OK'); header('Content-Type: text/plain'); status_header('200'); exit; } function no_content() { log_app('Status','204: No Content'); header('Content-Type: text/plain'); status_header('204'); echo "Deleted."; exit; } function internal_error($msg = 'Internal Server Error') { log_app('Status','500: Server Error'); header('Content-Type: text/plain'); status_header('500'); echo $msg; exit; } function bad_request() { log_app('Status','400: Bad Request'); header('Content-Type: text/plain'); status_header('400'); exit; } function length_required() { log_app('Status','411: Length Required'); header("HTTP/1.1 411 Length Required"); header('Content-Type: text/plain'); status_header('411'); exit; } function invalid_media() { log_app('Status','415: Unsupported Media Type'); header("HTTP/1.1 415 Unsupported Media Type"); header('Content-Type: text/plain'); exit; } function not_found() { log_app('Status','404: Not Found'); header('Content-Type: text/plain'); status_header('404'); exit; } function not_allowed($allow) { log_app('Status','405: Not Allowed'); header('Allow: ' . join(',', $allow)); status_header('405'); exit; } function redirect($url) { log_app('Status','302: Redirect'); $escaped_url = attribute_escape($url); $content = << 302 Found

    Found

    The document has moved here.

    EOD; header('HTTP/1.1 302 Moved'); header('Content-Type: text/html'); header('Location: ' . $url); echo $content; exit; } function client_error($msg = 'Client Error') { log_app('Status','400: Client Error'); header('Content-Type: text/plain'); status_header('400'); exit; } function created($post_ID, $content, $post_type = 'post') { log_app('created()::$post_ID',"$post_ID, $post_type"); $edit = $this->get_entry_url($post_ID); switch($post_type) { case 'post': $ctloc = $this->get_entry_url($post_ID); break; case 'attachment': $edit = get_bloginfo('url') . '/' . $this->script_name . "/attachments/$post_ID"; break; } header("Content-Type: $this->ATOM_CONTENT_TYPE"); if(isset($ctloc)) header('Content-Location: ' . $ctloc); header('Location: ' . $edit); status_header('201'); echo $content; exit; } function auth_required($msg) { log_app('Status','401: Auth Required'); nocache_headers(); header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); header("HTTP/1.1 401 $msg"); header('Status: ' . $msg); header('Content-Type: text/html'); $content = << 401 Unauthorized

    401 Unauthorized

    $msg

    EOD; echo $content; exit; } function output($xml, $ctype = 'application/atom+xml') { status_header('200'); $xml = ''."\n".$xml; header('Connection: close'); header('Content-Length: '. strlen($xml)); header('Content-Type: ' . $ctype); header('Content-Disposition: attachment; filename=atom.xml'); header('Date: '. date('r')); if($this->do_output) echo $xml; log_app('function', "output:\n$xml"); exit; } function escape(&$array) { global $wpdb; foreach ($array as $k => $v) { if (is_array($v)) { $this->escape($array[$k]); } else if (is_object($v)) { //skip } else { $array[$k] = $wpdb->escape($v); } } } /* * Access credential through various methods and perform login */ function authenticate() { $login_data = array(); $already_md5 = false; log_app("authenticate()",print_r($_ENV, true)); // if using mod_rewrite/ENV hack // http://www.besthostratings.com/articles/http-auth-php-cgi.html if(isset($_SERVER['HTTP_AUTHORIZATION'])) { list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); } // If Basic Auth is working... if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { $login_data = array('login' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']); log_app("Basic Auth",$login_data['login']); } else { // else, do cookie-based authentication if (function_exists('wp_get_cookie_login')) { $login_data = wp_get_cookie_login(); $already_md5 = true; } } // call wp_login and set current user if (!empty($login_data) && wp_login($login_data['login'], $login_data['password'], $already_md5)) { $current_user = new WP_User(0, $login_data['login']); wp_set_current_user($current_user->ID); log_app("authenticate()",$login_data['login']); } } function get_accepted_content_type($types = NULL) { if(!isset($types)) { $types = $this->media_content_types; } if(!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) { $this->length_required(); } $type = $_SERVER['CONTENT_TYPE']; list($type,$subtype) = explode('/',$type); list($subtype) = explode(";",$subtype); // strip MIME parameters log_app("get_accepted_content_type", "type=$type, subtype=$subtype"); foreach($types as $t) { list($acceptedType,$acceptedSubtype) = explode('/',$t); if($acceptedType == '*' || $acceptedType == $type) { if($acceptedSubtype == '*' || $acceptedSubtype == $subtype) return $type . "/" . $subtype; } } $this->invalid_media(); } function process_conditionals() { if(empty($this->params)) return; if($_SERVER['REQUEST_METHOD'] == 'DELETE') return; switch($this->params[0]) { case $this->ENTRY_PATH: global $post; $post = wp_get_single_post($this->params[1]); $wp_last_modified = get_post_modified_time('D, d M Y H:i:s', true); $post = NULL; break; case $this->ENTRIES_PATH: $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; break; default: return; } $wp_etag = md5($wp_last_modified); @header("Last-Modified: $wp_last_modified"); @header("ETag: $wp_etag"); // Support for Conditional GET if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); else $client_etag = false; $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']); // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; // Make a timestamp for our most recent modification... $wp_modified_timestamp = strtotime($wp_last_modified); if ( ($client_last_modified && $client_etag) ? (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { status_header( 304 ); exit; } } function rfc3339_str2time($str) { $match = false; if(!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) return false; if($match[3] == 'Z') $match[3] == '+0000'; return strtotime($match[1] . " " . $match[2] . " " . $match[3]); } function get_publish_time($entry) { $pubtime = $this->rfc3339_str2time($entry->published); if(!$pubtime) { return array(current_time('mysql'),current_time('mysql',1)); } else { return array(date("Y-m-d H:i:s", $pubtime), gmdate("Y-m-d H:i:s", $pubtime)); } } } $server = new AtomServer(); $server->handle_request(); ?> wp-atom.php0000644013707600007620000000020110654457162010660 0ustar wwwwp-blog-header.php0000644013707600007620000000174510620354044012073 0ustar wwwwp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress › Error"); } $wp_did_header = true; require_once( dirname(__FILE__) . '/wp-config.php'); wp(); gzip_compression(); require_once(ABSPATH . WPINC . '/template-loader.php'); endif; ?> wp-comments-post.php0000644013707600007620000000555310642725326012544 0ustar wwwget_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); if ( empty($status->comment_status) ) { do_action('comment_id_not_found', $comment_post_ID); exit; } elseif ( 'closed' == $status->comment_status ) { do_action('comment_closed', $comment_post_ID); wp_die( __('Sorry, comments are closed for this item.') ); } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { do_action('comment_on_draft', $comment_post_ID); exit; } $comment_author = trim(strip_tags($_POST['author'])); $comment_author_email = trim($_POST['email']); $comment_author_url = trim($_POST['url']); $comment_content = trim($_POST['comment']); // If the user is logged in $user = wp_get_current_user(); if ( $user->ID ) { $comment_author = $wpdb->escape($user->display_name); $comment_author_email = $wpdb->escape($user->user_email); $comment_author_url = $wpdb->escape($user->user_url); if ( current_user_can('unfiltered_html') ) { if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } } } else { if ( get_option('comment_registration') ) wp_die( __('Sorry, you must be logged in to post a comment.') ); } $comment_type = ''; if ( get_option('require_name_email') && !$user->ID ) { if ( 6 > strlen($comment_author_email) || '' == $comment_author ) wp_die( __('Error: please fill the required fields (name, email).') ); elseif ( !is_email($comment_author_email)) wp_die( __('Error: please enter a valid email address.') ); } if ( '' == $comment_content ) wp_die( __('Error: please type a comment.') ); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); $comment_id = wp_new_comment( $commentdata ); $comment = get_comment($comment_id); if ( !$user->ID ) { setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); } $location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id; $location = apply_filters('comment_post_redirect', $location, $comment); wp_redirect($location); ?> wp-commentsrss2.php0000644013707600007620000000023110654457162012362 0ustar wwwwp-config-sample.php0000644013707600007620000000144710670520346012452 0ustar wwwwp-content/0000755013707600007620000000000010706137424010662 5ustar wwwwp-content/index.php0000644013707600007620000000003610616707034012501 0ustar wwwwp-content/languages/0000755013707600007620000000000010706137424012630 5ustar wwwwp-content/languages/pl.mo0000644013707600007620000053637010705674156013625 0ustar wwwC42YLdͅ υ څCB(%kibV^ · ۇO \f*m'(5.3?!s ʼn ! /CTm% NJ Պ < G X e oz' ̋ ^eXA7ҍHf/LߎH,;uB<21Rd3`)L!v!ym4+>Γ) D70|9Q892r>44TNWQCMn5y67:>#b*=-ӛ C"LfN#&+. 4BQdsz Ɲߝ ,H`| ֞ "/SA ğП ԟ $HBXA)ݠNVh wEEɢ,<N]mD5Ĥ0N+Bz Ǧ˦ʨ ' 1>?+~''ҩ''">J.++@@Q\->=\::լ:&K!r!><;28n88?8Y>8ѯ, +7@c>@$L3!ױޱ $ 9C@W Բ߲1K 7 A LW` t մ ޴  '@%]'ʵ ޵ŷ̷Lշ"2 H S%ae #)M_ o}¹ѹ - > HT&],(K IW!#û<$>Qex}ʼ,ټ6= Uc lv  >;!3C#c]  8BJ[ ly ƿS15gx+-Y nH-#Gk R,43 hv  /=Q q|* 6Md{ f*    2L?i0.++A(m;4>)F+p 2 Sh nzH ' /:M R` v  "1 @JYq$&\3R  -H$%+:Q>6*H5s mHO Vct! "=W9 7D.J yW   +6 HT[ts~:gJI 7CG NYn } "!(0  '; S]d{ T }$+)%<lpm^b_nMKxg? #C0tw{trh-ETaJngpa@:{Ij$K'AQbrE  ( A NYAoG <IdIL(=={/58(S| 0TO) [r ,?P`q %2   " 2>NU  ( 8 ER[a fr     *; Xey % ,=A Vbg m{    5B JUZ`  '>%Q&w7'&7 KX mw    1 EO ^l/?U^!n`L9&`z5q+Gc|DD* 2 =yIF @ #J n w     M 6 U  p | #          !  @  K  W  e  o  {        s z O [ %.&?f ~   "3@<L}Zc%%+"$ *8RJ O^vC|    , B N[k8q TM/}        (6>N V d r~@   %) 0=N ,+@l|  (?0Q 27=Paen s  #*9Ncx V -:Nd{")  ! ]/)   4: BM3ah ! !!'4!L\!5!I!3)"]")#&*#Q#f#"{#,#/##$:$+Z$0$!$"$3$50%5f%3%3%;&6@&6w&/&@&@'`'i' n'"z'''''''W'U( r( ((((( ( ((() )))/)!M)o))) ))))?)***1*F* N*[* c*o****"*I+!L+Gn+A+S+&L,s,<,,L-<- .*..a.:/U/T007x1'1)1#2/&2IV2\22w3(33;4+4a 5cn5.5 66B65X6!6/6,6 7R75.8]d8M8S9/d99:-::;%y<{<S=Yo=P=>6? ???M@B@X@)A-6ooL=cP{+n{:3Q@ƢpE"4h<MJG2Ŧʦ ۦ  ) 4?G\bs §&< [|  ڨ$(7iK ҩܩ   +'dS^U.mLj}Xd$Rw &YѮV+1[[ls${I   ) 9G PZ bl>*ĵ$'$<-aB3Ҷ/86Co?\.P>=8;58q,׹@?X79к9 <DA9ûLMJ/'ȼ>F/Ovƽa@D ؾ & %/IF ڿ*1G&` ` lz    (2 P\q!+.6Om$  N2 Q [(hk ..9hz !)Kau $ M-6{g`!{$="8[l$p 2T+   EDK*23K  ! ,7 MY is L5-!c '4H}-*O1As7.&?ifB6J\%w$$%!. P#\)  ),@m1# :E]m!~ ,9M]o ~q"c- 674;I268L(8u5)$!Np7  $B Vc { ( ):S e q}  (;Qh$'~Zp+2"Or6z+A&>TYG' ?1)q  {3; AK M'n5&!6XM3< ]ent  S<lk iwz / '?]'{    #>Ql| ,#)#;*_Novnzi._#] )L J X akr"D]}$d,Z   4 sK  m 4 G _ $q U    0 B ^ O}   !  1  @ M Fe    L Kc~PVU<j&=>C0#,$Pu,Y,@U[*t s!<Ws$#$>$Z" =L  0 :G [hx}$="Vy    ,9I ]jz   '(4 ]k~+*DHMint |%   -= T b lx~? E Q&^3=R =^## #3 ES do!s"! !&A hr#  - : (X      6 )(!R!$n!!!!s! 6"A#CJ# ##A#s#W$p$$ $$>$>$ :% H% U% `%l%% &`)&&#&&&&' '#'O='@'' ''1($A(f( y( ( (( (( (!(() ) ) 0)>) M)[)n)}) )))w**c+y+],d,6,,, ,,,-,-A-S-'f- ---V-\.Ye.W. /*8/c/-k/.///Z/I0 d0r0z001)1N/1~1 11 1 11 1112(2?2W2=]222S23|&33033#3404D4U4d4v44 44444 4446 5B5]5 f5s55555 5 556666168 7D7$`7$77777&8/888I8,]88/88?89 '9H9X9!m999G::;;;;;;$;3;I;d;v;;; ; ;;;;;<(<F<_<#g<< >>0>I>Z>"o>>> >&>%> #?-?-I?bw?2?' @ 5@B@a@t@@@@ @@@N@ >AvJABBBB?C=^CyCLDcD4E3FEzEE"E)E4F5t``a"rb{beckwcbcFd:Be&}e6f8f}gg+gfgK:hhi ii1i3Pii$ieikk'k8l>mPnnoajpyqFrrs!"s=Ds ssssss s s sGsY=ttt tttttu #u /u:uMu7euuu'uvv.vCvcv~vvvvvvw&w*6w!awww ww wwwBx1Uxx0x$x8x;/y#kyyyyy.yz."zQzzJn{!{H{ $|.| 5| ?|J|.Q||| |(|(||}2}F}a}|} }} } }}}4}&~/~.2~Ta~j\! ~ "ÀaeZ`C!Pe ɅAՅ C$ChO,,|:+3Poԋ^''FO;ҏ    $=KSK ' ? I U_c1fifhRZ,bba[TjUZqW̗U$TzhϘt87(A@P<<Κ4 A@92--`Kg^;s=?---[>>9'*a0RU63ߡ8(aqIZOP#E$i'#(ڦ%-)0W,E@G<HGͨO4e  ]ѯ3/NcH_![}C ѱ߱ F#Bj4/n!6EJIJ~!ɶ / !<$^&ҷ -(Ir ø: & 8BSc$} Ĺ й۹"  #' @N T0a0#% +7Ui3nȻ ͻ׻ۻ   5SW\ dp(м߼<i-a_Z0#Lqu59sc;78=) LU >IPnc] !q k)z V-%s^9VR&LfO}$S9,\-x[ <YnmXJZ}L'x j5QdJ;Yj on#6!@B.'Zw[#NX$(k]'4dQ^ct :v [J&g-6ED(:Fo8 s"B!RWGe'BDW0/z %2)LIj]0`\ >A,1y3J=Fy@A B6 +m]c8n~%)3-r%<R][hQR`}|;GV @ /u5}'D^Pj 0xY6O ip/7/( "lFmE/C+K.(?U7n1CwspS1o'D3!G1xG#{*8;%f{~l21S/9_21[E3?mWD$66 8]rbX#W AT?H%bC4MQd<[B 75^D MS^h t|u*E&C!U.= >TuRC;tu}p~qAs@$@6'd?t?/.LI4.0;~==aEhy9"{n3oIJ|MYpXlaFk"Wzr+0qwX xi7}|ai*{v\ egz5*Z# Gr-&N<o ?Ot b&y)Np<{Kh;bSl*4,_tjFkTV:vUz5ZkOY{f8,_ V(, )KxgBU9> jHc2TisM>8:  qK$UJg=3-7hk@)9m^=P: X..PlabCWE2Aev4M$ %5IH"`\>|\~RAyNS|w!,&eH?PeyKMT~dez d`(w+3aHNvOFOib+Y!7c 4HT0&N+QKZ1"f2wP_l*4fpI*:Arg@:<q Q("2`Vom #uh_+$vG>f,\rB`gC - Private%% Comments%1$s %2$d%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author%1$s %2$sspam comments%3$s %4$sblocked by%5$s
    %6$sAkismet%7$s%1$s – %2$s of %3$s shown below%1$s category%1$s categories%1$s comment%1$s comments%1$s post%1$s posts%1$s comments recovered.%1$s in %2$s%1$s on %2$s%1$s tag%1$s tags%3$s shown below%d spam comments have been blocked by Akismet.%d topics%s ago%s comment approved.%s comments approved.%s comment deleted%s comments deleted.%s comment deleted.%s comments deleted.%s comment marked as spam%s comments marked as spam.%s day%s days%s hour%s hours%s is a protected WP option and may not be modified%s link deleted.%s links deleted%s min%s mins%s pending%s queries%s seconds%s user deleted%s users deleted« Back« Back to All Users« Back to Authors and Users« Older Posts« Previous« Previous Entries« Previous Page— No role for this blog —»|Used as a list bullet(%s comments)(%s pings)(Leave at 0 for no rating.)(Quick Links)(Searches within comment text, e-mail, URL, and IP address.)(already exists)(at most 15)(more...)(required), and %d more, or press the enter key to %toggle% it- Select -.htaccess (for rewrite rules )011 Comment404 TemplateAkismet has protected your site from %3$s spam comments.TrackBack a URL: (Separate multiple URLs with spaces.)The Codex (In other words, the WordPress Bible)DocumentationDocumentation on date formatting. Click "Update options" to update sample output.What is this?XFN Creator:WordPress, personal publishing platform.The WordPress support forumsFeedbackThe official WordPress siteUTC time is:RSSRSS feed for comments on this post.URLPowered by Wordpressmt-export.txt does not existRich editing, also called WYSIWYG for What You See Is What You Get, means your text is formatted as you type. The rich editor creates HTML code behind the scenes while you concentrate on writing. Font styles, links and images all appear approximately as they will on the internet.'%s' theme filesNote that password carefully! It is a random password that was generated just for you.ERROR: Couldn’t register you... please contact the webmaster !ERROR: Incorrect password.ERROR: Invalid username / e-mail combination.ERROR: Invalid username.ERROR: Passwords may not contain the character "\".ERROR: Please enter a username.ERROR: Please enter your password twice.ERROR: Please type the same password in the two password fields.ERROR: Please type your e-mail address.ERROR: The e-mail field is empty.ERROR: The email address isn’t correct.ERROR: The password field is empty.ERROR: The username field is empty.ERROR: This email is already registered, please choose another one.ERROR: This username is already registered, please choose another one.ERROR: This username is invalid. Please enter a valid username.ERROR: WordPress %s requires MySQL 4.0.0 or higherERROR: WordPress requires Cookies but your browser does not support them or they are blocked.ERROR: please type an e-mail addressERROR: that isn't a valid e-mail address. E-mail addresses look like: username@example.comERROR: the email address isn't correctERROR: you must provide an e-mail addressERROR: you typed your new password only once.Note:
    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 %s.Note:
    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 %s.Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.Warning: these pages should not be the same!A static page (select below)A comment is held for moderationA new comment on the post #%1$s "%2$s" is waiting for your approvalA new version of WordPress is available! Please update now.A new version of WordPress is available! Please notify the site administrator.A password will be e-mailed to you.AIM:AMAboutAbout TinyMCEAbout YourselfAbout the softwareAbout the userActionActionsActivateActivate this pluginAddAdd CategoryAdd Category »Add Custom Field »Add LinkAdd Link »Add Link BookmarkletAdd New UserAdd User »Add a link to your blogrollAdd a new custom field:Adding Tags to Posts…Additional Capabilities:AddressAddress:AdministratorAdvancedAdvanced Editing »Advanced Rich EditingAdvanced use of the Rich EditorAkismet ConfigurationAkismet SpamAkismet Spam (%s)Akismet has caught %1$s spam for you since you first installed it.Akismet is not active.Align CenterAlign LeftAlign RightAllAll OptionsAll done.All done. Have fun!All existing Bunny’s Technorati Tags will be removed after import.All existing Jerome’s Keywords will be removed after import.All of this theme’s files are located in %2$s.All plugins deactivated.All posts were imported with the current user as author. Use this form to move each Blogger user's posts to a different WordPress user. You may add users and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the "Restart" function below.All spam deleted.Allow CommentsAllow PingsAllow link notifications from other blogs (pingbacks and trackbacks.)Allow my blog to appear in search engines like Google and Technorati.Allow people to post comments on the articleAlready InstalledAlready existsAlready pinged:Also on freshmeatAlso, 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 Textile for WordPress. Trust me... You’ll want it.Also, since you're coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You'll want it.An administrator must always approve the commentAn error has occurred, which probably means the feed is down. Try again later.An error has occurred; the feed is probably down. Try again later.AnonymousAnyAny CSS color (%s or %s or %s)Any HTML entered directly into the rich editor will show up as text when the post is viewed. What you see is what you get. When you want to include HTML elements that cannot be generated with the toolbar buttons, you must enter it by hand in the HTML editor. Examples are tables and <code>. To do this, click the HTML button and edit the code, then click Update. If the code is valid and understood by the editor, you should see it rendered immediately.Anyone can registerAnyone posts a commentApproveApprove it: %sApprovedApr_April_abbreviationAprilArchivesArchives:Are you lost?Are you sure you want to activate this plugin: "%s"?Are you sure you want to add this category?Are you sure you want to add this link?Are you sure you want to add this page?Are you sure you want to add this post?Are you sure you want to add this user?Are you sure you want to approve this comment: "%s"?Are you sure you want to bulk modify comments?Are you sure you want to bulk modify links?Are you sure you want to bulk modify users?Are you sure you want to change your permalink structure to: %s?Are you sure you want to deactivate this plugin: "%s"?Are you sure you want to delete the file '%title%'? Click ok to delete or cancel to go back.Are you sure you want to delete this %thing%?Are you sure you want to delete this category: "%s"?Are you sure you want to delete this comment: "%s"?Are you sure you want to delete this link: "%s"?Are you sure you want to delete this page: "%s"?Are you sure you want to delete this post: "%s"?Are you sure you want to delete users?Are you sure you want to do that?Are you sure you want to do this?Are you sure you want to edit this attachment: "%s"?Are you sure you want to edit this category: "%s"?Are you sure you want to edit this comment: "%s"?Are you sure you want to edit this file: "%s"?Are you sure you want to edit this link: "%s"?Are you sure you want to edit this page: "%s"?Are you sure you want to edit this plugin file: "%s"?Are you sure you want to edit this post: "%s"?Are you sure you want to edit this theme file: "%s"?Are you sure you want to edit this user: "%s"?Are you sure you want to edit your settings?Are you sure you want to moderate comments?Are you sure you want to modify the profile for: "%s"?Are you sure you want to switch to this theme: "%s"?Are you sure you want to unapprove this comment: "%s"?Assign AuthorsAttempt to notify any blogs linked to from the article (slows down posting.)Attribute all posts and links to:Aug_August_abbreviationAugustAuthentication failedAuthorAuthor : %1$s (IP: %2$s , %3$s)Author mappingAuthor…Author:Authorization failedAuthorizeAuthors & UsersAutomatically discard spam comments on posts older than a month.Available ThemesAvailable WidgetsAwaiting Moderation (%s)Back to %sBack to Image UploadingBad login/pass combination.BasicsBasics of Rich EditingBefore a comment appears:Below, you can see the names of the authors of the MovableType posts in italics. 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.Blog NameBlog PagesBlog StatsBlog URLBlog address (URL):Blog title:Blog visibility:BloggerBlogger BlogsBlogger usernameBlogrollBlogroll ManagementBlogwareBookmarksBroken ThemesBrowseBrowse AllBrowse FilesBrowse your filesBrowsing %sBrowsing %sBrowsing %s (active)Browsing %s (inactive)Bulk Moderate Comments »Bulk Update »Bulk action:By %sBy default WordPress uses web URLs 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 number of tags are available, and here are some examples to get you started.By: %sCalendarCan’t delete the %s category: this is the default oneCannot load %s.Cannot load importer.CategoriesCategories %dCategories (add new)Categories WidgetsCategories can be selectively converted to tags using the category to tag converter.Categories to Tags ConverterCategories:Category %s addedCategory TemplateCategory added.Category baseCategory deleted.Category doesn't exist!Category is already a tag.Category name:Category not added.Category not updated.Category parent:Category slug:Category updated.Category…Category:Caught SpamCaution:Change your site’s look or themeChanged roles.Cheatin’ uh?Check SpellingCheck your e-mail for the confirmation link.Check your e-mail for your new password.Choose a LiveJournal XML file to upload, then click Upload file and import.Choose a WordPress WXR file to upload, then click Upload file and import.Choose a file from your computer:Choose an image from your computer:Choose the part of the image you want to use as your header.Clear account informationClose Color PickerClose all open tagsClose this window.CodeCommand failed CommentComment BlacklistComment ExcerptComment ModerationComment StatusComment author must fill out name and e-mailComment author must have a previously approved commentComment on %1$s by %2$sComment on %sComment:Comment: CommentsComments (%)Comments (0)Comments (1)Comments »Comments RSSComments TemplateComments for %sComments for %s searching on %sComments in moderation (%s) »Comments on %sComments on: %sComments you de-spam will be submitted to Akismet as mistakes so it can learn and get better.CommonCommon options:Completed GreyMatter import!ConfigureConfirmConfirm DeletionCongratulations!Contact InfoContinueContinue »ContributorConvert »Convert All CategoriesConvert Categories to TagsConvert emoticons like :-) and :-P to graphics on displayConvert existing categories to tags, selectively.Converted successfully.Converting category #%s ... Copyright © 2005, Moxiecode Systems AB, All rights reserved.Could not connect to %sCould not connect to https://www.google.comCould not save file.Could not write file %1$s (%2$s)Could not write file %sCouldn’t open plugins directory or there are no plugins available.Couldn't get post IDCreate New Page »Create New PostCreate a new page »Create user %1$s or map to existingCrop Header »Current ThemeCurrent author:Current theme previewCurrently %s comments are waiting for approval. Please visit the moderation panel:Currently showing %1$s links ordered by %2$sCurrently there are no comments for you to moderate.Custom FieldsCustom Image HeaderCustom field deleted.Custom field updatedCustom structureCustom, specify belowCustomize HeaderCustomize Permalink StructureDashboardDatabase Upgrade RequiredDate and TimeDate and name basedDe-spam marked comments »DeactivateDeactivate All PluginsDeactivate this pluginDec_December_abbreviationDecemberDefaultDefault SidebarDefault TemplateDefault date format:Default is wp-content/uploadsDefault link category:Default mail category:Default post category:Default time format:DeleteDelete Checked Comments »Delete Checked Links »Delete FileDelete UsersDelete allDelete all posts and links.Delete checked users.Delete every comment marked “defer.” Warning: This can’t be undone.Delete it: %sDelete this commentDelete this draftDelete this pageDelete this postDeletedDescriptionDescription:Description: (optional)Detects duplicate entries or comments. If you don't import everything the first time, or this import should fail in the middle, duplicate entries will not be made when you try again.Dictionary lookupDirect link to fileDiscussionDiscussion OptionsDisplay as a drop downDisplay name publicly as:Doesn't keep entries on top.Don’t be stupid - backup your database before proceeding!DoneDone !Done! %1$s categories imported.Done! %1$s comments imported.Done! %1$s posts imported.Done! %1$s users imported.Done! %s Links importedDone! %s links or link categories importedDone! %s posts with tags were read.Done! %s tag to post relationships were read.Done! %s tags were read.Done! %s tags where added!DotClearDotClear Database Host:DotClear Database Name:DotClear Database Password:DotClear Database User:DotClear Table prefix:Double-check your email address before continuing.Download Export FileDraftDraft pagesDrafts|manage posts headerDuplicate comment detected; it looks as though you've already said that!E-mailE-mail (required)E-mail : %sE-mail address:E-mail me whenever:E-mail:E-mail: %sE-mail: (required)EditEdit CategoryEdit Category »Edit CommentEdit Comment »Edit CommentsEdit HTMLEdit LinkEdit PluginsEdit ThemesEdit ThisEdit UserEdit commentEdit file »Edit postEdit this commentEdit this fileEdit this postEdit timeEdit timestampEditing %sEditing %sEditing %s (active)Editing %s (inactive)Editing Comment # %sEditorEither the file is not writable, or something wrong happened. The file has not been updated.Either there are no posts, or something went wrong.Empty command stringEmpty filenameEncoding for pages and feeds:Enter a description of the imageEnter a word to look up:Enter the RSS feed URL here:Enter the URLEnter the URL of the imageEnter the address here if you want your blog homepage to be different from the directory you installed WordPress.Enter your password to view commentsEnter your password to view comments.Entries RSSError Error in RSS %1$d: %2$sError in deleting...Error ocurred while accessing post metadata for file location.Error: %response%Error: could not find an RSS or ATOM feed at that URL.Error: please enter a valid email address.Error: please fill the required fields (name, email).Error: please type a comment.Excerpt: Exclude:Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s|1: month, 2: month string, 3: full year, 4: hours, 5: minutesExportF j, YF j, Y g:i aF_Friday_initialFailed to delete the page.Failed to write file to disk.Feature disabled.Feb_February_abbreviationFebruaryFeed for all posts filed under %sFileFile '%s' doesn't exist?File '%s' is not an image.File edited successfully.File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.File not foundFile not readable.File type does not meet security guidelines. Try another.Filed under:FilesFiletype not supported. Thumbnail not created.Filter »Final Step: Author MappingFinally, there are numerous WordPress resources around the internet. Some of them are:FinishFirst NameFirst Step »First name:Font ColorFont Color (CSS):Font Color:FooterFor each article, show:For many people, Akismet will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don't have a WordPress.com account yet, you can get one at WordPress.com.For more information about this software visit the TinyMCE website.For security, click the link below to reset this importer.For some strange yet very annoying reason, this post could not be deleted.For some strange yet very annoying reason, this post could not be edited.Formatting:FriFridayFront PageFront page displays:Front page: %sFull sizeFull textGNU Library General Public LicenceGeneralGeneral OptionsGet More PluginsGet More ThemesGet New Password »Give the feed a title (optional):Go backGo to Authors & Users, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.Got Moxie?GreyMatterHEX only (%s or %s)HTML in the Rich EditorHave fun!HeaderHeader Image and ColorHeader complete!Header updated.Hello world!Help on categoriesHelp on titlesHelp with post fieldHere you add links 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’s called a “blogroll.”Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.Hide TextHold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)Hosted By SourceforgeHotkeysHow many RSS widgets would you like?How many categories widgets would you like?How many items would you like to display?How many text widgets would you like?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.Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.Howdy! This importer allows you to extract posts from an RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.Howdy! This imports tags from an existing Bunny’s Technorati Tags installation into this blog using the new WordPress native tagging structure.Howdy! This imports tags from an existing Jerome’s Keywords installation into this blog using the new WordPress native tagging structure.Howdy! This imports tags from an existing Simple Tagging 1.6.2 installation into this blog using the new WordPress native tagging structure.Howdy! This imports tags from an existing Ultimate Tag Warrior 3 installation into this blog using the new WordPress native tagging structure.Howdy! Upload your LiveJournal XML export file and we’ll import the posts into this blog.Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.Howdy! We’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 mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"Howdy, %s.I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archiversI would like to block search engines, but allow normal visitorsIDID #%1s: %2sID #%1s: %2s The current user will not be deleted.IPIP:IconIf a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.If this file were writable you could edit it.If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:If you like, you may enter custom bases for your category and tag URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.If you like, you may enter custom bases for your category and tag URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.If you need to upload an image or sound file from your computer, you can use the uploading tool below the editor. The tool will attempt to create a thumbnail-sized image when you upload an image. To insert your uploaded image into the post, first click on the thumbnail to reveal a menu of options. Clicking on a "Using.." or "Linked..." option will change that option. For instance, you might want to use the thumbnail in the post and link it to a page showing the original with a caption. When you have selected the options you like, click "Send to Editor" and your image or file will appear in the post you are editing.If you would like to change the user's password type a new one twice below. Otherwise leave this blank.If you would like to change your password type a new one twice below. Otherwise leave this blank.If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.Image Address:Image linked to fileImage linked to pageImages and AttachmentsImages of exactly %1$d x %2$d pixels will be used as-is.ImportImport posts, comments, custom fields, pages, and categories from a WordPress export fileImport BloggerImport BlogrollImport BlogwareImport Bunny’s Technorati TagsImport Bunny’s Technorati Tags into the new native tagging structure.Import Categories »Import CommentsImport Complete!Import DotClearImport GreyMatterImport Jerome’s KeywordsImport Jerome’s Keywords into the new native tagging structure.Import LinksImport LiveJournalImport Movable Type or TypePadImport OPML File »Import PostsImport RSSImport Simple TaggingImport Simple Tagging tags into the new native tagging structure.Import Tags »Import TextpatternImport Ultimate Tag WarriorImport Ultimate Tag Warrior tags into the new native tagging structure.Import UsersImport Version 1.x »Import Version 2.0a »Import WordPressImport categories, users, posts, comments, and links from a DotClear blogImport categories, users, posts, comments, and links from a Textpattern blogImport gm-templates.Import posts and comments from a Movable Type or Typepad blogImport posts from BlogwareImport posts from a LiveJournal XML export fileImport posts from an RSS feedImport posts, comments, and users from a Blogger blogImport users, posts, and comments from a Greymatter blogImport your blogroll from another systemImporting Categories...Importing Comments...Importing Links...Importing Posts...Importing Users...Importing post %s...Importing post...Importing...In a few words, explain what this blog is about.In case you haven't done it already, you can import the posts from your other blogs:Incoming LinksInformation neededInsertInsert "More" TagInsert AnchorInsert ImageInserted %1$d links into category %2$s. All done! Go manage those links.Inserted %sInstall WordPress »Invalid TaxonomyInvalid file typeInvalid form submission.Invalid importer.Invalid plugin pageInvalid plugin.Invalid post id.Invalid post type.Invalid taxonomyInvalid term IDInvalid user ID.Is there no link to us?Jabber / Google Talk:Jan_January_abbreviationJanuaryJul_July_abbreviationJulyJump to new itemJun_June_abbreviationJuneJust another WordPress weblogJustify TextKeep 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.KeyLast NameLast entry's number:Last name:Last updatedLast updated: %sLaterLatest %sLatest ActivityLatest SpamLeave a commentLetterLine and paragraph breaks automatic, e-mail address never displayed, HTML allowed:Link IDLink Relationship (XFN)Link ThisLink add bookmarkletLink added.Link not found.Link to fileLink to pageLink to:LinksListLiveJournalLog out of this accountLogged in as %s.LoginLogin addressLogin name:LogoutLogout »Lost PasswordLost your password?Lower ColorLower Color (HEX):Lower Color:M j, g:i AM_Monday_initialMail (will not be published)Mail server:Main Index TemplateMain Page (no parent)ManageManage BlogrollManage PluginsManage ThemesManage pagesMar_March_abbreviationMarchMark Checked Comments as Spam »Mark all:Mass Edit ModeMaximum size: %sMayMay_May_abbreviationMembership:MetaMeta:MiscellaneousMiscellaneous OptionsMissing AttachmentMissing a temporary folder.Moderate CommentsModeratedModeration QueueModifiedMonMondayMonth…More »Movable Type and TypePadMr WordPressMy BlogMy ProfileNameName:Need help with WordPress? Please see our documentation or visit the support forums.NeverNew PageNew Password:New User Default Role:New WordPress BlogNew comment on your post #%1$s "%2$s"New pingback on your post #%1$s "%2$s"New theme activated. View site »New trackback on your post #%1$s "%2$s"New user created.New user registration on your blog %s:Newer Posts »Next »Next Entries »Next PageNext Page »Next PostNext pageNickname:NoNo Categories to Import!No CommentsNo Comments to Import!No Links to Import!No Sidebars DefinedNo Tags Found!No Upgrade RequiredNo Users to Import!No actionNo blogs foundNo categoriesNo comments found.No comments yet.No connection to serverNo file was uploaded.No importers are available.No linksNo login ID submittedNo matching users were found!No msg number submittedNo pages found.No password submittedNo post?No posts found.No posts were found to have tags!No results found.No role for this blogNo server bannerNo server specifiedNoneNot SpamNote: If you use the <!--more--> feature, it will cut off posts in RSS feeds.Note: of course, you can also edit the files/templates in your text editor of choice and upload them. This online editor is only meant to be used when you don’t have access to a text editor or FTP client.Notes:Nothing was imported. Had you already imported this blog?Nov_November_abbreviationNovemberNow select a category you want to put these links in.Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:Now wasn’t that easy?Number of comments to show:Number of posts to show:NumericOKOK, so we lied about this being a 4-step program! You’re done!OK, so we lied about this being a 5-step program! You’re done!Oct_October_abbreviationOctoberOnce DailyOnce HourlyOnce you’ve saved the download file, you can use the Import function on another WordPress blog to import this blog.One-click bookmarklet:Oops, no comment with this ID.Oops, no such file exists! Double check the name and try again, merci.Open HelpOpen this file in the Plugin EditorOptionalOptional ExcerptOptional optionsOptionsOptions saved.Or choose from your local disk:Or use mt-export.txt in your /wp-content/ directoryOrganize my uploads into month- and year-based foldersOriginating character set:Other FilesOther WordPress NewsOther user roles have been changed.Other users have been deleted.Others’ Drafts:Output:OwnerPMPagePage AuthorPage ContentPage IDPage IDs, separated by commas.Page OrderPage ParentPage PasswordPage SlugPage StatusPage TemplatePage TitlePage Type…Page orderPage saved.Page titlePagesPages 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.Pages:Parse gm-counter.cgi, gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log).Parses gm-authors.cgi to import (new) authors. Everyone is imported at level 1.Parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet).
    If authors are found not to be in gm-authors.cgi, imports them at level 0.PasswordPassword (twice)Password Lost and Changed for user: %sPassword Lost and FoundPassword:Password: %sPath to GM entries:Path to GM files:Pending ReviewPending Review:Pending postsPermalink OptionsPermalink structure updated.PermalinksPersonal OptionsPingbackPingback from %1$s to %2$s registered. Keep the web talking! :-)Please enter an API key. (Get your key.)Please enter your username and e-mail address. You will receive a new password via e-mail.Please provide the following information. Don't worry, you can always change these settings later.Please select some comments to deletePlease select some comments to mark as spamPluginPlugin activated.Plugin deactivated.Plugin EditorPlugin ManagementPlugin could not be activated because it triggered a fatal error.Plugin file does not exist.Plugin filesPluginsPlugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.Popup CommentsPopup Comments TemplatePort:Possible reason: your host may have disabled the mail() function...PostPost #%sPost %s already exists.Post AuthorPost PasswordPost SlugPost StatusPost TimestampPost already importedPost saved.Post updatedPost via e-mailPostsPosts »Posts by %sPosts page: %sPowered by WordPressPowered by WordPressPowered by WordPress, state-of-the-art semantic personal publishing platform.Premature end of listPreparing author mapping form...PresentationPreserving AuthorsPress It - %sPress it - %sPreview »Previous %sPrevious PagePrevious PostPrevious pagePrivacyPrivacy OptionsPrivatePrivate pagesPrivate postsPrivate: %sProfileProfile updated.Protected Comments: Please enter your password to view comments.Protected: %sPublishPublishedPublished pagesPublished postsQuote/IndentRSSRSS %dRSS Address:RSS Feed WidgetsRather than reaching for your mouse to click on the toolbar, use these access keys. Windows and Linux use Alt+<letter>. Macintosh uses Ctrl+<letter>.RatingRating:Read more »ReadingReading Bunny’s Technorati Tags…Reading Jerome’s Keywords Tags…Reading OptionsReading STP Post Tags…Reading UTW Post Tags…Reading UTW Tags…RecentRecent CommentsRecent PostsRecheck Queue for SpamRedoRegisterRegister »Register For This SiteRegistration FormRegistration complete. Please check your e-mail.Remember meReset Header Image and ColorRestartRestore Original HeaderRestrict Author:RevertRich Editing BasicsRich Editor HelpRight click on the following link and choose “Bookmark This Link...” or “Add to Favorites...” to create a Link This shortcut.Right click on the following link and choose “Bookmark This Link...” or “Add to Favorites...” to create a posting shortcut.RoleRole:S_Saturday_initialS_Sunday_initialSatSaturdaySaveSave »Save Changes »Save and Continue EditingSave as DraftSave as PrivateSaved at %time%.Saving Draft...Say It!ScheduledScheduled Entries:Scheduled postsSearchSearch ResultsSearch Terms…Search Users »Search terms…Search:Second step: GreyMatter details: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.Select »Select CategorySelect Default ColorsSelect MonthSelect a Text ColorSelect theme to edit:Send to editor »Send trackbacks to:Sep_September_abbreviationSeparate multiple URLs with spacesSeparate multiple categories with commas.SeptemberSet AuthorsSet the Role of checked users to:Share a little biographical information to fill out your profile. This may be shown publicly.Share a little biographical information. Show Comments That Contain...Show TextShow as dropdownShow at most:Show hierarchyShow post countsShow the most recent:Show:SidebarSidebar %dSidebar ArrangementSidebar updated. View site »Sign OutSince you’re a newcomer, you’ll have to wait for an admin to add the edit_posts capability to your user, in order to be authorized to post.
    You can also e-mail the admin to ask for a promotion.
    When you’re promoted, just reload this page and you’ll be able to blog. :)Single PostSite AdminSize of the post box:Slow down, I'm still sending your data!Someone has asked to reset the password for the following site and username.Something strange happened. Try refreshing the page.Something went wrong. If the problem persists, send this info to support:Sorry, can’t call files with their real path.Sorry, can’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.Sorry, comments are closed for this item.Sorry, no posts matched your criteria.Sorry, no such page.Sorry, no such post.Sorry, that file cannot be edited.Sorry, that key does not appear to be valid.Sorry, the comment form is closed at this time.Sorry, the new category failed.Sorry, there has been an errorSorry, there has been an error.Sorry, this user can not edit the template.Sorry, you are not allowed to post on this blog.Sorry, you can not add new pages.Sorry, you can not edit this post.Sorry, you do not have the right to add a category.Sorry, you do not have the right to delete this page.Sorry, you do not have the right to delete this post.Sorry, you do not have the right to edit this page.Sorry, you do not have the right to edit this post.Sorry, you do not have the right to edit/publish new posts.Sorry, you do not have the right to publish this page.Sorry, you do not have the right to publish this post.Sorry, you must be logged in to post a comment.Sorry, your entry could not be edited. Something wrong happened.Sorry, your entry could not be posted. Something wrong happened.Sort by:SpamSpam it: %sSpecified file failed upload test.Specify an OPML URL:Status…Step 1 »Step 2 »Step 3 »Step 4 »Steps may take a few minutes depending on the size of your database. Please be patient.Store uploads in this folderStrikethroughStylesheetStylesheet is missing.SubmitSubmit CommentSubmit for ReviewSubmittedSubscriberSuccess!Successfully logged you out.SummarySunSundaySyndicate this contentSyndicate this site using RSSSyndicate this site using RSS 2.0Syndication FeedsT_Thursday_initialT_Tuesday_initialTag CloudTag baseTagline:TagsTags (separate multiple tags with commas: cats, pet food, dogs)Tags: TargetTemplate & File EditingTemplate is missing.Text %dText WidgetsTextileTextpatternTextpattern Database Host:Textpattern Database Name:Textpattern Database Password:Textpattern Database User:Textpattern Table prefix (if any):Thank you for creating with WordPressThat was hard work! Take a break.That’s it! What are you waiting for? Go login!That's it! What are you waiting for? Go login!The URL to TrackBack this entry is:The GD image library is not installed.The Magic ButtonThe active theme is broken. Reverting to the default theme.The character encoding you write your blog in (UTF-8 is recommended)The config file cannot be edited or viewed through the web interface. Sorry!The current user's role must have user editing capabilities.The e-mail could not be sent.The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.The following tags were found:The following themes are installed but incomplete. Themes must have a stylesheet and a template.The importer is running...The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn't finish. If you get an out of memory error try splitting up the import file into pieces.The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.The key you entered is invalid. Please double-check it.The latest comments to all posts in RSSThe pingback has already been registered.The requested theme does not exist.The slug "%s" is already in use by another termThe source URL and the target URL cannot both point to the same resource.The source URL does not contain a link to the target URL, and so cannot be used as a source.The source URL does not exist.The specified target URL cannot be used as a target. It either doesn't exist, or it is not a pingback-enabled resource.The specified target URL does not exist.The template files are located in %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.The upgrade process may take a while, so please be patient.The uploaded file could not be moved to %s.The uploaded file exceeds the upload_max_filesize directive in php.ini.The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.The uploaded file was only partially uploaded.Theme EditorThemesThere are currently %1$s and %2$s, contained within %3$s and %4$s.There are currently %1$s comments identified as spam.There are no attachments to show.There are no valid users selected for deletion.There doesn’t seem to be any new mail.There is a button in the editor toolbar for inserting images that are already hosted somewhere on the internet. If you have a URL for an image, click this button and enter the URL in the box which appears.There is a new version of %s available. Download version %s here.There is no excerpt because this is a protected post.There was a problem connecting to the Akismet server. Please check your server configuration.There was a problem opening a connection to Blogger. This is what went wrong:There was a problem opening a secure connection to Google. This is what went wrong:These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.These settings may be overridden for individual articles.This address is used only for admin purposes.This can mean one of two things, either you copied the key wrong or that the plugin is unable to reach the Akismet servers, which is most often caused by an issue with your web host around firewalls or similar.This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don't worry, you can turn it back off when you're done.This feature requires iframe support.This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.This has not been tested on any other versions of Simple Tagging. Mileage may vary.This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.This has not been tested on previous versions of Textpattern. Mileage may vary.This importer will search for files 00000001.cgi to 000-whatever.cgi,
    so you need to enter the number of the last GM post here.
    (if you don't know that number, just log into your FTP and look it out
    in the entries' folder)This is a basic GreyMatter to WordPress import script.This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.This is suitable for Bunny’s Technorati Tags version 0.6.This is suitable for Jerome’s Keywords version 1.x and 2.0a.This is your header image. You can change the text color or upload and crop a new image.This key is valid.This page validates as XHTML 1.0 TransitionalThis plugin has been deactivated because your changes resulted in a fatal error.This post is password protected. To view it please enter your password below:This will restore the original header image and color. You will not be able to retrieve any customizations.ThuThumbnailThumbnail linked to fileThumbnail linked to pageThumbnail path invalidThursdayTimes in the blog should differ by:TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.TitleTitle: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!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!To edit a file, type its name here. You can edit any file writable by the server, e.g. CHMOD 666.To install a plugin you generally just need to upload the plugin file into your %s directory. Once a plugin is uploaded, you may activate it here.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 admins entries.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.To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: %s, %s, %s.To reset your password visit the following address, otherwise just ignore this email and nothing will happen.To use this importer, you must have a Google account, an upgraded (New, was Beta) blog, and it must be on blogspot or a custom domain (not FTP).Toggle TextToggle Text DisplayTrack Links’ Update TimesTrackBack URLTrackbackTrackbacksTrouble signing inTueTuesdayType it one more time:URLURL : %sURL:Uh, oh. Something didn't work. Please try again.Unable to create directory %s. Is its parent directory writable by the server?UnapproveUnapprovedUncategorizedUndoUnknown FeedUnlink AnchorUnpublishedUnquote/OutdentUntitledUpdateUpdate »Update File »Update File and Attempt to Reactivate »Update Header »Update Options »Update Permalink Structure »Update Profile »Update SelectedUpdate ServicesUpdate User »Update User's PasswordUpdate Your PasswordUpdate options »Update your profile or change your passwordUpdatedUpgrade CompleteUpgrade WordPress »UploadUpload »Upload New Header ImageUpload file and import »UploadingUploadsUpper ColorUpper Color (HEX):Upper Color:Use DefaultsUse Original ColorUse legacy my-hacks.php file supportUse the visual editor when writingUse these links to get started:User %s addedUser List by RoleUser already exists. Password inherited.User registration is currently not allowed.User updated.UsernameUsername (required)Username:Username: %sUsername: (no editing)UsersUsers Matching "%s" by RoleUsers can register themselves or you can manually create users here.Users cannot currently register themselves, but you can manually create users here.Users must be registered and logged in to commentUsual settings for an article:Valid XHTMLValueVersionVersion %sVersion: %sViewView %s postView %s postsView »View ModeView PostView all posts filed under %sView all posts in %sView page »View post “%s”View post »View posts by this authorView posts for %1$s %2$sView site »View the postVisibleVisit %sVisit %s's websiteVisit author homepageVisit plugin homepageVisit your site and you should see the new header now.VisualW_Wednesday_initialWe cannot find a title on that page.We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.We were able to log in but there were no blogs. Try a different account next time.We were not able to gain access to your account. Try starting over.WebsiteWebsite:Website: %1$s (IP: %2$s , %3$s)WedWednesdayWeeks in the calendar should start on:WelcomeWelcome to WordPressWelcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.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.Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!Welcome to the famous five minute WordPress installation process! You may want to browse the ReadMe documentation 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.Were you expecting more steps? Sorry to disappoint. :)What it does not:What it does:What should be done with posts and links owned by this user?WhenWhen a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the moderation queue. One word or IP per line. It will match inside words, so "press" will match "WordPress".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".When you click the button below WordPress will create an XML file for you to save to your computer.When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see Update Services on the Codex. Separate multiple service URLs with line breaks.When you're ready, click OK to start importing: Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%sWhy might my key be invalid?WidgetsWordPress › ErrorWordPress › InstallationWordPress › UpgradeWordPress BookmarkletWordPress ConfirmationWordPress Development BlogWordPress ResourcesWordPress address (URL):WordPress has been installed. Now you can log in with the username "admin" and password "%2$s".WordPress includes a rich HTML editor that works well in most web browsers used today. It is powerful but it has limitations. Pasting text from other word processors may not give the results you expect. If you do not like the way the rich editor works, you may turn it off in the Your Profile and Personal Options form, under Users in the admin menu.WordPress is not notifying any Update Services because of your blog's privacy settings.WordPress loginWordPress recommends a better browserWordPress should compress articles (gzip) if browsers ask for themWordPress should correct invalidly nested XHTML automaticallyWordPress.com API KeyWriteWrite PageWrite PostWrite a postWritingWriting OptionsWriting at Full SpeedWrong path, the path to the GM entries does not exist on the serverWrong path, the path to the GM files does not exist on the serverXML error: %1$s at line %2$sXML error: %s at line %dY-m-d \<\b\r \/\> g:i:s aY-m-d g:i aY-m-d g:i:s aYahoo IM:YesYou appear to have already installed WordPress. To reinstall please clear your old database tables first.You are about to approve the following comment:You are about to convert all categories to tags. Are you sure you want to continue?You are about to delete %s comments permanently 'Cancel' to stop, 'OK' to delete.You are about to delete the '%s' custom field on this post. 'OK' to delete, 'Cancel' to stop.You are about to delete the '%s' link to %s. 'Cancel' to stop, 'OK' to delete.You are about to delete the '%s' page. 'OK' to delete, 'Cancel' to stop.You are about to delete the category '%s'. All links that were only assigned to this category will be assigned to the '%s' category. 'OK' to delete, 'Cancel' to stop.You are about to delete the category '%s'. All posts that were only assigned to this category will be assigned to the '%s' category. All links that were only assigned to this category will be assigned to the '%s' category. 'OK' to delete, 'Cancel' to stop.You are about to delete the following comment:You are about to delete these links permanently. 'Cancel' to stop, 'OK' to delete.You are about to delete this comment by '%s'. 'Cancel' to stop, 'OK' to delete.You are about to delete this comment by '%s'. 'OK' to delete, 'Cancel' to stop.You are about to delete this comment by '%s'. 'Cancel' to stop, 'OK' to delete.You are about to delete this comment. 'Cancel' to stop, 'OK' to delete.You are about to delete this draft '%s' 'Cancel' to stop, 'OK' to delete.You are about to delete this page '%s' 'Cancel' to stop, 'OK' to delete.You are about to delete this post '%s' 'Cancel' to stop, 'OK' to delete.You are about to delete this post '%s'. 'OK' to delete, 'Cancel' to stop.You are about to mark %s comments as spam 'Cancel' to stop, 'OK' to mark as spam.You are about to mark as spam this comment by '%s'. 'Cancel' to stop, 'OK' to mark as spam.You are about to mark the following comment as spam:You are not allowed to be hereYou are not allowed to change the page author as this user.You are not allowed to change the post author as this user.You are not allowed to create pages as this userYou are not allowed to create pages as this user.You are not allowed to create pages on this blog.You are not allowed to create posts or drafts on this blog.You are not allowed to delete comments on this post.You are not allowed to delete this attachment.You are not allowed to delete this page.You are not allowed to delete this post.You are not allowed to edit comments on this post, so you cannot approve this comment.You are not allowed to edit comments on this post, so you cannot disapprove this comment.You are not allowed to edit comments on this post, so you cannot edit this comment.You are not allowed to edit comments on this post.You are not allowed to edit pages as this user.You are not allowed to edit posts as this user.You are not allowed to edit this page.You are not allowed to edit this post.You are not allowed to import.You are not allowed to post as this userYou are not allowed to post as this user.You are not allowed to upload files to this site.You are not allowed to upload files.You are posting comments too quickly. Slow down.You are seeing this message because the theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.You are using a development version (%s). Cool! Please stay updated.You attempted to edit a page that doesn't exist. Perhaps it was deleted?You attempted to edit a post that doesn't exist. Perhaps it was deleted?You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.You can drag and drop widgets onto your sidebar below.You can find additional plugins for your site in the WordPress plugin directory.You can find additional themes for your site in the WordPress theme directory. To install a theme you generally just need to upload the theme folder into your wp-content/themes directory. Once a theme is uploaded, you should see it on this page.You can see all comments on this post here: You can see all pingbacks on this post here: You can see all trackbacks on this post here: You can use these tags: %sYou can’t create users.You can’t delete that user.You can’t delete users.You can’t edit that user.You can’t edit users.You can't delete the current user.You do not have permission to edit this user.You do not have permission to upload files.You do not have sufficient permission to moderate comments.You do not have sufficient permissions to access this page.You do not have sufficient permissions to edit plugins for this blog.You do not have sufficient permissions to edit templates for this blog.You do not have sufficient permissions to edit the links for this blog.You do not have sufficient permissions to edit themes for this blog.You don't have permission to do that.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. Every user has the same username, but their passwords are reset to password123. So Login and change it.You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn't have that login in DotClear, 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 DotClear 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. Every user has the same username, but their passwords are reset to password123. So Login and change it.You have no categories to convert!You have no spam currently in the queue. Must be your lucky day. :)You have specified these users for deletion:You must enter your WordPress.com API key for it to work.You must be logged in to post a comment.You need to supply your OPML url. Press back on your browser and try againYou should update your .htaccess now.Your CommentYour DotClear Configuration settings are as follows:Your Drafts:Your Header ImageYour ProfileYour Profile and Personal OptionsYour Textpattern Configuration settings are as follows:Your WordPress %s is out of date. Please update.Your WordPress database has been successfully upgraded!Your WordPress database is already up-to-date!Your WordPress database is out-of-date, and must be upgraded before you can continue.Your e-mail:Your key has been cleared.Your key has been verified. Happy blogging!Your latest postsYour level is not high enough to moderate comments.Your new WordPress blog has been successfully set up at: %1$s You can log in to the administrator account with the following information: Username: %2$s Password: %3$s We hope you enjoy your new blog. Thanks! --The WordPress Team http://wordpress.org/ Your session has expired.Your theme will display its usual sidebar when this box is empty. Dragging widgets into this box will replace the usual sidebar with your customized sidebar.Your timezone offset, for example -6 for Central Time.[%1$s] Comment: "%2$s"[%1$s] Pingback: "%2$s"[%1$s] Please moderate: "%2$s"[%1$s] Trackback: "%2$s"[%s] New User Registration[%s] Password Lost/Changed[%s] Password Reset[%s] Your new password[%s] Your username and passwordabortaboutacquaintanceamanother web address of mineapop authentication failedblocked bybyby %sby other authorscancelchildclick hereclick to %toggle% this boxclick-down and drag to move this boxcloseclose tagsco-residentco-workercolleagueconnection does not existconnection not establishedcontactcrushdateduring %se-mail: %seditentry # %s : %s : by %sfamilyfriendfriendshipg:i ageographicalhello-worldhoursidentityignored %d pre-existing commentsimported %d comment(s)importing posts, comments, and karma...importing users...in “%s”kinlineslinkslookupmatching “%s”metmusemy-hacks.php (legacy hacks support)neighborno login ID submittednoneopenorparentphysicalpmpostsprofessionalregistered deleted user %s at level 0 relrel:romanticsiblingspam commentsspousesweetheartuse the arrow keys to move this boxuser %suser %s...viewProject-Id-Version: WordPress 2.3 Report-Msgid-Bugs-To: POT-Creation-Date: 2005-02-15 10:33-0600 PO-Revision-Date: 2007-09-25 09:03+0100 Last-Translator: Kuba Zwoliński Language-Team: SnowDog & Piotr Komoda MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Poedit-Language: Polish X-Poedit-Country: POLAND X-Poedit-Basepath: . X-Poedit-KeywordsList: _e;__ X-Poedit-SourceCharset: utf-8 Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; X-Poedit-SearchPath-0: F:\apache\htdocs\wordpress2-3 - Prywatne%Komentarze: %%1$s %2$d%1$s %2$s by %3$s|1: tytuł motywu, 2: wersja motywu, 3: autor motywu%1$s %2$sspamowych komentarzy%3$s %4$szablokowanych przez%5$s
    %6$sAkismet%7$s%1$s – %2$s / %3$s pokazane poniżej%1$s kategorii%1$s kategoriach%1$s kategoriach%1$s komentarz%1$s komentarze%1$s komentarzy%1$s wpis%1$s wpisy%1$s wpisówLiczba odzyskanych komentarzy: %1$s%1$s za %2$s%1$s do wpisu %2$s%1$s tagiem%1$s tagami%1$s tagami%3$s pokazani poniżej%d - tyle spamowych komentarzy zostało zablokowanych przez Akismet.%d wpis(y)%s temu%s komentarz zaakceptowany%s komentarze zaakceptowane%s komentarzy zaakceptowanych%s komentarz usunięty%s komentarze usunięte%s komentarzy usuniętych%s komentarz usunięty%s komentarze usunięte%s komentarzy usuniętych%s komentarz oznaczony jako spam%s komentarze oznaczone jako spam%s komentarzy oznaczonych jako spam%s dzień%s dni%s dni%s godzina%s godziny%s godzin%s jest chronioną opcją WP, która nie może być modyfikowana.%s link usunięty%s linki usunięte%s linków usuniętych%s minuta%s minuty%s minut%s oczekujeLiczba zapytań: %s%s sekundy%s uzytkownik usunięty%s uzytkowników usuniętych%s uzytkowników usuniętych« Powrót« Powrót do wszystkich użytkowników« Powrót do autorów i użytkowników« Starsze wpisy« Poprzednie« Poprzednie wpisy« Poprzednia strona— Brak funkcji dla tego bloga —»|Użyte jako wypunktowanie listy(komentarze: %s)(%s sygnałów ping)(Zostaw 0, gdy brak oceny)(szybkie linki)(wyszukiwanie w tekście komentarzy, adresach e-mail, URL i IP)(już istnieje)(najwięcej 15)(więcej...)(wymagane), i %d więcej, lub wciśnij enter aby %toggle%- Wybierz -.htaccess (dla reguł rewrite)011 KomentarzSzablon strony błędu 404Liczba spamowych komentarzy, przed którymi Akismet ochronił twoją stronę: %3$s.Wyślij sygnał TrackBack do adresu URL: (Rozdziel spacjami wszystkie adresy URL.)
    The Codex (inaczej mówiąc: Biblia systemu WordPress)DokumentacjaDokumentacja na temat formatowania daty. Zapisz ustawienia, aby zobaczyć nowy format.
    Uwaga: Tłumaczenie, które stosujesz zawiera zmieniony format skrótu miesiąca (oznaczany przez M )! Angielskie skróty (np. Jan), raczej nie używane w j. polskim, zostały zamienione na polskie nazwy miesięcy w dopełniaczu, użyteczne przy formatowaniu daty.Co to jest?Kreator XFN:WordPress, osobista platforma publikacyjna.Forum pomocy technicznej WordPressOpinieOficjalna strona WordPressCzas UTC:RSSKanał RSS dla tego wpisu.URLOparte na Wordpressmt-export.txt nie istniejeEdytor WYSIWYG (nazwa pochodzi od What You See Is What You Get: To Co Widzisz Jest Tym Co Otrzymasz) oznacza, że twój tekst jest formatowany podczas pisania. Edytor tworzy kod (X)HTML w tle, podczas gdy ty koncentrujesz się na pisaniu. Kroje czcionki, linki i obrazki są wyświetlane tak samo (no, prawie tak samo), jak będą opublikowane w Internecie.Pliki motywu graficznego '%s'Dobrze zapamiętaj to hasło! Jest to hasło generowane losowo, tylko do twojego użytku. BŁĄD: Rejestracja nie jest możliwa. Skontaktuj się z administratorem strony!Błąd: Nieprawidłowe hasło.BŁĄD: Niepoprawne połączenie danych użytkownik / hasło.BŁĄD: Podaj nazwę użytkownikaBŁĄD: Hasło nie może zawierać znaków "\".BŁĄD: Podaj nazwę użytkownikaBŁĄD: Wprowadź hasło dwukrotnieBŁĄD: Wpisz to samo hasło w obu polachBŁĄD: Wpisz swój adres e-mailBłąd: Pole e-mail jest puste.BŁĄD: Adres e-mail nie jest prawidłowyBŁĄD: Pole hasła jest puste.Błąd: Pole użytkownika jest puste.BŁĄD: Podany adres e-mail jest już przypisany do innego użytkownika. Proszę wybrać inny.BŁĄD: Ta nazwa użytkownika już istnieje, wybierz inną.BŁĄD: Podaj poprawną nazwę użytkownika.BŁĄD: WordPress %s wymaga bazy danych MySQL 4.0.0 lub nowszejBŁĄD: WordPress wymaga włączonych Cookies, twoja przeglądarka ich nie obsługuje lub są zablokowane.BŁĄD: Wpisz adres e-mailBŁĄD: to nie jest poprawny adres e-mail. Adres e-mail wygląda tak: uzytkownik@przyklad.plBŁĄD: Adres e-mail nie jest prawidłowyBŁĄD: musisz podać adres e-mailBŁĄD: Nowe hasło zostało wpisane tylko raz.Adnotacja:
    Usunięcie kategorii nie usuwa linków w danej kategorii. Zamiast tego, linki należące tylko do usuniętej kategorii zostają przyporządkowane do kategorii %s.Adnotacja:
    Usunięcie kategorii nie usuwa wpisów w danej kategorii. Zamiast tego, wpisy należące tylko do usuniętej kategorii zostają przyporządkowane do kategorii %s.Ostrzeżenie: Zmienianie aktywnych wtyczek jest wysoce niewskazane. Jeśli twoje zmiany spowodują błąd krytyczny, wtyczka zostanie automatycznie wyłączona.Ostrzeżenie: te strony nie powinny być takie same!Statyczna strona (wybierz poniżej)Komentarz czeka na sprawdzenieNowy komentarz do wpisu #%1$s "%2$s" oczekuje na akceptacjęNowa wersja WordPress jest już dostępna! Uaktualnij teraz.Nowa wersja WordPress jest już dostępna! Powiadom administratora strony.Hasło zostanie do ciebie wysłane pocztą e-mail.AIM:przed południemInformacjeO edytorze TinyMCEParę słów o sobieO programieO użytkownikuCzynnośćCzynnościWłączWłącz tę wtyczkęDodajDodaj kategorięDodaj kategorię »Dodaj nowe pole »Dodaj linkDodaj link »Skryptozakładka 'Dodaj link'Dodaj nowego użytkownikaDodaj użytkownika »Dodaj link do listy linków (blogroll)Dodaj nowe pole do tego wpisu:Dodawanie tagów do wpisu…Dodatkowe umiejętności:AdresAdres:AdministratorZaawansowaneZaawansowana edycja »Edycja zaawansowanaZaawansowane użycie edytora WYSIWYGKonfiguracja AkismetSpam z AkismetSpam z Akismet (%s)Liczba wychwyconych przez Akismet spamowych komentarzy od momentu jego instalacji: %1$s.Akismet nie jest włączony.WycentrujWyrównaj do lewejWyrównaj do prawejWszystkieWszystkie opcjeZrobione.Zrobione. Baw się dobrze!Wszystkie istniejące tagi Bunny’s Technorati Tags zostaną usunięte po zakończeniu importu.Wszystkie istniejące tagi Jerome’s Keywords zostaną usunięte po zakończeniu importu.Wszystkie pliki tego motywu graficznego umieszczone są w folderze %2$s.Wszystki wtyczki wyłączone.Wszystkie wpisy zostały zaimportowane z bieżącym użytkownikiem jako autorem. Użyj tego formularza, aby przenieść wpisy różnych użytkowników Blogger'a do różnych użytkowników WordPress. Możesz dodać użytkowników i następnie powrócić do tej strony w celu dokończenia mapowania uzytkowników. Formularz może być dowolnie wiele razy, dopóki nie aktywujesz poniższej funkcji 'Restart'.Cały spam został usunięty.Włącz komentarzeDopuść sygnały PingZezwalaj na powiadomienia o linkowaniu na innych blogach (sygnały pingback i trackback)Chciałbym, żeby moja strona pojawiała się w wyszukiwarkach takich jak np. Google czy Technorati.Zezwalaj na komentarze do publikacjiJuż zainstalowanoJuż istniejeSygnał ping został już wysłany do:Oraz na freshmeatJeśli przenosisz się z Textpattern, twoje wpisy i komentarze prawdopodobnie były formatowane przy użyciu Textile. Jeśli tak właśnie było, to zalecamy ściągnięcie i instalację wtyczki Textile dla WordPress. Zaufaj nam... chcesz jej, bardzo jej chcesz.Jeśli przenosisz się z DotClear, twoje wpisy i komentarze prawdopodobnie były formatowane przy użyciu Textile. Jeśli tak właśnie było, to zalecamy ściągnięcie i instalację wtyczki Textile dla WordPress. Zaufaj nam... chcesz jej, bardzo jej chcesz.Administrator musi zawsze zaakceptować komentarzWystąpił błąd; prawdopodobnie kanał chwilowo nie działa. Spróbuj ponownie później.Wystąpił błąd; prawdopodobnie kanał chwilowo nie działa. Spróbuj ponownie później.AnonimDowolnyDowolny kolor CSS (%s lub %s lub %s)Każdy kod HTML wstawiony bezpośrednio do edytora pojawi się jako tekst podczas oglądania wpisu. Czyli w skrócie - dostajesz to co widzisz (What You See Is What You Get). Jeśli chesz wstawić elementy, które nie mogą być wygenerowane przez przyciski edytora, musisz wpisać je ręcznie w edytorze HTML. Dotyczy to np. tabel albo znacznika <code>. Aby tego dokonać, naciśnij na przycisk „HTML” i edytuj swój kod, a następnie kliknij „Aktualizuj”, aby zaktualizować. Jeśli kod jest poprawny i zrozumiały dla edytora, pojawi się natychmiast.Każdy może się zarejestrowaćKtoś doda komentarzAkceptujAkceptuj to: %sZaakceptowanykwietniakwiecieńArchiwaArchiwum:Nie wiesz gdzie jesteś?Czy na pewno chcesz włączyć tę wtyczkę: „%s”?Czy na pewno chcesz dodać tę kategorię?Czy na pewno chcesz dodać ten link?Czy na pewno chcesz dodać tę stronę?Czy na pewno chcesz dodać ten wpis?Czy na pewno chcesz dodać tego użytkownika?Czy na pewno chcesz zaakceptować ten komentarz: „%s”?Czy na pewno chcesz grupowo modyfikowac komentarze?Czy na pewno chcesz grupowo modyfikować linki?Czy na pewno chcesz grupowo modyfikować użytkowników?Czy na pewno chcesz zmienić swoją strukturę odnośników na: %s?Czy na pewno chcesz wyłączyć tę wtyczkę: „%s”?Czy na pewno chcesz usunąć plik '%title%'? 'Anuluj', aby przerwać lub 'OK', aby usunąć.Czy na pewno chcesz usunąć element: %thing%?Czy na pewno chcesz usunąć tę kategorię: „%s”?Czy na pewno chcesz usunąć ten komentarz: „%s”?Czy na pewno chcesz usunąć ten link: „%s”?Czy na pewno chcesz usunąć tę stronę: „%s”?Czy na pewno chcesz usunąć ten wpis: „%s”?Czy na pewno chcesz usunąć użytkowników?Czy na pewno chcesz to zrobić?Czy na pewno chcesz to zrobić?Czy na pewno chcesz edytować ten załącznik: „%s”?Czy na pewno chcesz edytować tę kategorię: „%s”?Czy na pewno edytować ten komentarz: „%s”?Czy na pewno chcesz edytować ten plik: „%s”?Czy na pewno chcesz edytować ten link: „%s”?Czy na pewno chcesz edytować tę stronę: „%s”?Czy na pewno chcesz edytować ten plik wtyczki: „%s”?Czy na pewno chcesz edytować ten wpis: „%s”?Czy na pewno chcesz edytować ten plik motywu graficznego: „%s”?Czy na pewno chcesz edytować ustawienia tego użytkownika: „%s”?Czy na pewno chcesz edytować swoje ustawienia?Czy na pewno chcesz ocenić komentarze?Czy na pewno chcesz modyfikować profil dla: „%s”?Czy na pewno chcesz przejśc na ten motyw graficzny: „%s”?Czy na pewno chcesz usunąć akceptację dla tego komentarza: „%s”?Przyporządkowanie autorówPróbuj powiadamiać wszystkie blogi, które są linkowane w tekście (wydłuża czas publikacji)Przypisz wszystkie wpisy i linki następującemu użytkownikowi:sierpniasierpieńUwierzytalnianie nieudaneAutorAutor : %1$s (IP: %2$s , %3$s)Mapowanie autoraAutor…Autor:Autoryzacja zakończona niepowodzeniemAutoryzujAutorzy i użytkownicyAutomatycznie usuń spamowe komentarze z postów starszych niż miesiąc.Dostępne motywy graficzneDostępne widget'yPoczekalnia komentarzy (%s)Powrót do %sPowrót do wysyłania plikówBłędne połączenie danych login/hasło.Informacje podstawowePodstawy edytora WYSIWYGZanim komentarz zostanie opublikowany:Poniżej widzisz autorów wpisów z Movable Type (wyświetlane kursywą). Dla każdego z nich możesz wybrać z menu identyfikator autora w systemie WordPress lub wpisać identyfikator autora w polu tekstowym.Nazwa blogaStrony bloga:Statystyki blogaAdres URL blogaAdres bloga (URL):Tytuł bloga:Widoczność strony:BloggerBlogi BloggerNazwa użytkownika Blogger'aLinkiZarządzanie linkamiBlogwareZakładkiNiekompletne motywy graficznePrzeglądajPrzeglądaj wszystkoPrzeglądaj plikiPrzeglądaj swoje plikiPrzeglądanie %sPrzeglądanie %sPrzeglądanie %s (aktywne)Przeglądanie %s (nieaktywne)Oceń komentarze »Aktualizacja łączna »Grupowa operacja:Stworzona przez %sWordPress używa zwykle adresów URL, które składają się ze znaków zapytania i wielu cyfr, ale oferuje ci też możliwość samodzielnego stworzenia schematu adresów URL, których chcesz użyć w adresach wpisów (odnośnikach) i adresach archiwów. Może to poprawić estetykę, funcjonalność i trwałość linków twojego bloga. Masz do dyspozycji duży zbiór elementów, poniżej znajdziesz kilka przykładów, jak je zastosować.Przez: %sKalendarzNie można usunąć kategorii %s: to jest domyślna kategoriaNie można wczytać %s.Nie można wczytać importera.KategorieKategorie %dKategorie (dodaj nową)Widget'y kategoriiKategorie mogą zostać selektywnie zamienione na tagi przez użycie konwertera kategorii.Konwerter kategorii do tagówKategorie:Kategoria %s została dodanaSzablon kategoriiKategoria została dodana.Prefiks kategoriiKategoria została usunięta.Kategoria nie istnieje!Kategoria już jest tagiem.Nazwa kategorii:Kategoria nie została dodana.Kategoria nie została zmieniona.Kategoria nadrzędna:Znacznik kategorii:Kategoria została zmieniona.Kategoria…Kategoria:Przechwycony spamUwaga:Zmień motyw graficzny swojego blogaFunkcja została zmieniona.Oszukujemy, co?Sprawdź pisownięSprawdź swoją pocztę e-mail (szukaj linku potwierdzającego rejestrację).Sprawdź swoją pocztę e-mail (szukaj nowego hasła).Wybierz plik XML LiveJournal do przesłania, nastepnie kliknij 'Wyślij na serwer' i rozpocznij import.Wybierz plik WordPress WXR do załadowania, nastepnie kliknij na 'Wyślij na serwer' i importuj.Wybierz plik z twojego komputera:Wybierz obrazek z twojego komputera:Wybierz część obrazka, którą chcesz użyć w nagłówku.Wyczyść informacje o koncieZamknij wybieranie koloruZamknij wszystki otwarte znacznikiZamknij to okno.KodPolecenie zakończone niepowodzeniemKomentarzCzarna lista komentarzyWprowadzenie komentarzaSprawdzanie komentarzyStatus komentarzaAutor komentarza musi wpisać imię i adres e-mailAutor komentarza musi posiadać co najmniej jeden zaakceptowany wcześniej komentarzKomentarz do wpisu %1$s od %2$sKomentarze do wpisu %sKomentarz:Komentarz:KomentarzeKomentarze (%)Komentarze (0)Komentarze (1)Komentarze »Kanał RSS komentarzySzablon komentarzyKomentarze do wpisu '%s'Komentarze do wpisu %s dla wyszukiwania %sKomentarze oczekujące na sprawdzenie (%s) »Komentarze do wpisu '%s'Komentarze do wpisu: %sKomentarze, które oznaczasz jako „nie spam” sa przesyłane do Akismet jako błędy, aby nie popełniał ich w przyszłości.Najczęściej używaneUstawienia ogólne:Import z GreyMatter zakończony!KonfigurujPotwierdźPotwierdź usunięcieGratulacje!Dane kontaktoweKontynuujKontynuuj »FelietonistaKonwertuj »Konwertuj wszystkie kategorieKonwertuj kategorie do tagówZmieniaj emotikony, takie jak :-) i :-P na obrazkiWybiórczo konwertuj istniejące kategorie do tagów.Konwersja zakończona pomyślnie.Konwersja kategorii #%s...Prawa autorskie © 2005, Moxiecode Systems AB, wszelkie prawa zastrzeżone.Nie można połączyć się z %sNie można się połączyć z https://www.google.comNie można zapisać pliku.Zapis do pliku %1$s (%2$s) nie powiódł sięZapis pliku %s na dysk nie powiódł się.Nie można otworzyć katalogu wtyczek lub nie są one zainstalowane w systemie.Uzyskanie identyfikatora wpisu nie powiodło sięUtwórz nową stronę »Utwórz nowy wpisUtwórz nową stronę »Utwórz użytkownika %1$s lub przekaż do istniejącegoPrzytnij nagłówek »Aktualny motyw graficznyBieżący autor:Podgląd aktualnego motywu graficznegoW tej chwili liczba komentarzy oczekujących na akceptację wynosi %s. Przejdź do poczekalni komentarzy:Aktualnie pokazuje linki w kategorii %1$s , uporządkowane wg %2$sObecnie nie ma komentarzy czekających na sprawdzenie.Pola użytkownikaWłasny obrazek nagłówkaPole użytkownika zostało usunięte.Pole użytkownika zostało zmienioneWłasny schematWłasny, określ poniżejDostosuj nagłówekStwórz własny schemat odnośnikówNowościWymagana aktualizacja bazy danychData i czasOparty na dacie i nazwie publikacjiZaznaczone komentarze to nie spam »WyłączWyłącz wszystkie wtyczkiWyłącz tę wtyczkęgrudniagrudzieńDomyślnyDomyślny pasek bocznySzablon domyślnyDomyślny format daty:Domyślny to wp-content/uploadsDomyślna kategoria linków:Domyślna kategoria wpisów wysyłanych e-mailem:Domyślna kategoria wpisów:Domyślny format czasu:UsuńUsuń zaznaczone komentarze »Usuń zaznaczone linki »Usuń plikUsuwanie użytkownikówUsuń wszystkieUsuń wszystkie wpisy i linkiUsuń zaznaczonych użytkownikówUsuń wszystkie komentarze oznaczone jako “odłożone”. Uwaga: Tej operacji nie można cofnąć.Usuń to: %sUsuń ten komentarzUsuń ten szkicUsuń tę stronęUsuń ten wpisUsuniętyOpisOpis:Opis (opcjonalnie):Wykrywa duplikaty wpisów lub komentarzy. Jeśli nie zaimportujesz wszystkiego za pierwszym razem lub ten import zostanie przerwany, przy następnej próbie istniejące wpisy nie zostaną zduplikowane.Sprawdzanie słownikoweBezpośredni link do plikuDyskusjaOpcje dyskusji międzyblogowejWyświetlaj jako rozwijaną listęIdentyfikuj się na blogu jako:Nie trzyma wpisów na górze.Nie zachwouj się głupio - zrób zapasową kopię swojej bazy danych zanim będziesz kontynuować!ZrobioneZrobione !Zrobione! Importowano kategorii: %1$sZrobione! Importowano komentarzy: %1$sZrobione! Importowano wpisów: %1$sZrobione! Importowano użytkowników: %1$sZrobione! Importowano linków: %sZrobione! Importowano kategorii: %1$sZrobione! Tagi (%s) zostały odczytane.Zrobione! Relacje (%s) tagów i postów zostały odczytane.Zrobione! Tagi (%s) zostały odczytane.Zrobione! Tagi (%s) zostały dodane!DotClearHost bazy danych DotClear:Nazwa bazy danych DotClear:Hasło użytkownika bazy danych DotClear:Użytkownik bazy danych DotClear:Prefiks tabeli DotClear:Dokładnie sprawdź poprawność swojego adresu e-mail.Pobierz plik eksportuBrudnopisSzkice stronSzkice|zarządzaj nagłówkiem wpisuWykryto identyczny komentarz, wygląda na to, że się powtarzasz!Adres e-mailAdres e-mail (wymagany)E-mail : %sAdres e-mail:Wyślij do mnie wiadomość e-mail, gdy:Adres e-mail:Adres e-mail: %sAdres e-mail (wymagany):EdytujEdytuj kategorięEdytuj kategorię »Edytuj komentarzEdytuj komentarz »Edytuj komentarzeEdytuj HTMLEdytuj linkEdytuj wtyczkiEdytuj motywy graficzneEdytuj toEdytuj użytkownikaEdytuj komentarzEdytuj plik »Edytuj wpisEdytuj ten komentarzEdytuj ten plikEdytuj ten wpisEdytuj datę wpisuEdytuj znacznik czasuEdycja %sEdycja %sEdycja %s (aktywne)Edycja %s (nieaktywne)Edycja komentarza nr %sRedaktorSą dwa rozwiązania: albo plik nie ma praw do zapisu, albo coś poszło nie tak jak powinno. Plik nie został zaktualizowany.Są dwa rozwiązania: albo nie ma żadnych wpisów, albo coś poszło nie tak jak powinno.Pusty ciąg poleceniaPusta nazwa plikuKodowanie stron i kanałów informacyjnych:Wpisz opis obrazkaWpisz słowo do sprawdzenia:Wpisz adres URL kanału RSS tutaj:Wpisz adres URLWpisz adres URL obrazkaJeśli chcesz, aby strona domowa bloga znajdowała się w innym folderze niż ten, w którym zainstalowano WordPress, wpisz tutaj adres tej strony.Aby przeczytać komentarze, musisz wprowadzić hasło.Wprowadź hasło, aby obejrzeć komentarze.Kanał RSS wpisówBłądBłąd w RSS %1$d: %2$sBłąd podczas usuwania...Wystąpił błąd podczas próby uzyskania danych wpisu odnośnie położenia pliku.Błąd: %response%Błąd: nie można odnaleźć kanału RSS ani ATOM dla tego adresu URL.Błąd: Podaj prawidłowy adres e-mail.Błąd: wypełnij proszę wymagane pola (imię i adres e-mail).Błąd: wpisz proszę treść komentarza.Wprowadzenie:Wyłączenia:Aktualny znacznik czasu: %2$s %1$s %3$s @ %4$s:%5$s|1: dzień miesiąca, 2: miesiąc, 3: pełen rok, 4: godzina, 5: minutaEksportd/m/Yd/m/Y H:iPNie udało się usunąć strony.Zapis pliku na dysk nie powiódł się.Funkcja jest wyłączona.lutegolutyKanał informacyjny dla wpisów oznaczonych jako '%s'PlikPlik '%s' nie istnieje?Plik '%s' nie jest plikiem graficznym.Plik został zapisany pomyślnie.Plik jest pusty. Proszę, prześlij coś bardziej treściwego. Ten błąd może być również być spowodowany przez wyłączenie przesyłania w twoim php.ini.Plik nie został znalezionyPlik nie daje się odczytać.Typ pliku nie spełnia wymogów bezpieczeństwa. Spróbuj wysłać inny plik.Opublikowane jako:PlikiTyp pliku nieobsługiwany. Miniatura nie została utworzona.Filtruj »Ostatni krok: mapowanie autorówW Internecie istnieją liczne zasoby z informacjami na temat WordPress. Oto niektóre z nich:ZakończImięKrok pierwszy »Imię:Kolor tekstuKolor tekstu (CSS):Kolor tekstu:StopkaDla każdej publikacji pokazuj:W wielu przypadkach Akismet w znacznym stopniu zredukuje lub nawet zupełnie zlikwiduje spam w komentarzach i sygnałach TrackBack, które dodawane są do twojego bloga. Jeśli jednak jakiś spam nie zostanie wychwycony, oznacz go jako „spam” na stronie poczekalni i Akismet będzie uczył się na swoich błędach. Jeśli nie masz jeszcze konta WordPress.com, możesz założyć je na WordPress.com.Jeśli chcesz dowiedzieć się więcej o tym oprogramowaniu, odwiedź stronę TinyMCE.Ze względów bezpieczeństwa kliknij na poniższy link, aby zresetować importera.Z jakiegoś dziwnego, bliżej niesprecyzowanego i irytującego powodu, ten wpis nie może zostać usunięty.Z jakiegoś dziwnego, bliżej niesprecyzowanego i irytującego powodu, twój wpis nie może być edytowany.Formatowanie:PtpiątekStrona głównaPierwsza strona wyświetla:Pierwsza strona: %sOryginalny rozmiarCały tekstPowszechna Licencja Publiczna GNU dla BibliotekOgólneOpcje ogólneZnajdź więcej wtyczekZnajdź inne motywy graficzneZdobądź nowe hasło »Podaj tytuł dla kanału (opcjonalnie):PowrótPrzejdź do sekcji Autorzy i Użytkownicy, gdzie możesz zmieniać ustawienia lub usuwać użytkowników. Jeśli chcesz przypisać sobie autorstwo wszystkich importowanych wpisów, będziesz mieć taki wybór przy usuwaniu nowych autorów.Masz Moxie?GreyMatterTylko wartości HEX (%s lub %s)HTML w edytorze WYSIWYGBaw się dobrze!NagłówekObrazek i kolor nagłówkaNagłówek gotowy!Nagłówek zaktualizowany.Witaj świecie!Co to są kategorie?Co to są tytuły?Co to jest pole wpisu?Tutaj dodajesz linki do stron, które często odwiedzasz i chcesz opowiedzieć o tym innym na swojej stronie. Lista takich linków na pasku bocznym twojej strony nazywana jest „blogroll”.Tutaj możesz załadować na serwer swój własny obrazek nagłówka, który będzie widoczny na górze strony zamiast domyślnej grafiki. W nastepnym kroku będzie możliwość przycięcia obrazka do odpowiedniej wielkości.Cześć, to jest komentarz.
    Aby usunąć ten komentarz, zaloguj się i obejrzyj komentarze do wpisu. Tam znajdziesz opcję edycji lub usuwania komentarzy.Ukryj tekstZatrzymaj komentarz w poczekalni, jeśli zawiera więcej niż %s linków (jedna z cech spamu w komentarzach to duża liczba odsyłaczy w tekście).Na serwerze SourceforgeSkróty klawiaturoweIle widget'ów RSS chcesz używać?Ile widget'ów kategorii chcesz używać?Ile elementów chcesz wyświetlać?Ile widget'ów tekstowych chcesz używać?Hej! Ten konwerter pozwoli ci wybiórczo przekonwertować istniejące kategorie do tagów. Aby rozpocząć, zaznacz kategorie, które chcesz konwertować, a następnie kliknij przycisk Konwertuj.Hej! Ten importer umożliwi ci wczytanie wpisów z pliku eksportowego XML Blogware do twojego bloga WordPress. Wybierz plik Blogware do wysłania na serwer i wciśnij przycisk Import.Hej! Ten importer umożliwi ci wczytanie do twojego bloga wpisów z DotClear. Wyniki importu mogą byc różne.Hej! Ten importer umożliwi ci wczytanie wpisów z dowolnego pliku RSS 2.0 do twojego bloga. Jest to przydatne, jeśli chcesz importować z systemu, dla którego nie ma specjalnego importera. Wybierz plik RSS do wysłania na serwer i wciśnij przycisk Import.Hej! Ten importer umożliwi ci zaimportowanie wpisów i komentarzy z konta Blogger do twojego bloga WordPress.Hej! To importuje kategorie, użytkowników, wpisy, komentarze i linki z dowolnego systemu Textpattern 4.0.2+ do twojego bloga.Hej! To importuje tagi z istniejącej instalacji Bunny’s Technorati Tags do tego bloga z użyciem nowej, wbudowanej w WordPress, struktury tagowania.Hej! To importuje tagi z istniejącej instalacji Jerome’s Keywords do tego bloga z użyciem nowej, wbudowanej w WordPress, struktury tagowania.Hej! To importuje tagi z istniejącej instalacji Simple Tagging 1.6.2 do tego bloga z użyciem nowej, wbudowanej w WordPress, struktury tagowania.Hej! To importuje tagi z istniejącej instalacji Ultimate Tag Warrior 3 do tego bloga z użyciem nowej, wbudowanej w WordPress, struktury tagowania.Hej! Wyślij swój plik eksportu XML LiveJournal, a my zaimportujemy twoje wpisy do tego bloga.Hej! Załaduj swój plik WordPress eXtended RSS (WXR), a my zaimportujemy twoje wpisy, komentarze, dodatkowe pola i kategoie do tego bloga.Hej! Zaraz zaczniemy import do systemu WordPress wszystkich twoich wpisów z Movable Type lub Typepad. Aby rozpocząć, wybierz plik do wysłania na serwer i wciśnij przycisk "Import" lub użyj FTP aby przesłać twój plik eksportu MT do mt-export.txt w katalogu /wp-content/ i następnie kliknij "Importuj mt-export.txt"Witaj, %s.Chcę, żeby moja strona była widoczna dla wszystkich, włączając w to wyszukiwarki (np. Google, Technorati) i serwisy archiwująceChcę blokować wyszukiwarki, ale jednocześnie dopuszczać zwykłych gościIDID #%1s: %2sID #%1s: %2s Aktualny użytkownik nie zostanie usunięty.Adres IPAdres IP:IkonkaJeśli w systemie WordPress zostanie utworzony nowy użytkownik, jego nowe domyślne hasło będzie brzmiało "changeme" (ang. zmień mnie). Podsuwa niezłą myśl, prawda? ;)Jeśli używany przez ciebie program lub strona internetowa umożliwia eksport twoich linków i subskrypcji do pliku OPML, możesz go tutaj importować.Jesli coś pójdzie nie tak z wtyczką i nie możesz uruchomić swojej strony, usuń lub zmień nazwę pliku w katalogu %s, a problematyczna wtyczka zostanie automatycznie wyłączona.Jeśli ten plik byłby zapisywalny, to można by go było edytować.Jeśli nie chcesz zaimportować żadnego z tych tagów, należy usunąć je ze strony zarządzania UTW, a następnie ponownie uruchomić ten importer.Jeśli masz wpisy lub komentarze w innym systemie niż WordPress, możesz importować je do tego bloga. Aby rozpocząć tę operację, wybierz system, z którego chcesz importować:Jeśli chcesz, możesz wpisać przed adres URL kategorii i tagu wybrany przez siebie prefiks. Przykładowo, dodanie /index.php/zapiski/kategorie zamieni adres kategorii na coś takiego: http://www.twojastrona.pl/index.php/zapiski/kategorie/bezkategorii/. Jeśli zostawisz to pole puste, zastosowane będą ustawienia domyślne.Jeśli chcesz, możesz wpisać przed adres URL kategorii i tagu wybrany przez siebie prefiks. Przykładowo, dodanie /zapiski/kategorie zamieni adres kategorii na coś takiego: http://www.twojastrona.pl/zapiski/kategorie/bezkategorii. Jeśli zostawisz to pole puste, zastosowane będą ustawienia domyślne.Jeśli chcesz przesłać obrazek lub plik dźwiękowy ze swojego komputera na serwer, możesz skorzystać w tym celu z narzędzia do przesyłania plików, które znajduje się poniżej edytora. Po przesłaniu obrazka narzędzie to spróbuje utworzyć jego miniaturkę. Aby wstawić przesłany plik do wpisu, najpierw kliknij na miniaturkę, aby pojawiło się menu z opcjami. Możesz np. użyć we wpisie miniaturkę i sprawić, aby była odnośnikiem do strony z oryginalną wersją i podpisem. Kiedy już wybierzesz potrzebne ci opcje, kliknij „Wyślij do edytora”, a twój obrazek lub plik pojawi się w aktualnie edytowanym wpisie.Jeśli chcesz zmienić hasło użytkownika, wpisz dwukrotnie nowe hasło w polach poniżej. Jeśli nie, pozostaw te pola puste.Jeśli chcesz zmienić swoje hasło, wpisz nowe hasło poniżej. Jeśli nie, pozostaw te pola puste.Jeżeli twój plik .htaccess byłby zapisywalny, moglibyśmy to zrobić automatycznie, ale w tym przypadku konieczne jest dodanie reguł mod_rewrite do pliku .htaccess ręcznie. Kliknij w polu i wciśnij CTRL + a, aby zaznaczyć je wszystkie.Adres obrazka:Obrazek linkujący do plikuObrazek linkujący do stronyObrazki i załącznikiObrazki o rozmiarach dokładnie odpowiadających %1$d x %2$d pixeli będą użyte bez modyfikacji.ImportImport wpisów, komentarzy, własnych pól, stron i kategorii z pliku eksportowego WordPressImport z Blogger'aImportuj listę linkówImport z BlogwareImport Bunny’s Technorati TagsImportuje tagi Bunny’s Technorati Tags do nowej wbudowanej struktury tagowania.Importuj kategorie »Importuj komentarzeImport zakończony!Import z DotClearImport z systemu GreyMatterImport Jerome’s KeywordsImportuje tagi Jerome’s Keywords do nowej wbudowanej struktury tagowania.Importuj linkiImportuj z LiveJournalImport z Movable Type lub TypePadImportuj plik OPML »Importuj wpisyImportuj RSSImport z Simple TaggingImportuje tagi Simple Tagging do nowej wbudowanej struktury tagowania.Importuj tagi »Import z systemu TextpatternImportuj Ultimate Tag WarriorImportuje tagi Ultimate Tag Warrior do nowej wbudowanej struktury tagowania.Importuj użytkownikówImport wersji 1.x »Import versji 2.0a »Import z WordPressImport kategorii, użytkowników, wpisów, komentarzy i linków z bloga DotClearImport kategorii, użytkowników, wpisów, komentarzy oraz linków z bloga TextpatternImport gm-templates.Import wpisów i komentarzy z konta Movable Type lub TypepadImport wpisów z BlogwareImport wpisów z pliku XML LiveJournalImport wpisów z kanału RSSImport wpisów, komentarzy i użytkowników z konta Blogger'aImport użytkowników, wpisów i komentarzy z konta GreyMatterImport listy linków (blogroll) z innego systemuTrwa importowanie kategorii...Trwa importowanie komentarzy...Trwa importowanie linków...Trwa importowanie wpisów...Trwa importowanie użytkowników...Trwa importowanie wpisu %s...Trwa importowanie wpisu...Trwa importowanie...W kilku słowach opisz o czym jest ten blog.Jeśli nie zrobiłeś tego jeszcze, możesz zaimportować wpisy ze swoich innych blogów:Linki przychodzącePotrzebna informacjaWstawWstaw znacznik "więcej"Wstaw kotwicęWstaw obrazekDodano linki (sztuk: %1$d) do kategorii %2$s. Zrobione! Przejdź do strony zarządzania linkami.Dodano %sInstaluj WordPress »Nieprawidłowa KlasyfikacjaNieprawidłowy typ plikuNieprawidłowe wysłanie formularza.Nieprawidłowy importer.Nieprawidłowa strona wtyczkiNieprawidłowa wtyczka.Nieprawidłowy identyfikator wpisu.Nieprawidłowy typ wpisu.Nieprawidłowa klasyfikacjaNieprawidłowy identyfikator terminuNieprawidłowy nr ID użytkownika.Nie ma żadnego linku do nas?Jabber / Google Talk:styczniastyczeńlipcalipiecPrzejdź do nowej pozycjiczerwcaczerwiecJeszcze jeden blog WordPressWyjustuj tekstPamiętaj, ze jeśli przekonwertujesz kategorię razem z kategoriami podrzędnymi, wszystkie zostaną zamienione na równorzędne.KluczNazwiskoNumer ostatniego wpisu:Nazwisko:Ostatnia aktualizacjaOstatnia aktualizacja: %sPóźniejNajnowsze %sAktywność blogowaOstatni spamDodaj komentarzListWiersze i paragrafy zawijane automatycznie, adres e-mail nigdy nie widoczny, dozwolony HTML:ID linkuLinkowe relacje międzyludzkie (XFN)Dodaj link do tej stronySkryptozakładka dodawania linkówLink został dodany.Link nie został odnaleziony.Link do plikuLink do stronyIdentyfikator linku:LinkiPokaż listęLiveJournalWyloguj się z tego kontaZalogowano jako %s.Zaloguj sięAdres logowaniaNazwa użytkownika:Wyloguj sięWyloguj »Zgubione hasłoNie pamiętasz hasła?Dolny kolorDolny kolor (HEX):Dolny kolor:d/m/Y H:iPAdres e-mail (nie będzie opublikowany)Nazwa serwera pocztowego:Szablon strony głównejStrona główna (bez strony nadrzędnej)AdministracjaZarządzaj linkamiZarządzanie wtyczkamiZarządzaj motywami graficznymiZarządzaj stronamimarcamarzecOznacz wybrane komentarze jako spam »Zaznacz wszystkie:Tryb grupowej edycjiMaksymalna wielkość: %smajmajaUprawnienia użytkowników:MetaMeta:RóżneInne opcjeBrakuje załącznikaBrakuje folderu plików tymczasowych.Sprawdzaj komentarzeDo sprawdzeniaPoczekalnia komentarzyZmodyfikowanyPnponiedziałekMiesiąc…Więcej »Movable Type i TypePadPan WordPressMój blogMój profilNazwaNazwa:Potrzebujesz pomocy ze swoją stroną WordPress? Przejrzyj dokumentację lub odwiedź forum pomocy.NigdyNowa stronaNowe hasło:Domyślna funkcja nowego użytkownika:Nowy blog WordPressDodano nowy komentarz do twojego wpisu #%1$s "%2$s"Wysłano nowy sygnał pingback do twojego wpisu #%1$s "%2$s"Nowy motyw graficzny został aktywowany. Obejrzyj stronę »Wysłano nowy sygnał trackback do twojego wpisu #%1$s "%2$s"Nowy użytkownik został utworzony.Nowy użytkownik na twoim blogu %s:Nowsze wpisy »Następne »Następne wpisy »Nastęna stronaNastępne »Nastęny wpisNastępna stronaPseudonim:NieBrak kategorii do zaimportowania!Brak komentarzyBrak komentarzy do zaimportowania!Brak linków do zaimportowania!Nie zdefiniowano pasków bocznychNie znaleziono tagów!Aktualizacja nie jest koniecznaBrak użytkowników do zaimportowania!Bez akcjiNie znaleziono blogówBrak kategoriiNie znaleziono komentarzy.Nikt tego jeszcze nie skomentował.Brak połączenia z serweremNie wysłano żadnego pliku.Importery są niedostępne.Brak linkówNie wysłano danych logowaniaNie znaleziono pasującego użytkownika!Nie wysłano numeru wiadomościNie znaleziono stron.Nie podano hasłaNie ma wpisów?Nie znaleziono wpisów.Nie został odnaleziony żaden wpis posiadający tagi!Wyszukiwanie nie przyniosło rezultatów.Brak funkcji dla tego blogaSerwer nie ma wiadomości powitalnejNie podano nazwy serweraBrakTo nie jest spamAdnotacja: jeśli użyjesz kodu <--more-->, wpisy w kanale RSS będą obcięte od tego miejsca.Adnotacja: oczywiście możesz również edytować pliki i szablony w ulubionym edytorze tekstu, po czym wysłać je na serwer. Ten wbudowany edytor został stworzony po to, aby umożliwić edycję osobom, które nie mają dostępu do edytora tekstu lub klienta FTP.Notatki:Nic nie zostało zaimportowane. Czy ten blog był już importowany?listopadalistopadNastępnie wybierz kategorię, do której chcesz dodać te linki.Co chcesz zrobić teraz, gdy zaimportowano już twojego bloga z Blogger'a do systemu WordPress? Oto parę sugestii:Czy nie było to proste?Liczba komentarzy do pokazania:Ilość wpisów do pokazania:NumerycznyOKOK, trochę nakłamaliśmy o tych 4 krokach! To już wszystko!OK, trochę nakłamaliśmy o tych 5 krokach! To już wszystko!październikapaździernikCodziennieCo godzinęKiedy już zapiszesz ściągnięty plik, możesz użyć funkcji Import na innym blogu WordPress, aby zaimportować wpisy z tej strony.Szybka skryptozakładka:Brak komentarza o takim ID. W systemie nie ma takiego pliku! Sprawdź jego nazwę i spróbuj ponownie, z góry dziękujęmy!Otwórz plik pomocyOtwórz ten plik w edytorze wtyczekUstawienia opcjonalneWprowadzenie (nie wymagane)Dodatkowe opcjeOpcjeOpcje zostały zapisane.Lub wybierz plik z dysku:Lub użyj mt-export.txt w twoim katalogu /wp-content/Organizuj moje pliki w foldery, z podziałem na miesiące i lataPodstawowy zestaw znaków:Inne plikiInne wiadomości WordPressFunkcje innych użytkowników zostały zmienione.Inni użytkownicy zostali usunięci.Brudnopisy innych:Przykład:Właścicielpo południuStronaAutor stronyZawartość stronyID stronyID stron, oddzielone przecinkami.Pozycja stronyStrona nadrzędnaHasło stronyZnacznik stronyStatus stronySzablon stronyTytuł stronyTyp strony…Pozycja stronyStrona została zapisana.Tytuł stronyStronyStrony są jak wpisy, lecz znajdują się poza chronologiczną strukturą bloga i mogą być ułożone hierarchicznie. Możesz używać stron do organizowania dowolnej ilości tekstu i zarządzania nim.Strony:Parsowanie gm-counter.cgi, gm-banlist.cgi, gm-cplog.cgi (możesz zrobić CP log hack jeśli tego potrzebujesz, ale nie uważam CP log za niezbędny).Parsuje gm-authors.cgi, aby zaimportować autorów (nowych). Każdy jest importowany na poziomie 1.Parsuje pliki cgi, aby importować wpisy, komentarze i karmę wpisów (mimo, że karma jeszcze nie jest używana w WordPress).
    Jeśli autorzy nie zostaną odnalezieni w gm-authors.cgi, zostaną zaimportowani na poziomie 0.HasłoWprowadź hasło (dwukrotnie)Utrata i ustawienie nowego hasła dla użytkownika: %sBiuro haseł znalezionychHasło:Hasło: %sŚcieżka do wpisów GM:Ścieżka do plików GM:Oczekuje na opinięOczekuje na opinię:Oczekujące wpisyOpcje odnośnikówSchemat odnośników został zmieniony.OdnośnikiOpcje osobistePingbackSygnał pingback %1$s do %2$s został zarejestrowany. Podtrzymuj dyskusje w Sieci! :-)Proszę wprowadzić klucz API. (Zdobądź swój klucz.)Podaj swoją nazwę użytkownika oraz adres e-mail. Nowe hasło otrzymasz pocztą e-mail.Musisz podać kilka informacji. Nie obawiaj się, możesz je zawsze zmienić później.Wybierz komentarze do usunięciaWybierz komentarze do oznaczenia jako spamWtyczkaWtyczka została włączona.Wtyczka została wyłączona.Edytor wtyczekZarządzanie wtyczkamiWtyczka nie może zostać aktywowana ponieważ powoduje błąd krytyczny.Plik wtyczki nie istnieje.Pliki wtyczekWtyczkiWtyczki zwiększają funcjonalność systemu WordPress. Po zainstalowaniu wtyczki możesz ją włączyć lub wyłączyć poniżej.Komentarze pop-upSzablon komentarzy pop-upPort:Przypuszczalna przyczyna: administrator serwera wyłączył funkcję mail()...WpisWpis nr %sWpis %s już istnieje.Autor wpisuHasło wpisuZnacznik wpisuStatus wpisuZnacznik czasu wpisuWpis był już importowanyWpis został zapisany.Wpis został zmienionyPublikacja przez e-mailWpisyWpisy »Wpisy autora %sStrona wpisów: %sOparte na WordPressOparte na WordPressStrona została zbudowana przy pomocy WordPress, najwyższej klasy semantycznej platformy edytorskiej do użytku osobistego.Niespodziewany koniec listyPrzygotowywanie formularza mapowania autorów...WyglądZachowywanie istniejących autorówOpisz na blogu - %sOpisz na blogu - %sPodgląd »Poprzednie %sPoprzednia stronaPoprzedni wpisPoprzednia stronaPrywatnośćOpcje prywatnościPrywatnyPrywatne stronyPrywatne wpisyPoufny: %sProfilProfil został zmieniony.Aby przeczytać komentarze, musisz wprowadzić hasło.Wpis chroniony hasłem: %sPublikujOpublikowanyOpublikowane stronyOpublikowane wpisyCytuj/Zwiększ wcięcieRSSRSS %dAdres RSS:Widget'y RSSZamiast sięgać za każdym razem po myszkę, aby kliknąć na pasek narzędzi, użyj tych skrótów klawiaturowych. Windows i Linux używają kombinacji Alt+<znak>. Macintosh używa Ctrl+<znak>.OcenaOcena:Czytaj więcej »Wyświetlanie wpisówOdczytywanie tagów Bunny’s Technorati TagsOdczytywanie tagów wpisu Jerome’s Keywords…Opcje wyświetlania wpisówOdczytywanie tagów wpisu STP…Odczytywanie tagów wpisu UTW…Odczytywanie tagów UTW…Ostatnio używaneNajświeższe komentarzeNajświeższe wpisySprawdź czy w poczekalni nie ma spamuPowtórzZarejestruj sięRejestracja »Zarejestruj się jako użytkownik tej stronyFormularz rejestracjiRejestracja zakończona. Sprawdź swój e-mail.Pamiętaj mniePrzywróć wartości domyślne dla obrazka nagłówka i koloru.RestartPrzwróć oryginalny nagłówek.Wybierz autora:Przywróć domyślnePodstawy pracy w edytorze WYSIWYGPomoc edytora WYSIWYGKliknij prawym przyciskiem myszy na ten link i wybierz 'Dodaj do ulubionych' lub 'Dodaj odnośnik do zakładek' aby utworzyć skrót 'Dodaj link do tej strony'.Kliknij prawym przyciskiem myszy na ten link i wybierz “Dodaj do ulubionych” lub “Dodaj odnośnik do zakładek” aby utworzyć skrót do publikowania wpisów.FunkcjaFunkcja:SNSosobotaZapiszZapisz »Zapisz zmiany »Zapisz i kontynuuj edycjęZapisz jako szkicZapisz jako prywatneZapisane: %time%.Zapisywanie brudnopisu....Powiedz to!ZaplanowaneZaplanowane wpisy:Zaplanowane wpisySzukajWynik wyszukiwaniaSzukaj terminów…Szukaj użytkowników »Szukaj terminów…Szukaj:Krok drugi: szczegóły GreyMatter:Postaraliśmy się również zachować autorów wpisów. Jeśli jesteś jedynym autorem lub felietonistą na swoim blogu, to możesz odetchnąć. W większości przypadków udaje nam się zachować właściwe ustawienia. Jeśli jednak nie możemy wczytać danych autora wpisu z powodu rozbieżności w strukturze tabel bazy danych, przypisujemy taki wpis tobie, administratorowi bloga.Wybierz »Wybierz kategorięWybierz domyślne koloryWybierz miesiącWybierz kolor tekstuWybierz motyw graficzny do edycji:Wyślij do edytora »Wyślij sygnały TrackBack do:wrześniaRozdziel spacjami wszystkie adresy URLRozdziel przecinkami nazwy kategorii.wrzesieńPrzyporządkowanie autorówZaznaczonym użytkownikom przydziel funkcję:Podziel się z innymi paroma informacjami biograficznymi. Te dane mogą być dostępne publicznie.Podziel się z innymi paroma informacjami o sobie.Pokaż komentarze, które zawierają...Pokaż tekstPokazuj jako listę rozwijanąPokaż najwięcej:Pokaż hierarchięPokaż liczbę wpisówPokaż najnowsze:Pokaż:Pasek bocznyPasek boczny %dUstawienie paska bocznegoPasek boczny został zaktualizowany. Obejrzyj stronę »WylogowaniePonieważ jesteś nowym użytkownikiem, musisz poczekać, aż administrator zmieni twój poziom uprawnień na 1. Wtedy możesz publikować.
    Możesz też wysłać e-mail do administratora i poprosić o dodanie uprawnień.
    Gdy już awansujesz, po prostu odśwież tę stronę i już możesz publikować wpisy na blogu. :)Pojedynczy wpisAdministracja stronyWielkość okna edycji:Spokojnie. Nadal wysyłam dane!Ktoś poprosił o zmianę hasła dla tej strony i użytkownika.Coś dziwnego się wydarzyło. Spróbuj idświeżyć stronę.Coś poszło nie tak, jak powinno. Jeśli problem będzie się powtarzał, wyślij tę informację do pomocy technicznej:Niestety, pliki nie mogą nazywać się tak samo jak ich ścieżka dostępu.Niestety nie można edytować plików z ".." w nazwie. Jeśli próbujesz edytować plik w folderze instalacyjnym WordPress, możesz po prostu wpisać jego nazwę w tym polu.Niestety, skomentowanie tego wpisu jest niemożliwe.Brak wpisów spełniających kryteria wyszukiwania.Niestety, nie ma takiej strony.Niestety, nie ma takiego wpisu.Ten plik nie może być edytowany.Niestety, ten klucz nie jest prawidłowy.Niestety, skomentowanie tego wpisu jest niemożliwe.Niestety, dodanie nowej kategorii nie powiodło się.Niestety, pojawił się jakiś błądNiestety, pojawił się jakiś błąd.Niestety, ten użytkownik nie może edytować szablonu.Nie masz uprawnień do publikowania na tym blogu.Niestety, nie możesz dodawać nowych stron.Niestety, nie masz uprawnień do edytowania tego wpisu.Niestety, nie masz uprawnień aby dodać kategorię.Niestety, nie masz uprawnień do usunięcia tej strony.Niestety, nie masz uprawnień do usunięcia tego wpisu.Niestety, nie masz uprawnień do edycji tej strony.Niestety, nie masz uprawnień do edycji tego wpisu.Niestety, nie masz uprawnień do publikacji/edycji nowych wpisów.Niestety, nie masz uprawnień do publikacji tej strony.Niestety, nie masz uprawnień do publikacji tego wpisu.Musisz się zalogować, jeśli chcesz dodać komentarz.Niestety, wpis nie może być edytowany. Coś poszło nie tak jak powinno.Niestety, twój wpis nie może zostać opublikowany. Coś poszło nie tak, jak powinno.Sortuj:SpamOznacz jako spam: %sWybrany plik nie przeszedł pomyślnie testu wysyłania.Podaj adres URL pliku OPML:Status…Krok 1 »Krok 2 »Krok 3 »Krok 4 »Poniższe czynności mogą zająć parę minut, w zależności od wielkości twojej bazy danych. Prosimy o cierpliwość.Przechowuj przesłane pliki w tym folderze.PrzekreślArkusz styluBrak arkusza stylu.WyślijDodaj komentarzZgłoś do opiniiZgłoszonyAbonentSukces!Wylogowanie zakończone powodzeniem.StreszczenieNniedzielaSubskrybuj tę treśćSubskrybuj tę stronę w formacie RSSSubskrybuj tę stronę używając RSS 2.0Kanały do syndykacjiCWChmurka tagówPrefiks taguOpis bloga:TagiTagi (rozdziel poszczególne tagi przecinkami, np.: koty, jedzenie dla zwierząt, psy):Tagi:Otwieraj w:Edycja szablonu i plikuNie ma takiego szablonu.Tekst %dWidget'y tekstoweTextileTextpatternHost bazy danych Textpattern:Nazwa bazy danych Textpattern:Hasło użytkownika bazy danych Textpattern:Użytkownik bazy danych Textpattern:Prefiks tabeli Textpattern (jeśli istnieje):Dzięki za tworzenie przy pomocy WordPressTo był kawał dobrej roboty! Zrób sobie przerwę.To wszystko! Na co jeszcze czekasz? Zaloguj się!To wszystko! Na co jeszcze czekasz? Zaloguj się!URL do sygnału TrackBack to:Biblioteka GD nie jest zainstalowana.Magiczny PrzyciskAktywny motyw graficzny jest niezdatny do użytku. Zastosowano domyślny motyw graficzny.Kodowanie twojego bloga (zalecane jest kodowanie UTF-8 )Plik konfiguracyjny nie może być edytowany lub oglądany za pomocą przeglądarki internetowej. Przepraszamy!Funkcja pełniona przez aktualnego użytkownika musi obejmować prawo do edytowania ustawień innych użytkowników.Wiadomość e-mail nie mogła zostać wysłana. Pierwsza rzecz to umożliwienie WordPress dostępu do twojego konta Blogger'a. Zostaniesz odesłany tutaj z powrotem po autoryzacji.Znaleziono następujące tagi:Następujące motywy graficzne zostały zainstalowane, ale są niekompletne. Wszystkie motywy graficzne muszą posiadać arkusz stylu i co najmniej jeden szablon.Importowanie jest w toku...Ten importer jest wystarczająco sprytny, by uniknąć podwójnego wczytywania tych samych elementów, więc możesz go uruchamiać wielokrotnie, jeśli z jakiejś przyczyny nie ukończy importu. Jeśli pokaże się komunikat błędu out of memory, podziel importowany plik na mniejsze części.Poniższy klucz został już wcześniej uznany za prawidłowy, jednak tym razem połączenie z akismet.com nie może zostać ustanowione. Sprawdź proszę konfigurację swojego serwera.Wpisany klucz nie może zostać zweryfikowany ponieważ nie można ustanowić połączenia z akismet.com. Sprawdź proszę konfigurację swojego serwera.Twój klucz nie jest prawidłowy. Sprawdź go.Najnowsze komentarze do wszystkich wpisów w formacie RSSSygnał pingback już został zarejestrowany.Żądany motyw graficzny nie istnieje.Znacznik "%s" jest już używany przez coś innegoŹrodłowy i docelowy adres URL nie mogą prowadzić do tego samego miejsca.Źródłowy adres URL nie zawiera linku do docelowego adresu URL, więc nie może być użyty jako źródło.Wybrany adres źródłowy URL nie istnieje.Docelowy adres URL nie może zostać użyty. Nie istnieje lub nie ma mozliwości obsługi sygnałów pingback.Wybrany docelowy adres URL nie istnieje.Szablony motywu graficznego znajdują się w folderze %2$s. Arkusz stylu znajduje się w folderze %3$s. %4$s używa szablonów motywu graficznego %5$s. Zmiany dokonane w szablonach zostaną zastosowane w obu motywach graficznych.Proces aktualizacji może zająć chwilę, poczekaj cierpliwie.Plik wysłany na serwer nie może być przeniesiony do %s.Rozmiar wysyłanego plilku przekracza upload_max_filesize, ustawione w php.ini.Rozmiar wysyłanego pliku przekracza MAX_FILE_SIZE, podane w formularzu HTML.Plik nie został przesłany w całości.Edytor motywów graficznychMotywy graficzneAktualnie masz %1$s oraz %2$s, zawarte w %3$s i oznaczone %4$s.Liczba komentarzy uznanych obecnie za spam: %1$s.Brak załączników do pokazaniaBrak użytkowników wybranych do usunięcia.Nie ma nowych wiadomości.Na pasku narzędziowym edytora znajduje się przycisk, który służy do wstawiania obrazków znajdujących się gdzieś indziej w internecie. Jeśli znasz adres URL obrazka, kliknij na ten przycisk i wpisz ten adres w polu, które się pojawi.Nowa wersja %s jest dostępna. Pobierz wersję tutaj %s.Nie ma streszczenia tego wpisu, ponieważ jest on chroniony hasłem.Wystąpił problem podczas łączenia z serwerem Akismet. Proszę sprawdzić ustawienia serwera.Wystąpił problem podczas otwierania połączenia z Blogger'em. Problem:Wystąpił problem z otwarciem bezpiecznego połączenia z Google. Problem:To są najnowsze komentarze, które przez Akismet zostały uznane za spam. Jeśli jakiś komentarz znajduje się tu przez pomyłkę, po prostu zaznacz go jako „nie spam” i Akismet będzie uczył się na twoich korektach. Jeśli chcesz przywrócić jakiś komentarz na bloga, po prostu zaznacz go i kliknij „To nie jest spam”. Po 15 dniach śmieci są automatycznie usuwane.Te opcje mogą być zastapione przez osobne ustawienia w każdej publikacjiTen adres będzie używany tylko do potrzeb administracyjnych.To może oznaczać dwie możliwości: albo klucz został błędnie przekopiowany, albo wtyczka nie może się połączyć z serwerem Akismet, co zazwyczaj jest spowodowane przez ustawienia twojego hostingu (np. zapora ogniowa lub czegoś podobnego)Ta funkcja wymaga obsługi Javascript, która wygląda na wyłączoną. Włącz Javascript i przeładuj stronę. Nic się nie martw, możesz z powrotem wyłączyć obsługę JS kiedy tu skończysz.Ta funkcja wymaga obsługi iframe.Ten format, nazywany WordPress eXtended RSS lub WXR, będzie zawierał twoje wpisy, komentarze, specjalne pola i kategorie.To nie było testowany na wcześniejszych wersjach Simple Tagging. Wyniki importu mogą być różne.To nie było testowany na wcześniejszych wersjach Ultimate Tag Warrior. Wyniki importu mogą być różne.To nie było testowany na wcześniejszych wersjach Textpattern. Wyniki importu mogą być różne.Ten importer będzie szukał plików od 00000001.cgi do 000-cokolwiek.cgi,
    więc należy wpisać tutaj numer ostatniego wpisu GM.
    (jeśli nie znasz tego numeru, po prostu zaloguj się na swoje konto FTP i poszukaj
    w katalogu wpisów)To jest podstawowy skrypt importu GreyMatter do WordPress.To jest przykład strony w systemie WordPress, możesz ją zmienić i opublikować informacje o sobie oraz o swojej stronie tak, aby twoi czytelnicy wiedzieli, kim jesteś i czym się zajmujesz. Możesz utworzyć więcej stron takich jak ta, lub utworzyć podstrony i zarządzać ich treścią.Działa dla Bunny’s Technorati Tags w wersji 0.6Działa dla Jerome’s Keywords w wersji 1.x i 2.0a.To jest twój obrazek użyty w nagłówku. Możesz zmienić kolor tekstu lub załadować na serwer i przyciąć nowy obrazek.Klucz jest poprawny.Strona jest zgodna z XHTML 1.0 TransitionalTa wtyczka została wyłączona ponieważ twoje zmiany spowodowały błąd krytyczny.Ten wpis jest chroniony hasłem. Aby go przeczytać, wpisz hasło poniżej:Ta opcja przywróci domyslne wartości dla obrazka nagłówka i koloru. Nie będzie możliwości przywrócenia własnych zmian.CzMiniaturaMiniatura linkująca do plikuMiniatura linkująca do stronyŚcieżka dostępu do miniatury jest nieprawidłowaczwartekCzas tego bloga ma się różnić o:TinyMCE jest niezależnym od platformy, napisynym w języku JavaScript edytorem HTML, wykorzystującym tryb pracy WYSIWYG. Program ten stanowi Wolne Oprogramowanie (ang. Open Source) i jest objęty licencją %sLGPL. Umożliwia przekształcenie pól TEXTAREA lub innych elementów HTML w pola edytora WYSIWYG. Autorem programu jest Moxiecode Systems AB. TytułTytuł:Aby uporać się z większymi bazami danych dla tych zwariowanych-na-punkcie-tagów autorów, przygotowaliśmy łatwy program w 4 krokach pomagający uporac się z tym paskudnym zwyczajem Simple Tagging. Po prostu klikaj wg instrukcji i damy ci znać kiedy będzie dość!Aby uporać się z większymi bazami danych dla tych zwariowanych-na-punkcie-tagów autorów, przygotowaliśmy łatwy program w 5 krokach pomagający uporac się z tym paskudnym zwyczajem UTW. Po prostu klikaj wg instrukcji i damy ci znać kiedy będzie dość!Aby edytować plik, wpisz jego nazwę poniżej. Możesz edytować dowolny plik, który jest zapisywalny przez serwer, np. z atrybutem CHMOD 666.Aby zainstalować wtyczkę, zazwyczaj wystarczy załadować plik wtyczki do katalogu %s. Kiedy plik jest już na miejscu, możesz go aktywować w tym panelu.Aby ułatwić edycję i zapis importowanych wpisów, masz możliwość zmiany autora tych wpisów. Przykładowo, możesz importować wszystkie wpisy jako wpisy administratora.Aby ułatwić ci edycję i zapis importowanych wpisów, masz możliwość zmiany autora tych wpisów. Na przykład możesz importować wszystkie wpisy jako wpisy administratora.Aby móc publikować w WordPress przez e-mail, musisz założyć konto e-mail z dostępem POP3, które znasz tylko ty. Każda wiadomość e-mail otrzymana na to konto zostanie opublikowana, więc utrzymanie w tajemnicy jego adresu to dobry pomysł. Oto przykłady adresów z losowymi ciągami znaków : %s, %s, %s.Aby uzyskać nowe hasło, odwiedź adres podany poniżej. Jeśli nie chcesz nowego hasła, po prostu zignoruj ten e-mail.Aby użyć tego importera, musisz posiadać konto Google, zaktualizowany (nowy, dawniej Beta) blog oraz musi on znajdować się w blogspot lub dowolnej domenie (nie FTP).Przełącz tekstPrzełącz wyświetlanie tekstuZapisuj czas aktualizacji linkówTrackBack URLTrackbackSygnały TrackBackProblem z logowaniemWtwtorekWpisz je jeszcze raz:Adres URLURL : %sAdres URL:Ups, coś nie zadziałało. Proszę spróbuj ponownie.Nie można utworzyć katalogu %s. Czy nadrzędny katalog ma prawa do zapisu przez serwer?Cofnij akceptacjęCofnij akceptacjęBez kategoriiCofnijNieznany kanałUsuń link kotwicyNieopublikowanyUsuń cytat/Zmniejsz wcięcieBez tytułuAktualizujAktualizuj »Aktualizuj plik »Zaktualizuj plik i spróbuj włączyć ponownie »Aktualizuj nagłówek »Aktualizuj ustawienia »Aktualizuj schemat odnośników »Aktualizuj profil »Aktualizuj wybraneSerwisy aktualizacjiAktualizuj użytkownika »Zmień hasło użytkownikaZmień swoje hasłoAktualizuj ustawienia »Zmień swój profil lub hasłoZaktualizowanyAktualizacja zakończonaAktualizuj WordPress »Wyślij na serwerWyślij »Załaduj na serwer nowy obrazek nagłówkaPrześlij plik i importuj »Wysyłanie na serwerPrzesłane na serwerGórny kolorGórny kolor (HEX):Górny kolor:Użyj domyślnych wartościUżyj oryginalnego koloruUżyj rozwiązań indywidualnych z pliku my-hacks.phpPodczas tworzenia wpisów używaj edytora WYSIWYGZacznij od tych linków:Użytkownik %s został dodanyLista użytkowników według funkcjiUżytkownik już istnieje. Hasło zostaje odziedziczone.Rejestracja nowych użytkowników jest obecnie niemożliwa.Użytkownik został zaktualizowany.Nazwa użytkownikaNazwa użytkownika (wymagana)Nazwa użytkownika:Nazwa użytkownika: %sNazwa użytkownika (nie można jej edytować):AutorzyUżytkownicy pasujący do "%s" według funkcjiUżytkownicy mogą rejestrować się samodzielnie lub możesz dodawać ich do systemu, korzystając z tego formularza.Użytkownicy nie mogą obecnie rejestrować się samodzielnie, ale możesz dodawać ich do systemu przy pomocy tego formularza.Użytkownicy muszą być zarejestrowani i zalogowani, aby móc komentowaćZwykłe ustawienia dla artykułu:Poprawny XHTMLWartośćWersjaWersja %sWersja: %sZobaczZobacz %s wpisZobacz wpis %sZobacz wpisy: %sZobacz »Tryb podgląduObejrzyj wpisZobacz wszystkie wpisy oznaczone jako %sZobacz wszystkie wpisy oznaczone jako %sZobacz stronę »Zobacz wpis “%s”Zobacz wpis »Obejrzyj wpisy tego autoraZobacz wpisy dla %1$s %2$sZobacz stronę »Zobacz wpisWidocznyOdwiedź %sOdwiedź %sOdwiedź stronę autoraOdwiedź stronę wtyczkiOdwiedź swoją stronę i podziwiaj nowy nagłówek.WizualnyŚNie możemy odnaleźć tytułu na tej stronie.Zapisaliśmy pewne informacje o twoim koncie Blogger w twojej bazie danych WordPress. Wyczyszczenie tych informacji pozwoli ci zacząć od początku. Restart nie wpłynie na żadne wpisy, które już zostały zaimportowane. Jeśli podejmiesz próbę ponownego importu tego samego bloga, duplikaty wpisów zostaną pominięte w tym procesie.Udało się zalogować, niestety nie było tam żadnych blogów. Następnym razem spróbuj z innym kontem.Nie byliśmy w stanie uzyskać dostępu do twojego konta. Spróbuj jeszcze raz od początku.Strona WWWStrona WWW:Strona WWW: %1$s (IP: %2$s , %3$s)ŚrśrodaPierwszy dzień tygodnia to:WitajWitaj w WordPressWitaj w systemie WordPress. Mamy nadzieję (a nawet tego oczekujemy!), że uznasz ten system za niezwykle przydatny! Chcielibyśmy przedstawić ci - jako nowemu użytkownikowi systemu WordPress, który przeniósł się z DotClear - parę istotnych kwestii. Mamy nadzieję, że zapoznanie się z nimi ułatwi ci bezproblemową przesiadkę na nowy system.Witaj w systemie WordPress. Mamy nadzieję (a nawet tego oczekujemy !), że uznasz ten system za niezwykle przydatny! Chcielibyśmy przedstawić ci - jako nowemu użytkownikowi systemu WordPress, który przeniósł się z Textpattern - parę istotnych kwestii. Mamy nadzieję, że zapoznanie się z nimi ułatwi ci bezproblemową przesiadkę na nowy system.Witaj w WordPress. To jest twój pierwszy wpis. Zmień go lub usuń, a potem zacznij blogowanie!Witaj w słynnym 5-minutowym procesie instalacji WordPress! Możesz chcieć przejrzeć dokumentację w wolnym czasie. Jeśi nie, to po prostu podaj niezbędne informacje poniżej i będziesz na najlepszej drodze do stosowania najbardziej potężnej i elastycznej osobistej platformy publikacji na świecie.Chcesz dalszych kroków instalacji? Musimy cię rozczarować, to już koniec. :)Czego to nie robi:Co to robi:Co zrobić z wpisami i linkami, dodanymi przez tego użytkownika?OpublikowanyJeżeli treść, autor, adres URL, e-mail lub IP komentarza zawiera jedno z poniższych słów, komentarz zostanie przeniesiony do poczekalni. Wpisz każde słowo lub adres IP w nowej linii. Słowa mogą być częścią innych, np. „press” oznacza również „WordPress”.Jeżeli treść, autor, adres URL, e-mail lub IP komentarza zawiera jedno z poniższych słów, komentarz zostanie przeniesiony do poczekalni. Wpisz każde słowo lub adres IP w nowej linii. Słowa mogą być częścią innych, np. „press” oznacza również „WordPress”.Kiedy naciśniesz na poniższy przycisk, WordPress przygotuje dla ciebie plik XML, który możesz zapisać na swoim komputerze.Gdy publikujesz nowy wpis, WordPress poinformuje o tym poniższe serwisy aktualizacji. Żeby dowiedzieć się więcej o tej opcji, przeczytaj sekcję Update Services na stronach Codex. Wpisz każdy adres URL serwisu w nowej linii.Wciśnij 'OK', aby rozpocząć importowanie:Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%sDlaczego mój klucz może być niepoprawny?Widget'yWordPress › BłądInstalacja WordPress »Aktualizacja WordPress »Skryptozakładka WordPressPotwierdzenie WordPressBlog twórców WordPressZasoby systemu WordPressAdres WordPress (URL):WordPress został zainstalowany. Możesz teraz zalogować się, podając nazwę użytkownika "admin" oraz hasło "%2$s".WordPress zawiera TinyMCE, edytor WYSIWYG, który dobrze współpracuje z większością przeglądarek. Ma on duże możliwości, lecz także pewne ograniczenia. Wklejanie tekstu z innych edytorów tekstu może nie przynieść oczekiwanych rezultatów. Jeśli nie podoba ci się sposób pracy tego edytora, możesz go wyłączyć w sekcji Twój profil. Opcja ta znajduje się w menu administracyjnym pod działem Użytkownicy.WordPress nie powiadamia żadnych serwisów aktualizacji ze względu na ustawienia prywatności twojego bloga.Login WordPressWordPress poleca lepszą przeglądarkęWordPress ma kompresować publikacje na żądanie przeglądarek (gzip)Automatycznie poprawiaj nieprawidłowo zagnieżdżony XHTMLKlucz API z WordPress.comPublikujDodaj stronęDodaj wpisDodaj wpisPublikacjaOpcje publikacji wpisówPisanie pełną parąBłędna ścieżka: podana ścieżka do wpisów GM na serwerze nie istniejeBłędna ścieżka: podana ścieżka do plików GM na serwerze nie istniejeBłąd XML: %1$s w wierszu %2$sBłąd XML: %s w wierszu %dd/m/Y \<\b\r \/\> H:i:sd/m/Y H:id/m/Y H:i:sYahoo IM:TakWygląda na to, że WordPress został już zainstalowany. Aby zainstalować go ponownie, usuń najpierw stare tabele w bazie danych.Zamierzasz zaakceptować następujący komentarz:Zamierzasz właśnie przekonwertować wszystkie kategorie do tagów. Czy na pewno chcesz kontynuować?Zamierzasz ostatecznie usunąć wybrane komentarze (%s) 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz właśnie usunąć pole '%s' w tym wpisie. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć link nazwany'%s' prowadzący do %s. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz własnie usunąć stronę '%s'.'OK', aby usunąć lub 'Anuluj', aby przerwać.Zamierzasz właśnie usunąć kategorię '%s'. Wszystkie linki przejdą do kategorii '%s'. 'OK', aby usunąć lub 'Anuluj', aby przerwać.Zamierzasz właśnie usunąć kategorię '%s'. Wszystkie wpisy przejdą z niej do kategorii '%s' Wszystkie linki przejdą do kategorii '%s'. 'OK', aby usunąć lub 'Anuluj', aby przerwać.Zamierzasz usunąć następujący komentarz:Zamierzasz nieodwracalnie usunąć wybrane linki. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć komentarz dodany przez '%s'. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć komentarz dodany przez '%s'. Anuluj' aby zatrzymać, 'OK' aby usunąć.Zamierzasz usunąć ten komentarz, napisany przez '%s'. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć ten komentarz. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz właśnie usunąć szkic '%s' 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć tę stronę: '%s' 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć ten wpis: '%s' 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz usunąć ten wpis: '%s'. 'Anuluj', aby przerwać lub 'OK', aby usunąć.Zamierzasz oznaczyć wybrane komentarze (%s) jako spam 'Anuluj', aby cofnąć lub 'OK', aby oznaczyć.Zamierzasz oznaczyć ten komentarz wysłany przez '%s' jako spam 'Anuluj', aby przerwać lub 'OK', aby oznaczyć.' Zamierzasz oznaczyć jako spam następujący komentarz:Nie masz uprawnień do przebywania tutajNie masz uprawnień do zmiany autora strony jako ten użytkownik.Nie masz uprawnień do zmiany autora wpisu jako ten użytkownik.Nie masz uprawnień do tworzenia stron jako ten użytkownik.Nie masz uprawnień do tworzenia stron jako ten użytkownik.Nie masz uprawnień do tworzenia stron na tym blogu.Nie masz uprawnień do tworzenia wpisów i szkiców na tym blogu.Nie masz uprawnień do usuwania komentarzy do tego wpisu.Nie masz uprawnień, aby usunąć ten załącznik.Nie masz uprawnień do usunięcia tej strony.Nie masz uprawnień do usunięcia tego wpisu.Nie możesz edytować komentarzy do tego wpisu, więc nie możesz zaakceptować tego komentarza.Nie możesz edytować komentarzy do tego wpisu, więc nie możesz odrzucić akceptacji tego komentarza.Nie możesz edytować komentarzy do tego wpisu, więc nie możesz edytować i tego komentarza.Nie masz uprawnień do edytowania komentarzy do tego wpisu.Nie masz uprawnień do edytowania stron jako ten użytkownik.Nie masz uprawnień do edytowania wpisów jako ten użytkownik.Nie masz uprawnień do edytowania tej strony.Nie masz uprawnień do edytowania tego wpisu.Nie masz uprawnień do importu.Nie masz uprawnień do tworzenia wpisów jako ten użytkownik.Nie masz uprawnień do tworzenia wpisów jako ten użytkownik.Nie masz uprawnień do wysyłania plików na tę stronę.Nie masz uprawnień do wysyłania plików.Wysyłasz komentarze trochę za szybko. Zwolnij.Widzisz tę wiadomość, ponieważ motyw graficzny, którego obecnie używasz nie jest przystosowany do użycia widget'ów, tzn. nie ma pasków bocznych które możesz modyfikować z panelu administracyjnego. Aby uzyskac informacje na temat przystosowywania motywów graficznych do użycia widget'ów, zajrzyj do instrukcji na stronie automattic.com.Używasz wersji roboczej (%s). Super! Pamiętaj o aktualizacjach.Wybrana strona nie istnieje. Może została usunięta?Wybrany wpis nie istnieje. Może został usunięty?Możesz usunąć cały spam z bazy danych jednym kliknięciem. Tej operacji nie można cofnąć, więc upewnij się, że w spamie nie znalazły się przez pomyłkę wartościowe komentarze. Spam jest usuwany automatycznie po 15 dniach, więc nadgorliwość nie jest konieczna.Chwyć i przeciągaj widget'y na poniższy pasek boczny.Możesz znaleźć dodatkowe wtyczki do swojej strony w katalogu wtyczek WordPress.Dodatkowe motywy graficzne dla swojej strony znajdziesz w katalogu motywów graficznych WordPress. Aby zainstalować motyw graficzny, w większości przypadków wystarczy po prostu umieścić katalog motywu w katalogu wp-content/themes. Po udanej instalacji nowy motyw graficzny pojawi się na tej stronie.Aby przeczytać wszystkie komentarze do tego wpisu, odwiedź tę stronę:Aby przejrzeć wszystkie sygnały pingback do tego wpisu, odwiedź tę stronę:Aby przejrzeć wszystkie sygnały trackback do tego wpisu, odwiedź tę stronę:Możesz użyć tych znaczników: %sNie możesz tworzyć użytkowników.Nie możesz usunąć tego użytkownika.Nie możesz usuwać użytkowników.Nie możesz edytować tego użytkownika.Nie możesz edytować użytkowników.Nie możesz usunąć aktualnego użytkownika.Nie masz uprawnień do edycji tego użytkownika.Nie masz uprawnień do przesyłania plików.Nie masz wystarczających uprawnień do administrowania komentarzami.Nie masz wystarczających uprawnień do wejścia na tę stronę.Nie masz wystarczających uprawnień, aby edytować wtyczki tego bloga.Nie masz wystarczających uprawnień, aby edytować szablony tego bloga.Nie masz wystarczających uprawnień, aby edytować linki na tym blogu.Nie masz wystarczających uprawnień, by edytować motywy graficzne tego bloga.Nie masz wystarczających uprawnień, by to zrobić.System WordPress został już zainstalowany i skonfigurowany oraz przydzielona została nazwa użytkownika i hasło do jego administracji. Zapomnij te dane. Twoje dane logowania na Textpattern były inne, więc dlaczego nie mieć ich również tutaj? W tym celu importowaliśmy wszystkich twoich dotychczasowych użytkowników do systemu WordPress. Niestety to rozwiązanie ma jedną wadę: ponieważ zarówno Wordpress, jak i Textpattern używają silnego klucza do szyfrowania haseł, nie było możliwe ich odszyfrowanie. Przydzieliliśmy więc wszystkim użytkownikom tymczasowe hasła. Każdy użytkownik zachował swoją dotychczasową nazwę, ale jego hasło zostało zmienione na: password123. Zaloguj się i zamień je na coś lepszego.System WordPress został już zainstalowany i skonfigurowany oraz przydzielona została nazwa użytkownika i hasło do jego administracji. Zapomnij te dane. Twoje dane logowania na DotClear były inne, więc dlaczego nie mieć ich również tutaj? W tym celu importowaliśmy wszystkich twoich dotychczasowych użytkowników do systemu WordPress. Niestety to rozwiązanie ma jedną wadę: ponieważ zarówno Wordpress, jak i DotClear używają silnego klucza do szyfrowania haseł, nie było możliwe ich odszyfrowanie. Przydzieliliśmy więc wszystkim użytkownikom tymczasowe hasła. Każdy użytkownik zachował swoją dotychczasową nazwę, ale jego hasło zostało zmienione na: password123. Zaloguj się i zamień je na coś lepszego.Brak kategorii do konwertowania!Nie masz w tej chwili żadnego spamu w poczekalni. To musi być twój szczęśliwy dzień. :)Zamierzasz usunąć następujących użytkowników:Musisz wpisać klucz API z WordPress.com, aby zadziałało.Musisz się zalogować, żeby móc dodawać komentarze.Musisz podać adres pliku OPML. Wciśnij przycisk 'Wstecz' w przeglądarce i spróbuj ponownie.Zaktualizuj swój plik .htaccess.Twój komentarzTwoje ustawienia konfiguracyjne DotClear wyglądają następująco:Twoje szkice:Twój obrazek nagłówkaTwój profilTwój profil i opcje osobisteTwoje ustawienia konfiguracyjne Textpattern wyglądają następująco:Twój WordPress %s jest nieaktualny. Zaktualizuj.Twoja baza danych WordPress została zaktualizowana!Twoja baza danych WordPress jest już aktualna!Twoja baza danych WordPress jest nieaktualna i musi zostać zaktualizowana, zanim będzie można kontynuować.Twój adres e-mail:Twój klucz został wyczyszczony.Twój klucz został zweryfikowany. Miłego blogowania!Twoje ostatnie wpisyNie masz wystarczających uprawnień, aby móc sprawdzać komentarze.Twój nowy, świeżutki blog WordPress został właśnie założony pod adresem: %1$s Możesz zalogować się jako administrator używając następujących danych: Użytkownik: %2$s Hasło: %3$s Mamy nadzieje, że będziesz się świetnie bawił ze swoim nowym blogiem. Wielki dzięki! --Team WordPress http://wordpress.org/ Twoja sesja wygasła.Twój motyw graficzny bedzie wyświetlał domyślny pasek boczny, jeśli pozostawisz to pole puste. Przeciągnięcie widget'ów do tego pola spowoduje zastąpienie domyślnego paska bocznego przez zmodyfikowany.Różnica czasu dla twojej strefy czasowej, np. 1 dla Polski.[%1$s] Komentarz do wpisu: "%2$s"[%1$s] Pingback do wpisu: "%2$s"[%1$s] Prośba o sprawdzenie komentarza: "%2$s"[%1$s] TrackBack do wpisu: "%2$s"[%s] Rejestracja nowego użytkownika[%s] Utrata/zmiana hasła[%s] Ustawianie nowego hasła[%s] Twoje nowe hasło[%s] Twoja nazwa użytkownika i hasłopolecenie ABORTinformacjeznajomyprzed południemmój inny adres internetowyuwierzytelnianie APOP nie powiodło sięzablokowany przezodprzez %sprzez innych autorówanulujdzieckokliknij tutajkliknij aby %toggle% ten blokwciśnik klawisz i przeciągnij żeby przesunąć ten blokzamknąćzamknij znacznikimiejscowywspółpracownikkolega po fachupołączenie nie istniejepołączenie nie zostało nawiązanekontaktobiekt westchnieńrandkaw ciągu %se-mail: %sedytujwpis # %s : %s : napisany przez %srodzinaprzyjacielprzyjaźńH:ilokalizacja geograficznawitaj-swieciegodz.tożsamośćzignorowane %d istniejące wcześniej komentarzezaimportowano %d komnetarz(y)trwa importowanie wpisów, komentarzy i karmy...trwa importowanie użytkowników...w “%s”krewnyliniilinkisprawdzanieWyszukiwanie “%s”spotkany osobiściemuzamy-hacks.php (plik z rozwiązaniami indywidualnymi)sąsiadnie wysłano danych logowaniabrakotworzyćlubrodzickontakt fizycznypo południuwpisy(-ów)kontakt zawodowyzarejestrowany usunięty użytkownik %s na poziomie 0relrel:uczuciarodzeństwospamowe komentarzepartner życiowygłębokie uczucieużyj kursorów aby przesunąć ten blokużytkownik %sużytkownik %s...zobaczwp-content/plugins/0000755013707600007620000000000010706137474012350 5ustar wwwwp-content/plugins/akismet/0000755013707600007620000000000010706137424014000 5ustar wwwwp-content/plugins/akismet/akismet.gif0000644013707600007620000000533110473115264016125 0ustar wwwGIF89ax2}|ϋތ~рӁԉ܈ۅ؄ׇڐ㎭Ꭼ݀Ҋ|҃ՆهقՃz{Ώ}Ѝ⎬Ꮽ〉ߍ~}ϑ䌪~Њшۄ։܉ۂԆفԐ゠Յ؊܁ӆ؈ڃy̅ׄג䒱{{zz|π싩އyxy咰등xڋՙ⋦Ԙᒮܓz̐ئъҗ蔰ݞ薰獩ִ앰ݗ쉤ҌՖ䏪ؒۖ䐫㋥ԙތ֑ꓯ݌ҍ똲!,x2S H*\ȰÇp9Eŋ3jȱǏ Oq /lZɲ˗0cʜI͛C,+7 J(͜|A2QH-Xj"ׯ^ BhӦM¶m"p>Kx7߿ ѨP$THSuAU[vj3eWy$>V ukLHʔf9͝~hҥN#G@bkƬl7Y߿'2nq㣓^ҧSO]sI॰[Wyǩj}k@}U(Abh†&$) *j 8tw s=a|g}jȡ ㏕|`-؞D(ah_!X*te)J橈J6ǤPFy#Ue[䩧P@#آ` .)cmJy!Vcv޹9^Zriy(P*h*Pb鬛`9`4&5#B EZ-*VK(]Raj2;B9Xn +üBfHJJn2@ 4/+'"/.\m /+;r&^Y&q~lԒl1-lQD҆16,pЂs.,A M`;d/hg{.,?s/|6Jmvg ;^8j<-tkw^뽷} x` .z8N:2 k=9Dp9晗y{n3P?C?^@ a'];ٷy^=@ 0Kz,>;`/w}O>9ЃGj}*k? ~?`{Ab &x]}ۜg? 1 v!v 7p@ To~,Ğ a5$`s?g.zq N0x1hRV!E/ы5cu;jeTWB7!9wXt̸= ѐ`"H,ހ\$HI>bp,)@ZR z' Jэ)Q.J$,/9K[ЌV@r *D a)b&\&3gJդ 9Ӟ!E9ER ,&:[NK6g( Vʂ DbrTAm9RV.8CSzHu)T@YSuiWordPress.com API key to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <?php akismet_counter(); ?> in your template. Version: 2.0.2 Author: Matt Mullenweg Author URI: http://photomatt.net/ */ // If you hardcode a WP.com API key here, all key config screens will be hidden $wpcom_api_key = ''; function akismet_init() { global $wpcom_api_key, $akismet_api_host, $akismet_api_port; if ( $wpcom_api_key ) $akismet_api_host = $wpcom_api_key . '.rest.akismet.com'; else $akismet_api_host = get_option('wordpress_api_key') . '.rest.akismet.com'; $akismet_api_port = 80; add_action('admin_menu', 'akismet_config_page'); } add_action('init', 'akismet_init'); if ( !function_exists('wp_nonce_field') ) { function akismet_nonce_field($action = -1) { return; } $akismet_nonce = -1; } else { function akismet_nonce_field($action = -1) { return wp_nonce_field($action); } $akismet_nonce = 'akismet-update-key'; } function akismet_config_page() { if ( function_exists('add_submenu_page') ) add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf'); } function akismet_conf() { global $akismet_nonce, $wpcom_api_key; if ( isset($_POST['submit']) ) { if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(__('Cheatin’ uh?')); check_admin_referer( $akismet_nonce ); $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] ); if ( empty($key) ) { $key_status = 'empty'; $ms[] = 'new_key_empty'; delete_option('wordpress_api_key'); } else { $key_status = akismet_verify_key( $key ); } if ( $key_status == 'valid' ) { update_option('wordpress_api_key', $key); $ms[] = 'new_key_valid'; } else if ( $key_status == 'invalid' ) { $ms[] = 'new_key_invalid'; } else if ( $key_status == 'failed' ) { $ms[] = 'new_key_failed'; } if ( isset( $_POST['akismet_discard_month'] ) ) update_option( 'akismet_discard_month', 'true' ); else update_option( 'akismet_discard_month', 'false' ); } if ( $key_status != 'valid' ) { $key = get_option('wordpress_api_key'); if ( empty( $key ) ) { if ( $key_status != 'failed' ) { if ( akismet_verify_key( '1234567890ab' ) == 'failed' ) $ms[] = 'no_connection'; else $ms[] = 'key_empty'; } $key_status = 'empty'; } else { $key_status = akismet_verify_key( $key ); } if ( $key_status == 'valid' ) { $ms[] = 'key_valid'; } else if ( $key_status == 'invalid' ) { delete_option('wordpress_api_key'); $ms[] = 'key_empty'; } else if ( !empty($key) && $key_status == 'failed' ) { $ms[] = 'key_failed'; } } $messages = array( 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')), 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')), 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')), 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')), 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')), 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (Get your key.)'), 'http://wordpress.com/profile/')), 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')), 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.'))); ?>

    Akismet will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at WordPress.com.'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?>

    (What is this?'); ?>)

    ".__('Akismet is not active.')." ".sprintf(__('You must enter your WordPress.com API key for it to work.'), "plugins.php?page=akismet-key-config")."

    "; } add_action('admin_footer', 'akismet_warning'); return; } // Returns array with headers in $response[0] and body in $response[1] function akismet_http_post($request, $host, $path, $port = 80) { global $wp_version; $http_request = "POST $path HTTP/1.0\r\n"; $http_request .= "Host: $host\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 | Akismet/2.0\r\n"; $http_request .= "\r\n"; $http_request .= $request; $response = ''; if( false != ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) { 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); } return $response; } function akismet_auto_check_comment( $comment ) { global $akismet_api_host, $akismet_api_port; $comment['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); $comment['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $comment['referrer'] = $_SERVER['HTTP_REFERER']; $comment['blog'] = get_option('home'); $ignore = array( 'HTTP_COOKIE' ); foreach ( $_SERVER as $key => $value ) if ( !in_array( $key, $ignore ) ) $comment["$key"] = $value; $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); if ( 'true' == $response[1] ) { add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';')); update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); $post = get_post( $comment['comment_post_ID'] ); $last_updated = strtotime( $post->post_modified_gmt ); $diff = time() - $last_updated; $diff = $diff / 86400; if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) die; } akismet_delete_old(); return $comment; } function akismet_delete_old() { global $wpdb; $now_gmt = current_time('mysql', 1); $wpdb->query("DELETE FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'"); $n = mt_rand(1, 5000); if ( $n == 11 ) // lucky number $wpdb->query("OPTIMIZE TABLE $wpdb->comments"); } function akismet_submit_nonspam_comment ( $comment_id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'"); if ( !$comment ) // it was deleted return; $comment->blog = get_option('home'); $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port); } function akismet_submit_spam_comment ( $comment_id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'"); if ( !$comment ) // it was deleted return; if ( 'spam' != $comment->comment_approved ) return; $comment->blog = get_option('home'); $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port); } add_action('wp_set_comment_status', 'akismet_submit_spam_comment'); add_action('edit_comment', 'akismet_submit_spam_comment'); add_action('preprocess_comment', 'akismet_auto_check_comment', 1); function akismet_spam_count() { global $wpdb, $comments; $count = wp_cache_get( 'akismet_spam_count', 'widget' ); if ( false === $count ) { $count = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'"); wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 ); } return $count; } function akismet_manage_page() { global $wpdb, $submenu; $count = sprintf(__('Akismet Spam (%s)'), akismet_spam_count()); if ( isset( $submenu['edit-comments.php'] ) ) add_submenu_page('edit-comments.php', __('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught' ); elseif ( function_exists('add_management_page') ) add_management_page(__('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught'); } function akismet_caught() { global $wpdb, $comment, $akismet_caught, $akismet_nonce; akismet_recheck_queue(); if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) { check_admin_referer( $akismet_nonce ); if ( function_exists('current_user_can') && !current_user_can('moderate_comments') ) die(__('You do not have sufficient permission to moderate comments.')); $i = 0; foreach ($_POST['not_spam'] as $comment): $comment = (int) $comment; if ( function_exists('wp_set_comment_status') ) wp_set_comment_status($comment, 'approve'); else $wpdb->query("UPDATE $wpdb->comments SET comment_approved = '1' WHERE comment_ID = '$comment'"); akismet_submit_nonspam_comment($comment); ++$i; endforeach; $to = add_query_arg( 'recovered', $i, $_SERVER['HTTP_REFERER'] ); wp_redirect( $to ); exit; } if ('delete' == $_POST['action']) { check_admin_referer( $akismet_nonce ); if ( function_exists('current_user_can') && !current_user_can('moderate_comments') ) die(__('You do not have sufficient permission to moderate comments.')); $delete_time = addslashes( $_POST['display_time'] ); $nuked = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); wp_cache_delete( 'akismet_spam_count', 'widget' ); $to = add_query_arg( 'deleted', 'all', $_SERVER['HTTP_REFERER'] ); wp_redirect( $to ); exit; } if ( isset( $_GET['recovered'] ) ) { $i = (int) $_GET['recovered']; echo '

    ' . sprintf(__('%1$s comments recovered.'), $i) . "

    "; } if (isset( $_GET['deleted'] ) ) echo '

    ' . __('All spam deleted.') . '

    '; if ( isset( $GLOBALS['submenu']['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; ?>

    %1$s spam for you since you first installed it.'), number_format($count) ); ?>

    '.__('You have no spam currently in the queue. Must be your lucky day. :)').'

    '; echo '
    '; } else { echo '

    '.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.').'

    '; ?>
       

    '.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.').'

    '; ?> escape($_POST['s']); $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE (comment_author LIKE '%$s%' OR comment_author_email LIKE '%$s%' OR comment_author_url LIKE ('%$s%') OR comment_author_IP LIKE ('%$s%') OR comment_content LIKE ('%$s%') ) AND comment_approved = 'spam' ORDER BY comment_date DESC"); } else { if ( isset( $_GET['apage'] ) ) $page = (int) $_GET['apage']; else $page = 1; if ( $page < 2 ) $page = 1; $start = ( $page - 1 ) * 50; $end = $start + 50; $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end"); $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'" ); } if ($comments) { ?> 50 ) { $total_pages = ceil( $total / 50 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1; $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : if ( $page == $page_num ) : $r .= "$page_num\n"; else : $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? '' : $page_num; $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; $in = false; endif; endif; endfor; } if ( ( $page ) * 50 < $total || -1 == $total ) { $args['apage'] = $page + 1; $r .= '' . "\n"; } echo "

    $r

    "; ?>
    " id="akismetsearch">

      comment_date); $post = get_post($comment->comment_post_ID); $post_title = $post->post_title; if ($i % 2) $class = 'class="alternate"'; else $class = ''; echo "\n\t
    • "; ?>

      comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

      — [ comment_post_ID); $post_title = wp_specialchars( $post->post_title, 'double' ); $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; ?> ]

    50 ) { $total_pages = ceil( $total / 50 ); $r = ''; if ( 1 < $page ) { $args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1; $r .= '' . "\n"; } if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) { for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) : if ( $page == $page_num ) : $r .= "$page_num\n"; else : $p = false; if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : $args['apage'] = ( 1 == $page_num ) ? '' : $page_num; $r .= '' . ( $page_num ) . "\n"; $in = true; elseif ( $in == true ) : $r .= "...\n"; $in = false; endif; endif; endfor; } if ( ( $page ) * 50 < $total || -1 == $total ) { $args['apage'] = $page + 1; $r .= '' . "\n"; } echo "

    $r

    "; } ?>

       

    '.__('Spam').''; global $submenu; if ( isset( $submenu['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; echo '

    '.sprintf(__('Akismet has protected your site from %3$s spam comments.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format($count) ).'

    '; } add_action('activity_box_end', 'akismet_stats'); if ( 'moderation.php' == $pagenow ) { function akismet_recheck_button( $page ) { global $submenu; if ( isset( $submenu['edit-comments.php'] ) ) $link = 'edit-comments.php'; else $link = 'edit.php'; $button = "" . __('Recheck Queue for Spam') . ""; $page = str_replace( '
    ', '
    ' . $button, $page ); return $page; } if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'" ) ) ob_start( 'akismet_recheck_button' ); } function akismet_recheck_queue() { global $wpdb, $akismet_api_host, $akismet_api_port; if ( !isset( $_GET['recheckqueue'] ) ) return; $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A ); foreach ( $moderation as $c ) { $c['user_ip'] = $c['comment_author_IP']; $c['user_agent'] = $c['comment_agent']; $c['referrer'] = ''; $c['blog'] = get_option('home'); $id = $c['comment_ID']; $query_string = ''; foreach ( $c as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); if ( 'true' == $response[1] ) { $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = 'spam' WHERE comment_ID = $id" ); } } wp_redirect( $_SERVER['HTTP_REFERER'] ); exit; } function akismet_check_db_comment( $id ) { global $wpdb, $akismet_api_host, $akismet_api_port; $id = (int) $id; $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A ); if ( !$c ) return; $c['user_ip'] = $c['comment_author_IP']; $c['user_agent'] = $c['comment_agent']; $c['referrer'] = ''; $c['blog'] = get_option('home'); $id = $c['comment_ID']; $query_string = ''; foreach ( $c as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); return $response[1]; } // This option causes tons of FPs, was removed in 2.1 function akismet_kill_proxy_check( $option ) { return 0; } add_filter('option_open_proxy_check', 'akismet_kill_proxy_check'); // Widget stuff function widget_akismet_register() { if ( function_exists('register_sidebar_widget') ) : function widget_akismet($args) { extract($args); $options = get_option('widget_akismet'); $count = number_format(get_option('akismet_spam_count')); $text = __('%d spam comments have been blocked by Akismet.'); ?>

    wp-content/plugins/disable-wordpress-plugin-updates/0000755013707600007620000000000010706137424020733 5ustar wwwwp-content/plugins/disable-wordpress-plugin-updates/disable-plugin-updates.php0000644013707600007620000000214410700552240025776 0ustar wwwwp-content/plugins/disable-wordpress-plugin-updates/readme.txt0000644013707600007620000000356310700552240022727 0ustar www=== Disable WordPress Plugin Updates === Contributors: johnbillion Tags: disable, plugin, updates Requires at least: 2.3 Tested up to: 2.3 Stable tag: trunk Disables the plugin update checking and notification system. == Description == Completely disables the plugin update checking system which is a new feature in WordPress 2.3. The plugin prevents WordPress from checking for updates, and prevents any notifications from being displayed on the Plugins page. Ideal for administrators of multiple WordPress installations. = Please note! = It's important that you keep your WordPress plugins up to date. If you don't, your blog or website could be susceptible to security vulnerabilities or performance issues. If you use this plugin, you must make sure you keep yourself up to date with new releases of your active plugins and update them as new versions are released. == Installation == This plugin is only for WordPress 2.3 or later. Earlier versions of WordPress did not have the plugin update notification system, therefore do not need this plugin. 1. Unzip the ZIP file and drop the folder straight into your `wp-content/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. == Frequently Asked Questions == = Why would I want to disable the plugin update system? = Most people will not want to (and should not) disable this feature. It's a fantastic addition to WordPress and I'm fully in support of it. However, administrators who maintain multiple installations of WordPress on behalf of other people (eg. clients) may not want plugin update notifications to be shown to the users of these installations. This plugin is for them. = Can I disable the WordPress core update notifications too? = Yes. Please see the [Disable WordPress Core Update](http://wordpress.org/extend/plugins/disable-wordpress-core-update/) plugin. wp-content/plugins/hello.php0000644013707600007620000000375010667076612014173 0ustar wwwHello, Dolly in the upper right of your admin screen on every page. Author: Matt Mullenweg Version: 1.5 Author URI: http://photomatt.net/ */ // These are the lyrics to Hello Dolly $lyrics = "Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong We feel the room swayin' While the band's playin' One of your old favourite songs from way back when So, take her wrap, fellas Find her an empty lap, fellas Dolly'll never go away again Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong We feel the room swayin' While the band's playin' One of your old favourite songs from way back when Golly, gee, fellas Find her a vacant knee, fellas Dolly'll never go away Dolly'll never go away Dolly'll never go away again"; // Here we split it into lines $lyrics = explode("\n", $lyrics); // And then randomly choose a line $chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); // This just echoes the chosen line, we'll position it later function hello_dolly() { global $chosen; echo "

    $chosen

    "; } // Now we set that function up to execute when the admin_footer action is called add_action('admin_footer', 'hello_dolly'); // We need some CSS to position the paragraph function dolly_css() { echo " "; } add_action('admin_head', 'dolly_css'); ?>wp-content/themes/0000755013707600007620000000000010706137452012150 5ustar wwwwp-content/themes/classic/0000755013707600007620000000000010706137424013570 5ustar wwwwp-content/themes/classic/comments-popup.php0000644013707600007620000001170510667076612017302 0ustar www <?php echo get_option('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?>

    RSS feed for comments on this post."); ?>

    ping_status) { ?>

    URL to TrackBack this entry is:"); ?>

    post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?>
    1. @

    comment_status) { ?>

    HTML allowed:"); ?>

    '.$user_identity.''); ?>

    " />


    " />

    ID); ?>

    Powered by Wordpress"),__("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

    wp-content/themes/classic/comments.php0000644013707600007620000000656510666352010016135 0ustar wwwpost_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>

    ">»

    1. @

    RSS feed for comments on this post.')); ?> URL'); ?>

    logged in to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?>

    '.$user_identity.''); ?>

    ID); ?>

    wp-content/themes/classic/footer.php0000644013707600007620000000067610706110312015573 0ustar www

    WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?> & Polski Wordpress

    wp-content/themes/classic/functions.php0000644013707600007620000000036510616704562016320 0ustar www '
  • ', 'after_widget' => '
  • ', 'before_title' => '', 'after_title' => '', )); ?> wp-content/themes/classic/header.php0000644013707600007620000000244010553254502015526 0ustar www > <?php bloginfo('name'); ?><?php wp_title(); ?>

    wp-content/themes/classic/index.php0000644013707600007620000000201010632074622015377 0ustar www ',''); ?>

    @

    wp-content/themes/classic/rtl.css0000644013707600007620000000372510650435210015102 0ustar www/* Based on Arabic (RTL) version of WordPress Classic theme, converted by Serdal (Serdal.com) */ #menu ul ul, #wp-calendar caption, #wp-calendar #prev a { text-align: right; } #wp-calendar #next a, .feedback { text-align: left; } blockquote { border-left: 0; border-right: 5px solid #ccc; margin-left: auto; margin-right: 1.5em; padding-left: 0; padding-right: 5px; } body { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } h2 { font: 95% 'Al Bayan', 'Traditional Arabic', "Times New Roman", Times, serif; } p, li, .feedback { font: 90%/175% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; text-align: justify; } acronym, abbr, span.caps, h2, p, li, #header, #menu ul li, #menu ul ul li, #wp-calendar td, .feedback, .meta, .meta a { letter-spacing: normal; } #commentlist li ul { border-left: 0; border-right: 1px solid #ddd; } #content { margin: 30px 3em 0 13em; padding-right: 0; padding-left: 60px; } #header { border-left: solid 1px #9a9; border-right: solid 1px #565; font: normal normal 230% 'Al Bayan', 'Traditional Arabic', 'Times New Roman', Times, serif; padding: 15px 60px 15px 10px; } #menu { border-left: 0; border-right: 1px dotted #ccc; padding: 20px 30px 10px 0; right: auto; left: 2px; } #menu form { margin: 0 13px 0 0; } #menu ul { padding-left: 0; padding-right: 3px; } #menu ul li { font: normal normal 110% 'Geeza Pro', Tahoma, 'Times New Roman', Times, serif; } #menu ul ul li { font: normal normal 12px/115% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; padding-left: 0; padding-right: 12px; } #menu ul ul ul.children { padding-left: 0; padding-right: 4px; } #wp-calendar #next a { padding-right: 0; padding-left: 10px; } #wp-calendar #prev a { padding-left: 0; padding-right: 10px; } #wp-calendar td { font: normal normal 12px 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } wp-content/themes/classic/screenshot.png0000644013707600007620000002033410275341062016451 0ustar wwwPNG  IHDR,ExgAMA7tEXtSoftwareAdobe ImageReadyqe<`PLTE̮ȼЮ؝dacЭߣ򦠥~urxzwD IDATx]e J4_¤}w{;('Eq@xKK}:=R|.לseͻG`udoοR옹^tYNp4σp~?,-gKAQPOP@G-2. m׻$j:k7dzݣF٩Un?XGydݥ{Z&qa!Xݭ"3q{$w [sy-/G7;G[De5d/iO!Ҟ8]),UF;k^o "X.ݕ0wZD^=K>VW_w*ଗgCp޿k$ 6lO]%%ڵ@lQR(1U=] +z~sRG&>u/eԷC varHlg=)3^@w_Z?i?Kȫd QB$_5}ϵ]s!.ġha{;xσx+`1*[`!U\)Ԡv'QEG\E1]VewDZIR\HpoH.t\=5DꪫƏ4׫kS@uFXF2oX r+T]5e;]wnpp_#(b7|!XNw"V=R{GT `5&WRI0313/U)~X=j"!omaM6DR6j k8l6 AR, mUEThGzE 4ք,uW+hZ>BUO1Od.sҢ!%!q<M_\6MTـ~^PZJ&d_8ʖ8ELjaX!W߭ډN T<fٯzfqك-t3%]@>GA]IRLL,FDT'GB+@crAcggOvuuuuJRѱ+ER>j\D ):||< vըZ!+.9S#8'[6X>Xf929W[LQ5X?Xm4!6+eZ;qR! ՐI}@~}qnIF߾Ux&Y" &lMZڅJQ:<|2:(4vK0@%1Q| )XSHl!RJ z?J''%4)`c $< މ#zn`XXXXF׳,60"&T{6[B ^ %.@Qh7ۇo=I yو/_(>>@oR Q1#2}}[O`lDV\G0&E5W xzpGIꬅϋ[ꅃ)0*l!|RBoKS"zsY-X'q;TCP6eAJ.uOqJicu0" NV׻*ۚK aΤd H:: ߢBq6vtL4/.iR1)[ C5 FSѬ/+~Gq8 }݊}ow*EL`$K-ӗf4gר;8a@e%p$eDa\& 2,lHd12srzE@UDBD7,3&ifEIny^0ufCdl%Lζ\䌳V1}Igрc~$AaXKd9yo"#gBii/̷u^0]԰`k>B,W:2 Cd.Rf EA!ofRMoL4xC۬Y_ [MYmˊcg6yxU3ի=nև_kiHi?]ï]w*-mL[nS[m -52ZPb Aʏ+0Gn樶'D,}-z6?T7 ?:.z7ڕ5< T9mXl]ᴌ,t 6Cs.Os/Ow0x;3Ϯ |-ŀ-Oٔ22{E}, V_eUqs{D[0晱*:6~+QV_/ǫ_xgC?-65ceOnச:$hi]S= F4ܜW'W}ג0QiŲ fŇ`:H `@ ’--k|#gQّ/Lq6JGиC\͵=4Bɜ%Bq~~YSwX mFȦڝ 54-i7/vg͢ _eR(A,&]/YSLlOYsGr8х̪&:ry: b#iZbϪv9Bt&z K7y;,l7*czIL(K([-14t$NQD:GCDR?8;-~_q_w-[m.nTrjlrp>8v4:OWHִ7v/vQ>z3~wWJ}].Wo+z, X͍dJ lؖ15v1׼µnK5Xŷ#mGV&x뜉=TmEi|h%ؕFchgIf\ P5G^T_⹸o)Ymk?ӸYۙu2y|6lX:h`ÅN'ZDg7eaXpBV: w|G`GDid*Ք '@rìD `fI6: KS$ /$Cm鏻k)isO@ה<&CSv3UR^@+d`} c>^t90N"FOOuQJ2m:;GhĒ)LԸI`=900k;$|Wj+B23QR`=QeMۋո4iWqw+jO<U#ڑ֧|d.o-Va+%,jr1_Ce^J"X׶|>ؼ*.[A]um9U sSUA7_~#*u@]7oNK5s T.NΡdp|&9ֽ'O|/hazY&Fwk'z=e.$Y|,]Ss$)_@ێDEdl?5B*Bjԏ */+` md[4^a zҧ:+rgF2O~ XOthFԢ6eP<;`6ƬA̬KpmcYx 5:h=\۶oDO^!{}VCP~<"eا:ܟG$ۗ[ht_f;V) 05%UZBu']N"+gOe1]I*ds%]ZsG5Ffj d,.RM44e~uh9H1@Bb"kUk-%)j"Tx rF.GAмj Cxz&Y mžĴ'Fp o}mZ*s |Ln`kgG)$یd4Sjtzr[{[}^F 8dD[b[$MZ2;mmX ^m2O |U9SGyMG7zFOUIeXʧO/|vbh= UXS#0B x駵g뷘<1]۫R1l?6v'k[C`_}k"Ӆ t]$ c65iP<$H2+?n8iy[pzZ5=q e8ӪOx%Ӱ,;Xg5OdY*gэD\r@1/nͪ1h7ltZ |Z kPMz:M.;v N<~ 9 'c?E dqѶ\c6d`}<+{D5.}@1/1RAeĤ,gx]ӌIz&Sǁ;C]d XyV&}<^}юG fl=Gg%`Lc 47Jivrerd.;Lf7m4L`9(묲?zI1{q{mb^-zq;:9`^_ƿ,d~YV).>`CKݳMx#P^hOȏ5A #5㻒Emq+[ (f?,?6 fvg#/6{zEVT|M9V: =,ˣ ::x+5csxA^/u"yEhLr&Ke,bВqA brj09]-`:zm86@U3A*X2KP=cdqu)/!̸jKsq[m 'Ai!cIͯl&rOVt|b҇zhBKMOJN!4)jOFLQF&73ƢB,FNpST{t 53 34'XU2jv&V3n y8 EQ:9H:+uX?ܤj [ qJQvtSd$fOSTvXݫfXj{3, %LRH"MN)ctQ0BZcFR|ۺ3xy;i+GQڧ^ Q,__XZjXdGm4~aHV*1 Y j=e^)TF|jC?W^11Ňn{ޏ^hԻ|3˸W<`e8vsX%?iݓtC37[ϰ&RwQV76 ާvЧJ ~W KWX2`} V!EX9Ŭ*tR_Kj`,{d~}/#jhb OV3$FMf,#G!ٯVC;DVaH <:'*vLKR\6緈Xjw/hbf02_\GUD`]V3cH,dmߖ}vuHJlGI]@/OkW$ϫӏ!pxɤy0VhcAezԈ4Ml9HgĬb!g爍؃ٵ#gτV2&L{1vz Y`qCREhD'&eM4lut'/5`x glTX.8[ V3`605R&|߷b/I$_uR\JyHm:/kA` w, MtNFC9S5W$;X/c +Y!@!HrIEG"! P>?&W͉6ծlsgSc۪ҷM0<\B%9@< wp-content/themes/classic/style.css0000644013707600007620000001136310616722136015446 0ustar www/* Theme Name: WordPress Classic Theme URI: http://wordpress.org/ Description: The original WordPress theme that graced versions 1.2.x and prior. Version: 1.5 Author: Dave Shea Default WordPress by Dave Shea || http://mezzoblue.com Modifications by Matthew Mullenweg || http://photomatt.net This is just a basic layout, with only the bare minimum defined. Please tweak this and make it your own. :) */ a { color: #675; } a img { border: none; } a:visited { color: #342; } a:hover { color: #9a8; } acronym, abbr { border-bottom: 1px dashed #333; } acronym, abbr, span.caps { font-size: 90%; letter-spacing: .07em; } acronym, abbr { cursor: help; } blockquote { border-left: 5px solid #ccc; margin-left: 1.5em; padding-left: 5px; } body { background: #fff; border: 2px solid #565; border-bottom: 1px solid #565; border-top: 3px solid #565; color: #000; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; margin: 0; padding: 0; } cite { font-size: 90%; font-style: normal; } h2 { border-bottom: 1px dotted #ccc; font: 95% "Times New Roman", Times, serif; letter-spacing: 0.2em; margin: 15px 0 2px 0; padding-bottom: 2px; } h3 { border-bottom: 1px dotted #eee; font-family: "Times New Roman", Times, serif; margin-top: 0; } ol#comments li p { font-size: 100%; } p, li, .feedback { font: 90%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: -1px; } /* classes used by the_meta() */ ul.post-meta { list-style: none; } ul.post-meta span.post-meta-key { font-weight: bold; } .credit { background: #90a090; border-top: 3px double #aba; color: #fff; font-size: 11px; margin: 10px 0 0 0; padding: 3px; text-align: center; } .credit a:link, .credit a:hover { color: #fff; } .feedback { color: #ccc; text-align: right; clear: both; } .meta { font-size: .75em; } .meta li, ul.post-meta li { display: inline; } .meta ul { display: inline; list-style: none; margin: 0; padding: 0; } .meta, .meta a { color: #808080; font-weight: normal; letter-spacing: 0; } .storytitle { margin: 0; } .storytitle a { text-decoration: none; } #commentform #author, #commentform #email, #commentform #url, #commentform textarea { background: #fff; border: 1px solid #333; padding: .2em; } #commentform textarea { width: 100%; } #commentlist li ul { border-left: 1px solid #ddd; font-size: 110%; list-style-type: none; } #content { margin: 30px 13em 0 3em; padding-right: 60px; } #header { background: #90a090; border-bottom: 3px double #aba; border-left: 1px solid #9a9; border-right: 1px solid #565; border-top: 1px solid #9a9; font: italic normal 230% 'Times New Roman', Times, serif; letter-spacing: 0.2em; margin: 0; padding: 15px 10px 15px 60px; } #header a { color: #fff; text-decoration: none; } #header a:hover { text-decoration: underline; } #menu { background: #fff; border-left: 1px dotted #ccc; border-top: 3px solid #e0e6e0; padding: 20px 0 10px 30px; position: absolute; right: 2px; top: 0; width: 11em; } #menu form { margin: 0 0 0 13px; } #menu input#s { width: 80%; background: #eee; border: 1px solid #999; color: #000; } #menu ul { color: #ccc; font-weight: bold; list-style-type: none; margin: 0; padding-left: 3px; text-transform: lowercase; } #menu ul li { font: italic normal 110% 'Times New Roman', Times, serif; letter-spacing: 0.1em; margin-top: 10px; padding-bottom: 2px; /*border-bottom: dotted 1px #ccc;*/ } #menu ul ul { font-variant: normal; font-weight: normal; line-height: 100%; list-style-type: none; margin: 0; padding: 0; text-align: left; } #menu ul ul li { border: 0; font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: 0; margin-top: 0; padding: 0; padding-left: 12px; } #menu ul ul li a { color: #000; text-decoration: none; } #menu ul ul li a:hover { border-bottom: 1px solid #809080; } #menu ul ul ul.children { font-size: 142%; padding-left: 4px; } #wp-calendar { border: 1px solid #ddd; empty-cells: show; font-size: 14px; margin: 0; width: 90%; } #wp-calendar #next a { padding-right: 10px; text-align: right; } #wp-calendar #prev a { padding-left: 10px; text-align: left; } #wp-calendar a { display: block; text-decoration: none; } #wp-calendar a:hover { background: #e0e6e0; color: #333; } #wp-calendar caption { color: #999; font-size: 16px; text-align: left; } #wp-calendar td { color: #ccc; font: normal 12px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; letter-spacing: normal; padding: 2px 0; text-align: center; } #wp-calendar td.pad:hover { background: #fff; } #wp-calendar td:hover, #wp-calendar #today { background: #eee; color: #bbb; } #wp-calendar th { font-style: normal; text-transform: capitalize; } wp-content/themes/default/0000755013707600007620000000000010706137422013571 5ustar wwwwp-content/themes/default/404.php0000644013707600007620000000025310166414566014620 0ustar www

    Error 404 - Not Found

    wp-content/themes/default/archive.php0000644013707600007620000000462610674035064015736 0ustar www

    Archive for the ‘’ Category

    Posts Tagged ‘

    Archive for

    Archive for

    Archive for

    Author Archive

    Blog Archives

    Not Found

    wp-content/themes/default/archives.php0000644013707600007620000000054010530000006016063 0ustar www

    Archives by Month:

    Archives by Subject:

    wp-content/themes/default/attachment.php0000644013707600007620000000610110674035064016433 0ustar www
    ID, true, array(450, 800)); // This also populates the iconsize for the next line ?> ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>

    post_parent); ?> »


    guid); ?>

    Read the rest of this entry »

    '); ?> '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?>

    Sorry, no attachments matched your criteria.

    wp-content/themes/default/comments-popup.php0000644013707600007620000001104210667076612017277 0ustar www <?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?>

    Comments

    RSS feed for comments on this post.

    ping_status) { ?>

    The URL to TrackBack this entry is:

    post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie echo(get_the_password_form()); } else { ?>
    1. by @

    No comments yet.

    comment_status) { ?>

    Leave a comment

    Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

    Logged in as . Logout »

    " />


    ID); ?>

    Sorry, the comment form is closed at this time.

    Powered by Wordpress

    wp-content/themes/default/comments.php0000644013707600007620000000730710666352010016133 0ustar wwwpost_password)) { // if there's a password if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie ?>

    This post is password protected. Enter the password to view comments.

    to “

    1. id="comment-"> Says: comment_approved == '0') : ?> Your comment is awaiting moderation.
    comment_status) : ?>

    Comments are closed.

    comment_status) : ?>

    Leave a Reply

    You must be logged in to post a comment.

    Logged in as . Logout »

    ID); ?>
    wp-content/themes/default/footer.php0000644013707600007620000000150010706110122015560 0ustar www
    wp-content/themes/default/functions.php0000644013707600007620000004115210633331614016313 0ustar www '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); function kubrick_head() { $head = "\n"; if ( '' != $output ) echo $head . $output . $foot; } add_action('wp_head', 'kubrick_head'); function kubrick_header_image() { return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); } function kubrick_upper_color() { if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['upper']; } else return '69aee7'; } function kubrick_lower_color() { if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { parse_str(substr($url, strpos($url, '?') + 1), $q); return $q['lower']; } else return '4180b6'; } function kubrick_header_image_url() { if ( $image = kubrick_header_image() ) $url = get_template_directory_uri() . '/images/' . $image; else $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; return $url; } function kubrick_header_color() { return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); } function kubrick_header_color_string() { $color = kubrick_header_color(); if ( false === $color ) return 'white'; return $color; } function kubrick_header_display() { return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); } function kubrick_header_display_string() { $display = kubrick_header_display(); return $display ? $display : 'inline'; } add_action('admin_menu', 'kubrick_add_theme_page'); function kubrick_add_theme_page() { if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { check_admin_referer('kubrick-header'); if ( isset($_REQUEST['njform']) ) { if ( isset($_REQUEST['defaults']) ) { delete_option('kubrick_header_image'); delete_option('kubrick_header_color'); delete_option('kubrick_header_display'); } else { if ( '' == $_REQUEST['njfontcolor'] ) delete_option('kubrick_header_color'); else { $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); update_option('kubrick_header_color', $fontcolor); } if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); } if ( isset($_REQUEST['toggledisplay']) ) { if ( false === get_option('kubrick_header_display') ) update_option('kubrick_header_display', 'none'); else delete_option('kubrick_header_display'); } } } else { if ( isset($_REQUEST['headerimage']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['headerimage'] ) delete_option('kubrick_header_image'); else { $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); update_option('kubrick_header_image', $headerimage); } } if ( isset($_REQUEST['fontcolor']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['fontcolor'] ) delete_option('kubrick_header_color'); else { $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); update_option('kubrick_header_color', $fontcolor); } } if ( isset($_REQUEST['fontdisplay']) ) { check_admin_referer('kubrick-header'); if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) delete_option('kubrick_header_display'); else update_option('kubrick_header_display', 'none'); } } //print_r($_REQUEST); wp_redirect("themes.php?page=functions.php&saved=true"); die; } add_action('admin_head', 'kubrick_theme_page_head'); } add_theme_page(__('Customize Header'), __('Header Image and Color'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); } function kubrick_theme_page_head() { ?>

    '.__('Options saved.').'

    '; ?>


    red', '#FF0000', 'rgb(255, 0, 0)'); ?>
    #FF0000', '#F00'); ?>
    #FF0000', '#F00'); ?>

    wp-content/themes/default/header.php0000644013707600007620000000314710577550620015544 0ustar www > <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>

    wp-content/themes/default/images/0000755013707600007620000000000010706137424015040 5ustar wwwwp-content/themes/default/images/audio.jpg0000644013707600007620000001107710347610314016644 0ustar wwwJFIFddDuckyPAdobed      `` !1Aaq"Q2R#bBr$!1AQaq2R3r4 ?꯼e,x bY[-40]|ͻOCјfe7S~-oX{\bҗwݵ2^Kys-̗k%4fbI?(JI^~:GET ,glBF"tc?G]\7Њ, ;h]u8F貀:E~Qn]kq\Ik%C"hJNQy=oZF\=E=6?}_>u_Z5Tǁ #EE>`$҆-ŽB.),bAuc!2)Xo ftWңs(8סivI2XMO u-/퍒ɐz8 tˣe}K?>*Ϲ%#hBzBp,1VZIn awFCO"g'ǡVrpkF.bccAaTuY^\p"`kHǾv/X?Yvׯ(4+qF/aTws[k]C$`y{ RHLEO3e'r`,箶2uLn 4YVCgI32XXK.~7-0cu;]ow٭-yn4\fVz}-g2`46TDe{^d}Y$VTPզ82lڞe-kR]YHzB;箄-EPcJ)]]6\e-+HZUpvBAۡ;GBBzܨP >ru2[TV|i4 ;8Ao*#jUe`{U O\lhƁVRc,||WTi?ī|<nWW}80Cvf9cJ[x#xkDzaVe8- ;K xܛ5$[2nݸ} ר6Bߞcfw@φTGsᢨGsᢨGsᢨZqOcywXO%(,LQԏ0 68.+ӚZH7 S]^SQA$@ˍ^b3rlOfp2㗫ۻO |GgA)} &H Z&a@-Nwƾwp-content/themes/default/images/header-img.php0000644013707600007620000000414010634105372017547 0ustar wwwarray('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2')); foreach ( $vars as $var => $subvars ) { if ( isset($_GET[$var]) ) { foreach ( $subvars as $index => $subvar ) { $length = strlen($_GET[$var]) / 3; $v = substr($_GET[$var], $index * $length, $length); if ( $length == 1 ) $v = '' . $v . $v; $$subvar = hexdec( $v ); if ( $$subvar < 0 || $$subvar > 255 ) $default = true; } } else { $default = true; } } if ( $default ) list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 ); // Create the image $im = imagecreatefromjpeg($img); // Get the background color, define the rectangle height $white = imagecolorat( $im, 15, 15 ); $h = 182; // Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) $corners = array( 0 => array ( 25, 734 ), 1 => array ( 23, 736 ), 2 => array ( 22, 737 ), 3 => array ( 21, 738 ), 4 => array ( 21, 738 ), 177 => array ( 21, 738 ), 178 => array ( 21, 738 ), 179 => array ( 22, 737 ), 180 => array ( 23, 736 ), 181 => array ( 25, 734 ), ); // Blank out the blue thing for ( $i = 0; $i < $h; $i++ ) { $x1 = 19; $x2 = 740; imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); } // Draw a new color thing for ( $i = 0; $i < $h; $i++ ) { $x1 = 20; $x2 = 739; $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1; $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1; $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1; $color = imagecolorallocate( $im, $r, $g, $b ); if ( array_key_exists($i, $corners) ) { imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); list ( $x1, $x2 ) = $corners[$i]; } imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); } //die; header("Content-Type: image/jpeg"); imagejpeg($im, '', 92); imagedestroy($im); ?> wp-content/themes/default/images/kubrickbg-ltr.jpg0000644013707600007620000000202310577550620020304 0ustar wwwJFIFddDucky<&Adobed x       (`3q`@`1q Br L)*k0 2r7RrD Ԝu'$@I7R{?m?m?v mpHv mpHv ?!4` =@(#F4` =@(#F4` =@(/?!?! I$I$I$I$I$I$I$I$I$I$I$HI$I$I$I$I$I$I$I$I$I$I$@I$I$I$I$I$I$I$I I$I$I$I$I$I$I$I$I$I$II$I$I$$I$I$I$I$I$I$I$H$I$I$I$?`>,`>,`>,`>,`>,??wp-content/themes/default/images/kubrickbg-rtl.jpg0000644013707600007620000000317110577550620020311 0ustar wwwJFIFddC      C ( }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?!} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_} Io]n?Jՠ ( ( ( ( ( ( ~P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@dx@R[(*_wp-content/themes/default/images/kubrickbgcolor.jpg0000644013707600007620000000105410204471036020535 0ustar wwwJFIFddDucky<&Adobed  *       <<o```` ????!?!?! I$I$I$I$I$I$I$I$???wp-content/themes/default/images/kubrickbgwide.jpg0000644013707600007620000000176610204471036020361 0ustar wwwJFIFddDucky<&Adobed q       (`3q``1 M`  SXB@! T7Z2D ֌u$@h7Z;?m?m?v mpHv mpHv ?!qakGƼqa??!?! I$I$I$I$I$I$I$I$I$I$I$HI$I$I$I$I$I$I$I$I$I$I$@I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$$I$I$I$I$I$I$I$I$I$I$I$?k??>??89Ǟ=s}q}\s}\yg}~?_/xx矷8y珧oXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQaEXQ}}?!϶~g> U|UUUUUUUUUUU_UUUUUUUU|UUUUUUUUUUUUUUUUUUUUU_1}UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUdg,UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUg,?gUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUYKg,oUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUYzKgهUc+UUUUUUWªUU_ UUUW¯UU_ Wª?~S3[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ Mϯ?!>??!>? I$I$I$I$I$I$I$I$I$I$I$IA  I$I$I$I$I$I$I$I$I$I$I$$I$I$I$I$I$I$I$I$I$I$I$?{Ǐ?,l|l>6)}8X@HX~l+|l1-rw[p?"?ǣqـ @ @ @ @ @ @ @ @ @ @( @ @qcϏF?Eьb??>??>?wp-content/themes/default/images/kubrickheader.jpg0000644013707600007620000001727410204471036020351 0ustar wwwJFIFddDuckyFAdobed    UѓӤq2s6!1Q"ABt%RB1!Aq ??EU5%*`%.{@z4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}sh.GJ]͠:O攻@u)w6=?Rmz4\iKQҗ}shꩪKsYzU_#}7XaُQK咻O{ 6[,m\GW~M~xv`Tac`dnTb]UKm-][O{ݠO[1/iҰiWz5 ޿y[eg4?+?fGHMs~e- i՝öV5cɺ|^^wWljLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S#-w!ƶ5Ld d|^^5xƩLLkp3it)yzn[m2n2>Ry/MkcTͦMЦGZ5CWljɺK]漽7jS67B)kח ^5f&S'Msr~e,սò򱭏2na{WQw Kpn^m1a_~J?3?jמ٨&cIw ݖB{fϭx/[W`:}p220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 _/Mu߶jSx}y{w횏>` v?;bx/v[ >c>zt`:}p00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 L{>S}yPu߶jOvS``````````````````````_POT]w횏>` f?;bx/v[ >c8tO3tN$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@Z}E_pL{>S}yQ߶jO@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$Eǹ7/]fϢ$™w ݖB{fϭL"-]7nS}yL}>CSI {_R}O'Tw횏>` f?;bx/v[ >c0t}O3 N$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@\-}K?pL{>SxyS߶jOyɢ@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$A$Ϲ/O]fϢ$™w ݖB{fϭJ$]1lS}yL}>AS& _Sܓ>O'Umw횏>` f?;bx/v[ >c'tO3L$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@^}OrL>RyV5߶j`*V?;bx/v[ >ctjSx}yM{}>s)C0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 `WtL{>RyX5߶jԦ}pVS&``````````````````````kUDϹ/畗]fϢ$ʕw ݖB{fϭxM?DĬx6J .N۶Ym]l~NM?/Wh\<\;ÿeo]vmo-,??gA``````````````````````}a\{.aܲׯ^j,m?z#m+?~G]& (_mn޽n%K,#l_4?+QU_\=GE0LFewp-content/themes/default/index.php0000644013707600007620000000241010674035064015411 0ustar www

    Not Found

    Sorry, but you are looking for something that isn't here.

    wp-content/themes/default/links.php0000644013707600007620000000027210373555544015434 0ustar www

    Links:

    wp-content/themes/default/page.php0000644013707600007620000000115010530000006015171 0ustar www

    Read the rest of this page »

    '); ?> '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?>
    ', '

    '); ?>
    wp-content/themes/default/rtl.css0000644013707600007620000000406510651662372015117 0ustar www/* Based on Arabic (RTL) version of Kubrick theme, converted by Serdal (Serdal.com) */ .narrowcolumn, .alignleft, .widecolumn .smallattachment { float: right; } .alignright, #commentform #submit { float: left; } #page, .post, #wp-calendar #prev a { text-align: right; } body, #commentform p { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; } small { font-family: 'Geeza Pro', Tahoma, Arial, Helvetica, Sans-Serif; } h1, h2, h3 { font-family: 'Al Bayan', 'Traditional Arabic', 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; } #sidebar h2 { font-family: 'Al Bayan', 'Traditional Arabic', 'Lucida Grande', Verdana, Sans-Serif; } .commentlist li, #commentform input, #commentform textarea { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; } #sidebar { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; } #wp-calendar caption { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', Verdana, Arial, Sans-Serif; } acronym, abbr, span.caps { letter-spacing: normal; } #header { margin: 0 1px 0 0; } .narrowcolumn { padding: 0 45px 20px 0; } .widecolumn { margin: 5px 150px 0 0; } .widecolumn .smallattachment { margin: 5px 0px 5px 5px; } .postmetadata { clear: right; } img.alignright { margin: 0 7px 2px 0; } img.alignleft { margin: 0 0 2px 7px; } .entry ol { padding: 0 35px 0 0; } #sidebar ul ul, #sidebar ul ol { margin: 5px 10px 0 0; } #sidebar ul ul ul, #sidebar ul ol { margin: 0 10px 0 0; } #commentform input { margin: 5px 0 1px 5px; } .commentlist p { margin: 10px 0 10px 5px; } html>body .entry li { margin: 7px 10px 8px 0; } html>body .entry ul { margin-left: auto; margin-right: 0px; padding: 0 30px 0 0; } #sidebar { margin-left: auto; margin-right: 545px; } #wp-calendar #prev a, html>body .entry ul { padding-left: 0; padding-right: 10px; } blockquote { border-left: 0; border-right: 5px solid #ddd; padding-left: 0; padding-right: 20px; margin: 15px 10px 0 30px; } #wp-calendar #next a { padding-right: 0; padding-left: 10px; text-align: left; } wp-content/themes/default/screenshot.png0000644013707600007620000002456010275341062016461 0ustar wwwPNG  IHDR,ExgAMA7tEXtSoftwareAdobe ImageReadyqe<PLTEYID`Qe8z̸㺶Ǻ]ت莳ùa^`Nh씚¤g˧ʳ簣zәzoýcMǾ줾}slóΤX~}FOсoj^lGddw&~Y3 LB~9sΙ%l/8 X lP9|,'@GTK1@MB)} P Yh7 ,x>S"<8_ X X/uˀe X_ퟝ`ík2`Օ``0`86`]?{0`rX/u𳳺aXW 'ts~g̅ |P<-O}~~ۇkuo{tԹ}|٧7n<5 йm+™)mϝ;?1H8=4wp0 ;嫯/ݠ|~@sP_ k抵92:OfLYӣz~΄ר1dQguez^IEz_VݷU@ul͑s|T,z~y_ ʳ,~7fŹKuBh$@ANPvwo.>(:=r NZɣ|`VE|yk`\Uk` ^,|M  ܀\GӳLWw e  ̵ UT&/f' \v_Y$zi\;V̀ `Ujf^ՙ۬jYXGiy6bL;͊i{l b wpv68v\>n{ȭ(6:xq|3\fbX o=)Ο^'+uᛇէw^BX8l; @t^itN̫vga ͅ.>µםΓ_w./,,?y89~p7;pO<^;;:,8>~hεZί:ξ_g3vuܯι3_;Nc3t~yx8tېeAܡε|sZB /`9D;_g;xgy ݛU=v,;_: vW~XdW^zÝ;7g`oW/v~Y]xΣW77yzUyn޹pǏ=sMK_ Ûp[}q^M2$~࡞N/{%X7pX4`>4`]?{0`#\u=ggO֗2`_?`2`]K0U`I_ \i:y\.dSXx5.5o ˥}`2` X,֏ Bau/f Xcc8t9a`&?, e8Nfd]p>KRKY>²Qhw%"Zͧ>{\$ 2+/}%iGkՍ jAՏI:WZw6hDoDgvjfej]^Z_˕:IT Ia=։|x~oyPA4{p^dA:!ӝ5ܝrgD~- WªJ&Di1eE$!o BEـ ;%H[R"HhjRGL_ ʦ2{P@ &K9x}<)h~&|օ7`]gCzQu7l@m2 "*]ɀ!,od+I3~΃~?a[GLQ>j,)#o9:`16?ٯl#mLކ" XRշr<⌞/(p9$ X ”%XR#3`!h8G?hؒګV.FPGMƴQ>,0̶[~ic@a ~,}ڲFg|n%1l(e[+a*6gP2mJSt"FLXڨ`gk>.? I'QǪ:-F_ xT+B*miN sVNP&h>c4Fҹ1U@(A!4?#;^Q.Т$M(4.J-7>^-<펇sJF: 4<09EB2 Q;jQ$[lY(LŢDl+iT kgE܉q^mq#U-k ?o4Ň@E!»K Kn+^&TkV? Rt'UBv~H3z RF'xoyjPVFŶJ|FeV2'$̟tͤ0UcRꬉ2^hWe9m]Kd哐EKHLf1גh^GKMF>Ȕ$3xd&l;L*sעO*x D.i5ro՟&ְ0Mlgdrg?f]u(F~P㠴wYf q"*f?,'di$Q}_x-,)k$\nGϗ~;TWz0ỳo >A+Ѱ˛0jE>*cb d%@%sbn&ZRh);Fd·-:ZlBne#^߳⾾o0fb$YBf0dmP`@ݓ@1/m}5Չ92`e"GԀBjEuif&`Dj}ҬrMDq5'ЮzC?fCڀe2`Ori Xk)Nxh8WUf Xǩq!W }Sz9$z9\\6]ގM*ˁ*3=~\ rOqy8Gx_S>ea>?K|HlX Qdr-\Z&&hGLn 11[`Km 47~~MN rpMjc]yiDKJ懰@"}:2^bOO55":5 ai  L.<,~ @oDDHY`pF:[KV|zKp1'hFj~O`rVBO V_8N |<1cr*_h;x{cTL<p}z3vȯcEXTΗ4N „4[x?&)Fws -ģno3}kF h>`}_Oـ&%Biɯ\} & < h]Pe:Xjp9B }[i%R m|kQ%pe|"C^vh.+3]: >A+sN)uEMbX#^;]raI t eUMQ+ l0]˕\wԼlW2R@̖6I#\ܽpME(kd۵d1Ԫ..pr?[ղ~Gu^pߟEF*O' D8oE wԊ%SٲӠbBkۛGiz?FT3#JkYQƎpF-' S.&yj0KVvCqrѹ=;ngbSvXzocJkأy[+ zqp7TTm(ԕhrAte[FKmyHJpiP*Q6>F'yRpD8cжB+u<WÒkάs|i>+DrW7LY-)дJuc@(aڦ=Ss fˉL.5ǣoIsߣ!D0AX0G14)*Oc^rN& >;#:߃GFܒki+ D=!2srOr-b}jHqwQ}v/m,Os̘2VJW/PE&B2Ztef-sCgm<;FYpJ?Y eD1yʄGt #kF'5 X ֵG%rCV\u]M&]فhbP3UFeak7E!edΆ +M-xD1ʅ-Lf(\ @@b#qчmm}/Y%[.?Z4iNi$9˸Niϛ鸹h2BQk"6QKD)ɍְ`~--:HBzok,JQO ch!B>\ύMWQ|iLS&K-5Z9)ZfJm k,a2/Hh~Ų4WߢTZ"T,W*Qxdo41שBn?#[ 8آcd-ҥְϷk;(x;[:߈l QiJiYervTĠq M[J|&'?.{8h@f$+c1{uqknDAhY鸖 ,6[ZkJKdh&6ؔMFeUɥY$͉mW43fHR)fNůDYۀ|dS*YԸjQZܴ, Om$/~oSp=l. ,;:0Jx͔hLzT7{"Qjο`qՍfJ~ A5j&f{ $s%`^Kt<mFݠa>YY鋵JK~6n"#BL'FcZFUpX>pphq%'|oB){o7\MRSM_.j{Ze;ן^Vh҃#Rb:v15Tr f4XE[=m;bFroK45[N$mȠE* Y*P"m\UtHhqTM^B3}rnτ f$Kq̛Z2 @Mp2phqU"K~J|=K}wkh53rm;3ELj`Yk[.^Bp 389j?l5H2V٥[kW_5x05WSXXDlIdQD`vYc #Uְpª/<a*DqD~ !z=VR%.`\L<wGؐ/=z^wI;1 wkMs[/Z%٨޾dm-D\o*YɨWk8fG+ IHeUeؕ2?nQakX8` ^HUbX1C-G g\-blT̊' Q"1v#Sô-w}az۳\A][ef5?2h>o+tkџvN=Ӎ-z%צ2 4137sdqeϲ` #"[:20;h5ve5wKa RHeOktsH.Xbm; >xE4+]DJV[}IBG(?,Vstn ȲffY}d0^%(Qc[4!K=p6lTr*5ܪM5W~kuE٥i6!hfѰow)5Ef"Lgę%F8l+5["7,ٚF_G!t[Q3$;ԶMÙ-:LNh$e˲퓒gN_iŅ'0X:3ჹ_1MZ'l .yKg\WBO/ok/M>sWYz[]KCnUcP5Q{<5{T1٢x+ o5I{l_wQ#k-BHi7GU|I~#&1tXl'9+-IENDB`wp-content/themes/default/search.php0000644013707600007620000000251210674035064015552 0ustar www

    Search Results

    No posts found. Try a different search?

    wp-content/themes/default/searchform.php0000644013707600007620000000034010573416766016445 0ustar www
    wp-content/themes/default/sidebar.php0000644013707600007620000000611710706107566015726 0ustar www wp-content/themes/default/single.php0000644013707600007620000000521310674035064015567 0ustar www

    Read the rest of this entry »

    '); ?> '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?> Tags: ', ', ', '

    '); ?>

    Sorry, no posts matched your criteria.

    wp-content/themes/default/style.css0000644013707600007620000002153610534006560015447 0ustar www/* Theme Name: WordPress Default Theme URI: http://wordpress.org/ Description: The default WordPress theme based on the famous Kubrick. Version: 1.6 Author: Michael Heilemann Author URI: http://binarybonsai.com/ Kubrick v1.5 http://binarybonsai.com/kubrick/ This theme was designed and built by Michael Heilemann, whose blog you will find at http://binarybonsai.com/ The CSS, XHTML and design is released under GPL: http://www.opensource.org/licenses/gpl-license.php */ /* Begin Typography & Colors */ body { font-size: 62.5%; /* Resets 1em to 10px */ font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; background: #d5d6d7 url('images/kubrickbgcolor.jpg'); color: #333; text-align: center; } #page { background-color: white; border: 1px solid #959596; text-align: left; } #header { background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center; } #headerimg { margin: 7px 9px 0; height: 192px; width: 740px; } #content { font-size: 1.2em } .widecolumn .entry p { font-size: 1.05em; } .narrowcolumn .entry, .widecolumn .entry { line-height: 1.4em; } .widecolumn { line-height: 1.6em; } .narrowcolumn .postmetadata { text-align: center; } .alt { background-color: #f8f8f8; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; } #footer { background: #eee url('images/kubrickfooter.jpg') no-repeat top; border: none; } small { font-family: Arial, Helvetica, Sans-Serif; font-size: 0.9em; line-height: 1.5em; } h1, h2, h3 { font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; font-weight: bold; } h1 { font-size: 4em; text-align: center; } #headerimg .description { font-size: 1.2em; text-align: center; } h2 { font-size: 1.6em; } h2.pagetitle { font-size: 1.6em; } #sidebar h2 { font-family: 'Lucida Grande', Verdana, Sans-Serif; font-size: 1.2em; } h3 { font-size: 1.3em; } h1, h1 a, h1 a:hover, h1 a:visited, #headerimg .description { text-decoration: none; color: white; } h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited { color: #333; } h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite { text-decoration: none; } .entry p a:visited { color: #b85b5a; } .commentlist li, #commentform input, #commentform textarea { font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif; } .commentlist li { font-weight: bold; } .commentlist cite, .commentlist cite a { font-weight: bold; font-style: normal; font-size: 1.1em; } .commentlist p { font-weight: normal; line-height: 1.5em; text-transform: none; } #commentform p { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; } .commentmetadata { font-weight: normal; } #sidebar { font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif; } small, #sidebar ul ul li, #sidebar ul ol li, .nocomments, .postmetadata, blockquote, strike { color: #777; } code { font: 1.1em 'Courier New', Courier, Fixed; } acronym, abbr, span.caps { font-size: 0.9em; letter-spacing: .07em; } a, h2 a:hover, h3 a:hover { color: #06c; text-decoration: none; } a:hover { color: #147; text-decoration: underline; } #wp-calendar #prev a, #wp-calendar #next a { font-size: 9pt; } #wp-calendar a { text-decoration: none; } #wp-calendar caption { font: bold 1.3em 'Lucida Grande', Verdana, Arial, Sans-Serif; text-align: center; } #wp-calendar th { font-style: normal; text-transform: capitalize; } /* End Typography & Colors */ /* Begin Structure */ body { margin: 0 0 20px 0; padding: 0; } #page { background-color: white; margin: 20px auto; padding: 0; width: 760px; border: 1px solid #959596; } #header { background-color: #73a0c5; margin: 0 0 0 1px; padding: 0; height: 200px; width: 758px; } #headerimg { margin: 0; height: 200px; width: 100%; } .narrowcolumn { float: left; padding: 0 0 20px 45px; margin: 0px 0 0; width: 450px; } .widecolumn { padding: 10px 0 20px 0; margin: 5px 0 0 150px; width: 450px; } .post { margin: 0 0 40px; text-align: justify; } .post hr { display: block; } .widecolumn .post { margin: 0; } .narrowcolumn .postmetadata { padding-top: 5px; } .widecolumn .postmetadata { margin: 30px 0; } .widecolumn .smallattachment { text-align: center; float: left; width: 128px; margin: 5px 5px 5px 0px; } .widecolumn .attachment { text-align: center; margin: 5px 0px; } .postmetadata { clear: left; } #footer { padding: 0; margin: 0 auto; width: 760px; clear: both; } #footer p { margin: 0; padding: 20px 0; text-align: center; } /* End Structure */ /* Begin Headers */ h1 { padding-top: 70px; margin: 0; } h2 { margin: 30px 0 0; } h2.pagetitle { margin-top: 30px; text-align: center; } #sidebar h2 { margin: 5px 0 0; padding: 0; } h3 { padding: 0; margin: 30px 0 0; } h3.comments { padding: 0; margin: 40px auto 20px ; } /* End Headers */ /* Begin Images */ p img { padding: 0; max-width: 100%; } /* Using 'class="alignright"' on an image will (who would've thought?!) align the image to the right. And using 'class="centered', will of course center the image. This is much better than using align="center", being much more futureproof (and valid) */ img.centered { display: block; margin-left: auto; margin-right: auto; } img.alignright { padding: 4px; margin: 0 0 2px 7px; display: inline; } img.alignleft { padding: 4px; margin: 0 7px 2px 0; display: inline; } .alignright { float: right; } .alignleft { float: left } /* End Images */ /* Begin Lists Special stylized non-IE bullets Do not work in Internet Explorer, which merely default to normal bullets. */ html>body .entry ul { margin-left: 0px; padding: 0 0 0 30px; list-style: none; padding-left: 10px; text-indent: -10px; } html>body .entry li { margin: 7px 0 8px 10px; } .entry ul li:before, #sidebar ul ul li:before { content: "\00BB \0020"; } .entry ol { padding: 0 0 0 35px; margin: 0; } .entry ol li { margin: 0; padding: 0; } .postmetadata ul, .postmetadata li { display: inline; list-style-type: none; list-style-image: none; } #sidebar ul, #sidebar ul ol { margin: 0; padding: 0; } #sidebar ul li { list-style-type: none; list-style-image: none; margin-bottom: 15px; } #sidebar ul p, #sidebar ul select { margin: 5px 0 8px; } #sidebar ul ul, #sidebar ul ol { margin: 5px 0 0 10px; } #sidebar ul ul ul, #sidebar ul ol { margin: 0 0 0 10px; } ol li, #sidebar ul ol li { list-style: decimal outside; } #sidebar ul ul li, #sidebar ul ol li { margin: 3px 0 0; padding: 0; } /* End Entry Lists */ /* Begin Form Elements */ #searchform { margin: 10px auto; padding: 5px 3px; text-align: center; } #sidebar #searchform #s { width: 108px; padding: 2px; } #sidebar #searchsubmit { padding: 1px; } .entry form { /* This is mainly for password protected posts, makes them look better. */ text-align:center; } select { width: 130px; } #commentform input { width: 170px; padding: 2px; margin: 5px 5px 1px 0; } #commentform textarea { width: 100%; padding: 2px; } #commentform #submit { margin: 0; float: right; } /* End Form Elements */ /* Begin Comments*/ .alt { margin: 0; padding: 10px; } .commentlist { padding: 0; text-align: justify; } .commentlist li { margin: 15px 0 3px; padding: 5px 10px 3px; list-style: none; } .commentlist p { margin: 10px 5px 10px 0; } #commentform p { margin: 5px 0; } .nocomments { text-align: center; margin: 0; padding: 0; } .commentmetadata { margin: 0; display: block; } /* End Comments */ /* Begin Sidebar */ #sidebar { padding: 20px 0 10px 0; margin-left: 545px; width: 190px; } #sidebar form { margin: 0; } /* End Sidebar */ /* Begin Calendar */ #wp-calendar { empty-cells: show; margin: 10px auto 0; width: 155px; } #wp-calendar #next a { padding-right: 10px; text-align: right; } #wp-calendar #prev a { padding-left: 10px; text-align: left; } #wp-calendar a { display: block; } #wp-calendar caption { text-align: center; width: 100%; } #wp-calendar td { padding: 3px 0; text-align: center; } #wp-calendar td.pad:hover { /* Doesn't work in IE */ background-color: #fff; } /* End Calendar */ /* Begin Various Tags & Classes */ acronym, abbr, span.caps { cursor: help; } acronym, abbr { border-bottom: 1px dashed #999; } blockquote { margin: 15px 30px 0 10px; padding-left: 20px; border-left: 5px solid #ddd; } blockquote cite { margin: 5px 0 0; display: block; } .center { text-align: center; } hr { display: none; } a img { border: none; } .navigation { display: block; text-align: center; margin-top: 10px; margin-bottom: 60px; } /* End Various Tags & Classes*/ /* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. It won't be a stylish marriage, I can't afford a carriage. But you'll look sweet upon the seat of a bicycle built for two." */ wp-cron.php0000644013707600007620000000152310654457162010671 0ustar www time() ) exit; update_option('doing_cron', time() + 30); $crons = _get_cron_array(); $keys = array_keys($crons); if (!is_array($crons) || $keys[0] > time()) return; foreach ($crons as $timestamp => $cronhooks) { if ($timestamp > time()) break; foreach ($cronhooks as $hook => $keys) { foreach ($keys as $key => $args) { $schedule = $args['schedule']; if ($schedule != false) { $new_args = array($timestamp, $schedule, $hook, $args['args']); call_user_func_array('wp_reschedule_event', $new_args); } wp_unschedule_event($timestamp, $hook, $args['args']); do_action_ref_array($hook, $args['args']); } } } update_option('doing_cron', 0); ?> wp-feed.php0000644013707600007620000000017010530000006010576 0ustar www wp-includes/0000755013707600007620000000000010706137424011016 5ustar wwwwp-includes/atomlib.php0000644013707600007620000002415410672775704013177 0ustar www * Version: 0.4 * */ class AtomFeed { var $links = array(); var $categories = array(); var $entries = array(); } class AtomEntry { var $links = array(); var $categories = array(); } class AtomParser { var $NS = 'http://www.w3.org/2005/Atom'; var $ATOM_CONTENT_ELEMENTS = array('content','summary','title','subtitle','rights'); var $ATOM_SIMPLE_ELEMENTS = array('id','updated','published','draft'); var $debug = false; var $depth = 0; var $indent = 2; var $in_content; var $ns_contexts = array(); var $ns_decls = array(); var $content_ns_decls = array(); var $content_ns_contexts = array(); var $is_xhtml = false; var $is_html = false; var $is_text = true; var $skipped_div = false; var $FILE = "php://input"; var $feed; var $current; function AtomParser() { $this->feed = new AtomFeed(); $this->current = null; $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); } function _p($msg) { if($this->debug) { print str_repeat(" ", $this->depth * $this->indent) . $msg ."\n"; } } function error_handler($log_level, $log_text, $error_file, $error_line) { $this->error = $log_text; } function parse() { set_error_handler(array(&$this, 'error_handler')); array_unshift($this->ns_contexts, array()); $parser = xml_parser_create_ns(); xml_set_object($parser, $this); xml_set_element_handler($parser, "start_element", "end_element"); xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0); xml_set_character_data_handler($parser, "cdata"); xml_set_default_handler($parser, "_default"); xml_set_start_namespace_decl_handler($parser, "start_ns"); xml_set_end_namespace_decl_handler($parser, "end_ns"); $this->content = ''; $ret = true; $fp = fopen($this->FILE, "r"); while ($data = fread($fp, 4096)) { if($this->debug) $this->content .= $data; if(!xml_parse($parser, $data, feof($fp))) { trigger_error(sprintf(__('XML error: %s at line %d')."\n", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); $ret = false; break; } } fclose($fp); xml_parser_free($parser); restore_error_handler(); return $ret; } function start_element($parser, $name, $attrs) { $tag = array_pop(split(":", $name)); switch($name) { case $this->NS . ':feed': $this->current = $this->feed; break; case $this->NS . ':entry': $this->current = new AtomEntry(); break; }; $this->_p("start_element('$name')"); #$this->_p(print_r($this->ns_contexts,true)); #$this->_p('current(' . $this->current . ')'); array_unshift($this->ns_contexts, $this->ns_decls); $this->depth++; if(!empty($this->in_content)) { $this->content_ns_decls = array(); if($this->is_html || $this->is_text) trigger_error("Invalid content in element found. Content must not be of type text or html if it contains markup."); $attrs_prefix = array(); // resolve prefixes for attributes foreach($attrs as $key => $value) { $with_prefix = $this->ns_to_prefix($key, true); $attrs_prefix[$with_prefix[1]] = $this->xml_escape($value); } $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix))); if(strlen($attrs_str) > 0) { $attrs_str = " " . $attrs_str; } $with_prefix = $this->ns_to_prefix($name); if(!$this->is_declared_content_ns($with_prefix[0])) { array_push($this->content_ns_decls, $with_prefix[0]); } $xmlns_str = ''; if(count($this->content_ns_decls) > 0) { array_unshift($this->content_ns_contexts, $this->content_ns_decls); $xmlns_str .= join(' ', array_map($this->map_xmlns_func, array_keys($this->content_ns_contexts[0]), array_values($this->content_ns_contexts[0]))); if(strlen($xmlns_str) > 0) { $xmlns_str = " " . $xmlns_str; } } array_push($this->in_content, array($tag, $this->depth, "<". $with_prefix[1] ."{$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_html = $attrs['type'] == 'html' || $attrs['type'] == 'text/html'; $this->is_text = !in_array('type',array_keys($attrs)) || $attrs['type'] == 'text'; $type = $this->is_xhtml ? 'XHTML' : ($this->is_html ? 'HTML' : ($this->is_text ? 'TEXT' : $attrs['type'])); if(in_array('src',array_keys($attrs))) { $this->current->$tag = $attrs; } else { array_push($this->in_content, array($tag,$this->depth, $type)); } } else if($tag == 'link') { array_push($this->current->links, $attrs); } else if($tag == 'category') { array_push($this->current->categories, $attrs); } $this->ns_decls = array(); } function end_element($parser, $name) { $tag = array_pop(split(":", $name)); $ccount = count($this->in_content); # if we are *in* content, then let's proceed to serialize it if(!empty($this->in_content)) { # if we are ending the original content element # then let's finalize the content if($this->in_content[0][0] == $tag && $this->in_content[0][1] == $this->depth) { $origtype = $this->in_content[0][2]; array_shift($this->in_content); $newcontent = array(); foreach($this->in_content as $c) { if(count($c) == 3) { array_push($newcontent, $c[2]); } else { if($this->is_xhtml || $this->is_text) { array_push($newcontent, $this->xml_escape($c)); } else { array_push($newcontent, $c); } } } if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS)) { $this->current->$tag = array($origtype, join('',$newcontent)); } else { $this->current->$tag = join('',$newcontent); } $this->in_content = array(); } else if($this->in_content[$ccount-1][0] == $tag && $this->in_content[$ccount-1][1] == $this->depth) { $this->in_content[$ccount-1][2] = substr($this->in_content[$ccount-1][2],0,-1) . "/>"; } else { # else, just finalize the current element's content $endtag = $this->ns_to_prefix($name); array_push($this->in_content, array($tag, $this->depth, "")); } } array_shift($this->ns_contexts); $this->depth--; if($name == ($this->NS . ':entry')) { array_push($this->feed->entries, $this->current); $this->current = null; } $this->_p("end_element('$name')"); } function start_ns($parser, $prefix, $uri) { $this->_p("starting: " . $prefix . ":" . $uri); array_push($this->ns_decls, array($prefix,$uri)); } function end_ns($parser, $prefix) { $this->_p("ending: #" . $prefix . "#"); } function cdata($parser, $data) { $this->_p("data: #" . str_replace(array("\n"), array("\\n"), trim($data)) . "#"); if(!empty($this->in_content)) { array_push($this->in_content, $data); } } function _default($parser, $data) { # when does this gets called? } function ns_to_prefix($qname, $attr=false) { # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div') $components = split(":", $qname); # grab the last one (e.g 'div') $name = array_pop($components); if(!empty($components)) { # re-join back the namespace component $ns = join(":",$components); foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if($mapping[1] == $ns && strlen($mapping[0]) > 0) { return array($mapping, "$mapping[0]:$name"); } } } } if($attr) { return array(null, $name); } else { foreach($this->ns_contexts as $context) { foreach($context as $mapping) { if(strlen($mapping[0]) == 0) { return array($mapping, $name); } } } } } function is_declared_content_ns($new_mapping) { foreach($this->content_ns_contexts as $context) { foreach($context as $mapping) { if($new_mapping == $mapping) { return true; } } } return false; } function xml_escape($string) { return str_replace(array('&','"',"'",'<','>'), array('&','"',''','<','>'), $string ); } } ?> wp-includes/author-template.php0000644013707600007620000002760110667076612014657 0ustar wwwdisplay_name); } /** * Echo the name of the author of the current post in the Loop. * @see get_the_author() * @param string $deprecated Deprecated. * @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author(). * @return string The author's display name, from get_the_author(). */ function the_author($deprecated = '', $deprecated_echo = true) { if ( $deprecated_echo ) echo get_the_author(); return get_the_author(); } /** * Get the description of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's description. */ function get_the_author_description() { global $authordata; return $authordata->description; } /** * Echo the description of the author of the current post in the Loop. * @see get_the_author_description() * @return null */ function the_author_description() { echo get_the_author_description(); } /** * Get the login name of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's login name (username). */ function get_the_author_login() { global $authordata; return $authordata->user_login; } /** * Echo the login name of the author of the current post in the Loop. * @see get_the_author_login() * @return null */ function the_author_login() { echo get_the_author_login(); } /** * Get the first name of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's first name. */ function get_the_author_firstname() { global $authordata; return $authordata->first_name; } /** * Echo the first name of the author of the current post in the Loop. * @see get_the_author_firstname() * @return null */ function the_author_firstname() { echo get_the_author_firstname(); } /** * Get the last name of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's last name. */ function get_the_author_lastname() { global $authordata; return $authordata->last_name; } /** * Echo the last name of the author of the current post in the Loop. * @see get_the_author_lastname() * @return null */ function the_author_lastname() { echo get_the_author_lastname(); } /** * Get the nickname of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's nickname. */ function get_the_author_nickname() { global $authordata; return $authordata->nickname; } /** * Echo the nickname of the author of the current post in the Loop. * @see get_the_author_nickname() * @return null */ function the_author_nickname() { echo get_the_author_nickname(); } /** * Get the ID of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return int The author's ID. */ function get_the_author_ID() { global $authordata; return (int) $authordata->ID; } /** * Echo the ID of the author of the current post in the Loop. * @see get_the_author_ID() * @return null */ function the_author_ID() { echo get_the_author_id(); } /** * Get the email of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's username. */ function get_the_author_email() { global $authordata; return $authordata->user_email; } /** * Echo the email of the author of the current post in the Loop. * @see get_the_author_email() * @return null */ function the_author_email() { echo apply_filters('the_author_email', get_the_author_email() ); } /** * Get the URL to the home page of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The URL to the author's page. */ function get_the_author_url() { global $authordata; if ( 'http://' == $authordata->user_url ) return ''; return $authordata->user_url; } /** * Echo the URL to the home page of the author of the current post in the Loop. * @see get_the_author_url() * @return null */ function the_author_url() { echo get_the_author_url(); } /** * If the author has a home page set, echo an HTML link, otherwise just echo the author's name. * @see get_the_author_url() * @see the_author() * @return null */ function the_author_link() { if (get_the_author_url()) { echo '' . get_the_author() . ''; } else { the_author(); } } /** * Get the ICQ number of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's ICQ number. */ function get_the_author_icq() { global $authordata; return $authordata->icq; } /** * Echo the ICQ number of the author of the current post in the Loop. * @see get_the_author_icq() * @return null */ function the_author_icq() { echo get_the_author_icq(); } /** * Get the AIM name of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's AIM name. */ function get_the_author_aim() { global $authordata; return str_replace(' ', '+', $authordata->aim); } /** * Echo the AIM name of the author of the current post in the Loop. * @see get_the_author_aim() * @return null */ function the_author_aim() { echo get_the_author_aim(); } /** * Get the Yahoo! IM name of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's Yahoo! IM name. */ function get_the_author_yim() { global $authordata; return $authordata->yim; } /** * Echo the Yahoo! IM name of the author of the current post in the Loop. * @see get_the_author_yim() * @return null */ function the_author_yim() { echo get_the_author_yim(); } /** * Get the MSN address of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @return string The author's MSN address. */ function get_the_author_msn() { global $authordata; return $authordata->msn; } /** * Echo the MSN address of the author of the current post in the Loop. * @see get_the_author_msn() * @return null */ function the_author_msn() { echo get_the_author_msn(); } /** * Get the number of posts by the author of the current post in the Loop. * @global object $post The current post in the Loop's DB object. * @see get_usernumposts() * @return int The number of posts by the author. */ function get_the_author_posts() { global $post; return get_usernumposts($post->post_author); } /** * Echo the number of posts by the author of the current post in the Loop. * @see get_the_author_posts() * @return null */ function the_author_posts() { echo get_the_author_posts(); } /** * Echo an HTML link to the author page of the author of the current post in the Loop. * @global object $authordata The current author's DB object. * @see get_author_posts_url() * @see get_the_author() * @return null */ /* the_author_posts_link() requires no get_, use get_author_posts_url() */ function the_author_posts_link($deprecated = '') { global $authordata; printf( '%3$s', get_author_posts_url( $authordata->ID, $authordata->user_nicename ), sprintf( __( 'Posts by %s' ), attribute_escape( get_the_author() ) ), get_the_author() ); } /** * Get the URL to the author page of the author of the current post in the Loop. * @global object $wpdb WordPress database layer. * @global object $wp_rewrite WP_Rewrite * @global object $post The current post in the Loop's DB object. * @return string The URL to the author's page. */ function get_author_posts_url($author_id, $author_nicename = '') { global $wpdb, $wp_rewrite, $post; $auth_ID = (int) $author_id; $link = $wp_rewrite->get_author_permastruct(); if ( empty($link) ) { $file = get_option('home') . '/'; $link = $file . '?author=' . $auth_ID; } else { if ( '' == $author_nicename ) { $user = get_userdata($author_id); if ( !empty($user->user_nicename) ) $author_nicename = $user->user_nicename; } $link = str_replace('%author%', $author_nicename, $link); $link = get_option('home') . trailingslashit($link); } $link = apply_filters('author_link', $link, $author_id, $author_nicename); return $link; } /** * Get the specified author's preferred display name. * @param int $auth_id The ID of the author. * @return string The author's display name. */ function get_author_name( $auth_id ) { $authordata = get_userdata( $auth_id ); return $authordata->display_name; } /** * List all the authors of the blog, with several options available. * optioncount (boolean) (false): Show the count in parenthesis next to the author's name. * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default. * show_fullname (boolean) (false): Show their full names. * hide_empty (boolean) (true): Don't show authors without any posts. * feed (string) (''): If isn't empty, show links to author's feeds. * feed_image (string) (''): If isn't empty, use this image to link to feeds. * echo (boolean) (true): Set to false to return the output, instead of echoing. * @param array $args The argument array. * @return null|string The output, if echo is set to false. */ function wp_list_authors($args = '') { global $wpdb; $defaults = array( 'optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 'feed' => '', 'feed_image' => '', 'echo' => true ); $r = wp_parse_args( $args, $defaults ); extract($r, EXTR_SKIP); $return = ''; // TODO: Move select to get_authors(). $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); $author_count = array(); foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row) { $author_count[$row->post_author] = $row->count; } foreach ( (array) $authors as $author ) { $author = get_userdata( $author->ID ); $posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0; $name = $author->display_name; if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') ) $name = "$author->first_name $author->last_name"; if ( !($posts == 0 && $hide_empty) ) $return .= '
  • '; if ( $posts == 0 ) { if ( !$hide_empty ) $link = $name; } else { $link = 'display_name)) . '">' . $name . ''; if ( (! empty($feed_image)) || (! empty($feed)) ) { $link .= ' '; if (empty($feed_image)) $link .= '('; $link .= ''; else $link .= $name; $link .= ''; if ( empty($feed_image) ) $link .= ')'; } if ( $optioncount ) $link .= ' ('. $posts . ')'; } if ( !($posts == 0 && $hide_empty) ) $return .= $link . '
  • '; } if ( !$echo ) return $return; echo $return; } ?>wp-includes/bookmark-template.php0000644013707600007620000001006310675575524015161 0ustar www 0, 'show_description' => 0, 'show_images' => 1, 'before' => '
  • ', 'after' => '
  • ', 'between' => "\n" ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); foreach ( (array) $bookmarks as $bookmark ) { if ( !isset($bookmark->recently_updated) ) $bookmark->recently_updated = false; $output .= $before; if ( $show_updated && $bookmark->recently_updated ) $output .= get_option('links_recently_updated_prepend'); $the_link = '#'; if ( !empty($bookmark->link_url) ) $the_link = clean_url($bookmark->link_url); $rel = $bookmark->link_rel; if ( '' != $rel ) $rel = ' rel="' . $rel . '"'; $desc = attribute_escape(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display')); $name = attribute_escape(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display')); $title = $desc; if ( $show_updated ) if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { $title .= ' '; $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600))); $title .= ')'; } if ( '' != $title ) $title = ' title="' . $title . '"'; $alt = ' alt="' . $name . '"'; $target = $bookmark->link_target; if ( '' != $target ) $target = ' target="' . $target . '"'; $output .= ''; if ( $bookmark->link_image != null && $show_images ) { if ( strpos($bookmark->link_image, 'http') !== false ) $output .= "link_image\" $alt $title />"; else // If it's a relative path $output .= "link_image\" $alt $title />"; } else { $output .= $name; } $output .= ''; if ( $show_updated && $bookmark->recently_updated ) $output .= get_option('links_recently_updated_append'); if ( $show_description && '' != $desc ) $output .= $between . $desc; if ($show_rating) { $output .= $between . get_linkrating($bookmark); } $output .= "$after\n"; } // end while return $output; } function wp_list_bookmarks($args = '') { $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '

    ', 'title_after' => '

    ', 'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat', 'category_before' => '
  • ', 'category_after' => '
  • ' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $output = ''; if ( $categorize ) { //Split the bookmarks into ul's for each category $cats = get_terms('link_category', "category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0"); foreach ( (array) $cats as $cat ) { $params = array_merge($r, array('category'=>$cat->term_id)); $bookmarks = get_bookmarks($params); if ( empty($bookmarks) ) continue; $output .= str_replace(array('%id', '%class'), array("linkcat-$cat->term_id", $class), $category_before); $catname = apply_filters( "link_category", $cat->name ); $output .= "$title_before$catname$title_after\n\t
      \n"; $output .= _walk_bookmarks($bookmarks, $r); $output .= "\n\t
    \n$category_after\n"; } } else { //output one single list using title_li for the title $bookmarks = get_bookmarks($r); if ( !empty($bookmarks) ) { if ( !empty( $title_li ) ){ $output .= str_replace(array('%id', '%class'), array("linkcat-$category", $class), $category_before); $output .= "$title_before$title_li$title_after\n\t
      \n"; $output .= _walk_bookmarks($bookmarks, $r); $output .= "\n\t
    \n$category_after\n"; } else { $output .= _walk_bookmarks($bookmarks, $r); } } } if ( !$echo ) return $output; echo $output; } ?> wp-includes/bookmark.php0000644013707600007620000001454710667076612013356 0ustar wwwget_row("SELECT * FROM $wpdb->links WHERE link_id = '$bookmark_id' LIMIT 1"); $link->link_category = array_unique( wp_get_object_terms($link_id, 'link_category', 'fields=ids') ); $link = sanitize_bookmark($link, $filter); if ( $output == OBJECT ) { return $link; } elseif ( $output == ARRAY_A ) { return get_object_vars($link); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($link)); } else { return $link; } } function get_bookmark_field( $field, $bookmark, $context = 'display' ) { $bookmark = (int) $bookmark; $bookmark = get_bookmark( $bookmark ); if ( is_wp_error($bookmark) ) return $bookmark; if ( !is_object($bookmark) ) return ''; if ( !isset($bookmark->$field) ) return ''; return sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); } // Deprecate function get_link($bookmark_id, $output = OBJECT) { return get_bookmark($bookmark_id, $output); } function get_bookmarks($args = '') { global $wpdb; $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => '' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $key = md5( serialize( $r ) ); if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) if ( isset( $cache[ $key ] ) ) return apply_filters('get_bookmarks', $cache[ $key ], $r ); $inclusions = ''; if ( !empty($include) ) { $exclude = ''; //ignore exclude, category, and category_name params if using include $category = ''; $category_name = ''; $inclinks = preg_split('/[\s,]+/',$include); if ( count($inclinks) ) { foreach ( $inclinks as $inclink ) { if (empty($inclusions)) $inclusions = ' AND ( link_id = ' . intval($inclink) . ' '; else $inclusions .= ' OR link_id = ' . intval($inclink) . ' '; } } } if (!empty($inclusions)) $inclusions .= ')'; $exclusions = ''; if ( !empty($exclude) ) { $exlinks = preg_split('/[\s,]+/',$exclude); if ( count($exlinks) ) { foreach ( $exlinks as $exlink ) { if (empty($exclusions)) $exclusions = ' AND ( link_id <> ' . intval($exlink) . ' '; else $exclusions .= ' AND link_id <> ' . intval($exlink) . ' '; } } } if (!empty($exclusions)) $exclusions .= ')'; if ( ! empty($category_name) ) { if ( $category = get_term_by('name', $category_name, 'link_category') ) $category = $category->term_id; } $category_query = ''; $join = ''; if ( !empty($category) ) { $incategories = preg_split('/[\s,]+/',$category); if ( count($incategories) ) { foreach ( $incategories as $incat ) { if (empty($category_query)) $category_query = ' AND ( tt.term_id = ' . intval($incat) . ' '; else $category_query .= ' OR tt.term_id = ' . intval($incat) . ' '; } } } if (!empty($category_query)) { $category_query .= ") AND taxonomy = 'link_category'"; $join = " LEFT JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) LEFT JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } if (get_option('links_recently_updated_time')) { $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated "; } else { $recently_updated_test = ''; } if ($show_updated) { $get_updated = ", UNIX_TIMESTAMP(link_updated) AS link_updated_f "; } $orderby = strtolower($orderby); $length = ''; switch ($orderby) { case 'length': $length = ", CHAR_LENGTH(link_name) AS length"; break; case 'rand': $orderby = 'rand()'; break; default: $orderby = "link_" . $orderby; } if ( 'link_id' == $orderby ) $orderby = "$wpdb->links.link_id"; $visible = ''; if ( $hide_invisible ) $visible = "AND link_visible = 'Y'"; $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; $query .= " $exclusions $inclusions"; $query .= " ORDER BY $orderby $order"; if ($limit != -1) $query .= " LIMIT $limit"; $results = $wpdb->get_results($query); $cache[ $key ] = $results; wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); return apply_filters('get_bookmarks', $results, $r); } function sanitize_bookmark($bookmark, $context = 'display') { $fields = array('link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated', 'link_rel', 'link_notes', 'link_rss', ); $do_object = false; if ( is_object($bookmark) ) $do_object = true; foreach ( $fields as $field ) { if ( $do_object ) $bookmark->$field = sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); else $bookmark[$field] = sanitize_bookmark_field($field, $bookmark[$field], $bookmark['link_id'], $context); } return $bookmark; } function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { $int_fields = array('link_id', 'link_rating'); if ( in_array($field, $int_fields) ) $value = (int) $value; $yesno = array('link_visible'); if ( in_array($field, $yesno) ) $value = preg_replace('/[^YNyn]/', '', $value); if ( 'link_target' == $field ) { $targets = array('_top', '_blank'); if ( ! in_array($value, $targets) ) $value = ''; } if ( 'raw' == $context ) return $value; if ( 'edit' == $context ) { $format_to_edit = array('link_notes'); $value = apply_filters("edit_$field", $value, $bookmark_id); if ( in_array($field, $format_to_edit) ) { $value = format_to_edit($value); } else { $value = attribute_escape($value); } } else if ( 'db' == $context ) { $value = apply_filters("pre_$field", $value); } else { // Use display filters by default. $value = apply_filters($field, $value, $bookmark_id, $context); } if ( 'attribute' == $context ) $value = attribute_escape($value); else if ( 'js' == $context ) $value = js_escape($value); return $value; } function delete_get_bookmark_cache() { wp_cache_delete( 'get_bookmarks', 'bookmark' ); } add_action( 'add_link', 'delete_get_bookmark_cache' ); add_action( 'edit_link', 'delete_get_bookmark_cache' ); add_action( 'delete_link', 'delete_get_bookmark_cache' ); ?> wp-includes/cache.php0000644013707600007620000002440210660200570012564 0ustar wwwadd($key, $data, $flag, $expire); } function wp_cache_close() { global $wp_object_cache; if ( ! isset($wp_object_cache) ) return; return $wp_object_cache->save(); } function wp_cache_delete($id, $flag = '') { global $wp_object_cache; return $wp_object_cache->delete($id, $flag); } function wp_cache_flush() { global $wp_object_cache; return $wp_object_cache->flush(); } function wp_cache_get($id, $flag = '') { global $wp_object_cache; return $wp_object_cache->get($id, $flag); } function wp_cache_init() { $GLOBALS['wp_object_cache'] =& new WP_Object_Cache(); } function wp_cache_replace($key, $data, $flag = '', $expire = 0) { global $wp_object_cache; $data = unserialize(serialize($data)); return $wp_object_cache->replace($key, $data, $flag, $expire); } function wp_cache_set($key, $data, $flag = '', $expire = 0) { global $wp_object_cache; $data = unserialize(serialize($data)); return $wp_object_cache->set($key, $data, $flag, $expire); } define('CACHE_SERIAL_HEADER', ""); class WP_Object_Cache { var $cache_dir; var $cache_enabled = false; var $expiration_time = 900; var $flock_filename = 'wp_object_cache.lock'; var $mutex; var $cache = array (); var $dirty_objects = array (); var $non_existant_objects = array (); var $global_groups = array ('users', 'userlogins', 'usermeta'); var $non_persistent_groups = array('comment'); var $blog_id; var $cold_cache_hits = 0; var $warm_cache_hits = 0; var $cache_misses = 0; var $secret = ''; function acquire_lock() { // Acquire a write lock. $this->mutex = @fopen($this->cache_dir.$this->flock_filename, 'w'); if ( false == $this->mutex) return false; flock($this->mutex, LOCK_EX); return true; } function add($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (false !== $this->get($id, $group, false)) return false; return $this->set($id, $data, $group, $expire); } function delete($id, $group = 'default', $force = false) { if (empty ($group)) $group = 'default'; if (!$force && false === $this->get($id, $group, false)) return false; unset ($this->cache[$group][$id]); $this->non_existant_objects[$group][$id] = true; $this->dirty_objects[$group][] = $id; return true; } function flush() { if ( !$this->cache_enabled ) return true; if ( ! $this->acquire_lock() ) return false; $this->rm_cache_dir(); $this->cache = array (); $this->dirty_objects = array (); $this->non_existant_objects = array (); $this->release_lock(); return true; } function get($id, $group = 'default', $count_hits = true) { if (empty ($group)) $group = 'default'; if (isset ($this->cache[$group][$id])) { if ($count_hits) $this->warm_cache_hits += 1; return $this->cache[$group][$id]; } if (isset ($this->non_existant_objects[$group][$id])) return false; // If caching is not enabled, we have to fall back to pulling from the DB. if (!$this->cache_enabled) { if (!isset ($this->cache[$group])) $this->load_group_from_db($group); if (isset ($this->cache[$group][$id])) { $this->cold_cache_hits += 1; return $this->cache[$group][$id]; } $this->non_existant_objects[$group][$id] = true; $this->cache_misses += 1; return false; } $cache_file = $this->cache_dir.$this->get_group_dir($group)."/".$this->hash($id).'.php'; if (!file_exists($cache_file)) { $this->non_existant_objects[$group][$id] = true; $this->cache_misses += 1; return false; } // If the object has expired, remove it from the cache and return false to force // a refresh. $now = time(); if ((filemtime($cache_file) + $this->expiration_time) <= $now) { $this->cache_misses += 1; $this->delete($id, $group, true); return false; } $this->cache[$group][$id] = unserialize(base64_decode(substr(@ file_get_contents($cache_file), strlen(CACHE_SERIAL_HEADER), -strlen(CACHE_SERIAL_FOOTER)))); if (false === $this->cache[$group][$id]) $this->cache[$group][$id] = ''; $this->cold_cache_hits += 1; return $this->cache[$group][$id]; } function get_group_dir($group) { if (false !== array_search($group, $this->global_groups)) return $group; return "{$this->blog_id}/$group"; } function hash($data) { if ( function_exists('hash_hmac') ) { return hash_hmac('md5', $data, $this->secret); } else { return md5($data . $this->secret); } } function load_group_from_db($group) { return; } function make_group_dir($group, $perms) { $group_dir = $this->get_group_dir($group); $make_dir = ''; foreach (split('/', $group_dir) as $subdir) { $make_dir .= "$subdir/"; if (!file_exists($this->cache_dir.$make_dir)) { if (! @ mkdir($this->cache_dir.$make_dir)) break; @ chmod($this->cache_dir.$make_dir, $perms); } if (!file_exists($this->cache_dir.$make_dir."index.php")) { $file_perms = $perms & 0000666; @ touch($this->cache_dir.$make_dir."index.php"); @ chmod($this->cache_dir.$make_dir."index.php", $file_perms); } } return $this->cache_dir."$group_dir/"; } function rm_cache_dir() { $dir = $this->cache_dir; $dir = rtrim($dir, DIRECTORY_SEPARATOR); $top_dir = $dir; $stack = array($dir); $index = 0; while ($index < count($stack)) { # Get indexed directory from stack $dir = $stack[$index]; $dh = @ opendir($dir); if (!$dh) return false; while (($file = @ readdir($dh)) !== false) { if ($file == '.' or $file == '..') continue; if (@ is_dir($dir . DIRECTORY_SEPARATOR . $file)) $stack[] = $dir . DIRECTORY_SEPARATOR . $file; else if (@ is_file($dir . DIRECTORY_SEPARATOR . $file)) @ unlink($dir . DIRECTORY_SEPARATOR . $file); } $index++; } $stack = array_reverse($stack); // Last added dirs are deepest foreach($stack as $dir) { if ( $dir != $top_dir) @ rmdir($dir); } } function release_lock() { // Release write lock. flock($this->mutex, LOCK_UN); fclose($this->mutex); } function replace($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (false === $this->get($id, $group, false)) return false; return $this->set($id, $data, $group, $expire); } function set($id, $data, $group = 'default', $expire = '') { if (empty ($group)) $group = 'default'; if (NULL == $data) $data = ''; $this->cache[$group][$id] = $data; unset ($this->non_existant_objects[$group][$id]); $this->dirty_objects[$group][] = $id; return true; } function save() { //$this->stats(); if (!$this->cache_enabled) return true; if (empty ($this->dirty_objects)) return true; // Give the new dirs the same perms as wp-content. $stat = stat(ABSPATH.'wp-content'); $dir_perms = $stat['mode'] & 0007777; // Get the permission bits. $file_perms = $dir_perms & 0000666; // Remove execute bits for files. // Make the base cache dir. if (!file_exists($this->cache_dir)) { if (! @ mkdir($this->cache_dir)) return false; @ chmod($this->cache_dir, $dir_perms); } if (!file_exists($this->cache_dir."index.php")) { @ touch($this->cache_dir."index.php"); @ chmod($this->cache_dir."index.php", $file_perms); } if ( ! $this->acquire_lock() ) return false; // Loop over dirty objects and save them. $errors = 0; foreach ($this->dirty_objects as $group => $ids) { if ( in_array($group, $this->non_persistent_groups) ) continue; $group_dir = $this->make_group_dir($group, $dir_perms); $ids = array_unique($ids); foreach ($ids as $id) { $cache_file = $group_dir.$this->hash($id).'.php'; // Remove the cache file if the key is not set. if (!isset ($this->cache[$group][$id])) { if (file_exists($cache_file)) @ unlink($cache_file); continue; } $temp_file = tempnam($group_dir, 'tmp'); $serial = CACHE_SERIAL_HEADER.base64_encode(serialize($this->cache[$group][$id])).CACHE_SERIAL_FOOTER; $fd = @fopen($temp_file, 'w'); if ( false === $fd ) { $errors++; continue; } fputs($fd, $serial); fclose($fd); if (!@ rename($temp_file, $cache_file)) { if (!@ copy($temp_file, $cache_file)) $errors++; @ unlink($temp_file); } @ chmod($cache_file, $file_perms); } } $this->dirty_objects = array(); $this->release_lock(); if ( $errors ) return false; return true; } function stats() { echo "

    "; echo "Cold Cache Hits: {$this->cold_cache_hits}
    "; echo "Warm Cache Hits: {$this->warm_cache_hits}
    "; echo "Cache Misses: {$this->cache_misses}
    "; echo "

    "; foreach ($this->cache as $group => $cache) { echo "

    "; echo "Group: $group
    "; echo "Cache:"; echo "

    ";
    			print_r($cache);
    			echo "
    "; if (isset ($this->dirty_objects[$group])) { echo "Dirty Objects:"; echo "
    ";
    				print_r(array_unique($this->dirty_objects[$group]));
    				echo "
    "; echo "

    "; } } } function WP_Object_Cache() { return $this->__construct(); } function __construct() { global $blog_id; register_shutdown_function(array(&$this, "__destruct")); if (defined('DISABLE_CACHE')) return; if ( ! defined('ENABLE_CACHE') ) return; // Disable the persistent cache if safe_mode is on. if ( ini_get('safe_mode') && ! defined('ENABLE_CACHE') ) return; if (defined('CACHE_PATH')) $this->cache_dir = CACHE_PATH; else // Using the correct separator eliminates some cache flush errors on Windows $this->cache_dir = ABSPATH.'wp-content'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR; if (is_writable($this->cache_dir) && is_dir($this->cache_dir)) { $this->cache_enabled = true; } else { if (is_writable(ABSPATH.'wp-content')) { $this->cache_enabled = true; } } if (defined('CACHE_EXPIRATION_TIME')) $this->expiration_time = CACHE_EXPIRATION_TIME; if ( defined('WP_SECRET') ) $this->secret = WP_SECRET; else $this->secret = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH; $this->blog_id = $this->hash($blog_id); } function __destruct() { $this->save(); return true; } } ?> wp-includes/canonical.php0000644013707600007620000001763610674535450013500 0ustar wwwusing_permalinks() ) { // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 if ( is_single() && isset($_GET['p']) ) { if ( $redirect_url = get_permalink(get_query_var('p')) ) $redirect['query'] = remove_query_arg('p', $redirect['query']); } elseif ( is_page() && isset($_GET['page_id']) ) { if ( $redirect_url = get_permalink(get_query_var('page_id')) ) $redirect['query'] = remove_query_arg('page_id', $redirect['query']); } elseif ( isset($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { $m = get_query_var('m'); switch ( strlen($m) ) { case 4: // Yearly $redirect_url = get_year_link($m); break; case 6: // Monthly $redirect_url = get_month_link( substr($m, 0, 4), substr($m, 4, 2) ); break; case 8: // Daily $redirect_url = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2)); break; } if ( $redirect_url ) $redirect['query'] = remove_query_arg('m', $redirect['query']); // now moving on to non ?m=X year/month/day links } elseif ( is_day() && get_query_var('year') && get_query_var('monthnum') && isset($_GET['day']) ) { if ( $redirect_url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')) ) $redirect['query'] = remove_query_arg(array('year', 'monthnum', 'day'), $redirect['query']); } elseif ( is_month() && get_query_var('year') && isset($_GET['monthnum']) ) { if ( $redirect_url = get_month_link(get_query_var('year'), get_query_var('monthnum')) ) $redirect['query'] = remove_query_arg(array('year', 'monthnum'), $redirect['query']); } elseif ( is_year() && isset($_GET['year']) ) { if ( $redirect_url = get_year_link(get_query_var('year')) ) $redirect['query'] = remove_query_arg('year', $redirect['query']); } elseif ( is_category() && isset($_GET['cat']) ) { if ( $redirect_url = get_category_link(get_query_var('cat')) ) $redirect['query'] = remove_query_arg('cat', $redirect['query']); } elseif ( is_author() && isset($_GET['author']) ) { $author = get_userdata(get_query_var('author')); if ( false !== $author && $redirect_url = get_author_link(false, $author->ID, $author->user_nicename) ) $redirect['query'] = remove_query_arg('author', $redirect['author']); } // paging if ( $paged = get_query_var('paged') ) { if ( $paged > 0 ) { if ( !$redirect_url ) $redirect_url = $requested_url; $paged_redirect = @parse_url($redirect_url); $paged_redirect['path'] = preg_replace('|/page/[0-9]+?(/+)?$|', '/', $paged_redirect['path']); // strip off any existing paging $paged_redirect['path'] = preg_replace('|/index.php/?$|', '/', $paged_redirect['path']); // strip off trailing /index.php/ if ( $paged > 1 && !is_single() ) { $paged_redirect['path'] = trailingslashit($paged_redirect['path']); if ( $wp_rewrite->using_index_permalinks() && strpos($paged_redirect['path'], '/index.php/') === false ) $paged_redirect['path'] .= 'index.php/'; $paged_redirect['path'] .= user_trailingslashit("page/$paged", 'paged'); } elseif ( !is_home() && !is_single() ){ $paged_redirect['path'] = user_trailingslashit($paged_redirect['path'], 'paged'); } $redirect_url = $paged_redirect['scheme'] . '://' . $paged_redirect['host'] . $paged_redirect['path']; $redirect['path'] = $paged_redirect['path']; } $redirect['query'] = remove_query_arg('paged', $redirect['query']); } } // tack on any additional query vars if ( $redirect_url && $redirect['query'] ) { if ( strpos($redirect_url, '?') !== false ) $redirect_url .= '&'; else $redirect_url .= '?'; $redirect_url .= $redirect['query']; } if ( $redirect_url ) $redirect = @parse_url($redirect_url); // www.example.com vs example.com $user_home = @parse_url(get_option('home')); $redirect['host'] = $user_home['host']; // Handle ports if ( isset($user_home['port']) ) $redirect['port'] = $user_home['port']; else unset($redirect['port']); // trailing /index.php/ $redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']); // strip /index.php/ when we're not using PATHINFO permalinks if ( !$wp_rewrite->using_index_permalinks() ) $redirect['path'] = str_replace('/index.php/', '/', $redirect['path']); // trailing slashes if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_home() || ( is_home() && (get_query_var('paged') > 1) ) ) ) { $user_ts_type = ''; if ( get_query_var('paged') > 0 ) { $user_ts_type = 'paged'; } else { foreach ( array('single', 'category', 'page', 'day', 'month', 'year') as $type ) { $func = 'is_' . $type; if ( call_user_func($func) ) $user_ts_type = $type; break; } } $redirect['path'] = user_trailingslashit($redirect['path'], $user_ts_type); } elseif ( is_home() ) { $redirect['path'] = trailingslashit($redirect['path']); } // Always trailing slash the 'home' URL if ( $redirect['path'] == $user_home['path'] ) $redirect['path'] = trailingslashit($redirect['path']); // Ignore differences in host capitalization, as this can lead to infinite redirects if ( strtolower($original['host']) == strtolower($redirect['host']) ) $redirect['host'] = $original['host']; if ( array($original['host'], $original['port'], $original['path'], $original['query']) !== array($redirect['host'], $redirect['port'], $redirect['path'], $redirect['query']) ) { $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; if ( isset($redirect['port']) ) $redirect_url .= ':' . $redirect['port']; $redirect_url .= $redirect['path']; if ( $redirect['query'] ) $redirect_url .= '?' . $redirect['query']; } if ( $redirect_url && $redirect_url != $requested_url ) { // var_dump($redirect_url); die(); $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url); if ( $do_redirect) { // protect against chained redirects if ( !redirect_canonical($redirect_url, false) ) { wp_redirect($redirect_url, 301); exit(); } else { return false; } } else { return $redirect_url; } } else { return false; } } function redirect_guess_404_permalink() { global $wp_query, $wpdb; if ( !get_query_var('name') ) return false; $where = "post_name LIKE '" . $wpdb->escape(get_query_var('name')) . "%'"; // if any of year, monthnum, or day are set, use them to refine the query if ( get_query_var('year') ) $where .= " AND YEAR(post_date) = '" . $wpdb->escape(get_query_var('year')) . "'"; if ( get_query_var('monthnum') ) $where .= " AND MONTH(post_date) = '" . $wpdb->escape(get_query_var('monthnum')) . "'"; if ( get_query_var('day') ) $where .= " AND DAYOFMONTH(post_date) = '" . $wpdb->escape(get_query_var('day')) . "'"; $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'"); if ( !$post_id ) return false; return get_permalink($post_id); } add_action('template_redirect', 'redirect_canonical'); ?>wp-includes/capabilities.php0000644013707600007620000003061110660200570014151 0ustar www_init(); } function _init () { global $wpdb; global $wp_user_roles; $this->role_key = $wpdb->prefix . 'user_roles'; if ( ! empty($wp_user_roles) ) { $this->roles = $wp_user_roles; $this->use_db = false; } else { $this->roles = get_option($this->role_key); } if ( empty($this->roles) ) return; $this->role_objects = array(); $this->role_names = array(); foreach ($this->roles as $role => $data) { $this->role_objects[$role] = new WP_Role($role, $this->roles[$role]['capabilities']); $this->role_names[$role] = $this->roles[$role]['name']; } } function add_role($role, $display_name, $capabilities = '') { if ( isset($this->roles[$role]) ) return; $this->roles[$role] = array( 'name' => $display_name, 'capabilities' => $capabilities); if ( $this->use_db ) update_option($this->role_key, $this->roles); $this->role_objects[$role] = new WP_Role($role, $capabilities); $this->role_names[$role] = $display_name; return $this->role_objects[$role]; } function remove_role($role) { if ( ! isset($this->role_objects[$role]) ) return; unset($this->role_objects[$role]); unset($this->role_names[$role]); unset($this->roles[$role]); if ( $this->use_db ) update_option($this->role_key, $this->roles); } function add_cap($role, $cap, $grant = true) { $this->roles[$role]['capabilities'][$cap] = $grant; if ( $this->use_db ) update_option($this->role_key, $this->roles); } function remove_cap($role, $cap) { unset($this->roles[$role]['capabilities'][$cap]); if ( $this->use_db ) update_option($this->role_key, $this->roles); } function &get_role($role) { if ( isset($this->role_objects[$role]) ) return $this->role_objects[$role]; else return null; } function get_names() { return $this->role_names; } function is_role($role) { return isset($this->role_names[$role]); } } class WP_Role { var $name; var $capabilities; function WP_Role($role, $capabilities) { $this->name = $role; $this->capabilities = $capabilities; } function add_cap($cap, $grant = true) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); $this->capabilities[$cap] = $grant; $wp_roles->add_cap($this->name, $cap, $grant); } function remove_cap($cap) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); unset($this->capabilities[$cap]); $wp_roles->remove_cap($this->name, $cap); } function has_cap($cap) { $capabilities = apply_filters('role_has_cap', $this->capabilities, $cap, $this->name); if ( !empty($capabilities[$cap]) ) return $capabilities[$cap]; else return false; } } class WP_User { var $data; var $ID = 0; var $id = 0; // Deprecated, use $ID instead. var $caps = array(); var $cap_key; var $roles = array(); var $allcaps = array(); function WP_User($id, $name = '') { global $wpdb; if ( empty($id) && empty($name) ) return; if ( ! is_numeric($id) ) { $name = $id; $id = 0; } if ( ! empty($id) ) $this->data = get_userdata($id); else $this->data = get_userdatabylogin($name); if ( empty($this->data->ID) ) return; foreach (get_object_vars($this->data) as $key => $value) { $this->{$key} = $value; } $this->id = $this->ID; $this->_init_caps(); } function _init_caps() { global $wpdb; $this->cap_key = $wpdb->prefix . 'capabilities'; $this->caps = &$this->{$this->cap_key}; if ( ! is_array($this->caps) ) $this->caps = array(); $this->get_role_caps(); } function get_role_caps() { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); //Filter out caps that are not role names and assign to $this->roles if(is_array($this->caps)) $this->roles = array_filter(array_keys($this->caps), array(&$wp_roles, 'is_role')); //Build $allcaps from role caps, overlay user's $caps $this->allcaps = array(); foreach( (array) $this->roles as $role) { $role = $wp_roles->get_role($role); $this->allcaps = array_merge($this->allcaps, $role->capabilities); } $this->allcaps = array_merge($this->allcaps, $this->caps); } function add_role($role) { $this->caps[$role] = true; update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } function remove_role($role) { if ( empty($this->roles[$role]) || (count($this->roles) <= 1) ) return; unset($this->caps[$role]); update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); } function set_role($role) { foreach($this->roles as $oldrole) unset($this->caps[$oldrole]); if ( !empty($role) ) { $this->caps[$role] = true; $this->roles = array($role => true); } else { $this->roles = false; } update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } function level_reduction($max, $item) { if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) { $level = intval($matches[1]); return max($max, $level); } else { return $max; } } function update_user_level_from_caps() { global $wpdb; $this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0); update_usermeta($this->ID, $wpdb->prefix.'user_level', $this->user_level); } function add_cap($cap, $grant = true) { $this->caps[$cap] = $grant; update_usermeta($this->ID, $this->cap_key, $this->caps); } function remove_cap($cap) { if ( empty($this->caps[$cap]) ) return; unset($this->caps[$cap]); update_usermeta($this->ID, $this->cap_key, $this->caps); } function remove_all_caps() { global $wpdb; $this->caps = array(); update_usermeta($this->ID, $this->cap_key, ''); update_usermeta($this->ID, $wpdb->prefix.'user_level', ''); $this->get_role_caps(); } //has_cap(capability_or_role_name) or //has_cap('edit_post', post_id) function has_cap($cap) { if ( is_numeric($cap) ) $cap = $this->translate_level_to_cap($cap); $args = array_slice(func_get_args(), 1); $args = array_merge(array($cap, $this->ID), $args); $caps = call_user_func_array('map_meta_cap', $args); // Must have ALL requested caps $capabilities = apply_filters('user_has_cap', $this->allcaps, $caps, $args); foreach ($caps as $cap) { //echo "Checking cap $cap
    "; if(empty($capabilities[$cap]) || !$capabilities[$cap]) return false; } return true; } function translate_level_to_cap($level) { return 'level_' . $level; } } // Map meta capabilities to primitive capabilities. function map_meta_cap($cap, $user_id) { $args = array_slice(func_get_args(), 2); $caps = array(); switch ($cap) { case 'delete_user': $caps[] = 'delete_users'; break; case 'edit_user': $caps[] = 'edit_users'; break; case 'delete_post': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('delete_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
    "; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... if ($post->post_status == 'publish') $caps[] = 'delete_published_posts'; else // If the post is draft... $caps[] = 'delete_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'delete_others_posts'; // The post is published, extra cap required. if ($post->post_status == 'publish') $caps[] = 'delete_published_posts'; else if ($post->post_status == 'private') $caps[] = 'delete_private_posts'; } break; case 'delete_page': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
    "; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... if ($page->post_status == 'publish') $caps[] = 'delete_published_pages'; else // If the page is draft... $caps[] = 'delete_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'delete_others_pages'; // The page is published, extra cap required. if ($page->post_status == 'publish') $caps[] = 'delete_published_pages'; else if ($page->post_status == 'private') $caps[] = 'delete_private_pages'; } break; // edit_post breaks down to edit_posts, edit_published_posts, or // edit_others_posts case 'edit_post': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('edit_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
    "; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... if ($post->post_status == 'publish') $caps[] = 'edit_published_posts'; else // If the post is draft... $caps[] = 'edit_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'edit_others_posts'; // The post is published, extra cap required. if ($post->post_status == 'publish') $caps[] = 'edit_published_posts'; else if ($post->post_status == 'private') $caps[] = 'edit_private_posts'; } break; case 'edit_page': $author_data = get_userdata($user_id); //echo "post ID: {$args[0]}
    "; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
    "; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... if ($page->post_status == 'publish') $caps[] = 'edit_published_pages'; else // If the page is draft... $caps[] = 'edit_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'edit_others_pages'; // The page is published, extra cap required. if ($page->post_status == 'publish') $caps[] = 'edit_published_pages'; else if ($page->post_status == 'private') $caps[] = 'edit_private_pages'; } break; case 'read_post': $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('read_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } if ( 'private' != $post->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata($user_id); $post_author_data = get_userdata($post->post_author); if ($user_id == $post_author_data->ID) $caps[] = 'read'; else $caps[] = 'read_private_posts'; break; case 'read_page': $page = get_page($args[0]); if ( 'private' != $page->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata($user_id); $page_author_data = get_userdata($page->post_author); if ($user_id == $page_author_data->ID) $caps[] = 'read'; else $caps[] = 'read_private_pages'; break; default: // If no meta caps match, return the original cap. $caps[] = $cap; } return $caps; } // Capability checking wrapper around the global $current_user object. function current_user_can($capability) { $current_user = wp_get_current_user(); if ( empty($current_user) ) return false; $args = array_slice(func_get_args(), 1); $args = array_merge(array($capability), $args); return call_user_func_array(array(&$current_user, 'has_cap'), $args); } // Convenience wrappers around $wp_roles. function get_role($role) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->get_role($role); } function add_role($role, $display_name, $capabilities = '') { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->add_role($role, $display_name, $capabilities); } function remove_role($role) { global $wp_roles; if ( ! isset($wp_roles) ) $wp_roles = new WP_Roles(); return $wp_roles->remove_role($role); } ?> wp-includes/category-template.php0000644013707600007620000003265510673760566015204 0ustar wwwparent == $id ) { $chain .= $before.$category->term_id.$after; $chain .= get_category_children($category->term_id, $before, $after); } } return $chain; } function get_category_link($category_id) { global $wp_rewrite; $catlink = $wp_rewrite->get_category_permastruct(); if ( empty($catlink) ) { $file = get_option('home') . '/'; $catlink = $file . '?cat=' . $category_id; } else { $category = &get_category($category_id); if ( is_wp_error( $category ) ) return $category; $category_nicename = $category->slug; if ( $parent = $category->parent ) $category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename; $catlink = str_replace('%category%', $category_nicename, $catlink); $catlink = get_option('home') . user_trailingslashit($catlink, 'category'); } return apply_filters('category_link', $catlink, $category_id); } function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE){ $chain = ''; $parent = &get_category($id); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->cat_name; if ( $parent->parent && ($parent->parent != $parent->term_id) ) $chain .= get_category_parents($parent->parent, $link, $separator, $nicename); if ( $link ) $chain .= 'cat_name) . '">'.$name.'' . $separator; else $chain .= $name.$separator; return $chain; } function get_the_category($id = false) { global $post, $term_cache, $blog_id; $id = (int) $id; if ( !$id ) $id = (int) $post->ID; $categories = get_object_term_cache($id, 'category'); if ( false === $categories ) $categories = wp_get_object_terms($id, 'category'); if ( !empty($categories) ) usort($categories, '_usort_terms_by_name'); else $categories = array(); foreach(array_keys($categories) as $key) { _make_cat_compat($categories[$key]); } return $categories; } function _usort_terms_by_name($a, $b) { return strcmp($a->name, $b->name); } function _usort_terms_by_ID($a, $b) { if ( $a->term_id > $b->term_id ) return 1; elseif ( $a->term_id < $b->term_id ) return -1; else return 0; } function get_the_category_by_ID($cat_ID) { $cat_ID = (int) $cat_ID; $category = &get_category($cat_ID); if ( is_wp_error( $category ) ) return $category; return $category->name; } function get_the_category_list($separator = '', $parents='') { global $wp_rewrite; $categories = get_the_category(); if (empty($categories)) return apply_filters('the_category', __('Uncategorized'), $separator, $parents); $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; $thelist = ''; if ( '' == $separator ) { $thelist .= ''; } else { $i = 0; foreach ( $categories as $category ) { if ( 0 < $i ) $thelist .= $separator . ' '; switch ( strtolower($parents) ) { case 'multiple': if ( $category->parent ) $thelist .= get_category_parents($category->parent, TRUE); $thelist .= 'name) . '" ' . $rel . '>' . $category->cat_name.''; break; case 'single': $thelist .= 'name) . '" ' . $rel . '>'; if ( $category->parent ) $thelist .= get_category_parents($category->parent, FALSE); $thelist .= "$category->cat_name"; break; case '': default: $thelist .= 'name) . '" ' . $rel . '>' . $category->name.''; } ++$i; } } return apply_filters('the_category', $thelist, $separator, $parents); } function in_category( $category ) { // Check if the current post is in the given category global $post, $blog_id; $categories = get_object_term_cache($post->ID, 'category'); if ( false === $categories ) $categories = wp_get_object_terms($post->ID, 'category'); if(array_key_exists($category, $categories)) return true; else return false; } function the_category($separator = '', $parents='') { echo get_the_category_list($separator, $parents); } function category_description($category = 0) { global $cat; if ( !$category ) $category = $cat; return get_term_field('description', $category, 'category'); } function wp_dropdown_categories($args = '') { $defaults = array( 'show_option_all' => '', 'show_option_none' => '', 'orderby' => 'ID', 'order' => 'ASC', 'show_last_update' => 0, 'show_count' => 0, 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1, 'selected' => 0, 'hierarchical' => 0, 'name' => 'cat', 'class' => 'postform' ); $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0; $r = wp_parse_args( $args, $defaults ); $r['include_last_update_time'] = $r['show_last_update']; extract( $r ); $categories = get_categories($r); $output = ''; if ( ! empty($categories) ) { $output = "\n"; } $output = apply_filters('wp_dropdown_cats', $output); if ( $echo ) echo $output; return $output; } function wp_list_categories($args = '') { $defaults = array( 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', 'hierarchical' => true, 'title_li' => __('Categories'), 'echo' => 1 ); $r = wp_parse_args( $args, $defaults ); if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { $r['pad_counts'] = true; } if ( isset( $r['show_date'] ) ) { $r['include_last_update_time'] = $r['show_date']; } extract( $r ); $categories = get_categories($r); $output = ''; if ( $title_li && 'list' == $style ) $output = '
  • ' . $r['title_li'] . '
      '; if ( empty($categories) ) { if ( 'list' == $style ) $output .= '
    • ' . __("No categories") . '
    • '; else $output .= __("No categories"); } else { global $wp_query; if( !empty($show_option_all) ) if ('list' == $style ) $output .= '
    • ' . $show_option_all . '
    • '; else $output .= '' . $show_option_all . ''; if ( is_category() ) $r['current_category'] = $wp_query->get_queried_object_id(); if ( $hierarchical ) $depth = 0; // Walk the full depth. else $depth = -1; // Flat. $output .= walk_category_tree($categories, $depth, $r); } if ( $title_li && 'list' == $style ) $output .= '
  • '; $output = apply_filters('wp_list_categories', $output); if ( $echo ) echo $output; else return $output; } function wp_tag_cloud( $args = '' ) { $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => '', 'include' => '' ); $args = wp_parse_args( $args, $defaults ); $tags = get_tags( array_merge($args, array('orderby' => 'count', 'order' => 'DESC')) ); // Always query top tags if ( empty($tags) ) return; $return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args if ( is_wp_error( $return ) ) return false; else echo apply_filters( 'wp_tag_cloud', $return, $args ); } // $tags = prefetched tag array ( get_tags() ) // $args['format'] = 'flat' => whitespace separated, 'list' => UL, 'array' => array() // $args['orderby'] = 'name', 'count' function wp_generate_tag_cloud( $tags, $args = '' ) { global $wp_rewrite; $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45, 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC' ); $args = wp_parse_args( $args, $defaults ); extract($args); if ( !$tags ) return; $counts = $tag_links = array(); foreach ( (array) $tags as $tag ) { $counts[$tag->name] = $tag->count; $tag_links[$tag->name] = get_tag_link( $tag->term_id ); if ( is_wp_error( $tag_links[$tag->name] ) ) return $tag_links[$tag->name]; $tag_ids[$tag->name] = $tag->term_id; } $min_count = min($counts); $spread = max($counts) - $min_count; if ( $spread <= 0 ) $spread = 1; $font_spread = $largest - $smallest; if ( $font_spread <= 0 ) $font_spread = 1; $font_step = $font_spread / $spread; // SQL cannot save you; this is a second (potentially different) sort on a subset of data. if ( 'name' == $orderby ) uksort($counts, 'strnatcasecmp'); else asort($counts); if ( 'DESC' == $order ) $counts = array_reverse( $counts, true ); $a = array(); $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : ''; foreach ( $counts as $tag => $count ) { $tag_id = $tag_ids[$tag]; $tag_link = clean_url($tag_links[$tag]); $tag = str_replace(' ', ' ', wp_specialchars( $tag )); $a[] = "$tag"; } switch ( $format ) : case 'array' : $return =& $a; break; case 'list' : $return = "
      \n\t
    • "; $return .= join("
    • \n\t
    • ", $a); $return .= "
    • \n
    \n"; break; default : $return = join("\n", $a); break; endswitch; return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args ); } // // Helper functions // function walk_category_tree() { $walker = new Walker_Category; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } function walk_category_dropdown_tree() { $walker = new Walker_CategoryDropdown; $args = func_get_args(); return call_user_func_array(array(&$walker, 'walk'), $args); } // // Tags // function get_tag_link( $tag_id ) { global $wp_rewrite; $taglink = $wp_rewrite->get_tag_permastruct(); $tag = &get_term($tag_id, 'post_tag'); if ( is_wp_error( $tag ) ) return $tag; $slug = $tag->slug; if ( empty($taglink) ) { $file = get_option('home') . '/'; $taglink = $file . '?tag=' . $slug; } else { $taglink = str_replace('%tag%', $slug, $taglink); $taglink = get_option('home') . user_trailingslashit($taglink, 'category'); } return apply_filters('tag_link', $taglink, $tag_id); } function get_the_tags( $id = 0 ) { global $post; $id = (int) $id; if ( ! $id && ! in_the_loop() ) return false; // in-the-loop function if ( !$id ) $id = (int) $post->ID; $tags = get_object_term_cache($id, 'post_tag'); if ( false === $tags ) $tags = wp_get_object_terms($id, 'post_tag'); $tags = apply_filters( 'get_the_tags', $tags ); if ( empty( $tags ) ) return false; return $tags; } function get_the_tag_list( $before = '', $sep = '', $after = '' ) { $tags = get_the_tags(); if ( empty( $tags ) ) return false; $tag_list = $before; foreach ( $tags as $tag ) { $link = get_tag_link($tag->term_id); if ( is_wp_error( $link ) ) return $link; $tag_links[] = ''; } $tag_links = join( $sep, $tag_links ); $tag_links = apply_filters( 'the_tags', $tag_links ); $tag_list .= $tag_links; $tag_list .= $after; return $tag_list; } function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) { $return = get_the_tag_list($before, $sep, $after); if ( is_wp_error( $return ) ) return false; else echo $return; } ?> wp-includes/category.php0000644013707600007620000001166010673760566013364 0ustar www 'category'); $args = wp_parse_args($args, $defaults); $taxonomy = 'category'; if ( 'link' == $args['type'] ) $taxonomy = 'link_category'; $categories = get_terms($taxonomy, $args); foreach ( array_keys($categories) as $k ) _make_cat_compat($categories[$k]); return $categories; } // Retrieves category data given a category ID or category object. // Handles category caching. function &get_category($category, $output = OBJECT, $filter = 'raw') { $category = get_term($category, 'category', $output, $filter); if ( is_wp_error( $category ) ) return $category; _make_cat_compat($category); return $category; } function get_category_by_path($category_path, $full_match = true, $output = OBJECT) { global $wpdb; $category_path = rawurlencode(urldecode($category_path)); $category_path = str_replace('%2F', '/', $category_path); $category_path = str_replace('%20', ' ', $category_path); $category_paths = '/' . trim($category_path, '/'); $leaf_path = sanitize_title(basename($category_paths)); $category_paths = explode('/', $category_paths); $full_path = ''; foreach ( (array) $category_paths as $pathdir ) $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir); $categories = get_terms('category', "get=all&slug=$leaf_path"); if ( empty($categories) ) return NULL; foreach ($categories as $category) { $path = '/' . $leaf_path; $curcategory = $category; while ( ($curcategory->parent != 0) && ($curcategory->parent != $curcategory->term_id) ) { $curcategory = get_term($curcategory->parent, 'category'); if ( is_wp_error( $curcategory ) ) return $curcategory; $path = '/' . $curcategory->slug . $path; } if ( $path == $full_path ) return get_category($category->term_id, $output); } // If full matching is not required, return the first cat that matches the leaf. if ( ! $full_match ) return get_category($categories[0]->term_id, $output); return NULL; } function get_category_by_slug( $slug ) { $category = get_term_by('slug', $slug, 'category'); if ( $category ) _make_cat_compat($category); return $category; } // Get the ID of a category from its name function get_cat_ID($cat_name='General') { global $wpdb; $cat = get_term_by('name', $cat_name, 'category'); if ($cat) return $cat->term_id; return 0; } // Deprecate function get_catname($cat_ID) { return get_cat_name($cat_ID); } // Get the name of a category from its ID function get_cat_name($cat_id) { $cat_id = (int) $cat_id; $category = &get_category($cat_id); return $category->name; } function cat_is_ancestor_of($cat1, $cat2) { if ( is_int($cat1) ) $cat1 = & get_category($cat1); if ( is_int($cat2) ) $cat2 = & get_category($cat2); if ( !$cat1->term_id || !$cat2->parent ) return false; if ( $cat2->parent == $cat1->term_id ) return true; return cat_is_ancestor_of($cat1, get_category($cat2->parent)); } function sanitize_category($category, $context = 'display') { return sanitize_term($category, 'category', $context); } function sanitize_category_field($field, $value, $cat_id, $context) { return sanitize_term_field($field, $value, $cat_id, 'category', $context); } // Tags function &get_tags($args = '') { global $wpdb, $category_links; $key = md5( serialize( $args ) ); if ( $cache = wp_cache_get( 'get_tags', 'category' ) ) if ( isset( $cache[ $key ] ) ) return apply_filters('get_tags', $cache[$key], $args); $tags = get_terms('post_tag', $args); if ( empty($tags) ) return array(); $cache[ $key ] = $tags; wp_cache_set( 'get_tags', $cache, 'category' ); $tags = apply_filters('get_tags', $tags, $args); return $tags; } function &get_tag($tag, $output = OBJECT, $filter = 'raw') { return get_term($tag, 'post_tag', $output, $filter); } // // Cache // function update_category_cache() { return true; } function clean_category_cache($id) { clean_term_cache($id, 'category'); } // // Private helpers // function _make_cat_compat( &$category) { if ( is_object($category) ) { $category->cat_ID = &$category->term_id; $category->category_count = &$category->count; $category->category_description = &$category->description; $category->cat_name = &$category->name; $category->category_nicename = &$category->slug; $category->category_parent = &$category->parent; } else if ( is_array($category) && isset($category['term_id']) ) { $category['cat_ID'] = &$category['term_id']; $category['category_count'] = &$category['count']; $category['category_description'] = &$category['description']; $category['cat_name'] = &$category['name']; $category['category_nicename'] = &$category['slug']; $category['category_parent'] = &$category['parent']; } } ?> wp-includes/class-IXR.php0000644013707600007620000006555710667076612013325 0ustar wwwdata = $data; if (!$type) { $type = $this->calculateType(); } $this->type = $type; if ($type == 'struct') { /* Turn all the values in the array in to new IXR_Value objects */ foreach ($this->data as $key => $value) { $this->data[$key] = new IXR_Value($value); } } if ($type == 'array') { for ($i = 0, $j = count($this->data); $i < $j; $i++) { $this->data[$i] = new IXR_Value($this->data[$i]); } } } function calculateType() { if ($this->data === true || $this->data === false) { return 'boolean'; } if (is_integer($this->data)) { return 'int'; } if (is_double($this->data)) { return 'double'; } // Deal with IXR object types base64 and date if (is_object($this->data) && is_a($this->data, 'IXR_Date')) { return 'date'; } if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) { return 'base64'; } // If it is a normal PHP object convert it in to a struct if (is_object($this->data)) { $this->data = get_object_vars($this->data); return 'struct'; } if (!is_array($this->data)) { return 'string'; } /* We have an array - is it an array or a struct ? */ if ($this->isStruct($this->data)) { return 'struct'; } else { return 'array'; } } function getXml() { /* Return XML for this value */ switch ($this->type) { case 'boolean': return ''.(($this->data) ? '1' : '0').''; break; case 'int': return ''.$this->data.''; break; case 'double': return ''.$this->data.''; break; case 'string': return ''.htmlspecialchars($this->data).''; break; case 'array': $return = ''."\n"; foreach ($this->data as $item) { $return .= ' '.$item->getXml()."\n"; } $return .= ''; return $return; break; case 'struct': $return = ''."\n"; foreach ($this->data as $name => $value) { $name = htmlspecialchars($name); $return .= " $name"; $return .= $value->getXml()."\n"; } $return .= ''; return $return; break; case 'date': case 'base64': return $this->data->getXml(); break; } return false; } function isStruct($array) { /* Nasty function to check if an array is a struct or not */ $expected = 0; foreach ($array as $key => $value) { if ((string)$key != (string)$expected) { return true; } $expected++; } return false; } } class IXR_Message { var $message; var $messageType; // methodCall / methodResponse / fault var $faultCode; var $faultString; var $methodName; var $params; // Current variable stacks var $_arraystructs = array(); // The stack used to keep track of the current array/struct var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array var $_currentStructName = array(); // A stack as well var $_param; var $_value; var $_currentTag; var $_currentTagContents; // The XML parser var $_parser; function IXR_Message ($message) { $this->message = $message; } function parse() { // first remove the XML declaration $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message); if (trim($this->message) == '') { return false; } $this->_parser = xml_parser_create(); // Set XML parser to take the case of tags in to account xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); // Set XML parser callback functions xml_set_object($this->_parser, $this); xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); xml_set_character_data_handler($this->_parser, 'cdata'); if (!xml_parse($this->_parser, $this->message)) { /* die(sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($this->_parser)), xml_get_current_line_number($this->_parser))); */ return false; } xml_parser_free($this->_parser); // Grab the error messages, if any if ($this->messageType == 'fault') { $this->faultCode = $this->params[0]['faultCode']; $this->faultString = $this->params[0]['faultString']; } return true; } function tag_open($parser, $tag, $attr) { $this->_currentTagContents = ''; $this->currentTag = $tag; switch($tag) { case 'methodCall': case 'methodResponse': case 'fault': $this->messageType = $tag; break; /* Deal with stacks of arrays and structs */ case 'data': // data is to all intents and puposes more interesting than array $this->_arraystructstypes[] = 'array'; $this->_arraystructs[] = array(); break; case 'struct': $this->_arraystructstypes[] = 'struct'; $this->_arraystructs[] = array(); break; } } function cdata($parser, $cdata) { $this->_currentTagContents .= $cdata; } function tag_close($parser, $tag) { $valueFlag = false; switch($tag) { case 'int': case 'i4': $value = (int) trim($this->_currentTagContents); $valueFlag = true; break; case 'double': $value = (double) trim($this->_currentTagContents); $valueFlag = true; break; case 'string': $value = $this->_currentTagContents; $valueFlag = true; break; case 'dateTime.iso8601': $value = new IXR_Date(trim($this->_currentTagContents)); // $value = $iso->getTimestamp(); $valueFlag = true; break; case 'value': // "If no type is indicated, the type is string." if (trim($this->_currentTagContents) != '') { $value = (string)$this->_currentTagContents; $valueFlag = true; } break; case 'boolean': $value = (boolean) trim($this->_currentTagContents); $valueFlag = true; break; case 'base64': $value = base64_decode( trim( $this->_currentTagContents ) ); $valueFlag = true; break; /* Deal with stacks of arrays and structs */ case 'data': case 'struct': $value = array_pop($this->_arraystructs); array_pop($this->_arraystructstypes); $valueFlag = true; break; case 'member': array_pop($this->_currentStructName); break; case 'name': $this->_currentStructName[] = trim($this->_currentTagContents); break; case 'methodName': $this->methodName = trim($this->_currentTagContents); break; } if ($valueFlag) { if (count($this->_arraystructs) > 0) { // Add value to struct or array if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { // Add to struct $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; } else { // Add to array $this->_arraystructs[count($this->_arraystructs)-1][] = $value; } } else { // Just add as a paramater $this->params[] = $value; } } $this->_currentTagContents = ''; } } class IXR_Server { var $data; var $callbacks = array(); var $message; var $capabilities; function IXR_Server($callbacks = false, $data = false) { $this->setCapabilities(); if ($callbacks) { $this->callbacks = $callbacks; } $this->setCallbacks(); $this->serve($data); } function serve($data = false) { if (!$data) { global $HTTP_RAW_POST_DATA; if (!$HTTP_RAW_POST_DATA) { die('XML-RPC server accepts POST requests only.'); } $data = $HTTP_RAW_POST_DATA; } $this->message = new IXR_Message($data); if (!$this->message->parse()) { $this->error(-32700, 'parse error. not well formed'); } if ($this->message->messageType != 'methodCall') { $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall'); } $result = $this->call($this->message->methodName, $this->message->params); // Is the result an error? if (is_a($result, 'IXR_Error')) { $this->error($result); } // Encode the result $r = new IXR_Value($result); $resultxml = $r->getXml(); // Create the XML $xml = << $resultxml EOD; // Send it $this->output($xml); } function call($methodname, $args) { if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.'); } $method = $this->callbacks[$methodname]; // Perform the callback and send the response if (count($args) == 1) { // If only one paramater just send that instead of the whole array $args = $args[0]; } // Are we dealing with a function or a method? if (substr($method, 0, 5) == 'this:') { // It's a class method - check it exists $method = substr($method, 5); if (!method_exists($this, $method)) { return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); } // Call the method $result = $this->$method($args); } else { // It's a function - does it exist? if (is_array($method)) { if (!method_exists($method[0], $method[1])) { return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.'); } } else if (!function_exists($method)) { return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); } // Call the function $result = call_user_func($method, $args); } return $result; } function error($error, $message = false) { // Accepts either an error object or an error code and message if ($message && !is_object($error)) { $error = new IXR_Error($error, $message); } $this->output($error->getXml()); } function output($xml) { $xml = ''."\n".$xml; $length = strlen($xml); header('Connection: close'); header('Content-Length: '.$length); header('Content-Type: text/xml'); header('Date: '.date('r')); echo $xml; exit; } function hasMethod($method) { return in_array($method, array_keys($this->callbacks)); } function setCapabilities() { // Initialises capabilities array $this->capabilities = array( 'xmlrpc' => array( 'specUrl' => 'http://www.xmlrpc.com/spec', 'specVersion' => 1 ), 'faults_interop' => array( 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php', 'specVersion' => 20010516 ), 'system.multicall' => array( 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208', 'specVersion' => 1 ), ); } function getCapabilities($args) { return $this->capabilities; } function setCallbacks() { $this->callbacks['system.getCapabilities'] = 'this:getCapabilities'; $this->callbacks['system.listMethods'] = 'this:listMethods'; $this->callbacks['system.multicall'] = 'this:multiCall'; } function listMethods($args) { // Returns a list of methods - uses array_reverse to ensure user defined // methods are listed before server defined methods return array_reverse(array_keys($this->callbacks)); } function multiCall($methodcalls) { // See http://www.xmlrpc.com/discuss/msgReader$1208 $return = array(); foreach ($methodcalls as $call) { $method = $call['methodName']; $params = $call['params']; if ($method == 'system.multicall') { $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); } else { $result = $this->call($method, $params); } if (is_a($result, 'IXR_Error')) { $return[] = array( 'faultCode' => $result->code, 'faultString' => $result->message ); } else { $return[] = array($result); } } return $return; } } class IXR_Request { var $method; var $args; var $xml; function IXR_Request($method, $args) { $this->method = $method; $this->args = $args; $this->xml = << {$this->method} EOD; foreach ($this->args as $arg) { $this->xml .= ''; $v = new IXR_Value($arg); $this->xml .= $v->getXml(); $this->xml .= "\n"; } $this->xml .= ''; } function getLength() { return strlen($this->xml); } function getXml() { return $this->xml; } } class IXR_Client { var $server; var $port; var $path; var $useragent; var $response; var $message = false; var $debug = false; var $timeout; // Storage place for an error message var $error = false; function IXR_Client($server, $path = false, $port = 80, $timeout = false) { if (!$path) { // Assume we have been given a URL instead $bits = parse_url($server); $this->server = $bits['host']; $this->port = isset($bits['port']) ? $bits['port'] : 80; $this->path = isset($bits['path']) ? $bits['path'] : '/'; // Make absolutely sure we have a path if (!$this->path) { $this->path = '/'; } } else { $this->server = $server; $this->path = $path; $this->port = $port; } $this->useragent = 'Incutio XML-RPC'; $this->timeout = $timeout; } function query() { $args = func_get_args(); $method = array_shift($args); $request = new IXR_Request($method, $args); $length = $request->getLength(); $xml = $request->getXml(); $r = "\r\n"; $request = "POST {$this->path} HTTP/1.0$r"; $request .= "Host: {$this->server}$r"; $request .= "Content-Type: text/xml$r"; $request .= "User-Agent: {$this->useragent}$r"; $request .= "Content-length: {$length}$r$r"; $request .= $xml; // Now send the request if ($this->debug) { echo '
    '.htmlspecialchars($request)."\n
    \n\n"; } if ($this->timeout) { $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); } else { $fp = @fsockopen($this->server, $this->port, $errno, $errstr); } if (!$fp) { $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr"); return false; } fputs($fp, $request); $contents = ''; $gotFirstLine = false; $gettingHeaders = true; while (!feof($fp)) { $line = fgets($fp, 4096); if (!$gotFirstLine) { // Check line for '200' if (strstr($line, '200') === false) { $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200'); return false; } $gotFirstLine = true; } if (trim($line) == '') { $gettingHeaders = false; } if (!$gettingHeaders) { $contents .= trim($line)."\n"; } } if ($this->debug) { echo '
    '.htmlspecialchars($contents)."\n
    \n\n"; } // Now parse what we've got back $this->message = new IXR_Message($contents); if (!$this->message->parse()) { // XML error $this->error = new IXR_Error(-32700, 'parse error. not well formed'); return false; } // Is the message a fault? if ($this->message->messageType == 'fault') { $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString); return false; } // Message must be OK return true; } function getResponse() { // methodResponses can only have one param - return that return $this->message->params[0]; } function isError() { return (is_object($this->error)); } function getErrorCode() { return $this->error->code; } function getErrorMessage() { return $this->error->message; } } class IXR_Error { var $code; var $message; function IXR_Error($code, $message) { $this->code = $code; $this->message = $message; } function getXml() { $xml = << faultCode {$this->code} faultString {$this->message} EOD; return $xml; } } class IXR_Date { var $year; var $month; var $day; var $hour; var $minute; var $second; function IXR_Date($time) { // $time can be a PHP timestamp or an ISO one if (is_numeric($time)) { $this->parseTimestamp($time); } else { $this->parseIso($time); } } function parseTimestamp($timestamp) { $this->year = date('Y', $timestamp); $this->month = date('m', $timestamp); $this->day = date('d', $timestamp); $this->hour = date('H', $timestamp); $this->minute = date('i', $timestamp); $this->second = date('s', $timestamp); } function parseIso($iso) { $this->year = substr($iso, 0, 4); $this->month = substr($iso, 4, 2); $this->day = substr($iso, 6, 2); $this->hour = substr($iso, 9, 2); $this->minute = substr($iso, 12, 2); $this->second = substr($iso, 15, 2); $this->timezone = substr($iso, 17); } function getIso() { return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone; } function getXml() { return ''.$this->getIso().''; } function getTimestamp() { return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); } } class IXR_Base64 { var $data; function IXR_Base64($data) { $this->data = $data; } function getXml() { return ''.base64_encode($this->data).''; } } class IXR_IntrospectionServer extends IXR_Server { var $signatures; var $help; function IXR_IntrospectionServer() { $this->setCallbacks(); $this->setCapabilities(); $this->capabilities['introspection'] = array( 'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html', 'specVersion' => 1 ); $this->addCallback( 'system.methodSignature', 'this:methodSignature', array('array', 'string'), 'Returns an array describing the return type and required parameters of a method' ); $this->addCallback( 'system.getCapabilities', 'this:getCapabilities', array('struct'), 'Returns a struct describing the XML-RPC specifications supported by this server' ); $this->addCallback( 'system.listMethods', 'this:listMethods', array('array'), 'Returns an array of available methods on this server' ); $this->addCallback( 'system.methodHelp', 'this:methodHelp', array('string', 'string'), 'Returns a documentation string for the specified method' ); } function addCallback($method, $callback, $args, $help) { $this->callbacks[$method] = $callback; $this->signatures[$method] = $args; $this->help[$method] = $help; } function call($methodname, $args) { // Make sure it's in an array if ($args && !is_array($args)) { $args = array($args); } // Over-rides default call method, adds signature check if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.'); } $method = $this->callbacks[$methodname]; $signature = $this->signatures[$methodname]; $returnType = array_shift($signature); // Check the number of arguments if (count($args) != count($signature)) { return new IXR_Error(-32602, 'server error. wrong number of method parameters'); } // Check the argument types $ok = true; $argsbackup = $args; for ($i = 0, $j = count($args); $i < $j; $i++) { $arg = array_shift($args); $type = array_shift($signature); switch ($type) { case 'int': case 'i4': if (is_array($arg) || !is_int($arg)) { $ok = false; } break; case 'base64': case 'string': if (!is_string($arg)) { $ok = false; } break; case 'boolean': if ($arg !== false && $arg !== true) { $ok = false; } break; case 'float': case 'double': if (!is_float($arg)) { $ok = false; } break; case 'date': case 'dateTime.iso8601': if (!is_a($arg, 'IXR_Date')) { $ok = false; } break; } if (!$ok) { return new IXR_Error(-32602, 'server error. invalid method parameters'); } } // It passed the test - run the "real" method call return parent::call($methodname, $argsbackup); } function methodSignature($method) { if (!$this->hasMethod($method)) { return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); } // We should be returning an array of types $types = $this->signatures[$method]; $return = array(); foreach ($types as $type) { switch ($type) { case 'string': $return[] = 'string'; break; case 'int': case 'i4': $return[] = 42; break; case 'double': $return[] = 3.1415; break; case 'dateTime.iso8601': $return[] = new IXR_Date(time()); break; case 'boolean': $return[] = true; break; case 'base64': $return[] = new IXR_Base64('base64'); break; case 'array': $return[] = array('array'); break; case 'struct': $return[] = array('struct' => 'struct'); break; } } return $return; } function methodHelp($method) { return $this->help[$method]; } } class IXR_ClientMulticall extends IXR_Client { var $calls = array(); function IXR_ClientMulticall($server, $path = false, $port = 80) { parent::IXR_Client($server, $path, $port); $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; } function addCall() { $args = func_get_args(); $methodName = array_shift($args); $struct = array( 'methodName' => $methodName, 'params' => $args ); $this->calls[] = $struct; } function query() { // Prepare multicall, then call the parent::query() method return parent::query('system.multicall', $this->calls); } } ?>wp-includes/class-phpmailer.php0000644013707600007620000013005210667076612014623 0ustar wwwContentType = "text/html"; else $this->ContentType = "text/plain"; } /** * Sets Mailer to send message using SMTP. * @return void */ function IsSMTP() { $this->Mailer = "smtp"; } /** * Sets Mailer to send message using PHP mail() function. * @return void */ function IsMail() { $this->Mailer = "mail"; } /** * Sets Mailer to send message using the $Sendmail program. * @return void */ function IsSendmail() { $this->Mailer = "sendmail"; } /** * Sets Mailer to send message using the qmail MTA. * @return void */ function IsQmail() { $this->Sendmail = "/var/qmail/bin/sendmail"; $this->Mailer = "sendmail"; } ///////////////////////////////////////////////// // RECIPIENT METHODS ///////////////////////////////////////////////// /** * Adds a "To" address. * @param string $address * @param string $name * @return void */ function AddAddress($address, $name = "") { $cur = count($this->to); $this->to[$cur][0] = trim($address); $this->to[$cur][1] = $name; } /** * Adds a "Cc" address. Note: this function works * with the SMTP mailer on win32, not with the "mail" * mailer. * @param string $address * @param string $name * @return void */ function AddCC($address, $name = "") { $cur = count($this->cc); $this->cc[$cur][0] = trim($address); $this->cc[$cur][1] = $name; } /** * Adds a "Bcc" address. Note: this function works * with the SMTP mailer on win32, not with the "mail" * mailer. * @param string $address * @param string $name * @return void */ function AddBCC($address, $name = "") { $cur = count($this->bcc); $this->bcc[$cur][0] = trim($address); $this->bcc[$cur][1] = $name; } /** * Adds a "Reply-to" address. * @param string $address * @param string $name * @return void */ function AddReplyTo($address, $name = "") { $cur = count($this->ReplyTo); $this->ReplyTo[$cur][0] = trim($address); $this->ReplyTo[$cur][1] = $name; } ///////////////////////////////////////////////// // MAIL SENDING METHODS ///////////////////////////////////////////////// /** * Creates message and assigns Mailer. If the message is * not sent successfully then it returns false. Use the ErrorInfo * variable to view description of the error. * @return bool */ function Send() { $header = ""; $body = ""; $result = true; if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { $this->SetError($this->Lang("provide_address")); return false; } // Set whether the message is multipart/alternative if(!empty($this->AltBody)) $this->ContentType = "multipart/alternative"; $this->error_count = 0; // reset errors $this->SetMessageType(); $header .= $this->CreateHeader(); $body = $this->CreateBody(); if($body == "") { return false; } // Choose the mailer switch($this->Mailer) { case "sendmail": $result = $this->SendmailSend($header, $body); break; case "mail": $result = $this->MailSend($header, $body); break; case "smtp": $result = $this->SmtpSend($header, $body); break; default: $this->SetError($this->Mailer . $this->Lang("mailer_not_supported")); $result = false; break; } return $result; } /** * Sends mail using the $Sendmail program. * @access private * @return bool */ function SendmailSend($header, $body) { if ($this->Sender != "") $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, escapeshellarg($this->Sender)); else $sendmail = sprintf("%s -oi -t", $this->Sendmail); if(!@$mail = popen($sendmail, "w")) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail) >> 8 & 0xFF; if($result != 0) { $this->SetError($this->Lang("execute") . $this->Sendmail); return false; } return true; } /** * Sends mail using the PHP mail() function. * @access private * @return bool */ function MailSend($header, $body) { $to = ""; for($i = 0; $i < count($this->to); $i++) { if($i != 0) { $to .= ", "; } $to .= $this->to[$i][0]; } if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1) { $old_from = ini_get("sendmail_from"); ini_set("sendmail_from", $this->Sender); $params = sprintf("-oi -f %s", $this->Sender); $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header, $params); } else $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header); if (isset($old_from)) ini_set("sendmail_from", $old_from); if(!$rt) { $this->SetError($this->Lang("instantiate")); return false; } return true; } /** * Sends mail via SMTP using PhpSMTP (Author: * Chris Ryan). Returns bool. Returns false if there is a * bad MAIL FROM, RCPT, or DATA input. * @access private * @return bool */ function SmtpSend($header, $body) { include_once($this->PluginDir . "class-smtp.php"); $error = ""; $bad_rcpt = array(); if(!$this->SmtpConnect()) return false; $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender; if(!$this->smtp->Mail($smtp_from)) { $error = $this->Lang("from_failed") . $smtp_from; $this->SetError($error); $this->smtp->Reset(); return false; } // Attempt to send attach all recipients for($i = 0; $i < count($this->to); $i++) { if(!$this->smtp->Recipient($this->to[$i][0])) $bad_rcpt[] = $this->to[$i][0]; } for($i = 0; $i < count($this->cc); $i++) { if(!$this->smtp->Recipient($this->cc[$i][0])) $bad_rcpt[] = $this->cc[$i][0]; } for($i = 0; $i < count($this->bcc); $i++) { if(!$this->smtp->Recipient($this->bcc[$i][0])) $bad_rcpt[] = $this->bcc[$i][0]; } if(count($bad_rcpt) > 0) // Create error message { for($i = 0; $i < count($bad_rcpt); $i++) { if($i != 0) { $error .= ", "; } $error .= $bad_rcpt[$i]; } $error = $this->Lang("recipients_failed") . $error; $this->SetError($error); $this->smtp->Reset(); return false; } if(!$this->smtp->Data($header . $body)) { $this->SetError($this->Lang("data_not_accepted")); $this->smtp->Reset(); return false; } if($this->SMTPKeepAlive == true) $this->smtp->Reset(); else $this->SmtpClose(); return true; } /** * Initiates a connection to an SMTP server. Returns false if the * operation failed. * @access private * @return bool */ function SmtpConnect() { if($this->smtp == NULL) { $this->smtp = new SMTP(); } $this->smtp->do_debug = $this->SMTPDebug; $hosts = explode(";", $this->Host); $index = 0; $connection = ($this->smtp->Connected()); // Retry while there is no connection while($index < count($hosts) && $connection == false) { if(strstr($hosts[$index], ":")) list($host, $port) = explode(":", $hosts[$index]); else { $host = $hosts[$index]; $port = $this->Port; } if($this->smtp->Connect($host, $port, $this->Timeout)) { if ($this->Helo != '') $this->smtp->Hello($this->Helo); else $this->smtp->Hello($this->ServerHostname()); if($this->SMTPAuth) { if(!$this->smtp->Authenticate($this->Username, $this->Password)) { $this->SetError($this->Lang("authenticate")); $this->smtp->Reset(); $connection = false; } } $connection = true; } $index++; } if(!$connection) $this->SetError($this->Lang("connect_host")); return $connection; } /** * Closes the active SMTP session if one exists. * @return void */ function SmtpClose() { if($this->smtp != NULL) { if($this->smtp->Connected()) { $this->smtp->Quit(); $this->smtp->Close(); } } } /** * Sets the language for all class error messages. Returns false * if it cannot load the language file. The default language type * is English. * @param string $lang_type Type of language (e.g. Portuguese: "br") * @param string $lang_path Path to the language file directory * @access public * @return bool */ function SetLanguage($lang_type, $lang_path = "language/") { if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) include($lang_path.'phpmailer.lang-'.$lang_type.'.php'); else if(file_exists($lang_path.'phpmailer.lang-en.php')) include($lang_path.'phpmailer.lang-en.php'); else { $this->SetError("Could not load language file"); return false; } $this->language = $PHPMAILER_LANG; return true; } ///////////////////////////////////////////////// // MESSAGE CREATION METHODS ///////////////////////////////////////////////// /** * Creates recipient headers. * @access private * @return string */ function AddrAppend($type, $addr) { $addr_str = $type . ": "; $addr_str .= $this->AddrFormat($addr[0]); if(count($addr) > 1) { for($i = 1; $i < count($addr); $i++) $addr_str .= ", " . $this->AddrFormat($addr[$i]); } $addr_str .= $this->LE; return $addr_str; } /** * Formats an address correctly. * @access private * @return string */ function AddrFormat($addr) { if(empty($addr[1])) $formatted = $addr[0]; else { $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" . $addr[0] . ">"; } return $formatted; } /** * Wraps message for use with mailers that do not * automatically perform wrapping and for quoted-printable. * Original written by philippe. * @access private * @return string */ function WrapText($message, $length, $qp_mode = false) { $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; $message = $this->FixEOL($message); if (substr($message, -1) == $this->LE) $message = substr($message, 0, -1); $line = explode($this->LE, $message); $message = ""; for ($i=0 ;$i < count($line); $i++) { $line_part = explode(" ", $line[$i]); $buf = ""; for ($e = 0; $e $length)) { $space_left = $length - strlen($buf) - 1; if ($e != 0) { if ($space_left > 20) { $len = $space_left; if (substr($word, $len - 1, 1) == "=") $len--; elseif (substr($word, $len - 2, 1) == "=") $len -= 2; $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= " " . $part; $message .= $buf . sprintf("=%s", $this->LE); } else { $message .= $buf . $soft_break; } $buf = ""; } while (strlen($word) > 0) { $len = $length; if (substr($word, $len - 1, 1) == "=") $len--; elseif (substr($word, $len - 2, 1) == "=") $len -= 2; $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) $message .= $part . sprintf("=%s", $this->LE); else $buf = $part; } } else { $buf_o = $buf; $buf .= ($e == 0) ? $word : (" " . $word); if (strlen($buf) > $length and $buf_o != "") { $message .= $buf_o . $soft_break; $buf = $word; } } } $message .= $buf . $this->LE; } return $message; } /** * Set the body wrapping. * @access private * @return void */ function SetWordWrap() { if($this->WordWrap < 1) return; switch($this->message_type) { case "alt": // fall through case "alt_attachments": $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); break; default: $this->Body = $this->WrapText($this->Body, $this->WordWrap); break; } } /** * Assembles message header. * @access private * @return string */ function CreateHeader() { $result = ""; // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = "b1_" . $uniq_id; $this->boundary[2] = "b2_" . $uniq_id; $result .= $this->HeaderLine("Date", $this->RFCDate()); if($this->Sender == "") $result .= $this->HeaderLine("Return-Path", trim($this->From)); else $result .= $this->HeaderLine("Return-Path", trim($this->Sender)); // To be created automatically by mail() if($this->Mailer != "mail") { if(count($this->to) > 0) $result .= $this->AddrAppend("To", $this->to); else if (count($this->cc) == 0) $result .= $this->HeaderLine("To", "undisclosed-recipients:;"); if(count($this->cc) > 0) $result .= $this->AddrAppend("Cc", $this->cc); } $from = array(); $from[0][0] = trim($this->From); $from[0][1] = $this->FromName; $result .= $this->AddrAppend("From", $from); // sendmail and mail() extract Bcc from the header before sending if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0)) $result .= $this->AddrAppend("Bcc", $this->bcc); if(count($this->ReplyTo) > 0) $result .= $this->AddrAppend("Reply-to", $this->ReplyTo); // mail() sets the subject itself if($this->Mailer != "mail") $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject))); $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); $result .= $this->HeaderLine("X-Priority", $this->Priority); if($this->ConfirmReadingTo != "") { $result .= $this->HeaderLine("Disposition-Notification-To", "<" . trim($this->ConfirmReadingTo) . ">"); } // Add custom headers for($index = 0; $index < count($this->CustomHeader); $index++) { $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); } $result .= $this->HeaderLine("MIME-Version", "1.0"); switch($this->message_type) { case "plain": $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding); $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); break; case "attachments": // fall through case "alt_attachments": if($this->InlineImageExists()) { $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", "multipart/related", $this->LE, $this->LE, $this->boundary[1], $this->LE); } else { $result .= $this->HeaderLine("Content-Type", "multipart/mixed;"); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); } break; case "alt": $result .= $this->HeaderLine("Content-Type", "multipart/alternative;"); $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); break; } if($this->Mailer != "mail") $result .= $this->LE.$this->LE; return $result; } /** * Assembles the message body. Returns an empty string on failure. * @access private * @return string */ function CreateBody() { $result = ""; $this->SetWordWrap(); switch($this->message_type) { case "alt": $result .= $this->GetBoundary($this->boundary[1], "", "text/plain", ""); $result .= $this->EncodeString($this->AltBody, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->GetBoundary($this->boundary[1], "", "text/html", ""); $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->EndBoundary($this->boundary[1]); break; case "plain": $result .= $this->EncodeString($this->Body, $this->Encoding); break; case "attachments": $result .= $this->GetBoundary($this->boundary[1], "", "", ""); $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE; $result .= $this->AttachAll(); break; case "alt_attachments": $result .= sprintf("--%s%s", $this->boundary[1], $this->LE); $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", "multipart/alternative", $this->LE, $this->boundary[2], $this->LE.$this->LE); // Create text body $result .= $this->GetBoundary($this->boundary[2], "", "text/plain", "") . $this->LE; $result .= $this->EncodeString($this->AltBody, $this->Encoding); $result .= $this->LE.$this->LE; // Create the HTML body $result .= $this->GetBoundary($this->boundary[2], "", "text/html", "") . $this->LE; $result .= $this->EncodeString($this->Body, $this->Encoding); $result .= $this->LE.$this->LE; $result .= $this->EndBoundary($this->boundary[2]); $result .= $this->AttachAll(); break; } if($this->IsError()) $result = ""; return $result; } /** * Returns the start of a message boundary. * @access private */ function GetBoundary($boundary, $charSet, $contentType, $encoding) { $result = ""; if($charSet == "") { $charSet = $this->CharSet; } if($contentType == "") { $contentType = $this->ContentType; } if($encoding == "") { $encoding = $this->Encoding; } $result .= $this->TextLine("--" . $boundary); $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet); $result .= $this->LE; $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding); $result .= $this->LE; return $result; } /** * Returns the end of a message boundary. * @access private */ function EndBoundary($boundary) { return $this->LE . "--" . $boundary . "--" . $this->LE; } /** * Sets the message type. * @access private * @return void */ function SetMessageType() { if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) $this->message_type = "plain"; else { if(count($this->attachment) > 0) $this->message_type = "attachments"; if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) $this->message_type = "alt"; if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) $this->message_type = "alt_attachments"; } } /** * Returns a formatted header line. * @access private * @return string */ function HeaderLine($name, $value) { return $name . ": " . $value . $this->LE; } /** * Returns a formatted mail line. * @access private * @return string */ function TextLine($value) { return $value . $this->LE; } ///////////////////////////////////////////////// // ATTACHMENT METHODS ///////////////////////////////////////////////// /** * Adds an attachment from a path on the filesystem. * Returns false if the file could not be found * or accessed. * @param string $path Path to the attachment. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ function AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream") { if(!@is_file($path)) { $this->SetError($this->Lang("file_access") . $path); return false; } $filename = basename($path); if($name == "") $name = $filename; $cur = count($this->attachment); $this->attachment[$cur][0] = $path; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $name; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = false; // isStringAttachment $this->attachment[$cur][6] = "attachment"; $this->attachment[$cur][7] = 0; return true; } /** * Attaches all fs, string, and binary attachments to the message. * Returns an empty string on failure. * @access private * @return string */ function AttachAll() { // Return text of body $mime = array(); // Add all attachments for($i = 0; $i < count($this->attachment); $i++) { // Check for string attachment $bString = $this->attachment[$i][5]; if ($bString) $string = $this->attachment[$i][0]; else $path = $this->attachment[$i][0]; $filename = $this->attachment[$i][1]; $name = $this->attachment[$i][2]; $encoding = $this->attachment[$i][3]; $type = $this->attachment[$i][4]; $disposition = $this->attachment[$i][6]; $cid = $this->attachment[$i][7]; $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); if($disposition == "inline") $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE); // Encode as string attachment if($bString) { $mime[] = $this->EncodeString($string, $encoding); if($this->IsError()) { return ""; } $mime[] = $this->LE.$this->LE; } else { $mime[] = $this->EncodeFile($path, $encoding); if($this->IsError()) { return ""; } $mime[] = $this->LE.$this->LE; } } $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); return join("", $mime); } /** * Encodes attachment in requested format. Returns an * empty string on failure. * @access private * @return string */ function EncodeFile ($path, $encoding = "base64") { if(!@$fd = fopen($path, "rb")) { $this->SetError($this->Lang("file_open") . $path); return ""; } $magic_quotes = get_magic_quotes_runtime(); set_magic_quotes_runtime(0); $file_buffer = fread($fd, filesize($path)); $file_buffer = $this->EncodeString($file_buffer, $encoding); fclose($fd); set_magic_quotes_runtime($magic_quotes); return $file_buffer; } /** * Encodes string to requested format. Returns an * empty string on failure. * @access private * @return string */ function EncodeString ($str, $encoding = "base64") { $encoded = ""; switch(strtolower($encoding)) { case "base64": // chunk_split is found in PHP >= 3.0.6 $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case "7bit": case "8bit": $encoded = $this->FixEOL($str); if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; break; case "binary": $encoded = $str; break; case "quoted-printable": $encoded = $this->EncodeQP($str); break; default: $this->SetError($this->Lang("encoding") . $encoding); break; } return $encoded; } /** * Encode a header string to best of Q, B, quoted or none. * @access private * @return string */ function EncodeHeader ($str, $position = 'text') { $x = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know what value has magic_quotes_sybase. $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) return ($encoded); else return ("\"$encoded\""); } $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; case 'comment': $x = preg_match_all('/[()"]/', $str, $matches); // Fall-through case 'text': default: $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } if ($x == 0) return ($str); $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output if (strlen($str)/3 < $x) { $encoding = 'B'; $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } else { $encoding = 'Q'; $encoded = $this->EncodeQ($str, $position); $encoded = $this->WrapText($encoded, $maxlen, true); $encoded = str_replace("=".$this->LE, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; } /** * Encode string to quoted-printable. * @access private * @return string */ function EncodeQP ($str) { $encoded = $this->FixEOL($str); if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; // Replace every high ascii, control and = characters $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e', "'='.sprintf('%02X', ord('\\1'))", $encoded); // Replace every spaces and tabs when it's the last character on a line $encoded = preg_replace("/([\011\040])".$this->LE."/e", "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded); // Maximum line length of 76 characters before CRLF (74 + space + '=') $encoded = $this->WrapText($encoded, 74, true); return $encoded; } /** * Encode string to q encoding. * @access private * @return string */ function EncodeQ ($str, $position = "text") { // There should not be any EOL in the string $encoded = preg_replace("[\r\n]", "", $str); switch (strtolower($position)) { case "phrase": $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); break; case "comment": $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); case "text": default: // Replace every high ascii, control =, ? and _ characters $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', "'='.sprintf('%02X', ord('\\1'))", $encoded); break; } // Replace every spaces to _ (more readable than =20) $encoded = str_replace(" ", "_", $encoded); return $encoded; } /** * Adds a string or binary attachment (non-filesystem) to the list. * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * @param string $string String attachment data. * @param string $filename Name of the attachment. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return void */ function AddStringAttachment($string, $filename, $encoding = "base64", $type = "application/octet-stream") { // Append to $attachment array $cur = count($this->attachment); $this->attachment[$cur][0] = $string; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $filename; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = true; // isString $this->attachment[$cur][6] = "attachment"; $this->attachment[$cur][7] = 0; } /** * Adds an embedded attachment. This can include images, sounds, and * just about any other document. Make sure to set the $type to an * image type. For JPEG images use "image/jpeg" and for GIF images * use "image/gif". * @param string $path Path to the attachment. * @param string $cid Content ID of the attachment. Use this to identify * the Id for accessing the image in an HTML form. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @return bool */ function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64", $type = "application/octet-stream") { if(!@is_file($path)) { $this->SetError($this->Lang("file_access") . $path); return false; } $filename = basename($path); if($name == "") $name = $filename; // Append to $attachment array $cur = count($this->attachment); $this->attachment[$cur][0] = $path; $this->attachment[$cur][1] = $filename; $this->attachment[$cur][2] = $name; $this->attachment[$cur][3] = $encoding; $this->attachment[$cur][4] = $type; $this->attachment[$cur][5] = false; // isStringAttachment $this->attachment[$cur][6] = "inline"; $this->attachment[$cur][7] = $cid; return true; } /** * Returns true if an inline attachment is present. * @access private * @return bool */ function InlineImageExists() { $result = false; for($i = 0; $i < count($this->attachment); $i++) { if($this->attachment[$i][6] == "inline") { $result = true; break; } } return $result; } ///////////////////////////////////////////////// // MESSAGE RESET METHODS ///////////////////////////////////////////////// /** * Clears all recipients assigned in the TO array. Returns void. * @return void */ function ClearAddresses() { $this->to = array(); } /** * Clears all recipients assigned in the CC array. Returns void. * @return void */ function ClearCCs() { $this->cc = array(); } /** * Clears all recipients assigned in the BCC array. Returns void. * @return void */ function ClearBCCs() { $this->bcc = array(); } /** * Clears all recipients assigned in the ReplyTo array. Returns void. * @return void */ function ClearReplyTos() { $this->ReplyTo = array(); } /** * Clears all recipients assigned in the TO, CC and BCC * array. Returns void. * @return void */ function ClearAllRecipients() { $this->to = array(); $this->cc = array(); $this->bcc = array(); } /** * Clears all previously set filesystem, string, and binary * attachments. Returns void. * @return void */ function ClearAttachments() { $this->attachment = array(); } /** * Clears all custom headers. Returns void. * @return void */ function ClearCustomHeaders() { $this->CustomHeader = array(); } ///////////////////////////////////////////////// // MISCELLANEOUS METHODS ///////////////////////////////////////////////// /** * Adds the error message to the error container. * Returns void. * @access private * @return void */ function SetError($msg) { $this->error_count++; $this->ErrorInfo = $msg; } /** * Returns the proper RFC 822 formatted date. * @access private * @return string */ function RFCDate() { $tz = date("Z"); $tzs = ($tz < 0) ? "-" : "+"; $tz = abs($tz); $tz = ($tz/3600)*100 + ($tz%3600)/60; $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz); return $result; } /** * Returns the appropriate server variable. Should work with both * PHP 4.1.0+ as well as older versions. Returns an empty string * if nothing is found. * @access private * @return mixed */ function ServerVar($varName) { global $HTTP_SERVER_VARS; global $HTTP_ENV_VARS; if(!isset($_SERVER)) { $_SERVER = $HTTP_SERVER_VARS; if(!isset($_SERVER["REMOTE_ADDR"])) $_SERVER = $HTTP_ENV_VARS; // must be Apache } if(isset($_SERVER[$varName])) return $_SERVER[$varName]; else return ""; } /** * Returns the server hostname or 'localhost.localdomain' if unknown. * @access private * @return string */ function ServerHostname() { if ($this->Hostname != "") $result = $this->Hostname; elseif ($this->ServerVar('SERVER_NAME') != "") $result = $this->ServerVar('SERVER_NAME'); else $result = "localhost.localdomain"; return $result; } /** * Returns a message in the appropriate language. * @access private * @return string */ function Lang($key) { if(count($this->language) < 1) $this->SetLanguage("en"); // set the default language if(isset($this->language[$key])) return $this->language[$key]; else return "Language string failed to load: " . $key; } /** * Returns true if an error occurred. * @return bool */ function IsError() { return ($this->error_count > 0); } /** * Changes every end of line from CR or LF to CRLF. * @access private * @return string */ function FixEOL($str) { $str = str_replace("\r\n", "\n", $str); $str = str_replace("\r", "\n", $str); $str = str_replace("\n", $this->LE, $str); return $str; } /** * Adds a custom header. * @return void */ function AddCustomHeader($custom_header) { $this->CustomHeader[] = explode(":", $custom_header, 2); } } ?> wp-includes/class-pop3.php0000644013707600007620000005023610667613712013526 0ustar wwwBUFFER,"integer"); if( !empty($server) ) { // Do not allow programs to alter MAILSERVER // if it is already specified. They can get around // this if they -really- want to, so don't count on it. if(empty($this->MAILSERVER)) $this->MAILSERVER = $server; } if(!empty($timeout)) { settype($timeout,"integer"); $this->TIMEOUT = $timeout; if (!ini_get('safe_mode')) set_time_limit($timeout); } return true; } function update_timer () { if (!ini_get('safe_mode')) set_time_limit($this->TIMEOUT); return true; } function connect ($server, $port = 110) { // Opens a socket to the specified server. Unless overridden, // port defaults to 110. Returns true on success, false on fail // If MAILSERVER is set, override $server with it's value if (!isset($port) || !$port) {$port = 110;} if(!empty($this->MAILSERVER)) $server = $this->MAILSERVER; if(empty($server)){ $this->ERROR = "POP3 connect: " . _("No server specified"); unset($this->FP); return false; } $fp = @fsockopen("$server", $port, $errno, $errstr); if(!$fp) { $this->ERROR = "POP3 connect: " . _("Error ") . "[$errno] [$errstr]"; unset($this->FP); return false; } socket_set_blocking($fp,-1); $this->update_timer(); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) error_log("POP3 SEND [connect: $server] GOT [$reply]",0); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 connect: " . _("Error ") . "[$reply]"; unset($this->FP); return false; } $this->FP = $fp; $this->BANNER = $this->parse_banner($reply); return true; } function user ($user = "") { // Sends the USER command, returns true or false if( empty($user) ) { $this->ERROR = "POP3 user: " . _("no login ID submitted"); return false; } elseif(!isset($this->FP)) { $this->ERROR = "POP3 user: " . _("connection not established"); return false; } else { $reply = $this->send_cmd("USER $user"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 user: " . _("Error ") . "[$reply]"; return false; } else return true; } } function pass ($pass = "") { // Sends the PASS command, returns # of msgs in mailbox, // returns false (undef) on Auth failure if(empty($pass)) { $this->ERROR = "POP3 pass: " . _("No password submitted"); return false; } elseif(!isset($this->FP)) { $this->ERROR = "POP3 pass: " . _("connection not established"); return false; } else { $reply = $this->send_cmd("PASS $pass"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 pass: " . _("Authentication failed") . " [$reply]"; $this->quit(); return false; } else { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; return $count; } } } function apop ($login,$pass) { // Attempts an APOP login. If this fails, it'll // try a standard login. YOUR SERVER MUST SUPPORT // THE USE OF THE APOP COMMAND! // (apop is optional per rfc1939) if(!isset($this->FP)) { $this->ERROR = "POP3 apop: " . _("No connection to server"); return false; } elseif(!$this->ALLOWAPOP) { $retVal = $this->login($login,$pass); return $retVal; } elseif(empty($login)) { $this->ERROR = "POP3 apop: " . _("No login ID submitted"); return false; } elseif(empty($pass)) { $this->ERROR = "POP3 apop: " . _("No password submitted"); return false; } else { $banner = $this->BANNER; if( (!$banner) or (empty($banner)) ) { $this->ERROR = "POP3 apop: " . _("No server banner") . ' - ' . _("abort"); $retVal = $this->login($login,$pass); return $retVal; } else { $AuthString = $banner; $AuthString .= $pass; $APOPString = md5($AuthString); $cmd = "APOP $login $APOPString"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 apop: " . _("apop authentication failed") . ' - ' . _("abort"); $retVal = $this->login($login,$pass); return $retVal; } else { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; return $count; } } } } function login ($login = "", $pass = "") { // Sends both user and pass. Returns # of msgs in mailbox or // false on failure (or -1, if the error occurs while getting // the number of messages.) if( !isset($this->FP) ) { $this->ERROR = "POP3 login: " . _("No connection to server"); return false; } else { $fp = $this->FP; if( !$this->user( $login ) ) { // Preserve the error generated by user() return false; } else { $count = $this->pass($pass); if( (!$count) || ($count == -1) ) { // Preserve the error generated by last() and pass() return false; } else return $count; } } } function top ($msgNum, $numLines = "0") { // Gets the header and first $numLines of the msg body // returns data in an array with each returned line being // an array element. If $numLines is empty, returns // only the header information, and none of the body. if(!isset($this->FP)) { $this->ERROR = "POP3 top: " . _("No connection to server"); return false; } $this->update_timer(); $fp = $this->FP; $buffer = $this->BUFFER; $cmd = "TOP $msgNum $numLines"; fwrite($fp, "TOP $msgNum $numLines\r\n"); $reply = fgets($fp, $buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 top: " . _("Error ") . "[$reply]"; return false; } $count = 0; $MsgArray = array(); $line = fgets($fp,$buffer); while ( !ereg("^\.\r\n",$line)) { $MsgArray[$count] = $line; $count++; $line = fgets($fp,$buffer); if(empty($line)) { break; } } return $MsgArray; } function pop_list ($msgNum = "") { // If called with an argument, returns that msgs' size in octets // No argument returns an associative array of undeleted // msg numbers and their sizes in octets if(!isset($this->FP)) { $this->ERROR = "POP3 pop_list: " . _("No connection to server"); return false; } $fp = $this->FP; $Total = $this->COUNT; if( (!$Total) or ($Total == -1) ) { return false; } if($Total == 0) { return array("0","0"); // return -1; // mailbox empty } $this->update_timer(); if(!empty($msgNum)) { $cmd = "LIST $msgNum"; fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; return false; } list($junk,$num,$size) = preg_split('/\s+/',$reply); return $size; } $cmd = "LIST"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $reply = $this->strip_clf($reply); $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; return false; } $MsgArray = array(); $MsgArray[0] = $Total; for($msgC=1;$msgC <= $Total; $msgC++) { if($msgC > $Total) { break; } $line = fgets($fp,$this->BUFFER); $line = $this->strip_clf($line); if(ereg("^\.",$line)) { $this->ERROR = "POP3 pop_list: " . _("Premature end of list"); return false; } list($thisMsg,$msgSize) = preg_split('/\s+/',$line); settype($thisMsg,"integer"); if($thisMsg != $msgC) { $MsgArray[$msgC] = "deleted"; } else { $MsgArray[$msgC] = $msgSize; } } return $MsgArray; } function get ($msgNum) { // Retrieve the specified msg number. Returns an array // where each line of the msg is an array element. if(!isset($this->FP)) { $this->ERROR = "POP3 get: " . _("No connection to server"); return false; } $this->update_timer(); $fp = $this->FP; $buffer = $this->BUFFER; $cmd = "RETR $msgNum"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 get: " . _("Error ") . "[$reply]"; return false; } $count = 0; $MsgArray = array(); $line = fgets($fp,$buffer); while ( !ereg("^\.\r\n",$line)) { if ( $line{0} == '.' ) { $line = substr($line,1); } $MsgArray[$count] = $line; $count++; $line = fgets($fp,$buffer); if(empty($line)) { break; } } return $MsgArray; } function last ( $type = "count" ) { // Returns the highest msg number in the mailbox. // returns -1 on error, 0+ on success, if type != count // results in a popstat() call (2 element array returned) $last = -1; if(!isset($this->FP)) { $this->ERROR = "POP3 last: " . _("No connection to server"); return $last; } $reply = $this->send_cmd("STAT"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 last: " . _("Error ") . "[$reply]"; return $last; } $Vars = preg_split('/\s+/',$reply); $count = $Vars[1]; $size = $Vars[2]; settype($count,"integer"); settype($size,"integer"); if($type != "count") { return array($count,$size); } return $count; } function reset () { // Resets the status of the remote server. This includes // resetting the status of ALL msgs to not be deleted. // This method automatically closes the connection to the server. if(!isset($this->FP)) { $this->ERROR = "POP3 reset: " . _("No connection to server"); return false; } $reply = $this->send_cmd("RSET"); if(!$this->is_ok($reply)) { // The POP3 RSET command -never- gives a -ERR // response - if it ever does, something truely // wild is going on. $this->ERROR = "POP3 reset: " . _("Error ") . "[$reply]"; @error_log("POP3 reset: ERROR [$reply]",0); } $this->quit(); return true; } function send_cmd ( $cmd = "" ) { // Sends a user defined command string to the // POP server and returns the results. Useful for // non-compliant or custom POP servers. // Do NOT includ the \r\n as part of your command // string - it will be appended automatically. // The return value is a standard fgets() call, which // will read up to $this->BUFFER bytes of data, until it // encounters a new line, or EOF, whichever happens first. // This method works best if $cmd responds with only // one line of data. if(!isset($this->FP)) { $this->ERROR = "POP3 send_cmd: " . _("No connection to server"); return false; } if(empty($cmd)) { $this->ERROR = "POP3 send_cmd: " . _("Empty command string"); return ""; } $fp = $this->FP; $buffer = $this->BUFFER; $this->update_timer(); fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } return $reply; } function quit() { // Closes the connection to the POP3 server, deleting // any msgs marked as deleted. if(!isset($this->FP)) { $this->ERROR = "POP3 quit: " . _("connection does not exist"); return false; } $fp = $this->FP; $cmd = "QUIT"; fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } fclose($fp); unset($this->FP); return true; } function popstat () { // Returns an array of 2 elements. The number of undeleted // msgs in the mailbox, and the size of the mbox in octets. $PopArray = $this->last("array"); if($PopArray == -1) { return false; } if( (!$PopArray) or (empty($PopArray)) ) { return false; } return $PopArray; } function uidl ($msgNum = "") { // Returns the UIDL of the msg specified. If called with // no arguments, returns an associative array where each // undeleted msg num is a key, and the msg's uidl is the element // Array element 0 will contain the total number of msgs if(!isset($this->FP)) { $this->ERROR = "POP3 uidl: " . _("No connection to server"); return false; } $fp = $this->FP; $buffer = $this->BUFFER; if(!empty($msgNum)) { $cmd = "UIDL $msgNum"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; return false; } list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); return $myUidl; } else { $this->update_timer(); $UIDLArray = array(); $Total = $this->COUNT; $UIDLArray[0] = $Total; if ($Total < 1) { return $UIDLArray; } $cmd = "UIDL"; fwrite($fp, "UIDL\r\n"); $reply = fgets($fp, $buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; return false; } $line = ""; $count = 1; $line = fgets($fp,$buffer); while ( !ereg("^\.\r\n",$line)) { if(ereg("^\.\r\n",$line)) { break; } list ($msg,$msgUidl) = preg_split('/\s+/',$line); $msgUidl = $this->strip_clf($msgUidl); if($count == $msg) { $UIDLArray[$msg] = $msgUidl; } else { $UIDLArray[$count] = 'deleted'; } $count++; $line = fgets($fp,$buffer); } } return $UIDLArray; } function delete ($msgNum = "") { // Flags a specified msg as deleted. The msg will not // be deleted until a quit() method is called. if(!isset($this->FP)) { $this->ERROR = "POP3 delete: " . _("No connection to server"); return false; } if(empty($msgNum)) { $this->ERROR = "POP3 delete: " . _("No msg number submitted"); return false; } $reply = $this->send_cmd("DELE $msgNum"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 delete: " . _("Command failed ") . "[$reply]"; return false; } return true; } // ********************************************************* // The following methods are internal to the class. function is_ok ($cmd = "") { // Return true or false on +OK or -ERR if( empty($cmd) ) return false; else return( ereg ("^\+OK", $cmd ) ); } function strip_clf ($text = "") { // Strips \r\n from server responses if(empty($text)) return $text; else { $stripped = str_replace("\r",'',$text); $stripped = str_replace("\n",'',$stripped); return $stripped; } } function parse_banner ( $server_text ) { $outside = true; $banner = ""; $length = strlen($server_text); for($count =0; $count < $length; $count++) { $digit = substr($server_text,$count,1); if(!empty($digit)) { if( (!$outside) && ($digit != '<') && ($digit != '>') ) { $banner .= $digit; } if ($digit == '<') { $outside = false; } if($digit == '>') { $outside = true; } } } $banner = $this->strip_clf($banner); // Just in case return "<$banner>"; } } // End class ?> wp-includes/class-smtp.php0000644013707600007620000010134610634105372013617 0ustar wwwsmtp_conn = 0; $this->error = null; $this->helo_rply = null; $this->do_debug = 0; } /************************************************************* * CONNECTION FUNCTIONS * ***********************************************************/ /** * Connect to the server specified on the port specified. * If the port is not specified use the default SMTP_PORT. * If tval is specified then a connection will try and be * established with the server for that number of seconds. * If tval is not specified the default is 30 seconds to * try on the connection. * * SMTP CODE SUCCESS: 220 * SMTP CODE FAILURE: 421 * @access public * @return bool */ function Connect($host,$port=0,$tval=30) { # set the error val to null so there is no confusion $this->error = null; # make sure we are __not__ connected if($this->connected()) { # ok we are connected! what should we do? # for now we will just give an error saying we # are already connected $this->error = array("error" => "Already connected to a server"); return false; } if(empty($port)) { $port = $this->SMTP_PORT; } #connect to the smtp server $this->smtp_conn = fsockopen($host, # the host of the server $port, # the port to use $errno, # error number if any $errstr, # error message if any $tval); # give up after ? secs # verify we connected properly if(empty($this->smtp_conn)) { $this->error = array("error" => "Failed to connect to server", "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF; } return false; } # sometimes the SMTP server takes a little longer to respond # so we will give it a longer timeout for the first read // Windows still does not have support for this timeout function if(substr(PHP_OS, 0, 3) != "WIN") socket_set_timeout($this->smtp_conn, $tval, 0); # get any announcement stuff $announce = $this->get_lines(); # set the timeout of any socket functions at 1/10 of a second //if(function_exists("socket_set_timeout")) // socket_set_timeout($this->smtp_conn, 0, 100000); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; } return true; } /** * Performs SMTP authentication. Must be run after running the * Hello() method. Returns true if successfully authenticated. * @access public * @return bool */ function Authenticate($username, $password) { // Start authentication fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "AUTH not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } // Send encoded username fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 334) { $this->error = array("error" => "Username not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } // Send encoded password fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($code != 235) { $this->error = array("error" => "Password not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Returns true if connected to a server otherwise false * @access private * @return bool */ function Connected() { if(!empty($this->smtp_conn)) { $sock_status = socket_get_status($this->smtp_conn); if($sock_status["eof"]) { # hmm this is an odd situation... the socket is # valid but we aren't connected anymore if($this->do_debug >= 1) { echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; } $this->Close(); return false; } return true; # everything looks good } return false; } /** * Closes the socket and cleans up the state of the class. * It is not considered good to use this function without * first trying to use QUIT. * @access public * @return void */ function Close() { $this->error = null; # so there is no confusion $this->helo_rply = null; if(!empty($this->smtp_conn)) { # close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = 0; } } /*************************************************************** * SMTP COMMANDS * *************************************************************/ /** * Issues a data command and sends the msg_data to the server * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a with the message headers * and the message body being seperated by and additional . * * Implements rfc 821: DATA * * SMTP CODE INTERMEDIATE: 354 * [data] * . * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 552,554,451,452 * SMTP CODE FAILURE: 451,554 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ function Data($msg_data) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Data() without being connected"); return false; } fputs($this->smtp_conn,"DATA" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 354) { $this->error = array("error" => "DATA command not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } # the server is ready to accept data! # according to rfc 821 we should not send more than 1000 # including the CRLF # characters on a single line so we will break the data up # into lines by \r and/or \n then if needed we will break # each of those into smaller lines to fit within the limit. # in addition we will be looking for lines that start with # a period '.' and append and additional period '.' to that # line. NOTE: this does not count towards are limit. # normalize the line breaks so we know the explode works $msg_data = str_replace("\r\n","\n",$msg_data); $msg_data = str_replace("\r","\n",$msg_data); $lines = explode("\n",$msg_data); # we need to find a good way to determine is headers are # in the msg_data or if it is a straight msg body # currently I'm assuming rfc 822 definitions of msg headers # and if the first field of the first line (':' sperated) # does not contain a space then it _should_ be a header # and we can process all lines before a blank "" line as # headers. $field = substr($lines[0],0,strpos($lines[0],":")); $in_headers = false; if(!empty($field) && !strstr($field," ")) { $in_headers = true; } $max_line_length = 998; # used below; set here for ease in change while(list(,$line) = @each($lines)) { $lines_out = null; if($line == "" && $in_headers) { $in_headers = false; } # ok we need to break this line up into several # smaller lines while(strlen($line) > $max_line_length) { $pos = strrpos(substr($line,0,$max_line_length)," "); # Patch to fix DOS attack if(!$pos) { $pos = $max_line_length - 1; } $lines_out[] = substr($line,0,$pos); $line = substr($line,$pos + 1); # if we are processing headers we need to # add a LWSP-char to the front of the new line # rfc 822 on long msg headers if($in_headers) { $line = "\t" . $line; } } $lines_out[] = $line; # now send the lines to the server while(list(,$line_out) = @each($lines_out)) { if(strlen($line_out) > 0) { if(substr($line_out, 0, 1) == ".") { $line_out = "." . $line_out; } } fputs($this->smtp_conn,$line_out . $this->CRLF); } } # ok all the message data has been sent so lets get this # over with aleady fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "DATA not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Expand takes the name and asks the server to list all the * people who are members of the _list_. Expand will return * back and array of the result or false if an error occurs. * Each value in the array returned has the format of: * [ ] * The definition of is defined in rfc 821 * * Implements rfc 821: EXPN * * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 550 * SMTP CODE ERROR : 500,501,502,504,421 * @access public * @return string array */ function Expand($name) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Expand() without being connected"); return false; } fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "EXPN not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } # parse the reply and place in our array to return to user $entries = explode($this->CRLF,$rply); while(list(,$l) = @each($entries)) { $list[] = substr($l,4); } return $list; } /** * Sends the HELO command to the smtp server. * This makes sure that we and the server are in * the same known state. * * Implements from rfc 821: HELO * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 501, 504, 421 * @access public * @return bool */ function Hello($host="") { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Hello() without being connected"); return false; } # if a hostname for the HELO wasn't specified determine # a suitable one to send if(empty($host)) { # we need to determine some sort of appopiate default # to send to the server $host = "localhost"; } // Send extended hello first (RFC 2821) if(!$this->SendHello("EHLO", $host)) { if(!$this->SendHello("HELO", $host)) return false; } return true; } /** * Sends a HELO/EHLO command. * @access private * @return bool */ function SendHello($hello, $host) { fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => $hello . " not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } $this->helo_rply = $rply; return true; } /** * Gets help information on the keyword specified. If the keyword * is not specified then returns generic help, ussually contianing * A list of keywords that help is available on. This function * returns the results back to the user. It is up to the user to * handle the returned data. If an error occurs then false is * returned with $this->error set appropiately. * * Implements rfc 821: HELP [ ] * * SMTP CODE SUCCESS: 211,214 * SMTP CODE ERROR : 500,501,502,504,421 * @access public * @return string */ function Help($keyword="") { $this->error = null; # to avoid confusion if(!$this->connected()) { $this->error = array( "error" => "Called Help() without being connected"); return false; } $extra = ""; if(!empty($keyword)) { $extra = " " . $keyword; } fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 211 && $code != 214) { $this->error = array("error" => "HELP not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return $rply; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. * * Implements rfc 821: MAIL FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,421 * @access public * @return bool */ function Mail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Mail() without being connected"); return false; } fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "MAIL not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the command NOOP to the SMTP server. * * Implements from rfc 821: NOOP * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500, 421 * @access public * @return bool */ function Noop() { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Noop() without being connected"); return false; } fputs($this->smtp_conn,"NOOP" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "NOOP not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the quit command to the server and then closes the socket * if there is no error or the $close_on_error argument is true. * * Implements from rfc 821: QUIT * * SMTP CODE SUCCESS: 221 * SMTP CODE ERROR : 500 * @access public * @return bool */ function Quit($close_on_error=true) { $this->error = null; # so there is no confusion if(!$this->connected()) { $this->error = array( "error" => "Called Quit() without being connected"); return false; } # send the quit command to the server fputs($this->smtp_conn,"quit" . $this->CRLF); # get any good-bye messages $byemsg = $this->get_lines(); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; } $rval = true; $e = null; $code = substr($byemsg,0,3); if($code != 221) { # use e as a tmp var cause Close will overwrite $this->error $e = array("error" => "SMTP server rejected quit command", "smtp_code" => $code, "smtp_rply" => substr($byemsg,4)); $rval = false; if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF; } } if(empty($e) || $close_on_error) { $this->Close(); } return $rval; } /** * Sends the command RCPT to the SMTP server with the TO: argument of $to. * Returns true if the recipient was accepted false if it was rejected. * * Implements from rfc 821: RCPT TO: * * SMTP CODE SUCCESS: 250,251 * SMTP CODE FAILURE: 550,551,552,553,450,451,452 * SMTP CODE ERROR : 500,501,503,421 * @access public * @return bool */ function Recipient($to) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Recipient() without being connected"); return false; } fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250 && $code != 251) { $this->error = array("error" => "RCPT not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Sends the RSET command to abort and transaction that is * currently in progress. Returns true if successful false * otherwise. * * Implements rfc 821: RSET * * SMTP CODE SUCCESS: 250 * SMTP CODE ERROR : 500,501,504,421 * @access public * @return bool */ function Reset() { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Reset() without being connected"); return false; } fputs($this->smtp_conn,"RSET" . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "RSET failed", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in. * * Implements rfc 821: SEND FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function Send($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Send() without being connected"); return false; } fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SEND not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * * Implements rfc 821: SAML FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function SendAndMail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called SendAndMail() without being connected"); return false; } fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SAML not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more Recipient * commands may be called followed by a Data command. This command * will send the message to the users terminal if they are logged * in or mail it to them if they are not. * * Implements rfc 821: SOML FROM: * * SMTP CODE SUCCESS: 250 * SMTP CODE SUCCESS: 552,451,452 * SMTP CODE SUCCESS: 500,501,502,421 * @access public * @return bool */ function SendOrMail($from) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called SendOrMail() without being connected"); return false; } fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250) { $this->error = array("error" => "SOML not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return true; } /** * This is an optional command for SMTP that this class does not * support. This method is here to make the RFC821 Definition * complete for this class and __may__ be implimented in the future * * Implements from rfc 821: TURN * * SMTP CODE SUCCESS: 250 * SMTP CODE FAILURE: 502 * SMTP CODE ERROR : 500, 503 * @access public * @return bool */ function Turn() { $this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >= 1) { echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; } return false; } /** * Verifies that the name is recognized by the server. * Returns false if the name could not be verified otherwise * the response from the server is returned. * * Implements rfc 821: VRFY * * SMTP CODE SUCCESS: 250,251 * SMTP CODE FAILURE: 550,551,553 * SMTP CODE ERROR : 500,501,502,421 * @access public * @return int */ function Verify($name) { $this->error = null; # so no confusion is caused if(!$this->connected()) { $this->error = array( "error" => "Called Verify() without being connected"); return false; } fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; } if($code != 250 && $code != 251) { $this->error = array("error" => "VRFY failed on name '$name'", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; } return false; } return $rply; } /******************************************************************* * INTERNAL FUNCTIONS * ******************************************************************/ /** * Read in as many lines as possible * either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * @access private * @return string */ function get_lines() { $data = ""; while($str = fgets($this->smtp_conn,515)) { if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF; echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF; } $data .= $str; if($this->do_debug >= 4) { echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; } # if the 4th character is a space then we are done reading # so just break the loop if(substr($str,3,1) == " ") { break; } } return $data; } } ?> wp-includes/class-snoopy.php0000644013707600007620000011150710667076612014175 0ustar www Copyright (c): 1999-2000 ispi, all rights reserved Version: 1.01 * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You may contact the author of Snoopy by e-mail at: monte@ispi.net Or, write to: Monte Ohrt CTO, ispi 237 S. 70th suite 220 Lincoln, NE 68510 The latest version of Snoopy can be obtained from: http://snoopy.sourceforge.net/ *************************************************/ if ( !in_array('Snoopy', get_declared_classes() ) ) : class Snoopy { /**** Public variables ****/ /* user definable vars */ var $host = "www.php.net"; // host name we are connecting to var $port = 80; // port we are connecting to var $proxy_host = ""; // proxy host to use var $proxy_port = ""; // proxy port to use var $proxy_user = ""; // proxy user to use var $proxy_pass = ""; // proxy password to use var $agent = "Snoopy v1.2.3"; // agent we masquerade as var $referer = ""; // referer info to pass var $cookies = array(); // array of cookies to pass // $cookies["username"]="joe"; var $rawheaders = array(); // array of raw headers to send // $rawheaders["Content-type"]="text/html"; var $maxredirs = 5; // http redirection depth maximum. 0 = disallow var $lastredirectaddr = ""; // contains address of last redirected address var $offsiteok = true; // allows redirection off-site var $maxframes = 0; // frame content depth maximum. 0 = disallow var $expandlinks = true; // expand links to fully qualified URLs. // this only applies to fetchlinks() // submitlinks(), and submittext() var $passcookies = true; // pass set cookies back through redirects // NOTE: this currently does not respect // dates, domains or paths. var $user = ""; // user for http authentication var $pass = ""; // password for http authentication // http accept types var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; var $results = ""; // where the content is put var $error = ""; // error messages sent here var $response_code = ""; // response code returned from server var $headers = array(); // headers returned from server sent here var $maxlength = 8192; // max return data length (body) var $read_timeout = 0; // timeout on read operations, in seconds // supported only since PHP 4 Beta 4 // set to 0 to disallow timeouts var $timed_out = false; // if a read operation timed out var $status = 0; // http request status var $temp_dir = "/tmp"; // temporary directory that the webserver // has permission to write to. // under Windows, this should be C:\temp var $curl_path = "/usr/local/bin/curl"; // Snoopy will use cURL for fetching // SSL content if a full system path to // the cURL binary is supplied here. // set to false if you do not have // cURL installed. See http://curl.haxx.se // for details on installing cURL. // Snoopy does *not* use the cURL // library functions built into php, // as these functions are not stable // as of this Snoopy release. /**** Private variables ****/ var $_maxlinelen = 4096; // max line length (headers) var $_httpmethod = "GET"; // default http request method var $_httpversion = "HTTP/1.0"; // default http request version var $_submit_method = "POST"; // default submit method var $_submit_type = "application/x-www-form-urlencoded"; // default submit type var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type var $_redirectaddr = false; // will be set if page fetched is a redirect var $_redirectdepth = 0; // increments on an http redirect var $_frameurls = array(); // frame src urls var $_framedepth = 0; // increments on frame depth var $_isproxy = false; // set if using a proxy server var $_fp_timeout = 30; // timeout for socket connection /*======================================================================*\ Function: fetch Purpose: fetch the contents of a web page (and possibly other protocols in the future like ftp, nntp, gopher, etc.) Input: $URI the location of the page to fetch Output: $this->results the output text from the fetch \*======================================================================*/ function fetch($URI) { //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS); $URI_PARTS = parse_url($URI); if (!empty($URI_PARTS["user"])) $this->user = $URI_PARTS["user"]; if (!empty($URI_PARTS["pass"])) $this->pass = $URI_PARTS["pass"]; if (empty($URI_PARTS["query"])) $URI_PARTS["query"] = ''; if (empty($URI_PARTS["path"])) $URI_PARTS["path"] = ''; switch(strtolower($URI_PARTS["scheme"])) { case "http": $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_connect($fp)) { if($this->_isproxy) { // using proxy, send entire URI $this->_httprequest($URI,$fp,$URI,$this->_httpmethod); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httprequest($path, $fp, $URI, $this->_httpmethod); } $this->_disconnect($fp); if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; $this->fetch($this->_redirectaddr); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } } else { return false; } return true; break; case "https": if(!$this->curl_path) return false; if(function_exists("is_executable")) if (!is_executable($this->curl_path)) return false; $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_isproxy) { // using proxy, send entire URI $this->_httpsrequest($URI,$URI,$this->_httpmethod); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httpsrequest($path, $URI, $this->_httpmethod); } if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; $this->fetch($this->_redirectaddr); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } return true; break; default: // not a valid protocol $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; return false; break; } return true; } /*======================================================================*\ Function: submit Purpose: submit an http form Input: $URI the location to post the data $formvars the formvars to use. format: $formvars["var"] = "val"; $formfiles an array of files to submit format: $formfiles["var"] = "/dir/filename.ext"; Output: $this->results the text output from the post \*======================================================================*/ function submit($URI, $formvars="", $formfiles="") { unset($postdata); $postdata = $this->_prepare_post_body($formvars, $formfiles); $URI_PARTS = parse_url($URI); if (!empty($URI_PARTS["user"])) $this->user = $URI_PARTS["user"]; if (!empty($URI_PARTS["pass"])) $this->pass = $URI_PARTS["pass"]; if (empty($URI_PARTS["query"])) $URI_PARTS["query"] = ''; if (empty($URI_PARTS["path"])) $URI_PARTS["path"] = ''; switch(strtolower($URI_PARTS["scheme"])) { case "http": $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_connect($fp)) { if($this->_isproxy) { // using proxy, send entire URI $this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); } $this->_disconnect($fp); if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; if( strpos( $this->_redirectaddr, "?" ) > 0 ) $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get else $this->submit($this->_redirectaddr,$formvars, $formfiles); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } } else { return false; } return true; break; case "https": if(!$this->curl_path) return false; if(function_exists("is_executable")) if (!is_executable($this->curl_path)) return false; $this->host = $URI_PARTS["host"]; if(!empty($URI_PARTS["port"])) $this->port = $URI_PARTS["port"]; if($this->_isproxy) { // using proxy, send entire URI $this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata); } else { $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); // no proxy, send only the path $this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata); } if($this->_redirectaddr) { /* url was redirected, check if we've hit the max depth */ if($this->maxredirs > $this->_redirectdepth) { if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]); // only follow redirect if it's on this site, or offsiteok is true if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok) { /* follow the redirect */ $this->_redirectdepth++; $this->lastredirectaddr=$this->_redirectaddr; if( strpos( $this->_redirectaddr, "?" ) > 0 ) $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get else $this->submit($this->_redirectaddr,$formvars, $formfiles); } } } if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; $this->_frameurls = array(); while(list(,$frameurl) = each($frameurls)) { if($this->_framedepth < $this->maxframes) { $this->fetch($frameurl); $this->_framedepth++; } else break; } } return true; break; default: // not a valid protocol $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; return false; break; } return true; } /*======================================================================*\ Function: fetchlinks Purpose: fetch the links from a web page Input: $URI where you are fetching from Output: $this->results an array of the URLs \*======================================================================*/ function fetchlinks($URI) { if ($this->fetch($URI)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$xresults);$x++) $this->results[$x] = $this->_striplinks($this->results[$x]); } else $this->results = $this->_striplinks($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results, $URI); return true; } else return false; } /*======================================================================*\ Function: fetchform Purpose: fetch the form elements from a web page Input: $URI where you are fetching from Output: $this->results the resulting html form \*======================================================================*/ function fetchform($URI) { if ($this->fetch($URI)) { if(is_array($this->results)) { for($x=0;$xresults);$x++) $this->results[$x] = $this->_stripform($this->results[$x]); } else $this->results = $this->_stripform($this->results); return true; } else return false; } /*======================================================================*\ Function: fetchtext Purpose: fetch the text from a web page, stripping the links Input: $URI where you are fetching from Output: $this->results the text from the web page \*======================================================================*/ function fetchtext($URI) { if($this->fetch($URI)) { if(is_array($this->results)) { for($x=0;$xresults);$x++) $this->results[$x] = $this->_striptext($this->results[$x]); } else $this->results = $this->_striptext($this->results); return true; } else return false; } /*======================================================================*\ Function: submitlinks Purpose: grab links from a form submission Input: $URI where you are submitting from Output: $this->results an array of the links from the post \*======================================================================*/ function submitlinks($URI, $formvars="", $formfiles="") { if($this->submit($URI,$formvars, $formfiles)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$xresults);$x++) { $this->results[$x] = $this->_striplinks($this->results[$x]); if($this->expandlinks) $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); } } else { $this->results = $this->_striplinks($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results,$URI); } return true; } else return false; } /*======================================================================*\ Function: submittext Purpose: grab text from a form submission Input: $URI where you are submitting from Output: $this->results the text from the web page \*======================================================================*/ function submittext($URI, $formvars = "", $formfiles = "") { if($this->submit($URI,$formvars, $formfiles)) { if($this->lastredirectaddr) $URI = $this->lastredirectaddr; if(is_array($this->results)) { for($x=0;$xresults);$x++) { $this->results[$x] = $this->_striptext($this->results[$x]); if($this->expandlinks) $this->results[$x] = $this->_expandlinks($this->results[$x],$URI); } } else { $this->results = $this->_striptext($this->results); if($this->expandlinks) $this->results = $this->_expandlinks($this->results,$URI); } return true; } else return false; } /*======================================================================*\ Function: set_submit_multipart Purpose: Set the form submission content type to multipart/form-data \*======================================================================*/ function set_submit_multipart() { $this->_submit_type = "multipart/form-data"; } /*======================================================================*\ Function: set_submit_normal Purpose: Set the form submission content type to application/x-www-form-urlencoded \*======================================================================*/ function set_submit_normal() { $this->_submit_type = "application/x-www-form-urlencoded"; } /*======================================================================*\ Private functions \*======================================================================*/ /*======================================================================*\ Function: _striplinks Purpose: strip the hyperlinks from an html document Input: $document document to strip. Output: $match an array of the links \*======================================================================*/ function _striplinks($document) { preg_match_all("'<\s*a\s.*?href\s*=\s* # find ]+)) # if quote found, match up to next matching # quote, otherwise match up to next space 'isx",$document,$links); // catenate the non-empty matches from the conditional subpattern while(list($key,$val) = each($links[2])) { if(!empty($val)) $match[] = $val; } while(list($key,$val) = each($links[3])) { if(!empty($val)) $match[] = $val; } // return the links return $match; } /*======================================================================*\ Function: _stripform Purpose: strip the form elements from an html document Input: $document document to strip. Output: $match an array of the links \*======================================================================*/ function _stripform($document) { preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements); // catenate the matches $match = implode("\r\n",$elements[0]); // return the links return $match; } /*======================================================================*\ Function: _striptext Purpose: strip the text from an html document Input: $document document to strip. Output: $text the resulting text \*======================================================================*/ function _striptext($document) { // I didn't use preg eval (//e) since that is only available in PHP 4.0. // so, list your entities one by one here. I included some of the // more common ones. $search = array("']*?>.*?'si", // strip out javascript "'<[\/\!]*?[^<>]*?>'si", // strip out html tags "'([\r\n])[\s]+'", // strip out white space "'&(quot|#34|#034|#x22);'i", // replace html entities "'&(amp|#38|#038|#x26);'i", // added hexadecimal values "'&(lt|#60|#060|#x3c);'i", "'&(gt|#62|#062|#x3e);'i", "'&(nbsp|#160|#xa0);'i", "'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&(reg|#174);'i", "'&(deg|#176);'i", "'&(#39|#039|#x27);'", "'&(euro|#8364);'i", // europe "'&a(uml|UML);'", // german "'&o(uml|UML);'", "'&u(uml|UML);'", "'&A(uml|UML);'", "'&O(uml|UML);'", "'&U(uml|UML);'", "'ß'i", ); $replace = array( "", "", "\\1", "\"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), chr(174), chr(176), chr(39), chr(128), "ä", "ö", "ü", "Ä", "Ö", "Ü", "ß", ); $text = preg_replace($search,$replace,$document); return $text; } /*======================================================================*\ Function: _expandlinks Purpose: expand each link into a fully qualified URL Input: $links the links to qualify $URI the full URI to get the base from Output: $expandedLinks the expanded links \*======================================================================*/ function _expandlinks($links,$URI) { preg_match("/^[^\?]+/",$URI,$match); $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]); $match = preg_replace("|/$|","",$match); $match_part = parse_url($match); $match_root = $match_part["scheme"]."://".$match_part["host"]; $search = array( "|^http://".preg_quote($this->host)."|i", "|^(\/)|i", "|^(?!http://)(?!mailto:)|i", "|/\./|", "|/[^\/]+/\.\./|" ); $replace = array( "", $match_root."/", $match."/", "/", "/" ); $expandedLinks = preg_replace($search,$replace,$links); return $expandedLinks; } /*======================================================================*\ Function: _httprequest Purpose: go get the http data from the server Input: $url the url to fetch $fp the current open file pointer $URI the full URI $body body contents to send if any (POST) Output: \*======================================================================*/ function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="") { $cookie_headers = ''; if($this->passcookies && $this->_redirectaddr) $this->setcookies(); $URI_PARTS = parse_url($URI); if(empty($url)) $url = "/"; $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; if(!empty($this->agent)) $headers .= "User-Agent: ".$this->agent."\r\n"; if(!empty($this->host) && !isset($this->rawheaders['Host'])) { $headers .= "Host: ".$this->host; if(!empty($this->port) && $this->port != 80) $headers .= ":".$this->port; $headers .= "\r\n"; } if(!empty($this->accept)) $headers .= "Accept: ".$this->accept."\r\n"; if(!empty($this->referer)) $headers .= "Referer: ".$this->referer."\r\n"; if(!empty($this->cookies)) { if(!is_array($this->cookies)) $this->cookies = (array)$this->cookies; reset($this->cookies); if ( count($this->cookies) > 0 ) { $cookie_headers .= 'Cookie: '; foreach ( $this->cookies as $cookieKey => $cookieVal ) { $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; } $headers .= substr($cookie_headers,0,-2) . "\r\n"; } } if(!empty($this->rawheaders)) { if(!is_array($this->rawheaders)) $this->rawheaders = (array)$this->rawheaders; while(list($headerKey,$headerVal) = each($this->rawheaders)) $headers .= $headerKey.": ".$headerVal."\r\n"; } if(!empty($content_type)) { $headers .= "Content-type: $content_type"; if ($content_type == "multipart/form-data") $headers .= "; boundary=".$this->_mime_boundary; $headers .= "\r\n"; } if(!empty($body)) $headers .= "Content-length: ".strlen($body)."\r\n"; if(!empty($this->user) || !empty($this->pass)) $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"; //add proxy auth headers if(!empty($this->proxy_user)) $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass)."\r\n"; $headers .= "\r\n"; // set the read timeout if needed if ($this->read_timeout > 0) socket_set_timeout($fp, $this->read_timeout); $this->timed_out = false; fwrite($fp,$headers.$body,strlen($headers.$body)); $this->_redirectaddr = false; unset($this->headers); while($currentHeader = fgets($fp,$this->_maxlinelen)) { if ($this->read_timeout > 0 && $this->_check_timeout($fp)) { $this->status=-100; return false; } if($currentHeader == "\r\n") break; // if a header begins with Location: or URI:, set the redirect if(preg_match("/^(Location:|URI:)/i",$currentHeader)) { // get URL portion of the redirect preg_match("/^(Location:|URI:)[ ]+(.*)/i",chop($currentHeader),$matches); // look for :// in the Location header to see if hostname is included if(!preg_match("|\:\/\/|",$matches[2])) { // no host in the path, so prepend $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; // eliminate double slash if(!preg_match("|^/|",$matches[2])) $this->_redirectaddr .= "/".$matches[2]; else $this->_redirectaddr .= $matches[2]; } else $this->_redirectaddr = $matches[2]; } if(preg_match("|^HTTP/|",$currentHeader)) { if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status)) { $this->status= $status[1]; } $this->response_code = $currentHeader; } $this->headers[] = $currentHeader; } $results = ''; do { $_data = fread($fp, $this->maxlength); if (strlen($_data) == 0) { break; } $results .= $_data; } while(true); if ($this->read_timeout > 0 && $this->_check_timeout($fp)) { $this->status=-100; return false; } // check if there is a a redirect meta tag if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) { $this->_redirectaddr = $this->_expandlinks($match[1],$URI); } // have we hit our frame depth and is there frame src to fetch? if(($this->_framedepth < $this->maxframes) && preg_match_all("']+)'i",$results,$match)) { $this->results[] = $results; for($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); } // have we already fetched framed content? elseif(is_array($this->results)) $this->results[] = $results; // no framed content else $this->results = $results; return true; } /*======================================================================*\ Function: _httpsrequest Purpose: go get the https data from the server using curl Input: $url the url to fetch $URI the full URI $body body contents to send if any (POST) Output: \*======================================================================*/ function _httpsrequest($url,$URI,$http_method,$content_type="",$body="") { if($this->passcookies && $this->_redirectaddr) $this->setcookies(); $headers = array(); $URI_PARTS = parse_url($URI); if(empty($url)) $url = "/"; // GET ... header not needed for curl //$headers[] = $http_method." ".$url." ".$this->_httpversion; if(!empty($this->agent)) $headers[] = "User-Agent: ".$this->agent; if(!empty($this->host)) if(!empty($this->port)) $headers[] = "Host: ".$this->host.":".$this->port; else $headers[] = "Host: ".$this->host; if(!empty($this->accept)) $headers[] = "Accept: ".$this->accept; if(!empty($this->referer)) $headers[] = "Referer: ".$this->referer; if(!empty($this->cookies)) { if(!is_array($this->cookies)) $this->cookies = (array)$this->cookies; reset($this->cookies); if ( count($this->cookies) > 0 ) { $cookie_str = 'Cookie: '; foreach ( $this->cookies as $cookieKey => $cookieVal ) { $cookie_str .= $cookieKey."=".urlencode($cookieVal)."; "; } $headers[] = substr($cookie_str,0,-2); } } if(!empty($this->rawheaders)) { if(!is_array($this->rawheaders)) $this->rawheaders = (array)$this->rawheaders; while(list($headerKey,$headerVal) = each($this->rawheaders)) $headers[] = $headerKey.": ".$headerVal; } if(!empty($content_type)) { if ($content_type == "multipart/form-data") $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary; else $headers[] = "Content-type: $content_type"; } if(!empty($body)) $headers[] = "Content-length: ".strlen($body); if(!empty($this->user) || !empty($this->pass)) $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass); for($curr_header = 0; $curr_header < count($headers); $curr_header++) { $safer_header = strtr( $headers[$curr_header], "\"", " " ); $cmdline_params .= " -H \"".$safer_header."\""; } if(!empty($body)) $cmdline_params .= " -d \"$body\""; if($this->read_timeout > 0) $cmdline_params .= " -m ".$this->read_timeout; $headerfile = tempnam($temp_dir, "sno"); $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access exec(escapeshellcmd($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\""),$results,$return); if($return) { $this->error = "Error: cURL could not retrieve the document, error $return."; return false; } $results = implode("\r\n",$results); $result_headers = file("$headerfile"); $this->_redirectaddr = false; unset($this->headers); for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++) { // if a header begins with Location: or URI:, set the redirect if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader])) { // get URL portion of the redirect preg_match("/^(Location: |URI:)\s+(.*)/",chop($result_headers[$currentHeader]),$matches); // look for :// in the Location header to see if hostname is included if(!preg_match("|\:\/\/|",$matches[2])) { // no host in the path, so prepend $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; // eliminate double slash if(!preg_match("|^/|",$matches[2])) $this->_redirectaddr .= "/".$matches[2]; else $this->_redirectaddr .= $matches[2]; } else $this->_redirectaddr = $matches[2]; } if(preg_match("|^HTTP/|",$result_headers[$currentHeader])) $this->response_code = $result_headers[$currentHeader]; $this->headers[] = $result_headers[$currentHeader]; } // check if there is a a redirect meta tag if(preg_match("']*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match)) { $this->_redirectaddr = $this->_expandlinks($match[1],$URI); } // have we hit our frame depth and is there frame src to fetch? if(($this->_framedepth < $this->maxframes) && preg_match_all("']+)'i",$results,$match)) { $this->results[] = $results; for($x=0; $x_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host); } // have we already fetched framed content? elseif(is_array($this->results)) $this->results[] = $results; // no framed content else $this->results = $results; unlink("$headerfile"); return true; } /*======================================================================*\ Function: setcookies() Purpose: set cookies for a redirection \*======================================================================*/ function setcookies() { for($x=0; $xheaders); $x++) { if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match)) $this->cookies[$match[1]] = urldecode($match[2]); } } /*======================================================================*\ Function: _check_timeout Purpose: checks whether timeout has occurred Input: $fp file pointer \*======================================================================*/ function _check_timeout($fp) { if ($this->read_timeout > 0) { $fp_status = socket_get_status($fp); if ($fp_status["timed_out"]) { $this->timed_out = true; return true; } } return false; } /*======================================================================*\ Function: _connect Purpose: make a socket connection Input: $fp file pointer \*======================================================================*/ function _connect(&$fp) { if(!empty($this->proxy_host) && !empty($this->proxy_port)) { $this->_isproxy = true; $host = $this->proxy_host; $port = $this->proxy_port; } else { $host = $this->host; $port = $this->port; } $this->status = 0; if($fp = fsockopen( $host, $port, $errno, $errstr, $this->_fp_timeout )) { // socket connection succeeded return true; } else { // socket connection failed $this->status = $errno; switch($errno) { case -3: $this->error="socket creation failed (-3)"; case -4: $this->error="dns lookup failure (-4)"; case -5: $this->error="connection refused or timed out (-5)"; default: $this->error="connection failed (".$errno.")"; } return false; } } /*======================================================================*\ Function: _disconnect Purpose: disconnect a socket connection Input: $fp file pointer \*======================================================================*/ function _disconnect($fp) { return(fclose($fp)); } /*======================================================================*\ Function: _prepare_post_body Purpose: Prepare post body according to encoding type Input: $formvars - form variables $formfiles - form upload files Output: post body \*======================================================================*/ function _prepare_post_body($formvars, $formfiles) { settype($formvars, "array"); settype($formfiles, "array"); $postdata = ''; if (count($formvars) == 0 && count($formfiles) == 0) return; switch ($this->_submit_type) { case "application/x-www-form-urlencoded": reset($formvars); while(list($key,$val) = each($formvars)) { if (is_array($val) || is_object($val)) { while (list($cur_key, $cur_val) = each($val)) { $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; } } else $postdata .= urlencode($key)."=".urlencode($val)."&"; } break; case "multipart/form-data": $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); reset($formvars); while(list($key,$val) = each($formvars)) { if (is_array($val) || is_object($val)) { while (list($cur_key, $cur_val) = each($val)) { $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; $postdata .= "$cur_val\r\n"; } } else { $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; $postdata .= "$val\r\n"; } } reset($formfiles); while (list($field_name, $file_names) = each($formfiles)) { settype($file_names, "array"); while (list(, $file_name) = each($file_names)) { if (!is_readable($file_name)) continue; $fp = fopen($file_name, "r"); while (!feof($fp)) { $file_content .= fread($fp, filesize($file_name)); } fclose($fp); $base_name = basename($file_name); $postdata .= "--".$this->_mime_boundary."\r\n"; $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; $postdata .= "$file_content\r\n"; } } $postdata .= "--".$this->_mime_boundary."--\r\n"; break; } return $postdata; } } endif; ?> wp-includes/classes.php0000644013707600007620000005542110667031316013172 0ustar wwwpublic_query_vars[] = $qv; } function set_query_var($key, $value) { $this->query_vars[$key] = $value; } function parse_request($extra_query_vars = '') { global $wp_rewrite; $this->query_vars = array(); if ( is_array($extra_query_vars) ) $this->extra_query_vars = & $extra_query_vars; else if (! empty($extra_query_vars)) parse_str($extra_query_vars, $this->extra_query_vars); // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. // Fetch the rewrite rules. $rewrite = $wp_rewrite->wp_rewrite_rules(); if (! empty($rewrite)) { // If we match a rewrite rule, this will be cleared. $error = '404'; $this->did_permalink = true; if ( isset($_SERVER['PATH_INFO']) ) $pathinfo = $_SERVER['PATH_INFO']; else $pathinfo = ''; $pathinfo_array = explode('?', $pathinfo); $pathinfo = str_replace("%", "%25", $pathinfo_array[0]); $req_uri = $_SERVER['REQUEST_URI']; $req_uri_array = explode('?', $req_uri); $req_uri = $req_uri_array[0]; $self = $_SERVER['PHP_SELF']; $home_path = parse_url(get_option('home')); if ( isset($home_path['path']) ) $home_path = $home_path['path']; else $home_path = ''; $home_path = trim($home_path, '/'); // Trim path info from the end and the leading home path from the // front. For path info requests, this leaves us with the requesting // filename, if any. For 404 requests, this leaves us with the // requested permalink. $req_uri = str_replace($pathinfo, '', rawurldecode($req_uri)); $req_uri = trim($req_uri, '/'); $req_uri = preg_replace("|^$home_path|", '', $req_uri); $req_uri = trim($req_uri, '/'); $pathinfo = trim($pathinfo, '/'); $pathinfo = preg_replace("|^$home_path|", '', $pathinfo); $pathinfo = trim($pathinfo, '/'); $self = trim($self, '/'); $self = preg_replace("|^$home_path|", '', $self); $self = str_replace($home_path, '', $self); $self = trim($self, '/'); // The requested permalink is in $pathinfo for path info requests and // $req_uri for other requests. if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) { $request = $pathinfo; } else { // If the request uri is the index, blank it out so that we don't try to match it against a rule. if ( $req_uri == $wp_rewrite->index ) $req_uri = ''; $request = $req_uri; } $this->request = $request; // Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { // If the requesting file is the anchor of the match, prepend it // to the path info. if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request)) { $request_match = $req_uri . '/' . $request; } if (preg_match("!^$match!", $request_match, $matches) || preg_match("!^$match!", urldecode($request_match), $matches)) { // Got a match. $this->matched_rule = $match; // Trim the query of everything up to the '?'. $query = preg_replace("!^.+\?!", '', $query); // Substitute the substring matches into the query. eval("\$query = \"$query\";"); $this->matched_query = $query; // Parse the query. parse_str($query, $perma_query_vars); // If we're processing a 404 request, clear the error var // since we found something. if (isset($_GET['error'])) unset($_GET['error']); if (isset($error)) unset($error); break; } } // If req_uri is empty or if it is a request for ourself, unset error. if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { if (isset($_GET['error'])) unset($_GET['error']); if (isset($error)) unset($error); if (isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) unset($perma_query_vars); $this->did_permalink = false; } } $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars); for ($i=0; $ipublic_query_vars); $i += 1) { $wpvar = $this->public_query_vars[$i]; if (isset($this->extra_query_vars[$wpvar])) $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar]; elseif (isset($GLOBALS[$wpvar])) $this->query_vars[$wpvar] = $GLOBALS[$wpvar]; elseif (!empty($_POST[$wpvar])) $this->query_vars[$wpvar] = $_POST[$wpvar]; elseif (!empty($_GET[$wpvar])) $this->query_vars[$wpvar] = $_GET[$wpvar]; elseif (!empty($perma_query_vars[$wpvar])) $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; if ( !empty( $this->query_vars[$wpvar] ) ) $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; } foreach ($this->private_query_vars as $var) { if (isset($this->extra_query_vars[$var])) $this->query_vars[$var] = $this->extra_query_vars[$var]; elseif (isset($GLOBALS[$var]) && '' != $GLOBALS[$var]) $this->query_vars[$var] = $GLOBALS[$var]; } if ( isset($error) ) $this->query_vars['error'] = $error; $this->query_vars = apply_filters('request', $this->query_vars); do_action_ref_array('parse_request', array(&$this)); } function send_headers() { @header('X-Pingback: '. get_bloginfo('pingback_url')); if ( is_user_logged_in() ) nocache_headers(); if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) { status_header( 404 ); if ( !is_user_logged_in() ) nocache_headers(); @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else if ( empty($this->query_vars['feed']) ) { @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else { // We're showing a feed, so WP is indeed the only thing that last changed if ( $this->query_vars['withcomments'] || ( !$this->query_vars['withoutcomments'] && ( $this->query_vars['p'] || $this->query_vars['name'] || $this->query_vars['page_id'] || $this->query_vars['pagename'] || $this->query_vars['attachment'] || $this->query_vars['attachment_id'] ) ) ) $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT'; else $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT'; $wp_etag = '"' . md5($wp_last_modified) . '"'; @header("Last-Modified: $wp_last_modified"); @header("ETag: $wp_etag"); // Support for Conditional GET if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); else $client_etag = false; $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']); // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; // Make a timestamp for our most recent modification... $wp_modified_timestamp = strtotime($wp_last_modified); if ( ($client_last_modified && $client_etag) ? (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) : (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) { status_header( 304 ); exit; } } do_action_ref_array('send_headers', array(&$this)); } function build_query_string() { $this->query_string = ''; foreach (array_keys($this->query_vars) as $wpvar) { if ( '' != $this->query_vars[$wpvar] ) { $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&'; if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars. continue; $this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]); } } // query_string filter deprecated. Use request filter instead. global $wp_filter; if ( isset($wp_filter['query_string']) ) { // Don't bother filtering and parsing if no plugins are hooked in. $this->query_string = apply_filters('query_string', $this->query_string); parse_str($this->query_string, $this->query_vars); } } function register_globals() { global $wp_query; // Extract updated query vars back into global namespace. foreach ($wp_query->query_vars as $key => $value) { $GLOBALS[$key] = $value; } $GLOBALS['query_string'] = & $this->query_string; $GLOBALS['posts'] = & $wp_query->posts; $GLOBALS['post'] = & $wp_query->post; $GLOBALS['request'] = & $wp_query->request; if ( is_single() || is_page() ) { $GLOBALS['more'] = 1; $GLOBALS['single'] = 1; } } function init() { wp_get_current_user(); } function query_posts() { global $wp_the_query; $this->build_query_string(); $wp_the_query->query($this->query_vars); } function handle_404() { global $wp_query; // Issue a 404 if a permalink request doesn't match any posts. Don't // issue a 404 if one was already issued, if the request was a search, // or if the request was a regular query string request rather than a // permalink request. if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) { $wp_query->set_404(); status_header( 404 ); nocache_headers(); } elseif( is_404() != true ) { status_header( 200 ); } } function main($query_args = '') { $this->init(); $this->parse_request($query_args); $this->send_headers(); $this->query_posts(); $this->handle_404(); $this->register_globals(); do_action_ref_array('wp', array(&$this)); } function WP() { // Empty. } } class WP_Error { var $errors = array(); var $error_data = array(); function WP_Error($code = '', $message = '', $data = '') { if ( empty($code) ) return; $this->errors[$code][] = $message; if ( ! empty($data) ) $this->error_data[$code] = $data; } function get_error_codes() { if ( empty($this->errors) ) return array(); return array_keys($this->errors); } function get_error_code() { $codes = $this->get_error_codes(); if ( empty($codes) ) return ''; return $codes[0]; } function get_error_messages($code = '') { // Return all messages if no code specified. if ( empty($code) ) { $all_messages = array(); foreach ( $this->errors as $code => $messages ) $all_messages = array_merge($all_messages, $messages); return $all_messages; } if ( isset($this->errors[$code]) ) return $this->errors[$code]; else return array(); } function get_error_message($code = '') { if ( empty($code) ) $code = $this->get_error_code(); $messages = $this->get_error_messages($code); if ( empty($messages) ) return ''; return $messages[0]; } function get_error_data($code = '') { if ( empty($code) ) $code = $this->get_error_code(); if ( isset($this->error_data[$code]) ) return $this->error_data[$code]; return null; } function add($code, $message, $data = '') { $this->errors[$code][] = $message; if ( ! empty($data) ) $this->error_data[$code] = $data; } function add_data($data, $code = '') { if ( empty($code) ) $code = $this->get_error_code(); $this->error_data[$code] = $data; } } function is_wp_error($thing) { if ( is_object($thing) && is_a($thing, 'WP_Error') ) return true; return false; } // A class for displaying various tree-like structures. Extend the Walker class to use it, see examples at the bottom class Walker { var $tree_type; var $db_fields; //abstract callbacks function start_lvl($output) { return $output; } function end_lvl($output) { return $output; } function start_el($output) { return $output; } function end_el($output) { return $output; } function walk($elements, $to_depth) { $args = array_slice(func_get_args(), 2); $parents = array(); $depth = 1; $previous_element = ''; $output = ''; //padding at the end $last_element->post_parent = 0; $last_element->post_id = 0; $elements[] = $last_element; $id_field = $this->db_fields['id']; $parent_field = $this->db_fields['parent']; $flat = ($to_depth == -1) ? true : false; foreach ( $elements as $element ) { // If flat, start and end the element and skip the level checks. if ( $flat) { // Start the element. if ( isset($element->$id_field) && $element->$id_field != 0 ) { $cb_args = array_merge( array($output, $element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'start_el'), $cb_args); } // End the element. if ( isset($element->$id_field) && $element->$id_field != 0 ) { $cb_args = array_merge( array($output, $element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } continue; } // Walk the tree. if ( !empty($previous_element) && ($element->$parent_field == $previous_element->$id_field) ) { // Previous element is my parent. Descend a level. array_unshift($parents, $previous_element); if ( !$to_depth || ($depth < $to_depth) ) { //only descend if we're below $to_depth $cb_args = array_merge( array($output, $depth), $args); $output = call_user_func_array(array(&$this, 'start_lvl'), $cb_args); } else if ( $to_depth && $depth == $to_depth ) { // If we've reached depth, end the previous element. $cb_args = array_merge( array($output, $previous_element, $depth), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } $depth++; //always do this so when we start the element further down, we know where we are } else if ( $element->$parent_field == $previous_element->$parent_field) { // On the same level as previous element. if ( !$to_depth || ($depth <= $to_depth) ) { $cb_args = array_merge( array($output, $previous_element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } } else if ( $depth > 1 ) { // Ascend one or more levels. if ( !$to_depth || ($depth <= $to_depth) ) { $cb_args = array_merge( array($output, $previous_element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } while ( $parent = array_shift($parents) ) { $depth--; if ( !$to_depth || ($depth < $to_depth) ) { $cb_args = array_merge( array($output, $depth), $args); $output = call_user_func_array(array(&$this, 'end_lvl'), $cb_args); $cb_args = array_merge( array($output, $parent, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } if ( $element->$parent_field == $parents[0]->$id_field ) { break; } } } else if ( !empty($previous_element) ) { // Close off previous element. if ( !$to_depth || ($depth <= $to_depth) ) { $cb_args = array_merge( array($output, $previous_element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } } // Start the element. if ( !$to_depth || ($depth <= $to_depth) ) { if ( $element->$id_field != 0 ) { $cb_args = array_merge( array($output, $element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'start_el'), $cb_args); } } $previous_element = $element; } return $output; } } class Walker_Page extends Walker { var $tree_type = 'page'; var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this function start_lvl($output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent
      \n"; return $output; } function end_lvl($output, $depth) { $indent = str_repeat("\t", $depth); $output .= "$indent
    \n"; return $output; } function start_el($output, $page, $depth, $current_page, $args) { if ( $depth ) $indent = str_repeat("\t", $depth); extract($args, EXTR_SKIP); $css_class = 'page_item page-item-'.$page->ID; $_current_page = get_page( $current_page ); if ( $page->ID == $current_page ) $css_class .= ' current_page_item '; elseif ( $_current_page && $page->ID == $_current_page->post_parent ) $css_class .= ' current_page_parent'; $output .= $indent . '
  • ' . apply_filters('the_title', $page->post_title) . ''; if ( !empty($show_date) ) { if ( 'modified' == $show_date ) $time = $page->post_modified; else $time = $page->post_date; $output .= " " . mysql2date($date_format, $time); } return $output; } function end_el($output, $page, $depth) { $output .= "
  • \n"; return $output; } } class Walker_PageDropdown extends Walker { var $tree_type = 'page'; var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this function start_el($output, $page, $depth, $args) { $pad = str_repeat(' ', $depth * 3); $output .= "\t\n"; return $output; } } class Walker_Category extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl($output, $depth, $args) { if ( 'list' != $args['style'] ) return $output; $indent = str_repeat("\t", $depth); $output .= "$indent
      \n"; return $output; } function end_lvl($output, $depth, $args) { if ( 'list' != $args['style'] ) return $output; $indent = str_repeat("\t", $depth); $output .= "$indent
    \n"; return $output; } function start_el($output, $category, $depth, $args) { extract($args); $cat_name = attribute_escape( $category->name); $cat_name = apply_filters( 'list_cats', $cat_name, $category ); $link = 'description) ) $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; else $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->description, $category )) . '"'; $link .= '>'; $link .= $cat_name . ''; if ( (! empty($feed_image)) || (! empty($feed)) ) { $link .= ' '; if ( empty($feed_image) ) $link .= '('; $link .= ''; $link .= ''; if ( empty($feed_image) ) $link .= ')'; } if ( isset($show_count) && $show_count ) $link .= ' (' . intval($category->count) . ')'; if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); } if ( $current_category ) $_current_category = get_category( $current_category ); if ( 'list' == $args['style'] ) { $output .= "\tterm_id; if ( $current_category && ($category->term_id == $current_category) ) $class .= ' current-cat'; elseif ( $_current_category && ($category->term_id == $_current_category->parent) ) $class .= ' current-cat-parent'; $output .= ' class="'.$class.'"'; $output .= ">$link\n"; } else { $output .= "\t$link
    \n"; } return $output; } function end_el($output, $page, $depth, $args) { if ( 'list' != $args['style'] ) return $output; $output .= "\n"; return $output; } } class Walker_CategoryDropdown extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_el($output, $category, $depth, $args) { $pad = str_repeat(' ', $depth * 3); $cat_name = apply_filters('list_cats', $category->name, $category); $output .= "\t\n"; return $output; } } class WP_Ajax_Response { var $responses = array(); function WP_Ajax_Response( $args = '' ) { if ( !empty($args) ) $this->add($args); } // a WP_Error object can be passed in 'id' or 'data' function add( $args = '' ) { $defaults = array( 'what' => 'object', 'action' => false, 'id' => '0', 'old_id' => false, 'data' => '', 'supplemental' => array() ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); if ( is_wp_error($id) ) { $data = $id; $id = 0; } $response = ''; if ( is_wp_error($data) ) foreach ( $data->get_error_codes() as $code ) $response .= "get_error_message($code) . "]]>"; else $response = ""; $s = ''; if ( (array) $supplemental ) foreach ( $supplemental as $k => $v ) $s .= "<$k>"; if ( false === $action ) $action = $_POST['action']; $x = ''; $x .= ""; // The action attribute in the xml output is formatted like a nonce action $x .= "<$what id='$id'" . ( false !== $old_id ? "old_id='$old_id'>" : '>' ); $x .= $response; $x .= $s; $x .= ""; $x .= ""; $this->responses[] = $x; return $x; } function send() { header('Content-Type: text/xml'); echo ""; foreach ( $this->responses as $response ) echo $response; echo ''; die(); } } ?> wp-includes/comment-template.php0000644013707600007620000002521010667076612015011 0ustar wwwcomment_author) ) $author = __('Anonymous'); else $author = $comment->comment_author; return apply_filters('get_comment_author', $author); } function comment_author() { $author = apply_filters('comment_author', get_comment_author() ); echo $author; } function get_comment_author_email() { global $comment; return apply_filters('get_comment_author_email', $comment->comment_author_email); } function comment_author_email() { echo apply_filters('author_email', get_comment_author_email() ); } function comment_author_email_link($linktext='', $before='', $after='') { global $comment; $email = apply_filters('comment_email', $comment->comment_author_email); if ((!empty($email)) && ($email != '@')) { $display = ($linktext != '') ? $linktext : $email; echo $before; echo "$display"; echo $after; } } function get_comment_author_link() { global $comment; $url = get_comment_author_url(); $author = get_comment_author(); if ( empty( $url ) || 'http://' == $url ) $return = $author; else $return = "$author"; return apply_filters('get_comment_author_link', $return); } function comment_author_link() { echo get_comment_author_link(); } function get_comment_author_IP() { global $comment; return apply_filters('get_comment_author_IP', $comment->comment_author_IP); } function comment_author_IP() { echo get_comment_author_IP(); } function get_comment_author_url() { global $comment; return apply_filters('get_comment_author_url', $comment->comment_author_url); } function comment_author_url() { echo apply_filters('comment_url', get_comment_author_url()); } function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) { global $comment; $url = get_comment_author_url(); $display = ($linktext != '') ? $linktext : $url; $display = str_replace( 'http://www.', '', $display ); $display = str_replace( 'http://', '', $display ); if ( '/' == substr($display, -1) ) $display = substr($display, 0, -1); $return = "$before$display$after"; return apply_filters('get_comment_author_url_link', $return); } function comment_author_url_link( $linktext = '', $before = '', $after = '' ) { echo get_comment_author_url_link( $linktext, $before, $after ); } function get_comment_date( $d = '' ) { global $comment; if ( '' == $d ) $date = mysql2date( get_option('date_format'), $comment->comment_date); else $date = mysql2date($d, $comment->comment_date); return apply_filters('get_comment_date', $date, $d); } function comment_date( $d = '' ) { echo get_comment_date( $d ); } function get_comment_excerpt() { global $comment; $comment_text = strip_tags($comment->comment_content); $blah = explode(' ', $comment_text); if (count($blah) > 20) { $k = 20; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } $excerpt = ''; for ($i=0; $i<$k; $i++) { $excerpt .= $blah[$i] . ' '; } $excerpt .= ($use_dotdotdot) ? '...' : ''; return apply_filters('get_comment_excerpt', $excerpt); } function comment_excerpt() { echo apply_filters('comment_excerpt', get_comment_excerpt() ); } function get_comment_ID() { global $comment; return apply_filters('get_comment_ID', $comment->comment_ID); } function comment_ID() { echo get_comment_ID(); } function get_comment_link() { global $comment; return get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; } function get_comments_link() { return get_permalink() . '#comments'; } function comments_link( $file = '', $echo = true ) { echo get_comments_link(); } function get_comments_number( $post_id = 0 ) { global $wpdb, $id; $post_id = (int) $post_id; if ( !$post_id ) $post_id = (int) $id; $post = get_post($post_id); if ( ! isset($post->comment_count) ) $count = 0; else $count = $post->comment_count; return apply_filters('get_comments_number', $count); } function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) { global $id; $number = get_comments_number($id); if ( $number > 1 ) $output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more); elseif ( $number == 0 ) $output = ( false === $zero ) ? __('No Comments') : $zero; else // must be one $output = ( false === $one ) ? __('1 Comment') : $one; echo apply_filters('comments_number', $output, $number); } function get_comment_text() { global $comment; return apply_filters('get_comment_text', $comment->comment_content); } function comment_text() { echo apply_filters('comment_text', get_comment_text() ); } function get_comment_time( $d = '', $gmt = false ) { global $comment; $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date; if ( '' == $d ) $date = mysql2date(get_option('time_format'), $comment_date); else $date = mysql2date($d, $comment_date); return apply_filters('get_comment_time', $date, $d, $gmt); } function comment_time( $d = '' ) { echo get_comment_time($d); } function get_comment_type() { global $comment; if ( '' == $comment->comment_type ) $comment->comment_type = 'comment'; return apply_filters('get_comment_type', $comment->comment_type); } function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') { $type = get_comment_type(); switch( $type ) { case 'trackback' : echo $trackbacktxt; break; case 'pingback' : echo $pingbacktxt; break; default : echo $commenttxt; } } function get_trackback_url() { global $id; if ( '' != get_option('permalink_structure') ) { $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); } else { $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id; } return apply_filters('trackback_url', $tb_url); } function trackback_url($deprecated = true) { // remove backwards compat in 2.4 if ($deprecated) echo get_trackback_url(); else return get_trackback_url(); } function trackback_rdf($timezone = 0) { global $id; if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) { echo ' \n"; echo ''; } } function comments_open() { global $post; if ( 'open' == $post->comment_status ) return true; else return false; } function pings_open() { global $post; if ( 'open' == $post->ping_status ) return true; else return false; } function wp_comment_form_unfiltered_html_nonce() { global $post; if ( current_user_can('unfiltered_html') ) wp_nonce_field('unfiltered-html-comment_' . $post->ID, '_wp_unfiltered_html_comment', false); } function comments_template( $file = '/comments.php' ) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity; if ( ! (is_single() || is_page() || $withcomments) ) return; $req = get_option('require_name_email'); $commenter = wp_get_current_commenter(); extract($commenter, EXTR_SKIP); // TODO: Use API instead of SELECTs. if ( $user_ID) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date"); } else if ( empty($comment_author) ) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); } else { $author_db = $wpdb->escape($comment_author); $email_db = $wpdb->escape($comment_author_email); $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date"); } // keep $comments for legacy's sake (remember $table*? ;) ) $comments = $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID ); $wp_query->comment_count = count($wp_query->comments); update_comment_cache($comments); define('COMMENTS_TEMPLATE', true); $include = apply_filters('comments_template', TEMPLATEPATH . $file ); if ( file_exists( $include ) ) require( $include ); else require( ABSPATH . 'wp-content/themes/default/comments.php'); } function comments_popup_script($width=400, $height=400, $file='') { global $wpcommentspopupfile, $wptrackbackpopupfile, $wppingbackpopupfile, $wpcommentsjavascript; if (empty ($file)) { $wpcommentspopupfile = ''; // Use the index. } else { $wpcommentspopupfile = $file; } $wpcommentsjavascript = 1; $javascript = "\n"; echo $javascript; } function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') { global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb; if ( is_single() || is_page() ) return; $number = get_comments_number($id); if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) { echo '' . $none . ''; return; } if ( !empty($post->post_password) ) { // if there's a password if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie echo(__('Enter your password to view comments')); return; } } echo ''; comments_number($zero, $one, $more, $number); echo ''; } ?> wp-includes/comment.php0000644013707600007620000006730710665323416013210 0ustar www= get_option('comment_max_links') ) return false; // Check # of external links $mod_keys = trim(get_option('moderation_keys')); if ( !empty($mod_keys) ) { $words = explode("\n", $mod_keys ); foreach ($words as $word) { $word = trim($word); // Skip empty lines if ( empty($word) ) continue; // Do some escaping magic so that '#' chars in the // spam words don't break things: $word = preg_quote($word, '#'); $pattern = "#$word#i"; if ( preg_match($pattern, $author) ) return false; if ( preg_match($pattern, $email) ) return false; if ( preg_match($pattern, $url) ) return false; if ( preg_match($pattern, $comment) ) return false; if ( preg_match($pattern, $user_ip) ) return false; if ( preg_match($pattern, $user_agent) ) return false; } } // Comment whitelisting: if ( 1 == get_option('comment_whitelist')) { if ( 'trackback' == $comment_type || 'pingback' == $comment_type ) { // check if domain is in blogroll $uri = parse_url($url); $domain = $uri['host']; $uri = parse_url( get_option('home') ); $home_domain = $uri['host']; if ( $wpdb->get_var("SELECT link_id FROM $wpdb->links WHERE link_url LIKE ('%$domain%') LIMIT 1") || $domain == $home_domain ) return true; else return false; } elseif ( $author != '' && $email != '' ) { $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' LIMIT 1"); if ( ( 1 == $ok_to_comment ) && ( empty($mod_keys) || false === strpos( $email, $mod_keys) ) ) return true; else return false; } else { return false; } } return true; } function get_approved_comments($post_id) { global $wpdb; $post_id = (int) $post_id; return $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1' ORDER BY comment_date"); } // Retrieves comment data given a comment ID or comment object. // Handles comment caching. function &get_comment(&$comment, $output = OBJECT) { global $wpdb; if ( empty($comment) ) { if ( isset($GLOBALS['comment']) ) $_comment = & $GLOBALS['comment']; else $_comment = null; } elseif ( is_object($comment) ) { wp_cache_add($comment->comment_ID, $comment, 'comment'); $_comment = $comment; } else { $comment = (int) $comment; if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->comment_ID == $comment) ) { $_comment = & $GLOBALS['comment']; } elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) { $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1"); wp_cache_add($_comment->comment_ID, $_comment, 'comment'); } } $_comment = apply_filters('get_comment', $_comment); if ( $output == OBJECT ) { return $_comment; } elseif ( $output == ARRAY_A ) { return get_object_vars($_comment); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($_comment)); } else { return $_comment; } } // Deprecate in favor of get_comment()? function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries global $postc, $id, $commentdata, $wpdb; if ( $no_cache ) { $query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'"; if ( false == $include_unapproved ) $query .= " AND comment_approved = '1'"; $myrow = $wpdb->get_row($query, ARRAY_A); } else { $myrow['comment_ID'] = $postc->comment_ID; $myrow['comment_post_ID'] = $postc->comment_post_ID; $myrow['comment_author'] = $postc->comment_author; $myrow['comment_author_email'] = $postc->comment_author_email; $myrow['comment_author_url'] = $postc->comment_author_url; $myrow['comment_author_IP'] = $postc->comment_author_IP; $myrow['comment_date'] = $postc->comment_date; $myrow['comment_content'] = $postc->comment_content; $myrow['comment_karma'] = $postc->comment_karma; $myrow['comment_approved'] = $postc->comment_approved; $myrow['comment_type'] = $postc->comment_type; } return $myrow; } function get_lastcommentmodified($timezone = 'server') { global $cache_lastcommentmodified, $pagenow, $wpdb; $add_seconds_blog = get_option('gmt_offset') * 3600; $add_seconds_server = date('Z'); $now = current_time('mysql', 1); if ( !isset($cache_lastcommentmodified[$timezone]) ) { switch ( strtolower($timezone)) { case 'gmt': $lastcommentmodified = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; case 'blog': $lastcommentmodified = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; case 'server': $lastcommentmodified = $wpdb->get_var("SELECT DATE_ADD(comment_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->comments WHERE comment_date_gmt <= '$now' AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 1"); break; } $cache_lastcommentmodified[$timezone] = $lastcommentmodified; } else { $lastcommentmodified = $cache_lastcommentmodified[$timezone]; } return $lastcommentmodified; } function sanitize_comment_cookies() { if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) { $comment_author = apply_filters('pre_comment_author_name', $_COOKIE['comment_author_'.COOKIEHASH]); $comment_author = stripslashes($comment_author); $comment_author = attribute_escape($comment_author); $_COOKIE['comment_author_'.COOKIEHASH] = $comment_author; } if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ) { $comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]); $comment_author_email = stripslashes($comment_author_email); $comment_author_email = attribute_escape($comment_author_email); $_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email; } if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ) { $comment_author_url = apply_filters('pre_comment_author_url', $_COOKIE['comment_author_url_'.COOKIEHASH]); $comment_author_url = stripslashes($comment_author_url); $_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url; } } function wp_allow_comment($commentdata) { global $wpdb; extract($commentdata, EXTR_SKIP); // Simple duplicate check $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' "; if ( $comment_author_email ) $dupe .= "OR comment_author_email = '$comment_author_email' "; $dupe .= ") AND comment_content = '$comment_content' LIMIT 1"; if ( $wpdb->get_var($dupe) ) wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') ); do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt ); if ( $user_id ) { $userdata = get_userdata($user_id); $user = new WP_User($user_id); $post_author = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = '$comment_post_ID' LIMIT 1"); } if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') ) ) { // The author and the admins get respect. $approved = 1; } else { // Everyone else's comments will be checked. if ( check_comment($comment_author, $comment_author_email, $comment_author_url, $comment_content, $comment_author_IP, $comment_agent, $comment_type) ) $approved = 1; else $approved = 0; if ( wp_blacklist_check($comment_author, $comment_author_email, $comment_author_url, $comment_content, $comment_author_IP, $comment_agent) ) $approved = 'spam'; } $approved = apply_filters('pre_comment_approved', $approved); return $approved; } function check_comment_flood_db( $ip, $email, $date ) { global $wpdb; if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$ip' OR comment_author_email = '$email' ORDER BY comment_date DESC LIMIT 1") ) { $time_lastcomment = mysql2date('U', $lasttime); $time_newcomment = mysql2date('U', $date); $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); if ( $flood_die ) { do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment); wp_die( __('You are posting comments too quickly. Slow down.') ); } } } function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) { global $wpdb; do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent); if ( preg_match_all('/&#(\d+);/', $comment . $author . $url, $chars) ) { foreach ( (array) $chars[1] as $char ) { // If it's an encoded char in the normal ASCII set, reject if ( 38 == $char ) continue; // Unless it's & if ( $char < 128 ) return true; } } $mod_keys = trim( get_option('blacklist_keys') ); if ( '' == $mod_keys ) return false; // If moderation keys are empty $words = explode("\n", $mod_keys ); foreach ( (array) $words as $word ) { $word = trim($word); // Skip empty lines if ( empty($word) ) { continue; } // Do some escaping magic so that '#' chars in the // spam words don't break things: $word = preg_quote($word, '#'); $pattern = "#$word#i"; if ( preg_match($pattern, $author) || preg_match($pattern, $email) || preg_match($pattern, $url) || preg_match($pattern, $comment) || preg_match($pattern, $user_ip) || preg_match($pattern, $user_agent) ) return true; } return false; } function wp_delete_comment($comment_id) { global $wpdb; do_action('delete_comment', $comment_id); $comment = get_comment($comment_id); if ( ! $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1") ) return false; $post_id = $comment->comment_post_ID; if ( $post_id && $comment->comment_approved == 1 ) wp_update_comment_count($post_id); clean_comment_cache($comment_id); do_action('wp_set_comment_status', $comment_id, 'delete'); return true; } function wp_get_comment_status($comment_id) { global $wpdb; $comment = get_comment($comment_id); if ( !$comment ) return false; $approved = $comment->comment_approved; if ( $approved == NULL ) return 'deleted'; elseif ( $approved == '1' ) return 'approved'; elseif ( $approved == '0' ) return 'unapproved'; elseif ( $approved == 'spam' ) return 'spam'; else return false; } function wp_get_current_commenter() { // Cookies should already be sanitized. $comment_author = ''; if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) $comment_author = $_COOKIE['comment_author_'.COOKIEHASH]; $comment_author_email = ''; if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ) $comment_author_email = $_COOKIE['comment_author_email_'.COOKIEHASH]; $comment_author_url = ''; if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ) $comment_author_url = $_COOKIE['comment_author_url_'.COOKIEHASH]; return compact('comment_author', 'comment_author_email', 'comment_author_url'); } function wp_insert_comment($commentdata) { global $wpdb; extract($commentdata, EXTR_SKIP); if ( ! isset($comment_author_IP) ) $comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] ); if ( ! isset($comment_date) ) $comment_date = current_time('mysql'); if ( ! isset($comment_date_gmt) ) $comment_date_gmt = get_gmt_from_date($comment_date); if ( ! isset($comment_parent) ) $comment_parent = 0; if ( ! isset($comment_approved) ) $comment_approved = 1; if ( ! isset($user_id) ) $user_id = 0; $result = $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id) VALUES ('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id') "); $id = (int) $wpdb->insert_id; if ( $comment_approved == 1) wp_update_comment_count($comment_post_ID); return $id; } function wp_filter_comment($commentdata) { $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']); $commentdata['comment_agent'] = apply_filters('pre_comment_user_agent', $commentdata['comment_agent']); $commentdata['comment_author'] = apply_filters('pre_comment_author_name', $commentdata['comment_author']); $commentdata['comment_content'] = apply_filters('pre_comment_content', $commentdata['comment_content']); $commentdata['comment_author_IP'] = apply_filters('pre_comment_user_ip', $commentdata['comment_author_IP']); $commentdata['comment_author_url'] = apply_filters('pre_comment_author_url', $commentdata['comment_author_url']); $commentdata['comment_author_email'] = apply_filters('pre_comment_author_email', $commentdata['comment_author_email']); $commentdata['filtered'] = true; return $commentdata; } function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) { if ( $block ) // a plugin has already blocked... we'll let that decision stand return $block; if ( ($time_newcomment - $time_lastcomment) < 15 ) return true; return false; } function wp_new_comment( $commentdata ) { $commentdata = apply_filters('preprocess_comment', $commentdata); $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID']; $commentdata['user_ID'] = (int) $commentdata['user_ID']; $commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] ); $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT']; $commentdata['comment_date'] = current_time('mysql'); $commentdata['comment_date_gmt'] = current_time('mysql', 1); $commentdata = wp_filter_comment($commentdata); $commentdata['comment_approved'] = wp_allow_comment($commentdata); $comment_ID = wp_insert_comment($commentdata); do_action('comment_post', $comment_ID, $commentdata['comment_approved']); if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching if ( '0' == $commentdata['comment_approved'] ) wp_notify_moderator($comment_ID); $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_ID'] ) wp_notify_postauthor($comment_ID, $commentdata['comment_type']); } return $comment_ID; } function wp_set_comment_status($comment_id, $comment_status) { global $wpdb; switch ( $comment_status ) { case 'hold': $query = "UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID='$comment_id' LIMIT 1"; break; case 'approve': $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1"; break; case 'spam': $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1"; break; case 'delete': return wp_delete_comment($comment_id); break; default: return false; } if ( !$wpdb->query($query) ) return false; clean_comment_cache($comment_id); do_action('wp_set_comment_status', $comment_id, $comment_status); $comment = get_comment($comment_id); wp_update_comment_count($comment->comment_post_ID); return true; } function wp_update_comment($commentarr) { global $wpdb; // First, get all of the original fields $comment = get_comment($commentarr['comment_ID'], ARRAY_A); // Escape data pulled from DB. foreach ( (array) $comment as $key => $value ) $comment[$key] = $wpdb->escape($value); // Merge old and new fields with new fields overwriting old ones. $commentarr = array_merge($comment, $commentarr); $commentarr = wp_filter_comment( $commentarr ); // Now extract the merged array. extract($commentarr, EXTR_SKIP); $comment_content = apply_filters('comment_save_pre', $comment_content); $comment_date_gmt = get_gmt_from_date($comment_date); $result = $wpdb->query( "UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author', comment_author_email = '$comment_author_email', comment_approved = '$comment_approved', comment_author_url = '$comment_author_url', comment_date = '$comment_date', comment_date_gmt = '$comment_date_gmt' WHERE comment_ID = $comment_ID" ); $rval = $wpdb->rows_affected; clean_comment_cache($comment_ID); wp_update_comment_count($comment_post_ID); do_action('edit_comment', $comment_ID); return $rval; } function wp_update_comment_count($post_id) { global $wpdb, $comment_count_cache; $post_id = (int) $post_id; if ( !$post_id ) return false; if ( !$post = get_post($post_id) ) return false; $old = (int) $post->comment_count; $new = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1'"); $wpdb->query("UPDATE $wpdb->posts SET comment_count = '$new' WHERE ID = '$post_id'"); $comment_count_cache[$post_id] = $new; if ( 'page' == $post->post_type ) clean_page_cache( $post_id ); else clean_post_cache( $post_id ); do_action('wp_update_comment_count', $post_id, $new, $old); do_action('edit_post', $post_id, $post); return true; } // // Ping and trackback functions. // function discover_pingback_server_uri($url, $timeout_bytes = 2048) { global $wp_version; $byte_count = 0; $contents = ''; $headers = ''; $pingback_str_dquote = 'rel="pingback"'; $pingback_str_squote = 'rel=\'pingback\''; $x_pingback_str = 'x-pingback: '; $pingback_href_original_pos = 27; extract(parse_url($url), EXTR_SKIP); if ( !isset($host) ) // Not an URL. This should never happen. return false; $path = ( !isset($path) ) ? '/' : $path; $path .= ( isset($query) ) ? '?' . $query : ''; $port = ( isset($port) ) ? $port : 80; // Try to connect to the server at $host $fp = @fsockopen($host, $port, $errno, $errstr, 2); if ( !$fp ) // Couldn't open a connection to $host return false; // Send the GET request $request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: WordPress/$wp_version \r\n\r\n"; // ob_end_flush(); fputs($fp, $request); // Let's check for an X-Pingback header first while ( !feof($fp) ) { $line = fgets($fp, 512); if ( trim($line) == '' ) break; $headers .= trim($line)."\n"; $x_pingback_header_offset = strpos(strtolower($headers), $x_pingback_str); if ( $x_pingback_header_offset ) { // We got it! preg_match('#x-pingback: (.+)#is', $headers, $matches); $pingback_server_url = trim($matches[1]); return $pingback_server_url; } if ( strpos(strtolower($headers), 'content-type: ') ) { preg_match('#content-type: (.+)#is', $headers, $matches); $content_type = trim($matches[1]); } } if ( preg_match('#(image|audio|video|model)/#is', $content_type) ) // Not an (x)html, sgml, or xml page, no use going further return false; while ( !feof($fp) ) { $line = fgets($fp, 1024); $contents .= trim($line); $pingback_link_offset_dquote = strpos($contents, $pingback_str_dquote); $pingback_link_offset_squote = strpos($contents, $pingback_str_squote); if ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) { $quote = ($pingback_link_offset_dquote) ? '"' : '\''; $pingback_link_offset = ($quote=='"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote; $pingback_href_pos = @strpos($contents, 'href=', $pingback_link_offset); $pingback_href_start = $pingback_href_pos+6; $pingback_href_end = @strpos($contents, $quote, $pingback_href_start); $pingback_server_url_len = $pingback_href_end - $pingback_href_start; $pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len); // We may find rel="pingback" but an incomplete pingback URL if ( $pingback_server_url_len > 0 ) // We got it! return $pingback_server_url; } $byte_count += strlen($line); if ( $byte_count > $timeout_bytes ) { // It's no use going further, there probably isn't any pingback // server to find in this file. (Prevents loading large files.) return false; } } // We didn't find anything. return false; } function do_all_pings() { global $wpdb; // Do pingbacks while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) { $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); pingback($ping->post_content, $ping->ID); } // Do Enclosures while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) { $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';"); do_enclose($enclosure->post_content, $enclosure->ID); } // Do Trackbacks $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE CHAR_LENGTH(TRIM(to_ping)) > 7 AND post_status = 'publish'"); if ( is_array($trackbacks) ) { foreach ( $trackbacks as $trackback ) do_trackbacks($trackback->ID); } //Do Update Services/Generic Pings generic_ping(); } function do_trackbacks($post_id) { global $wpdb; $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id"); $to_ping = get_to_ping($post_id); $pinged = get_pung($post_id); if ( empty($to_ping) ) { $wpdb->query("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = '$post_id'"); return; } if ( empty($post->post_excerpt) ) $excerpt = apply_filters('the_content', $post->post_content); else $excerpt = apply_filters('the_excerpt', $post->post_excerpt); $excerpt = str_replace(']]>', ']]>', $excerpt); $excerpt = strip_tags($excerpt); if ( function_exists('mb_strcut') ) // For international trackbacks $excerpt = mb_strcut($excerpt, 0, 252, get_option('blog_charset')) . '...'; else $excerpt = substr($excerpt, 0, 252) . '...'; $post_title = apply_filters('the_title', $post->post_title); $post_title = strip_tags($post_title); if ( $to_ping ) { foreach ( (array) $to_ping as $tb_ping ) { $tb_ping = trim($tb_ping); if ( !in_array($tb_ping, $pinged) ) { trackback($tb_ping, $post_title, $excerpt, $post_id); $pinged[] = $tb_ping; } else { $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_ping', '')) WHERE ID = '$post_id'"); } } } } function generic_ping($post_id = 0) { $services = get_option('ping_sites'); $services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines $services = trim($services); if ( '' != $services ) { $services = explode("\n", $services); foreach ( (array) $services as $service ) weblog_ping($service); } return $post_id; } function pingback($content, $post_ID) { global $wp_version, $wpdb; include_once(ABSPATH . WPINC . '/class-IXR.php'); // original code by Mort (http://mort.mine.nu:8080) $post_links = array(); $pung = get_pung($post_ID); // Variables $ltrs = '\w'; $gunk = '/#~:.?+=&%@!\-'; $punc = '.:?\-'; $any = $ltrs . $gunk . $punc; // Step 1 // Parsing the post, external links (if any) are stored in the $post_links array // This regexp comes straight from phpfreaks.com // http://www.phpfreaks.com/quickcode/Extract_All_URLs_on_a_Page/15.php preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp); // Step 2. // Walking thru the links array // first we get rid of links pointing to sites, not to specific files // Example: // http://dummy-weblog.org // http://dummy-weblog.org/ // http://dummy-weblog.org/post.php // We don't wanna ping first and second types, even if they have a valid foreach ( $post_links_temp[0] as $link_test ) : if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments. $test = parse_url($link_test); if ( isset($test['query']) ) $post_links[] = $link_test; elseif ( ($test['path'] != '/') && ($test['path'] != '') ) $post_links[] = $link_test; endif; endforeach; do_action_ref_array('pre_ping', array(&$post_links, &$pung)); foreach ( (array) $post_links as $pagelinkedto ) { $pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048); if ( $pingback_server_url ) { @ set_time_limit( 60 ); // Now, the RPC call $pagelinkedfrom = get_permalink($post_ID); // using a timeout of 3 seconds should be enough to cover slow servers $client = new IXR_Client($pingback_server_url); $client->timeout = 3; $client->useragent .= ' -- WordPress/' . $wp_version; // when set to true, this outputs debug messages by itself $client->debug = false; if ( $client->query('pingback.ping', $pagelinkedfrom, $pagelinkedto) || ( isset($client->error->code) && 48 == $client->error->code ) ) // Already registered add_ping( $post_ID, $pagelinkedto ); } } } function privacy_ping_filter($sites) { if ( '0' != get_option('blog_public') ) return $sites; else return ''; } // Send a Trackback function trackback($trackback_url, $title, $excerpt, $ID) { global $wpdb, $wp_version; if ( empty($trackback_url) ) return; $title = urlencode($title); $excerpt = urlencode($excerpt); $blog_name = urlencode(get_option('blogname')); $tb_url = $trackback_url; $url = urlencode(get_permalink($ID)); $query_string = "title=$title&url=$url&blog_name=$blog_name&excerpt=$excerpt"; $trackback_url = parse_url($trackback_url); $http_request = 'POST ' . $trackback_url['path'] . ($trackback_url['query'] ? '?'.$trackback_url['query'] : '') . " HTTP/1.0\r\n"; $http_request .= 'Host: '.$trackback_url['host']."\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n"; $http_request .= 'Content-Length: '.strlen($query_string)."\r\n"; $http_request .= "User-Agent: WordPress/" . $wp_version; $http_request .= "\r\n\r\n"; $http_request .= $query_string; if ( '' == $trackback_url['port'] ) $trackback_url['port'] = 80; $fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4); @fputs($fs, $http_request); @fclose($fs); $tb_url = addslashes( $tb_url ); $wpdb->query("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = '$ID'"); return $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = '$ID'"); } function weblog_ping($server = '', $path = '') { global $wp_version; include_once(ABSPATH . WPINC . '/class-IXR.php'); // using a timeout of 3 seconds should be enough to cover slow servers $client = new IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path)); $client->timeout = 3; $client->useragent .= ' -- WordPress/'.$wp_version; // when set to true, this outputs debug messages by itself $client->debug = false; $home = trailingslashit( get_option('home') ); if ( !$client->query('weblogUpdates.extendedPing', get_option('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping $client->query('weblogUpdates.ping', get_option('blogname'), $home); } // // Cache // function clean_comment_cache($id) { wp_cache_delete($id, 'comment'); } function update_comment_cache($comments) { foreach ( $comments as $comment ) wp_cache_add($comment->comment_ID, $comment, 'comment'); } ?> wp-includes/compat.php0000644013707600007620000000631510671246136013021 0ustar www if (get_class($object) == strtolower($class)) { return true; } else { return is_subclass_of($object, $class); } } } if (!function_exists('ob_clean')) { function ob_clean() { // by Aidan Lister if (@ob_end_clean()) { return ob_start(); } return false; } } /* Added in PHP 4.3.0 */ function printr($var, $do_not_echo = false) { // from php.net/print_r user contributed notes ob_start(); print_r($var); $code = htmlentities(ob_get_contents()); ob_clean(); if (!$do_not_echo) { echo "
    $code
    "; } ob_end_clean(); return $code; } /* compatibility with PHP versions older than 4.3 */ if ( !function_exists('file_get_contents') ) { function file_get_contents( $file ) { $file = file($file); return !$file ? false : implode('', $file); } } if (!defined('CASE_LOWER')) { define('CASE_LOWER', 0); } if (!defined('CASE_UPPER')) { define('CASE_UPPER', 1); } /** * Replace array_change_key_case() * * @category PHP * @package PHP_Compat * @link http://php.net/function.array_change_key_case * @author Stephan Schmidt * @author Aidan Lister * @version $Revision: 6070 $ * @since PHP 4.2.0 * @require PHP 4.0.0 (user_error) */ if (!function_exists('array_change_key_case')) { function array_change_key_case($input, $case = CASE_LOWER) { if (!is_array($input)) { user_error('array_change_key_case(): The argument should be an array', E_USER_WARNING); return false; } $output = array (); $keys = array_keys($input); $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; foreach ($keys as $key) { $output[$casefunc($key)] = $input[$key]; } return $output; } } if (!function_exists('http_build_query')) { function http_build_query($data, $prefix=null, $sep=null) { return _http_build_query($data, $prefix, $sep); } } // from php.net (modified by Mark Jaquith to behave like the native PHP5 function) function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true) { $ret = array(); foreach ( (array) $data as $k => $v ) { if ( $urlencode) $k = urlencode($k); if ( is_int($k) && $prefix != null ) $k = $prefix.$k; if ( !empty($key) ) $k = $key . '%5B' . $k . '%5D'; if ( $v === NULL ) continue; elseif ( $v === FALSE ) $v = '0'; if ( is_array($v) || is_object($v) ) array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode)); elseif ( $urlencode ) array_push($ret, $k.'='.urlencode($v)); else array_push($ret, $k.'='.$v); } if ( NULL === $sep ) $sep = ini_get('arg_separator.output'); return implode($sep, $ret); } if ( !function_exists('_') ) { function _($string) { return $string; } } // Added in PHP 5.0 if (!function_exists('stripos')) { function stripos($haystack, $needle, $offset = 0) { return strpos(strtolower($haystack), strtolower($needle), $offset); } } ?> wp-includes/cron.php0000644013707600007620000001175310665313522012476 0ustar www false, 'args' => $args ); uksort( $crons, "strnatcasecmp" ); _set_cron_array( $crons ); } function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { $crons = _get_cron_array(); $schedules = wp_get_schedules(); $key = md5(serialize($args)); if ( !isset( $schedules[$recurrence] ) ) return false; $crons[$timestamp][$hook][$key] = array( 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] ); uksort( $crons, "strnatcasecmp" ); _set_cron_array( $crons ); } function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) { $crons = _get_cron_array(); $schedules = wp_get_schedules(); $key = md5(serialize($args)); $interval = 0; // First we try to get it from the schedule if ( 0 == $interval ) $interval = $schedules[$recurrence]['interval']; // Now we try to get it from the saved interval in case the schedule disappears if ( 0 == $interval ) $interval = $crons[$timestamp][$hook][$key]['interval']; // Now we assume something is wrong and fail to schedule if ( 0 == $interval ) return false; while ( $timestamp < time() + 1 ) $timestamp += $interval; wp_schedule_event( $timestamp, $recurrence, $hook, $args ); } function wp_unschedule_event( $timestamp, $hook, $args = array() ) { $crons = _get_cron_array(); $key = md5(serialize($args)); unset( $crons[$timestamp][$hook][$key] ); if ( empty($crons[$timestamp][$hook]) ) unset( $crons[$timestamp][$hook] ); if ( empty($crons[$timestamp]) ) unset( $crons[$timestamp] ); _set_cron_array( $crons ); } function wp_clear_scheduled_hook( $hook ) { $args = array_slice( func_get_args(), 1 ); while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook, $args ); } function wp_next_scheduled( $hook, $args = array() ) { $crons = _get_cron_array(); $key = md5(serialize($args)); if ( empty($crons) ) return false; foreach ( $crons as $timestamp => $cron ) { if ( isset( $cron[$hook][$key] ) ) return $timestamp; } return false; } function spawn_cron() { $crons = _get_cron_array(); if ( !is_array($crons) ) return; $keys = array_keys( $crons ); if ( array_shift( $keys ) > time() ) return; $cron_url = get_option( 'siteurl' ) . '/wp-cron.php'; $parts = parse_url( $cron_url ); if ($parts['scheme'] == 'https') { // support for SSL was added in 4.3.0 if (version_compare(phpversion(), '4.3.0', '>=') && function_exists('openssl_open')) { $port = isset($parts['port']) ? $parts['port'] : 443; $argyle = @fsockopen('ssl://' . $parts['host'], $port, $errno, $errstr, 0.01); } else { return false; } } else { $port = isset($parts['port']) ? $parts['port'] : 80; $argyle = @ fsockopen( $parts['host'], $port, $errno, $errstr, 0.01 ); } if ( $argyle ) fputs( $argyle, "GET {$parts['path']}?check=" . wp_hash('187425') . " HTTP/1.0\r\n" . "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n" ); } function wp_cron() { // Prevent infinite loops caused by lack of wp-cron.php if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false ) return; $crons = _get_cron_array(); if ( !is_array($crons) ) return; $keys = array_keys( $crons ); if ( isset($keys[0]) && $keys[0] > time() ) return; $schedules = wp_get_schedules(); foreach ( $crons as $timestamp => $cronhooks ) { if ( $timestamp > time() ) break; foreach ( $cronhooks as $hook => $args ) { if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) ) continue; spawn_cron(); break 2; } } } function wp_get_schedules() { $schedules = array( 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ), 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ), ); return array_merge( apply_filters( 'cron_schedules', array() ), $schedules ); } function wp_get_schedule($hook, $args = array()) { $crons = _get_cron_array(); $key = md5(serialize($args)); if ( empty($crons) ) return false; foreach ( $crons as $timestamp => $cron ) { if ( isset( $cron[$hook][$key] ) ) return $cron[$hook][$key]['schedule']; } return false; } // // Private functions // function _get_cron_array() { $cron = get_option('cron'); if ( ! is_array($cron) ) return false; if ( !isset($cron['version']) ) $cron = _upgrade_cron_array($cron); unset($cron['version']); return $cron; } function _set_cron_array($cron) { $cron['version'] = 2; update_option( 'cron', $cron ); } function _upgrade_cron_array($cron) { if ( isset($cron['version']) && 2 == $cron['version']) return $cron; $new_cron = array(); foreach ($cron as $timestamp => $hooks) { foreach ( $hooks as $hook => $args ) { $key = md5(serialize($args['args'])); $new_cron[$timestamp][$hook][$key] = $args; } } $new_cron['version'] = 2; update_option( 'cron', $new_cron ); return $new_cron; } ?> wp-includes/default-filters.php0000644013707600007620000001323710674517206014633 0ustar wwwwp-includes/deprecated.php0000644013707600007620000005763010675520574013651 0ustar wwwposts; $tableusers = $wpdb->users; $tablecategories = $wpdb->categories; $tablepost2cat = $wpdb->post2cat; $tablecomments = $wpdb->comments; $tablelinks = $wpdb->links; $tablelinkcategories = 'linkcategories_is_gone'; $tableoptions = $wpdb->options; $tablepostmeta = $wpdb->postmeta; /* * Deprecated functions come here to die. */ // Use get_post(). function get_postdata($postid) { $post = &get_post($postid); $postdata = array ( 'ID' => $post->ID, 'Author_ID' => $post->post_author, 'Date' => $post->post_date, 'Content' => $post->post_content, 'Excerpt' => $post->post_excerpt, 'Title' => $post->post_title, 'Category' => $post->post_category, 'post_status' => $post->post_status, 'comment_status' => $post->comment_status, 'ping_status' => $post->ping_status, 'post_password' => $post->post_password, 'to_ping' => $post->to_ping, 'pinged' => $post->pinged, 'post_type' => $post->post_type, 'post_name' => $post->post_name ); return $postdata; } // Use the new post loop. function start_wp() { global $wp_query, $post; // Since the old style loop is being used, advance the query iterator here. $wp_query->next_post(); setup_postdata($post); } function the_category_ID($echo = true) { // Grab the first cat in the list. $categories = get_the_category(); $cat = $categories[0]->term_id; if ( $echo ) echo $cat; return $cat; } function the_category_head($before='', $after='') { global $currentcat, $previouscat; // Grab the first cat in the list. $categories = get_the_category(); $currentcat = $categories[0]->category_id; if ( $currentcat != $previouscat ) { echo $before; echo get_the_category_by_ID($currentcat); echo $after; $previouscat = $currentcat; } } // Use previous_post_link(). function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; else $in_same_cat = true; $post = get_previous_post($in_same_cat, $excluded_categories); if ( !$post ) return; $string = ''.$previous; if ( 'yes' == $title ) $string .= apply_filters('the_title', $post->post_title, $post); $string .= ''; $format = str_replace('%', $string, $format); echo $format; } // Use next_post_link(). function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; else $in_same_cat = true; $post = get_next_post($in_same_cat, $excluded_categories); if ( !$post ) return; $string = ''.$next; if ( 'yes' == $title ) $string .= apply_filters('the_title', $post->post_title, $nextpost); $string .= ''; $format = str_replace('%', $string, $format); echo $format; } // // Use current_user_can() for these. // /* returns true if $user_id can create a new post */ function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { $author_data = get_userdata($user_id); return ($author_data->user_level > 1); } /* returns true if $user_id can create a new post */ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { $author_data = get_userdata($user_id); return ($author_data->user_level >= 1); } /* returns true if $user_id can edit $post_id */ function user_can_edit_post($user_id, $post_id, $blog_id = 1) { $author_data = get_userdata($user_id); $post = get_post($post_id); $post_author_data = get_userdata($post->post_author); if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) || ($author_data->user_level > $post_author_data->user_level) || ($author_data->user_level >= 10) ) { return true; } else { return false; } } /* returns true if $user_id can delete $post_id */ function user_can_delete_post($user_id, $post_id, $blog_id = 1) { // right now if one can edit, one can delete return user_can_edit_post($user_id, $post_id, $blog_id); } /* returns true if $user_id can set new posts' dates on $blog_id */ function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); } /* returns true if $user_id can edit $post_id's date */ function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); } /* returns true if $user_id can edit $post_id's comments */ function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { // right now if one can edit a post, one can edit comments made on it return user_can_edit_post($user_id, $post_id, $blog_id); } /* returns true if $user_id can delete $post_id's comments */ function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { // right now if one can edit comments, one can delete comments return user_can_edit_post_comments($user_id, $post_id, $blog_id); } function user_can_edit_user($user_id, $other_user) { $user = get_userdata($user_id); $other = get_userdata($other_user); if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) return true; else return false; } /** function get_linksbyname() ** Gets the links associated with category 'cat_name'. ** Parameters: ** cat_name (default 'noname') - The category name to use. If no ** match is found uses all ** before (default '') - the html to output before the link ** after (default '
    ') - the html to output after the link ** between (default ' ') - the html to output between the link/image ** and it's description. Not used if no image or show_images == true ** show_images (default true) - whether to show images (if defined). ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url', 'description' or 'rating'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** show_description (default true) - whether to show the description if ** show_images=false/not defined ** show_rating (default false) - show rating stars/chars ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** show_updated (default 0) - whether to show last updated timestamp */ function get_linksbyname($cat_name = "noname", $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 0) { global $wpdb; $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); if ( $cat ) $cat_id = $cat->term_id; get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated); } /** function wp_get_linksbyname() ** Gets the links associated with the named category. ** Parameters: ** category (no default) - The category to use. **/ function wp_get_linksbyname($category, $args = '') { global $wpdb; $cat = get_term_by('name', $cat_name, 'link_category'); if ( !$cat ) return false; $cat_id = $cat->term_id; $args = add_query_arg('category', $cat_id, $args); wp_get_links($args); } /** function get_linkobjectsbyname() ** Gets an array of link objects associated with category 'cat_name'. ** Parameters: ** cat_name (default 'noname') - The category name to use. If no ** match is found uses all ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url', 'description', or 'rating'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** ** Use this like: ** $links = get_linkobjectsbyname('fred'); ** foreach ($links as $link) { ** echo '
  • '.$link->link_name.'
  • '; ** } **/ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { global $wpdb; $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); if ( $cat ) $cat_id = $cat->term_id; return get_linkobjects($cat_id, $orderby, $limit); } /** function get_linkobjects() ** Gets an array of link objects associated with category n. ** Parameters: ** category (default -1) - The category to use. If no category supplied ** uses all ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url', 'description', or 'rating'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** ** Use this like: ** $links = get_linkobjects(1); ** if ($links) { ** foreach ($links as $link) { ** echo '
  • '.$link->link_name.'
    '.$link->link_description.'
  • '; ** } ** } ** Fields are: ** link_id ** link_url ** link_name ** link_image ** link_target ** link_category ** link_description ** link_visible ** link_owner ** link_rating ** link_updated ** link_rel ** link_notes **/ // Deprecate in favor of get_linkz(). function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { global $wpdb; $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); $links_array = array(); foreach ($links as $link) { $links_array[] = $link; } return $links_array; } /** function get_linksbyname_withrating() ** Gets the links associated with category 'cat_name' and display rating stars/chars. ** Parameters: ** cat_name (default 'noname') - The category name to use. If no ** match is found uses all ** before (default '') - the html to output before the link ** after (default '
    ') - the html to output after the link ** between (default ' ') - the html to output between the link/image ** and it's description. Not used if no image or show_images == true ** show_images (default true) - whether to show images (if defined). ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url' or 'description'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** show_description (default true) - whether to show the description if ** show_images=false/not defined ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** show_updated (default 0) - whether to show last updated timestamp */ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } /** function get_links_withrating() ** Gets the links associated with category n and display rating stars/chars. ** Parameters: ** category (default -1) - The category to use. If no category supplied ** uses all ** before (default '') - the html to output before the link ** after (default '
    ') - the html to output after the link ** between (default ' ') - the html to output between the link/image ** and it's description. Not used if no image or show_images == true ** show_images (default true) - whether to show images (if defined). ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url' or 'description'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** show_description (default true) - whether to show the description if ** show_images=false/not defined . ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** show_updated (default 0) - whether to show last updated timestamp */ function get_links_withrating($category = -1, $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } /** function get_get_autotoggle() ** Gets the auto_toggle setting of category n. ** Parameters: id (default 0) - The category to get. If no category supplied ** uses 0 */ function get_autotoggle($id = 0) { return 0; } // Use wp_list_cats(). function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) { $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); return wp_list_cats($query); } function wp_list_cats($args = '') { $r = wp_parse_args( $args ); // Map to new names. if ( isset($r['optionall']) && isset($r['all'])) $r['show_option_all'] = $r['all']; if ( isset($r['sort_column']) ) $r['orderby'] = $r['sort_column']; if ( isset($r['sort_order']) ) $r['order'] = $r['sort_order']; if ( isset($r['optiondates']) ) $r['show_last_update'] = $r['optiondates']; if ( isset($r['optioncount']) ) $r['show_count'] = $r['optioncount']; if ( isset($r['list']) ) $r['style'] = $r['list'] ? 'list' : 'break'; $r['title_li'] = ''; return wp_list_categories($r); } function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = FALSE, $selected = 0, $exclude = 0) { $show_option_all = ''; if ( $optionall ) $show_option_all = $all; $show_option_none = ''; if ( $optionnone ) $show_option_none = __('None'); $vars = compact('show_option_all', 'show_option_none', 'orderby', 'order', 'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude'); $query = add_query_arg($vars, ''); return wp_dropdown_categories($query); } // Use wp_print_scripts() or WP_Scripts. function tinymce_include() { wp_print_script('wp_tiny_mce'); } function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); } function wp_get_post_cats($blogid = '1', $post_ID = 0) { return wp_get_post_categories($post_ID); } function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { return wp_set_post_categories($post_ID, $post_categories); } // Use wp_get_archives(). function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); return wp_get_archives($args); } // Use get_author_posts_url(). function get_author_link($echo = false, $author_id, $author_nicename = '') { $link = get_author_posts_url($author_id, $author_nicename); if ( $echo ) echo $link; return $link; } // Use wp_link_pages(). function link_pages($before='
    ', $after='
    ', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); return wp_link_pages($args); } // Use get_option(). function get_settings($option) { return get_option($option); } // Use the_permalink(). function permalink_link() { the_permalink(); } // Use the_permalink_rss() function permalink_single_rss($file = '') { the_permalink_rss(); } /** function wp_get_links() ** Gets the links associated with category n. ** Parameters: ** category (no default) - The category to use. ** or: ** a query string **/ function wp_get_links($args = '') { global $wpdb; if ( strpos( $args, '=' ) === false ) { $cat_id = $args; $args = add_query_arg( 'category', $cat_id, $args ); } $defaults = array( 'category' => -1, 'before' => '', 'after' => '
    ', 'between' => ' ', 'show_images' => true, 'orderby' => 'name', 'show_description' => true, 'show_rating' => false, 'limit' => -1, 'show_updated' => true, 'echo' => true ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); } // end wp_get_links /** function get_links() ** Gets the links associated with category n. ** Parameters: ** category (default -1) - The category to use. If no category supplied ** uses all ** before (default '') - the html to output before the link ** after (default '
    ') - the html to output after the link ** between (default ' ') - the html to output between the link/image ** and its description. Not used if no image or show_images == true ** show_images (default true) - whether to show images (if defined). ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', ** 'url', 'description', or 'rating'. Or maybe owner. If you start the ** name with an underscore the order will be reversed. ** You can also specify 'rand' as the order which will return links in a ** random order. ** show_description (default true) - whether to show the description if ** show_images=false/not defined . ** show_rating (default false) - show rating stars/chars ** limit (default -1) - Limit to X entries. If not specified, all entries ** are shown. ** show_updated (default 0) - whether to show last updated timestamp ** echo (default true) - whether to echo the results, or return them instead */ function get_links($category = -1, $before = '', $after = '
    ', $between = ' ', $show_images = true, $orderby = 'name', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { global $wpdb; $order = 'ASC'; if ( substr($orderby, 0, 1) == '_' ) { $order = 'DESC'; $orderby = substr($orderby, 1); } if ( $category == -1 ) //get_bookmarks uses '' to signify all categories $category = ''; $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); if ( !$results ) return; $output = ''; foreach ( (array) $results as $row ) { if ( !isset($row->recently_updated) ) $row->recently_updated = false; $output .= $before; if ( $show_updated && $row->recently_updated ) $output .= get_option('links_recently_updated_prepend'); $the_link = '#'; if ( !empty($row->link_url) ) $the_link = clean_url($row->link_url); $rel = $row->link_rel; if ( '' != $rel ) $rel = ' rel="' . $rel . '"'; $desc = attribute_escape(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display')); $name = attribute_escape(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display')); $title = $desc; if ( $show_updated ) if (substr($row->link_updated_f, 0, 2) != '00') $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')'; if ( '' != $title ) $title = ' title="' . $title . '"'; $alt = ' alt="' . $name . '"'; $target = $row->link_target; if ( '' != $target ) $target = ' target="' . $target . '"'; $output .= ''; if ( $row->link_image != null && $show_images ) { if ( strpos($row->link_image, 'http') !== false ) $output .= "link_image\" $alt $title />"; else // If it's a relative path $output .= "link_image\" $alt $title />"; } else { $output .= $name; } $output .= ''; if ( $show_updated && $row->recently_updated ) $output .= get_option('links_recently_updated_append'); if ( $show_description && '' != $desc ) $output .= $between . $desc; if ($show_rating) { $output .= $between . get_linkrating($row); } $output .= "$after\n"; } // end while if ( !$echo ) return $output; echo $output; } /* * function get_links_list() * * added by Dougal * * Output a list of all links, listed by category, using the * settings in $wpdb->linkcategories and output it as a nested * HTML unordered list. * * Parameters: * order (default 'name') - Sort link categories by 'name' or 'id' * hide_if_empty (default true) - Supress listing empty link categories */ function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { $order = strtolower($order); // Handle link category sorting $direction = 'ASC'; if ( '_' == substr($order,0,1) ) { $direction = 'DESC'; $order = substr($order,1); } if ( !isset($direction) ) $direction = ''; $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); // Display each category if ( $cats ) { foreach ( (array) $cats as $cat ) { // Handle each category. // Display the category name echo '
  • ' . apply_filters('link_category', $cat->name ) . "

    \n\t
      \n"; // Call get_links() with all the appropriate params get_links($cat->term_id, '
    • ', "
    • ", "\n", true, 'name', false); // Close the last category echo "\n\t
    \n
  • \n"; } } } /** function links_popup_script() ** This function contributed by Fullo -- http://sprite.csr.unibo.it/fullo/ ** Show the link to the links popup and the number of links ** Parameters: ** text (default Links) - the text of the link ** width (default 400) - the width of the popup window ** height (default 400) - the height of the popup window ** file (default linkspopup.php) - the page to open in the popup window ** count (default true) - the number of links in the db */ function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { if ( $count ) $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); $javascript = ""; $javascript .= $text; if ( $count ) $javascript .= " ($counts)"; $javascript .= "\n\n"; echo $javascript; } function get_linkrating($link) { return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); } /** function get_linkcatname() ** Gets the name of category n. ** Parameters: id (default 0) - The category to get. If no category supplied ** uses 0 */ function get_linkcatname($id = 0) { $id = (int) $id; if ( empty($id) ) return ''; $cats = wp_get_link_cats($id); if ( empty($cats) || ! is_array($cats) ) return ''; $cat_id = (int) $cats[0]; // Take the first cat. $cat = get_category($cat_id); return $cat->name; } ?>wp-includes/feed-atom-comments.php0000644013707600007620000000524610667076612015231 0ustar www'; ?> > <?php if ( is_singular() ) printf(__('Comments on: %s'), get_the_title_rss()); elseif ( is_search() ) printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); else printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> WordPress comment_post_ID); get_post_custom($comment_post->ID); ?> <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { printf(__('By: %s'), get_comment_author_rss()); } ?> ' . get_comment_author_url() . ''; ?> post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> ]]> ]]> comment_ID, $comment_post->ID); ?> wp-includes/feed-atom.php0000644013707600007620000000403010671773440013372 0ustar www '; ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> WordPress <![CDATA[<?php the_title_rss() ?>]]> ]]> ]]> wp-includes/feed-rdf.php0000644013707600007620000000406710662611202013202 0ustar www '; ?> > "> <?php bloginfo_rss('name'); wp_title_rss(); ?> hourly 1 2000-01-01T12:00+00:00 <?php the_title_rss() ?> post_date_gmt, false); ?> ]]> wp-includes/feed-rss.php0000644013707600007620000000223710662611202013233 0ustar www '; ?> <?php bloginfo_rss('name'); wp_title_rss(); ?> http://backend.userland.com/rss092 <?php the_title_rss() ?> ]]> wp-includes/feed-rss2-comments.php0000644013707600007620000000450010667076612015152 0ustar www'; ?> <?php if ( is_singular() ) printf(__('Comments on: %s'), get_the_title_rss()); elseif ( is_search() ) printf(__('Comments for %s searching on %s'), get_bloginfo_rss( 'name' ), attribute_escape($wp_query->query_vars['s'])); else printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> http://wordpress.org/?v= comment_post_ID); get_post_custom($comment_post->ID); ?> <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); $title = apply_filters('the_title_rss', $title); printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); } else { printf(__('By: %s'), get_comment_author_rss()); } ?> post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?> ]]> ]]> comment_ID, $comment_post->ID); ?> wp-includes/feed-rss2.php0000644013707600007620000000367610662611202013325 0ustar www '; ?> > <?php bloginfo_rss('name'); wp_title_rss(); ?> http://wordpress.org/?v= <?php the_title_rss() ?> ]]> ]]> post_content ) > 0 ) : ?> ]]> ]]> wp-includes/feed.php0000644013707600007620000001460710673760566012456 0ustar wwwget_error_message(); $title = apply_filters('get_wp_title_rss', $title); return $title; } function wp_title_rss($sep = '»') { echo apply_filters('wp_title_rss', get_wp_title_rss($sep)); } function get_the_title_rss() { $title = get_the_title(); $title = apply_filters('the_title_rss', $title); return $title; } function the_title_rss() { echo get_the_title_rss(); } function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content_rss', $content); if ( $cut && !$encode_html ) $encode_html = 2; if ( 1== $encode_html ) { $content = wp_specialchars($content); $cut = 0; } elseif ( 0 == $encode_html ) { $content = make_url_footnote($content); } elseif ( 2 == $encode_html ) { $content = strip_tags($content); } if ( $cut ) { $blah = explode(' ', $content); if ( count($blah) > $cut ) { $k = $cut; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } for ( $i=0; $i<$k; $i++ ) $excerpt .= $blah[$i].' '; $excerpt .= ($use_dotdotdot) ? '...' : ''; $content = $excerpt; } $content = str_replace(']]>', ']]>', $content); echo $content; } function the_excerpt_rss() { $output = get_the_excerpt(); echo apply_filters('the_excerpt_rss', $output); } function the_permalink_rss() { echo apply_filters('the_permalink_rss', get_permalink()); } function comment_link() { echo get_comment_link(); } function get_comment_author_rss() { return apply_filters('comment_author_rss', get_comment_author() ); } function comment_author_rss() { echo get_comment_author_rss(); } function comment_text_rss() { $comment_text = get_comment_text(); $comment_text = apply_filters('comment_text_rss', $comment_text); echo $comment_text; } function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = 'nolongerused') { $url = get_post_comments_feed_link(); echo "$link_text"; } function comments_rss($commentsrssfilename = 'nolongerused') { return get_post_comments_feed_link(); } function get_author_rss_link($echo = false, $author_id, $author_nicename) { $auth_ID = (int) $author_id; $permalink_structure = get_option('permalink_structure'); if ( '' == $permalink_structure ) { $link = get_option('home') . '?feed=rss2&author=' . $author_id; } else { $link = get_author_posts_url($author_id, $author_nicename); $link = trailingslashit($link) . user_trailingslashit('feed', 'feed'); } $link = apply_filters('author_feed_link', $link); if ( $echo ) echo $link; return $link; } function get_category_rss_link($echo = false, $cat_ID, $category_nicename) { $permalink_structure = get_option('permalink_structure'); if ( '' == $permalink_structure ) { $link = get_option('home') . '?feed=rss2&cat=' . $cat_ID; } else { $link = get_category_link($cat_ID); $link = trailingslashit($link) . user_trailingslashit('feed', 'feed'); } $link = apply_filters('category_feed_link', $link); if ( $echo ) echo $link; return $link; } function get_the_category_rss($type = 'rss') { $categories = get_the_category(); $tags = get_the_tags(); $home = get_bloginfo_rss('home'); $the_list = ''; $cat_names = array(); $filter = 'rss'; if ( 'atom' == $type ) $filter = 'raw'; if ( !empty($categories) ) foreach ( (array) $categories as $category ) { $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); } if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { $cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); } $cat_names = array_unique($cat_names); foreach ( $cat_names as $cat_name ) { if ( 'rdf' == $type ) $the_list .= "\n\t\t\n"; elseif ( 'atom' == $type ) $the_list .= sprintf( '', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $cat_name ) ); else $the_list .= "\n\t\t\n"; } return apply_filters('the_category_rss', $the_list, $type); } function the_category_rss($type = 'rss') { echo get_the_category_rss($type); } function get_tag_feed_link($tag_id, $feed = 'rss2') { $tag_id = (int) $tag_id; $tag = get_tag($tag_id); if ( empty($tag) || is_wp_error($tag) ) return false; $permalink_structure = get_option('permalink_structure'); if ( '' == $permalink_structure ) { $link = get_option('home') . "?feed=$feed&tag=" . $tag->slug; } else { $link = get_tag_link($tag->term_id); if ( 'rss2' == $feed ) $feed_link = 'feed'; else $feed_link = "feed/$feed"; $link = $link . user_trailingslashit($feed_link, 'feed'); } $link = apply_filters('tag_feed_link', $link, $feed); return $link; } function html_type_rss() { $type = get_bloginfo('html_type'); if (strpos($type, 'xhtml') !== false) $type = 'xhtml'; else $type = 'html'; echo $type; } function rss_enclosure() { global $id, $post; if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) return; foreach (get_post_custom() as $key => $val) { if ($key == 'enclosure') { foreach ((array)$val as $enc) { $enclosure = split("\n", $enc); echo apply_filters('rss_enclosure', '' . "\n"); } } } } function atom_enclosure() { global $id, $post; if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) return; foreach (get_post_custom() as $key => $val) { if ($key == 'enclosure') { foreach ((array)$val as $enc) { $enclosure = split("\n", $enc); echo apply_filters('atom_enclosure', '' . "\n"); } } } } ?> wp-includes/formatting.php0000644013707600007620000011675610675000414013712 0ustar www)/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); // if a plugin has provided an autocorrect array, use it if ( isset($wp_cockneyreplace) ) { $cockney = array_keys($wp_cockneyreplace); $cockneyreplace = array_values($wp_cockneyreplace); } else { $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); } $static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); $static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace); $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag // static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); } elseif (strpos($curl, '"; else $text = $matches; $text = str_replace('
    ', '', $text); $text = str_replace('

    ', "\n", $text); $text = str_replace('

    ', '', $text); return $text; } function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|
    \s*
    |', "\n\n", $pee); // Space things out a little $allblocks = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!()!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

    $1

    \n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|

    \s*?

    |', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!

    ([^<]+)\s*?(]*>)!', "

    $1

    $2", $pee); $pee = preg_replace( '|

    |', "$1

    ", $pee ); $pee = preg_replace('!

    \s*(]*>)\s*

    !', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|

    (|", "$1", $pee); // problem with nested lists $pee = preg_replace('|

    ]*)>|i', "

    ", $pee); $pee = str_replace('

    ', '

    ', $pee); $pee = preg_replace('!

    \s*(]*>)!', "$1", $pee); $pee = preg_replace('!(]*>)\s*

    !', "$1", $pee); if ($br) { $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "", "\\0")', $pee); $pee = preg_replace('|(?)\s*\n|', "
    \n", $pee); // optionally make line breaks $pee = str_replace('', "\n", $pee); } $pee = preg_replace('!(]*>)\s*
    !', "$1", $pee); $pee = preg_replace('!
    (\s*]*>)!', '$1', $pee); if (strpos($pee, ')(.*?)!is', 'clean_pre', $pee ); $pee = preg_replace( "|\n

    $|", '

    ', $pee ); return $pee; } function seems_utf8($Str) { # by bmorel at ssi dot fr for ($i=0; $i', '>', $text); if ( 'double' === $quotes ) { $text = str_replace('"', '"', $text); } elseif ( 'single' === $quotes ) { $text = str_replace("'", ''', $text); } elseif ( $quotes ) { $text = str_replace('"', '"', $text); $text = str_replace("'", ''', $text); } return $text; } function utf8_uri_encode( $utf8_string, $length = 0 ) { $unicode = ''; $values = array(); $num_octets = 1; for ($i = 0; $i < strlen( $utf8_string ); $i++ ) { $value = ord( $utf8_string[ $i ] ); if ( $value < 128 ) { if ( $length && ( strlen($unicode) + 1 > $length ) ) break; $unicode .= chr($value); } else { if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3; $values[] = $value; if ( $length && ( (strlen($unicode) + ($num_octets * 3)) > $length ) ) break; if ( count( $values ) == $num_octets ) { if ($num_octets == 3) { $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]); } else { $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]); } $values = array(); $num_octets = 1; } } } return $unicode; } function remove_accents($string) { if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; if (seems_utf8($string)) { $chars = array( // Decompositions for Latin-1 Supplement chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', chr(195).chr(159) => 's', chr(195).chr(160) => 'a', chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', chr(195).chr(191) => 'y', // Decompositions for Latin Extended-A chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', chr(197).chr(154) => 'S',chr(197).chr(155) => 's', chr(197).chr(156) => 'S',chr(197).chr(157) => 's', chr(197).chr(158) => 'S',chr(197).chr(159) => 's', chr(197).chr(160) => 'S', chr(197).chr(161) => 's', chr(197).chr(162) => 'T', chr(197).chr(163) => 't', chr(197).chr(164) => 'T', chr(197).chr(165) => 't', chr(197).chr(166) => 'T', chr(197).chr(167) => 't', chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', chr(197).chr(190) => 'z', chr(197).chr(191) => 's', // Euro Sign chr(226).chr(130).chr(172) => 'E', // GBP (Pound) Sign chr(194).chr(163) => ''); $string = strtr($string, $chars); } else { // Assume ISO-8859-1 if not UTF-8 $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194) .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202) .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210) .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218) .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227) .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235) .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243) .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251) .chr(252).chr(253).chr(255); $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy"; $string = strtr($string, $chars['in'], $chars['out']); $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); $string = str_replace($double_chars['in'], $double_chars['out'], $string); } return $string; } function sanitize_file_name( $name ) { // Like sanitize_title, but with periods $name = strtolower( $name ); $name = preg_replace('/&.+?;/', '', $name); // kill entities $name = str_replace( '_', '-', $name ); $name = preg_replace('/[^a-z0-9\s-.]/', '', $name); $name = preg_replace('/\s+/', '-', $name); $name = preg_replace('|-+|', '-', $name); $name = trim($name, '-'); return $name; } function sanitize_user( $username, $strict = false ) { $raw_username = $username; $username = strip_tags($username); // Kill octets $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username); $username = preg_replace('/&.+?;/', '', $username); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); return apply_filters('sanitize_user', $username, $raw_username, $strict); } function sanitize_title($title, $fallback_title = '') { $title = strip_tags($title); $title = apply_filters('sanitize_title', $title); if (empty($title)) { $title = $fallback_title; } return $title; } function sanitize_title_with_dashes($title) { $title = strip_tags($title); // Preserve escaped octets. $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title); // Remove percent signs that are not part of an octet. $title = str_replace('%', '', $title); // Restore octets. $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title); $title = remove_accents($title); if (seems_utf8($title)) { if (function_exists('mb_strtolower')) { $title = mb_strtolower($title, 'UTF-8'); } $title = utf8_uri_encode($title, 200); } $title = strtolower($title); $title = preg_replace('/&.+?;/', '', $title); // kill entities $title = preg_replace('/[^%a-z0-9 _-]/', '', $title); $title = preg_replace('/\s+/', '-', $title); $title = preg_replace('|-+|', '-', $title); $title = trim($title, '-'); return $title; } function convert_chars($content, $flag = 'obsolete') { // Translation of invalid Unicode references range to valid range $wp_htmltranswinuni = array( '€' => '€', // the Euro sign '' => '', '‚' => '‚', // these are Windows CP1252 specific characters 'ƒ' => 'ƒ', // they would look weird on non-Windows browsers '„' => '„', '…' => '…', '†' => '†', '‡' => '‡', 'ˆ' => 'ˆ', '‰' => '‰', 'Š' => 'Š', '‹' => '‹', 'Œ' => 'Œ', '' => '', 'Ž' => 'ž', '' => '', '' => '', '‘' => '‘', '’' => '’', '“' => '“', '”' => '”', '•' => '•', '–' => '–', '—' => '—', '˜' => '˜', '™' => '™', 'š' => 'š', '›' => '›', 'œ' => 'œ', '' => '', 'ž' => '', 'Ÿ' => 'Ÿ' ); // Remove metadata tags $content = preg_replace('/(.+?)<\/title>/','',$content); $content = preg_replace('/<category>(.+?)<\/category>/','',$content); // Converts lone & characters into & (a.k.a. &) $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content); // Fix Word pasting $content = strtr($content, $wp_htmltranswinuni); // Just a little XHTML help $content = str_replace('<br>', '<br />', $content); $content = str_replace('<hr>', '<hr />', $content); return $content; } function funky_javascript_fix($text) { // Fixes for browsers' javascript bugs global $is_macIE, $is_winIE; if ( $is_winIE || $is_macIE ) $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); return $text; } function balanceTags( $text, $force = false ) { if ( !$force && get_option('use_balanceTags') == 0 ) return $text; return force_balance_tags( $text ); } /* force_balance_tags Balances Tags of string using a modified stack. @param text Text to be balanced @param force Forces balancing, ignoring the value of the option @return Returns balanced text @author Leonard Lin (leonard@acm.org) @version v1.1 @date November 4, 2001 @license GPL v2.0 @notes @changelog --- Modified by Scott Reilly (coffee2code) 02 Aug 2004 1.2 ***TODO*** Make better - change loop condition to $text 1.1 Fixed handling of append/stack pop order of end text Added Cleaning Hooks 1.0 First Version */ function force_balance_tags( $text ) { $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves # WP bug fix for comments - in case you REALLY meant to type '< !--' $text = str_replace('< !--', '< !--', $text); # WP bug fix for LOVE <3 (and other situations with '<' before a number) $text = preg_replace('#<([0-9]{1})#', '<$1', $text); while (preg_match("/<(\/?\w*)\s*([^>]*)>/",$text,$regex)) { $newtext .= $tagqueue; $i = strpos($text,$regex[0]); $l = strlen($regex[0]); // clear the shifter $tagqueue = ''; // Pop or Push if ($regex[1][0] == "/") { // End Tag $tag = strtolower(substr($regex[1],1)); // if too many closing tags if($stacksize <= 0) { $tag = ''; //or close to be safe $tag = '/' . $tag; } // if stacktop value = tag close value then pop else if ($tagstack[$stacksize - 1] == $tag) { // found closing tag $tag = '</' . $tag . '>'; // Close Tag // Pop array_pop ($tagstack); $stacksize--; } else { // closing tag not at top, search for it for ($j=$stacksize-1;$j>=0;$j--) { if ($tagstack[$j] == $tag) { // add tag to tagqueue for ($k=$stacksize-1;$k>=$j;$k--){ $tagqueue .= '</' . array_pop ($tagstack) . '>'; $stacksize--; } break; } } $tag = ''; } } else { // Begin Tag $tag = strtolower($regex[1]); // Tag Cleaning // If self-closing or '', don't do anything. if((substr($regex[2],-1) == '/') || ($tag == '')) { } // ElseIf it's a known single-entity tag but it doesn't close itself, do so elseif ( in_array($tag, $single_tags) ) { $regex[2] .= '/'; } else { // Push the tag onto the stack // If the top of the stack is the same as the tag we want to push, close previous tag if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) { $tagqueue = '</' . array_pop ($tagstack) . '>'; $stacksize--; } $stacksize = array_push ($tagstack, $tag); } // Attributes $attributes = $regex[2]; if($attributes) { $attributes = ' '.$attributes; } $tag = '<'.$tag.$attributes.'>'; //If already queuing a close tag, then put this tag on, too if ($tagqueue) { $tagqueue .= $tag; $tag = ''; } } $newtext .= substr($text,0,$i) . $tag; $text = substr($text,$i+$l); } // Clear Tag Queue $newtext .= $tagqueue; // Add Remaining text $newtext .= $text; // Empty Stack while($x = array_pop($tagstack)) { $newtext .= '</' . $x . '>'; // Add remaining tags to close } // WP fix for the bug with HTML comments $newtext = str_replace("< !--","<!--",$newtext); $newtext = str_replace("< !--","< !--",$newtext); return $newtext; } function format_to_edit($content, $richedit = false) { $content = apply_filters('format_to_edit', $content); if (! $richedit ) $content = htmlspecialchars($content); return $content; } function format_to_post($content) { global $wpdb; $content = apply_filters('format_to_post', $content); return $content; } function zeroise($number,$threshold) { // function to add leading zeros when necessary return sprintf('%0'.$threshold.'s', $number); } function backslashit($string) { $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string); $string = preg_replace('/([a-z])/i', '\\\\\1', $string); return $string; } function trailingslashit($string) { return untrailingslashit($string) . '/'; } function untrailingslashit($string) { return rtrim($string, '/'); } function addslashes_gpc($gpc) { global $wpdb; if (get_magic_quotes_gpc()) { $gpc = stripslashes($gpc); } return $wpdb->escape($gpc); } function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } function urlencode_deep($value) { $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value); return $value; } function antispambot($emailaddy, $mailto=0) { $emailNOSPAMaddy = ''; srand ((float) microtime() * 1000000); for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) { $j = floor(rand(0, 1+$mailto)); if ($j==0) { $emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';'; } elseif ($j==1) { $emailNOSPAMaddy .= substr($emailaddy,$i,1); } elseif ($j==2) { $emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2); } } $emailNOSPAMaddy = str_replace('@','@',$emailNOSPAMaddy); return $emailNOSPAMaddy; } function make_clickable($ret) { $ret = ' ' . $ret; // in testing, using arrays here was found to be faster $ret = preg_replace( array( '#([\s>])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '#([\s>])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '#([\s>])([a-z0-9\-_.]+)@([^,< \n\r]+)#i'), array( '$1<a href="$2" rel="nofollow">$2</a>', '$1<a href="http://$2" rel="nofollow">$2</a>', '$1<a href="mailto:$2@$3">$2@$3</a>'),$ret); // this one is not in an array because we need it to run last, for cleanup of accidental links within links $ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); $ret = trim($ret); return $ret; } function wp_rel_nofollow( $text ) { global $wpdb; // This is a pre save filter, so text is already escaped. $text = stripslashes($text); $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); $text = $wpdb->escape($text); return $text; } function wp_rel_nofollow_callback( $matches ) { $text = $matches[1]; $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); return "<a $text rel=\"nofollow\">"; } function convert_smilies($text) { global $wp_smiliessearch, $wp_smiliesreplace; $output = ''; if (get_option('use_smilies')) { // HTML loop taken from texturize function, could possible be consolidated $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between $stop = count($textarr);// loop stuff for ($i = 0; $i < $stop; $i++) { $content = $textarr[$i]; if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content); } $output .= $content; } } else { // return default text. $output = $text; } return $output; } function is_email($user_email) { $chars = "/^([a-z0-9+_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,6}\$/i"; if (strpos($user_email, '@') !== false && strpos($user_email, '.') !== false) { if (preg_match($chars, $user_email)) { return true; } else { return false; } } else { return false; } } // used by wp-mail to handle charsets in email subjects function wp_iso_descrambler($string) { /* this may only work with iso-8859-1, I'm afraid */ if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) { return $string; } else { $subject = str_replace('_', ' ', $matches[2]); $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); return $subject; } } // give it a date, it will give you the same date as GMT function get_gmt_from_date($string) { // note: this only substracts $time_difference from the given date preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_option('gmt_offset') * 3600); return $string_gmt; } // give it a GMT date, it will give you the same date with $time_difference added function get_date_from_gmt($string) { // note: this only adds $time_difference to the given date preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_option('gmt_offset')*3600); return $string_localtime; } // computes an offset in seconds from an iso8601 timezone function iso8601_timezone_to_offset($timezone) { // $timezone is either 'Z' or '[+|-]hhmm' if ($timezone == 'Z') { $offset = 0; } else { $sign = (substr($timezone, 0, 1) == '+') ? 1 : -1; $hours = intval(substr($timezone, 1, 2)); $minutes = intval(substr($timezone, 3, 4)) / 60; $offset = $sign * 3600 * ($hours + $minutes); } return $offset; } // converts an iso8601 date to MySQL DateTime format used by post_date[_gmt] function iso8601_to_datetime($date_string, $timezone = USER) { if ($timezone == GMT) { preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits); if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset $offset = iso8601_timezone_to_offset($date_bits[7]); } else { // we don't have a timezone, so we assume user local timezone (not server's!) $offset = 3600 * get_option('gmt_offset'); } $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); $timestamp -= $offset; return gmdate('Y-m-d H:i:s', $timestamp); } elseif ($timezone == USER) { return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string); } } function popuplinks($text) { // Comment text in popup windows should be filtered through this. // Right now it's a moderately dumb function, ideally it would detect whether // a target or rel attribute was already there and adjust its actions accordingly. $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); return $text; } function sanitize_email($email) { return preg_replace('/[^a-z0-9+_.@-]/i', '', $email); } function human_time_diff( $from, $to = '' ) { if ( empty($to) ) $to = time(); $diff = (int) abs($to - $from); if ($diff <= 3600) { $mins = round($diff / 60); if ($mins <= 1) { $mins = 1; } $since = sprintf(__ngettext('%s min', '%s mins', $mins), $mins); } else if (($diff <= 86400) && ($diff > 3600)) { $hours = round($diff / 3600); if ($hours <= 1) { $hour = 1; } $since = sprintf(__ngettext('%s hour', '%s hours', $hours), $hours); } elseif ($diff >= 86400) { $days = round($diff / 86400); if ($days <= 1) { $days = 1; } $since = sprintf(__ngettext('%s day', '%s days', $days), $days); } return $since; } function wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); $excerpt_length = 55; $words = explode(' ', $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop($words); array_push($words, '[...]'); $text = implode(' ', $words); } } return $text; } function ent2ncr($text) { $to_ncr = array( '"' => '"', '&' => '&', '⁄' => '/', '<' => '<', '>' => '>', '|' => '|', ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '¦' => '¦', '&brkbar;' => '¦', '§' => '§', '¨' => '¨', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '&hibar;' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶', '·' => '·', '¸' => '¸', '¹' => '¹', 'º' => 'º', '»' => '»', '¼' => '¼', '½' => '½', '¾' => '¾', '¿' => '¿', 'À' => 'À', 'Á' => 'Á', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Å' => 'Å', 'Æ' => 'Æ', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê', 'Ë' => 'Ë', 'Ì' => 'Ì', 'Í' => 'Í', 'Î' => 'Î', 'Ï' => 'Ï', 'Ð' => 'Ð', 'Ñ' => 'Ñ', 'Ò' => 'Ò', 'Ó' => 'Ó', 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö', '×' => '×', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'Ý' => 'Ý', 'Þ' => 'Þ', 'ß' => 'ß', 'à' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'å' => 'å', 'æ' => 'æ', 'ç' => 'ç', 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'í' => 'í', 'î' => 'î', 'ï' => 'ï', 'ð' => 'ð', 'ñ' => 'ñ', 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ö' => 'ö', '÷' => '÷', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û', 'ü' => 'ü', 'ý' => 'ý', 'þ' => 'þ', 'ÿ' => 'ÿ', 'Œ' => 'Œ', 'œ' => 'œ', 'Š' => 'Š', 'š' => 'š', 'Ÿ' => 'Ÿ', 'ƒ' => 'ƒ', 'ˆ' => 'ˆ', '˜' => '˜', 'Α' => 'Α', 'Β' => 'Β', 'Γ' => 'Γ', 'Δ' => 'Δ', 'Ε' => 'Ε', 'Ζ' => 'Ζ', 'Η' => 'Η', 'Θ' => 'Θ', 'Ι' => 'Ι', 'Κ' => 'Κ', 'Λ' => 'Λ', 'Μ' => 'Μ', 'Ν' => 'Ν', 'Ξ' => 'Ξ', 'Ο' => 'Ο', 'Π' => 'Π', 'Ρ' => 'Ρ', 'Σ' => 'Σ', 'Τ' => 'Τ', 'Υ' => 'Υ', 'Φ' => 'Φ', 'Χ' => 'Χ', 'Ψ' => 'Ψ', 'Ω' => 'Ω', 'α' => 'α', 'β' => 'β', 'γ' => 'γ', 'δ' => 'δ', 'ε' => 'ε', 'ζ' => 'ζ', 'η' => 'η', 'θ' => 'θ', 'ι' => 'ι', 'κ' => 'κ', 'λ' => 'λ', 'μ' => 'μ', 'ν' => 'ν', 'ξ' => 'ξ', 'ο' => 'ο', 'π' => 'π', 'ρ' => 'ρ', 'ς' => 'ς', 'σ' => 'σ', 'τ' => 'τ', 'υ' => 'υ', 'φ' => 'φ', 'χ' => 'χ', 'ψ' => 'ψ', 'ω' => 'ω', 'ϑ' => 'ϑ', 'ϒ' => 'ϒ', 'ϖ' => 'ϖ', ' ' => ' ', ' ' => ' ', ' ' => ' ', '‌' => '‌', '‍' => '‍', '‎' => '‎', '‏' => '‏', '–' => '–', '—' => '—', '‘' => '‘', '’' => '’', '‚' => '‚', '“' => '“', '”' => '”', '„' => '„', '†' => '†', '‡' => '‡', '•' => '•', '…' => '…', '‰' => '‰', '′' => '′', '″' => '″', '‹' => '‹', '›' => '›', '‾' => '‾', '⁄' => '⁄', '€' => '€', 'ℑ' => 'ℑ', '℘' => '℘', 'ℜ' => 'ℜ', '™' => '™', 'ℵ' => 'ℵ', '↵' => '↵', '⇐' => '⇐', '⇑' => '⇑', '⇒' => '⇒', '⇓' => '⇓', '⇔' => '⇔', '∀' => '∀', '∂' => '∂', '∃' => '∃', '∅' => '∅', '∇' => '∇', '∈' => '∈', '∉' => '∉', '∋' => '∋', '∏' => '∏', '∑' => '∑', '−' => '−', '∗' => '∗', '√' => '√', '∝' => '∝', '∞' => '∞', '∠' => '∠', '∧' => '∧', '∨' => '∨', '∩' => '∩', '∪' => '∪', '∫' => '∫', '∴' => '∴', '∼' => '∼', '≅' => '≅', '≈' => '≈', '≠' => '≠', '≡' => '≡', '≤' => '≤', '≥' => '≥', '⊂' => '⊂', '⊃' => '⊃', '⊄' => '⊄', '⊆' => '⊆', '⊇' => '⊇', '⊕' => '⊕', '⊗' => '⊗', '⊥' => '⊥', '⋅' => '⋅', '⌈' => '⌈', '⌉' => '⌉', '⌊' => '⌊', '⌋' => '⌋', '⟨' => '〈', '⟩' => '〉', '←' => '←', '↑' => '↑', '→' => '→', '↓' => '↓', '↔' => '↔', '◊' => '◊', '♠' => '♠', '♣' => '♣', '♥' => '♥', '♦' => '♦' ); return str_replace( array_keys($to_ncr), array_values($to_ncr), $text ); } function wp_richedit_pre($text) { // Filtering a blank results in an annoying <br />\n if ( empty($text) ) return apply_filters('richedit_pre', ''); $output = $text; $output = convert_chars($output); $output = wpautop($output); // These must be double-escaped or planets will collide. $output = str_replace('<', '&lt;', $output); $output = str_replace('>', '&gt;', $output); return apply_filters('richedit_pre', $output); } function clean_url( $url, $protocols = null ) { $original_url = $url; if ('' == $url) return $url; $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@]|i', '', $url); $strip = array('%0d', '%0a'); $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); /* If the URL doesn't appear to contain a scheme, we * presume it needs http:// appended (unless a relative * link starting with / or a php file). */ if ( strpos($url, ':') === false && substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) ) $url = 'http://' . $url; $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); if ( !is_array($protocols) ) $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); if ( wp_kses_bad_protocol( $url, $protocols ) != $url ) return ''; return apply_filters('clean_url', $url, $original_url); } // Borrowed from the PHP Manual user notes. Convert entities, while // preserving already-encoded entities: function htmlentities2($myHTML) { $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES); $translation_table[chr(38)] = '&'; return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); } // Escape single quotes, specialchar double quotes, and fix line endings. function js_escape($text) { $safe_text = wp_specialchars($text, 'double'); $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text)); $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); return apply_filters('js_escape', $safe_text, $text); } // Escaping for HTML attributes function attribute_escape($text) { $safe_text = wp_specialchars($text, true); return apply_filters('attribute_escape', $safe_text, $text); } function wp_make_link_relative( $link ) { return preg_replace('|https?://[^/]+(/.*)|i', '$1', $link ); } function sanitize_option($option, $value) { // Remember to call stripslashes! switch ($option) { case 'admin_email': $value = sanitize_email($value); break; case 'default_post_edit_rows': case 'mailserver_port': case 'comment_max_links': case 'page_on_front': case 'rss_excerpt_length': case 'default_category': case 'default_email_category': case 'default_link_category': $value = abs((int) $value); break; case 'posts_per_page': case 'posts_per_rss': $value = (int) $value; if ( empty($value) ) $value = 1; if ( $value < -1 ) $value = abs($value); break; case 'default_ping_status': case 'default_comment_status': // 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': $value = addslashes($value); $value = wp_filter_post_kses( $value ); // calls stripslashes then addslashes $value = stripslashes($value); $value = wp_specialchars( $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 = addslashes($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 = apply_filters("sanitize_option_{$option}", $value, $option); break; } return $value; } function wp_parse_str( $string, &$array ) { parse_str( $string, $array ); if ( get_magic_quotes_gpc() ) $array = stripslashes_deep( $array ); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str $array = apply_filters( 'wp_parse_str', $array ); } // Convert lone less than signs. KSES already converts lone greater than signs. function wp_pre_kses_less_than( $text ) { return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text); } function wp_pre_kses_less_than_callback( $matches ) { if ( false === strpos($matches[0], '>') ) return wp_specialchars($matches[0]); return $matches[0]; } ?> ������������������wp-includes/functions.php���������������������������������������������������������������������������0000644�0137076�0000762�00000126764�10675113004�013550� 0����������������������������������������������������������������������������������������������������ustar ���������������������������������www��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php function mysql2date($dateformatstring, $mysqlstring, $translate = true) { global $wp_locale; $m = $mysqlstring; if ( empty($m) ) { return false; } $i = mktime( (int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ), (int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 ) ); if( 'U' == $dateformatstring ) return $i; if ( -1 == $i || false == $i ) $i = 0; if ( !empty($wp_locale->month) && !empty($wp_locale->weekday) && $translate ) { $datemonth = $wp_locale->get_month(date('m', $i)); $datemonth_abbrev = $wp_locale->get_month_abbrev($datemonth); $dateweekday = $wp_locale->get_weekday(date('w', $i)); $dateweekday_abbrev = $wp_locale->get_weekday_abbrev($dateweekday); $datemeridiem = $wp_locale->get_meridiem(date('a', $i)); $datemeridiem_capital = $wp_locale->get_meridiem(date('A', $i)); $dateformatstring = ' '.$dateformatstring; $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])F/", "\\1".backslashit($datemonth), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])l/", "\\1".backslashit($dateweekday), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit($datemonth_abbrev), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])a/", "\\1".backslashit($datemeridiem), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])A/", "\\1".backslashit($datemeridiem_capital), $dateformatstring); $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1); } $j = @date($dateformatstring, $i); if ( !$j ) { // for debug purposes // echo $i." ".$mysqlstring; } return $j; } function current_time($type, $gmt = 0) { switch ($type) { case 'mysql': if ( $gmt ) $d = gmdate('Y-m-d H:i:s'); else $d = gmdate('Y-m-d H:i:s', (time() + (get_option('gmt_offset') * 3600))); return $d; break; case 'timestamp': if ( $gmt ) $d = time(); else $d = time() + (get_option('gmt_offset') * 3600); return $d; break; } } function date_i18n($dateformatstring, $unixtimestamp) { global $wp_locale; $i = $unixtimestamp; if ( (!empty($wp_locale->month)) && (!empty($wp_locale->weekday)) ) { $datemonth = $wp_locale->get_month(date('m', $i)); $datemonth_abbrev = $wp_locale->get_month_abbrev($datemonth); $dateweekday = $wp_locale->get_weekday(date('w', $i)); $dateweekday_abbrev = $wp_locale->get_weekday_abbrev($dateweekday); $datemeridiem = $wp_locale->get_meridiem(date('a', $i)); $datemeridiem_capital = $wp_locale->get_meridiem(date('A', $i)); $dateformatstring = ' '.$dateformatstring; $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])F/", "\\1".backslashit($datemonth), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])l/", "\\1".backslashit($dateweekday), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit($datemonth_abbrev), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])a/", "\\1".backslashit($datemeridiem), $dateformatstring); $dateformatstring = preg_replace("/([^\\\])A/", "\\1".backslashit($datemeridiem_capital), $dateformatstring); $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1); } $j = @date($dateformatstring, $i); return $j; } function number_format_i18n($number, $decimals = null) { global $wp_locale; // let the user override the precision only $decimals = is_null($decimals)? $wp_locale->number_format['decimals'] : intval($decimals); return number_format($number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep']); } function size_format($bytes, $decimals = null) { // technically the correct unit names for powers of 1024 are KiB, MiB etc // see http://en.wikipedia.org/wiki/Byte $quant = array( 'TB' => pow(1024, 4), 'GB' => pow(1024, 3), 'MB' => pow(1024, 2), 'kB' => pow(1024, 1), 'B' => pow(1024, 0), ); foreach ($quant as $unit => $mag) if ( intval($bytes) >= $mag ) return number_format_i18n($bytes / $mag, $decimals) . ' ' . $unit; } function get_weekstartend($mysqlstring, $start_of_week) { $my = substr($mysqlstring,0,4); $mm = substr($mysqlstring,8,2); $md = substr($mysqlstring,5,2); $day = mktime(0,0,0, $md, $mm, $my); $weekday = date('w',$day); $i = 86400; if ( $weekday < get_option('start_of_week') ) $weekday = 7 - (get_option('start_of_week') - $weekday); while ($weekday > get_option('start_of_week')) { $weekday = date('w',$day); if ( $weekday < get_option('start_of_week') ) $weekday = 7 - (get_option('start_of_week') - $weekday); $day = $day - 86400; $i = 0; } $week['start'] = $day + 86400 - $i; // $week['end'] = $day - $i + 691199; $week['end'] = $week['start'] + 604799; return $week; } function maybe_unserialize($original) { if ( is_serialized($original) ) // don't attempt to unserialize data that wasn't serialized going in if ( false !== $gm = @ unserialize($original) ) return $gm; return $original; } function is_serialized($data) { // if it isn't a string, it isn't serialized if ( !is_string($data) ) return false; $data = trim($data); if ( 'N;' == $data ) return true; if ( !preg_match('/^([adObis]):/', $data, $badions) ) return false; switch ( $badions[1] ) : case 'a' : case 'O' : case 's' : if ( preg_match("/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data) ) return true; break; case 'b' : case 'i' : case 'd' : if ( preg_match("/^{$badions[1]}:[0-9.E-]+;\$/", $data) ) return true; break; endswitch; return false; } function is_serialized_string($data) { // if it isn't a string, it isn't a serialized string if ( !is_string($data) ) return false; $data = trim($data); if ( preg_match('/^s:[0-9]+:.*;$/s',$data) ) // this should fetch all serialized strings return true; return false; } /* Options functions */ // expects $setting to already be SQL-escaped function get_option($setting) { global $wpdb; // Allow plugins to short-circuit options. $pre = apply_filters( 'pre_option_' . $setting, false ); if ( false !== $pre ) return $pre; // prevent non-existent options from triggering multiple queries $notoptions = wp_cache_get('notoptions', 'options'); if ( isset($notoptions[$setting]) ) return false; $alloptions = wp_load_alloptions(); if ( isset($alloptions[$setting]) ) { $value = $alloptions[$setting]; } else { $value = wp_cache_get($setting, 'options'); if ( false === $value ) { if ( defined('WP_INSTALLING') ) $wpdb->hide_errors(); $row = $wpdb->get_row("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1"); if ( defined('WP_INSTALLING') ) $wpdb->show_errors(); if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values $value = $row->option_value; wp_cache_add($setting, $value, 'options'); } else { // option does not exist, so we must cache its non-existence $notoptions[$setting] = true; wp_cache_set('notoptions', $notoptions, 'options'); return false; } } } // If home is not set use siteurl. if ( 'home' == $setting && '' == $value ) return get_option('siteurl'); if ( in_array($setting, array('siteurl', 'home', 'category_base', 'tag_base')) ) $value = untrailingslashit($value); return apply_filters( 'option_' . $setting, maybe_unserialize($value) ); } function wp_protect_special_option($option) { $protected = array('alloptions', 'notoptions'); if ( in_array($option, $protected) ) die(sprintf(__('%s is a protected WP option and may not be modified'), wp_specialchars($option))); } function form_option($option) { echo attribute_escape(get_option($option)); } function get_alloptions() { global $wpdb, $wp_queries; $wpdb->hide_errors(); if ( !$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'") ) { $options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options"); } $wpdb->show_errors(); foreach ($options as $option) { // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" -- Dougal if ( 'siteurl' == $option->option_name ) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ( 'home' == $option->option_name ) $option->option_value = preg_replace('|/+$|', '', $option->option_value); if ( 'category_base' == $option->option_name ) $option->option_value = preg_replace('|/+$|', '', $option->option_value); $value = maybe_unserialize($option->option_value); $all_options->{$option->option_name} = apply_filters('pre_option_' . $option->option_name, $value); } return apply_filters('all_options', $all_options); } function wp_load_alloptions() { global $wpdb; $alloptions = wp_cache_get('alloptions', 'options'); if ( !$alloptions ) { $wpdb->hide_errors(); if ( !$alloptions_db = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'") ) $alloptions_db = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options"); $wpdb->show_errors(); $alloptions = array(); foreach ( (array) $alloptions_db as $o ) $alloptions[$o->option_name] = $o->option_value; wp_cache_add('alloptions', $alloptions, 'options'); } return $alloptions; } // expects $option_name to NOT be SQL-escaped function update_option($option_name, $newvalue) { global $wpdb; wp_protect_special_option($option_name); $safe_option_name = $wpdb->escape($option_name); $newvalue = sanitize_option($option_name, $newvalue); if ( is_string($newvalue) ) $newvalue = trim($newvalue); // If the new and old values are the same, no need to update. $oldvalue = get_option($safe_option_name); if ( $newvalue === $oldvalue ) { return false; } if ( false === $oldvalue ) { add_option($option_name, $newvalue); return true; } $notoptions = wp_cache_get('notoptions', 'options'); if ( is_array($notoptions) && isset($notoptions[$option_name]) ) { unset($notoptions[$option_name]); wp_cache_set('notoptions', $notoptions, 'options'); } $_newvalue = $newvalue; $newvalue = maybe_serialize($newvalue); $alloptions = wp_load_alloptions(); if ( isset($alloptions[$option_name]) ) { $alloptions[$option_name] = $newvalue; wp_cache_set('alloptions', $alloptions, 'options'); } else { wp_cache_set($option_name, $newvalue, 'options'); } $newvalue = $wpdb->escape($newvalue); $option_name = $wpdb->escape($option_name); $wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'"); if ( $wpdb->rows_affected == 1 ) { do_action("update_option_{$option_name}", $oldvalue, $_newvalue); return true; } return false; } // thx Alex Stapleton, http://alex.vort-x.net/blog/ // expects $name to NOT be SQL-escaped function add_option($name, $value = '', $deprecated = '', $autoload = 'yes') { global $wpdb; wp_protect_special_option($name); $safe_name = $wpdb->escape($name); // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query $notoptions = wp_cache_get('notoptions', 'options'); if ( !is_array($notoptions) || !isset($notoptions[$name]) ) if ( false !== get_option($safe_name) ) return; $value = maybe_serialize($value); $autoload = ( 'no' === $autoload ) ? 'no' : 'yes'; if ( 'yes' == $autoload ) { $alloptions = wp_load_alloptions(); $alloptions[$name] = $value; wp_cache_set('alloptions', $alloptions, 'options'); } else { wp_cache_set($name, $value, 'options'); } // This option exists now $notoptions = wp_cache_get('notoptions', 'options'); // yes, again... we need it to be fresh if ( is_array($notoptions) && isset($notoptions[$name]) ) { unset($notoptions[$name]); wp_cache_set('notoptions', $notoptions, 'options'); } $name = $wpdb->escape($name); $value = $wpdb->escape($value); $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES ('$name', '$value', '$autoload')"); return; } function delete_option($name) { global $wpdb; wp_protect_special_option($name); // Get the ID, if no ID then return $option = $wpdb->get_row("SELECT option_id, autoload FROM $wpdb->options WHERE option_name = '$name'"); if ( !$option->option_id ) return false; $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = '$name'"); if ( 'yes' == $option->autoload ) { $alloptions = wp_load_alloptions(); if ( isset($alloptions[$name]) ) { unset($alloptions[$name]); wp_cache_set('alloptions', $alloptions, 'options'); } } else { wp_cache_delete($name, 'options'); } return true; } function maybe_serialize($data) { if ( is_string($data) ) $data = trim($data); elseif ( is_array($data) || is_object($data) ) return serialize($data); if ( is_serialized($data) ) return serialize($data); return $data; } function gzip_compression() { if ( !get_option( 'gzipcompression' ) ) { return false; } if ( ( ini_get( 'zlib.output_compression' ) == 'On' || ini_get( 'zlib.output_compression_level' ) > 0 ) || ini_get( 'output_handler' ) == 'ob_gzhandler' ) { return false; } if ( extension_loaded( 'zlib' ) ) { ob_start( 'ob_gzhandler' ); } } function make_url_footnote($content) { preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches); $j = 0; for ($i=0; $i<count($matches[0]); $i++) { $links_summary = (!$j) ? "\n" : $links_summary; $j++; $link_match = $matches[0][$i]; $link_number = '['.($i+1).']'; $link_url = $matches[2][$i]; $link_text = $matches[4][$i]; $content = str_replace($link_match, $link_text.' '.$link_number, $content); $link_url = ((strtolower(substr($link_url,0,7)) != 'http://') && (strtolower(substr($link_url,0,8)) != 'https://')) ? get_option('home') . $link_url : $link_url; $links_summary .= "\n".$link_number.' '.$link_url; } $content = strip_tags($content); $content .= $links_summary; return $content; } function xmlrpc_getposttitle($content) { global $post_default_title; if ( preg_match('/<title>(.+?)<\/title>/is', $content, $matchtitle) ) { $post_title = $matchtitle[0]; $post_title = preg_replace('/<title>/si', '', $post_title); $post_title = preg_replace('/<\/title>/si', '', $post_title); } else { $post_title = $post_default_title; } return $post_title; } function xmlrpc_getpostcategory($content) { global $post_default_category; if ( preg_match('/<category>(.+?)<\/category>/is', $content, $matchcat) ) { $post_category = trim($matchcat[1], ','); $post_category = explode(',', $post_category); } else { $post_category = $post_default_category; } return $post_category; } function xmlrpc_removepostdata($content) { $content = preg_replace('/<title>(.+?)<\/title>/si', '', $content); $content = preg_replace('/<category>(.+?)<\/category>/si', '', $content); $content = trim($content); return $content; } function debug_fopen($filename, $mode) { global $debug; if ( $debug == 1 ) { $fp = fopen($filename, $mode); return $fp; } else { return false; } } function debug_fwrite($fp, $string) { global $debug; if ( $debug == 1 ) { fwrite($fp, $string); } } function debug_fclose($fp) { global $debug; if ( $debug == 1 ) { fclose($fp); } } function do_enclose( $content, $post_ID ) { global $wp_version, $wpdb; include_once (ABSPATH . WPINC . '/class-IXR.php'); $log = debug_fopen(ABSPATH . 'enclosures.log', 'a'); $post_links = array(); debug_fwrite($log, 'BEGIN '.date('YmdHis', time())."\n"); $pung = get_enclosed( $post_ID ); $ltrs = '\w'; $gunk = '/#~:.?+=&%@!\-'; $punc = '.:?\-'; $any = $ltrs . $gunk . $punc; preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp); debug_fwrite($log, 'Post contents:'); debug_fwrite($log, $content."\n"); foreach($post_links_temp[0] as $link_test) : if ( !in_array($link_test, $pung) ) : // If we haven't pung it already $test = parse_url($link_test); if ( isset($test['query']) ) $post_links[] = $link_test; elseif (($test['path'] != '/') && ($test['path'] != '')) $post_links[] = $link_test; endif; endforeach; foreach ($post_links as $url) : if ( $url != '' && !$wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE post_id = '$post_ID' AND meta_key = 'enclosure' AND meta_value LIKE ('$url%')") ) { if ( $headers = wp_get_http_headers( $url) ) { $len = (int) $headers['content-length']; $type = $wpdb->escape( $headers['content-type'] ); $allowed_types = array( 'video', 'audio' ); if ( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) { $meta_value = "$url\n$len\n$type\n"; $wpdb->query( "INSERT INTO `$wpdb->postmeta` ( `post_id` , `meta_key` , `meta_value` ) VALUES ( '$post_ID', 'enclosure' , '$meta_value')" ); } } } endforeach; } function wp_get_http_headers( $url, $red = 1 ) { global $wp_version; @set_time_limit( 60 ); if ( $red > 5 ) return false; $parts = parse_url( $url ); $file = $parts['path'] . ($parts['query'] ? '?'.$parts['query'] : ''); $host = $parts['host']; if ( !isset( $parts['port'] ) ) $parts['port'] = 80; $head = "HEAD $file HTTP/1.1\r\nHOST: $host\r\nUser-Agent: WordPress/" . $wp_version . "\r\n\r\n"; $fp = @fsockopen($host, $parts['port'], $err_num, $err_msg, 3); if ( !$fp ) return false; $response = ''; fputs( $fp, $head ); while ( !feof( $fp ) && strpos( $response, "\r\n\r\n" ) == false ) $response .= fgets( $fp, 2048 ); fclose( $fp ); preg_match_all('/(.*?): (.*)\r/', $response, $matches); $count = count($matches[1]); for ( $i = 0; $i < $count; $i++) { $key = strtolower($matches[1][$i]); $headers["$key"] = $matches[2][$i]; } preg_match('/.*([0-9]{3}).*/', $response, $return); $headers['response'] = $return[1]; // HTTP response code eg 204, 200, 404 $code = $headers['response']; if ( ('302' == $code || '301' == $code) && isset($headers['location']) ) return wp_get_http_headers( $headers['location'], ++$red ); return $headers; } function is_new_day() { global $day, $previousday; if ( $day != $previousday ) { return(1); } else { return(0); } } function build_query($data) { return _http_build_query($data, NULL, '&', '', false); } /* add_query_arg: Returns a modified querystring by adding a single key & value or an associative array. Setting a key value to emptystring removes the key. Omitting oldquery_or_uri uses the $_SERVER value. Parameters: add_query_arg(newkey, newvalue, oldquery_or_uri) or add_query_arg(associative_array, oldquery_or_uri) */ function add_query_arg() { $ret = ''; if ( is_array(func_get_arg(0)) ) { if ( @func_num_args() < 2 || false === @func_get_arg(1) ) $uri = $_SERVER['REQUEST_URI']; else $uri = @func_get_arg(1); } else { if ( @func_num_args() < 3 || false === @func_get_arg(2) ) $uri = $_SERVER['REQUEST_URI']; else $uri = @func_get_arg(2); } if ( $frag = strstr($uri, '#') ) $uri = substr($uri, 0, -strlen($frag)); else $frag = ''; if ( preg_match('|^https?://|i', $uri, $matches) ) { $protocol = $matches[0]; $uri = substr($uri, strlen($protocol)); } else { $protocol = ''; } if (strpos($uri, '?') !== false) { $parts = explode('?', $uri, 2); if ( 1 == count($parts) ) { $base = '?'; $query = $parts[0]; } else { $base = $parts[0] . '?'; $query = $parts[1]; } } elseif (!empty($protocol) || strpos($uri, '=') === false ) { $base = $uri . '?'; $query = ''; } else { $base = ''; $query = $uri; } wp_parse_str($query, $qs); $qs = urlencode_deep($qs); // this re-URL-encodes things that were already in the query string if ( is_array(func_get_arg(0)) ) { $kayvees = func_get_arg(0); $qs = array_merge($qs, $kayvees); } else { $qs[func_get_arg(0)] = func_get_arg(1); } foreach ( $qs as $k => $v ) { if ( $v === false ) unset($qs[$k]); } $ret = build_query($qs); $ret = trim($ret, '?'); $ret = preg_replace('#=(&|$)#', '$1', $ret); $ret = $protocol . $base . $ret . $frag; $ret = rtrim($ret, '?'); return $ret; } /* remove_query_arg: Returns a modified querystring by removing a single key or an array of keys. Omitting oldquery_or_uri uses the $_SERVER value. Parameters: remove_query_arg(removekey, [oldquery_or_uri]) or remove_query_arg(removekeyarray, [oldquery_or_uri]) */ function remove_query_arg($key, $query=FALSE) { if ( is_array($key) ) { // removing multiple keys foreach ( (array) $key as $k ) $query = add_query_arg($k, FALSE, $query); return $query; } return add_query_arg($key, FALSE, $query); } function add_magic_quotes($array) { global $wpdb; foreach ($array as $k => $v) { if ( is_array($v) ) { $array[$k] = add_magic_quotes($v); } else { $array[$k] = $wpdb->escape($v); } } return $array; } function wp_remote_fopen( $uri ) { $timeout = 10; $parsed_url = @parse_url($uri); if ( !$parsed_url || !is_array($parsed_url) ) return false; if ( !isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], array('http','https')) ) $uri = 'http://' . $uri; if ( ini_get('allow_url_fopen') ) { $fp = @fopen( $uri, 'r' ); if ( !$fp ) return false; //stream_set_timeout($fp, $timeout); // Requires php 4.3 $linea = ''; while( $remote_read = fread($fp, 4096) ) $linea .= $remote_read; fclose($fp); return $linea; } else if ( function_exists('curl_init') ) { $handle = curl_init(); curl_setopt ($handle, CURLOPT_URL, $uri); curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($handle, CURLOPT_TIMEOUT, $timeout); $buffer = curl_exec($handle); curl_close($handle); return $buffer; } else { return false; } } function wp($query_vars = '') { global $wp; $wp->main($query_vars); } function get_status_header_desc( $code ) { global $wp_header_to_desc; $code = (int) $code; if ( !isset($wp_header_to_desc) ) { $wp_header_to_desc = array( 100 => 'Continue', 101 => 'Switching Protocols', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported' ); } if ( isset( $wp_header_to_desc[$code] ) ) { return $wp_header_to_desc[$code]; } else { return ''; } } function status_header( $header ) { $text = get_status_header_desc( $header ); if ( empty( $text ) ) return false; $protocol = $_SERVER["SERVER_PROTOCOL"]; if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) ) $protocol = 'HTTP/1.0'; $status_header = "$protocol $header $text"; if ( function_exists('apply_filters') ) $status_header = apply_filters('status_header', $status_header, $header, $text, $protocol); if ( version_compare( phpversion(), '4.3.0', '>=' ) ) { return @header( $status_header, true, $header ); } else { return @header( $status_header ); } } function nocache_headers() { @ header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); @ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); @ header('Cache-Control: no-cache, must-revalidate, max-age=0'); @ header('Pragma: no-cache'); } function cache_javascript_headers() { $expiresOffset = 864000; // 10 days header("Content-Type: text/javascript; charset=" . get_bloginfo('charset')); header("Vary: Accept-Encoding"); // Handle proxies header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT"); } function get_num_queries() { global $wpdb; return $wpdb->num_queries; } function bool_from_yn( $yn ) { return ( strtolower( $yn ) == 'y' ); } function do_feed() { global $wp_query; $feed = get_query_var('feed'); // Remove the pad, if present. $feed = preg_replace('/^_+/', '', $feed); if ( $feed == '' || $feed == 'feed' ) $feed = 'rss2'; $hook = 'do_feed_' . $feed; do_action($hook, $wp_query->is_comment_feed); } function do_feed_rdf() { load_template(ABSPATH . WPINC . '/feed-rdf.php'); } function do_feed_rss() { load_template(ABSPATH . WPINC . '/feed-rss.php'); } function do_feed_rss2($for_comments) { if ( $for_comments ) { load_template(ABSPATH . WPINC . '/feed-rss2-comments.php'); } else { load_template(ABSPATH . WPINC . '/feed-rss2.php'); } } function do_feed_atom($for_comments) { if ($for_comments) { load_template(ABSPATH . WPINC . '/feed-atom-comments.php'); } else { load_template(ABSPATH . WPINC . '/feed-atom.php'); } } function do_robots() { header('Content-Type: text/plain; charset=utf-8'); do_action('do_robotstxt'); if ( '0' == get_option('blog_public') ) { echo "User-agent: *\n"; echo "Disallow: /\n"; } else { echo "User-agent: *\n"; echo "Disallow:\n"; } } function is_blog_installed() { global $wpdb; $wpdb->hide_errors(); $installed = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'"); $wpdb->show_errors(); $install_status = !empty( $installed ) ? TRUE : FALSE; return $install_status; } function wp_nonce_url($actionurl, $action = -1) { $actionurl = str_replace('&', '&', $actionurl); return wp_specialchars(add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl)); } function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true) { $name = attribute_escape($name); echo '<input type="hidden" name="' . $name . '" value="' . wp_create_nonce($action) . '" />'; if ( $referer ) wp_referer_field(); } function wp_referer_field() { $ref = attribute_escape($_SERVER['REQUEST_URI']); echo '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />'; if ( wp_get_original_referer() ) { $original_ref = attribute_escape(stripslashes(wp_get_original_referer())); echo '<input type="hidden" name="_wp_original_http_referer" value="'. $original_ref . '" />'; } } function wp_original_referer_field() { echo '<input type="hidden" name="_wp_original_http_referer" value="' . attribute_escape(stripslashes($_SERVER['REQUEST_URI'])) . '" />'; } function wp_get_referer() { foreach ( array($_REQUEST['_wp_http_referer'], $_SERVER['HTTP_REFERER']) as $ref ) if ( !empty($ref) ) return $ref; return false; } function wp_get_original_referer() { if ( !empty($_REQUEST['_wp_original_http_referer']) ) return $_REQUEST['_wp_original_http_referer']; return false; } function wp_mkdir_p($target) { // from php.net/mkdir user contributed notes if (file_exists($target)) { if (! @ is_dir($target)) return false; else return true; } // Attempting to create the directory may clutter up our display. if (@ mkdir($target)) { $stat = @ stat(dirname($target)); $dir_perms = $stat['mode'] & 0007777; // Get the permission bits. @ chmod($target, $dir_perms); return true; } else { if ( is_dir(dirname($target)) ) return false; } // If the above failed, attempt to create the parent node, then try again. if (wp_mkdir_p(dirname($target))) return wp_mkdir_p($target); return false; } // Returns an array containing the current upload directory's path and url, or an error message. function wp_upload_dir() { $siteurl = get_option('siteurl'); //prepend ABSPATH to $dir and $siteurl to $url if they're not already there $path = str_replace(ABSPATH, '', trim(get_option('upload_path'))); $dir = ABSPATH . $path; $url = trailingslashit($siteurl) . $path; if ( $dir == ABSPATH ) { //the option was empty $dir = ABSPATH . 'wp-content/uploads'; } if ( defined('UPLOADS') ) { $dir = ABSPATH . UPLOADS; $url = trailingslashit($siteurl) . UPLOADS; } if ( get_option('uploads_use_yearmonth_folders')) { // Generate the yearly and monthly dirs $time = current_time( 'mysql' ); $y = substr( $time, 0, 4 ); $m = substr( $time, 5, 2 ); $dir = $dir . "/$y/$m"; $url = $url . "/$y/$m"; } // Make sure we have an uploads dir if ( ! wp_mkdir_p( $dir ) ) { $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), $dir); return array('error' => $message); } $uploads = array('path' => $dir, 'url' => $url, 'error' => false); return apply_filters('upload_dir', $uploads); } function wp_upload_bits($name, $type, $bits) { if ( empty($name) ) return array('error' => __("Empty filename")); $wp_filetype = wp_check_filetype($name); if ( !$wp_filetype['ext'] ) return array('error' => __("Invalid file type")); $upload = wp_upload_dir(); if ( $upload['error'] !== false ) return $upload; $number = ''; $filename = $name; $path_parts = pathinfo($filename); $ext = $path_parts['extension']; if ( empty($ext) ) $ext = ''; else $ext = ".$ext"; while ( file_exists($upload['path'] . "/$filename") ) { if ( '' == "$number$ext" ) $filename = $filename . ++$number . $ext; else $filename = str_replace("$number$ext", ++$number . $ext, $filename); } $new_file = $upload['path'] . "/$filename"; if ( ! wp_mkdir_p( dirname($new_file) ) ) { $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file)); return array('error' => $message); } $ifp = @ fopen($new_file, 'wb'); if ( ! $ifp ) return array('error' => sprintf(__('Could not write file %s'), $new_file)); $success = @ fwrite($ifp, $bits); fclose($ifp); // Set correct file permissions $stat = @ stat(dirname($new_file)); $perms = $stat['mode'] & 0007777; $perms = $perms & 0000666; @ chmod($new_file, $perms); // Compute the URL $url = $upload['url'] . "/$filename"; return array('file' => $new_file, 'url' => $url, 'error' => false); } function wp_check_filetype($filename, $mimes = null) { // Accepted MIME types are set here as PCRE unless provided. $mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array ( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon', 'asf|asx|wax|wmv|wmx' => 'video/asf', 'avi' => 'video/avi', 'mov|qt' => 'video/quicktime', 'mpeg|mpg|mpe' => 'video/mpeg', 'txt|c|cc|h' => 'text/plain', 'rtx' => 'text/richtext', 'css' => 'text/css', 'htm|html' => 'text/html', 'mp3|mp4' => 'audio/mpeg', 'ra|ram' => 'audio/x-realaudio', 'wav' => 'audio/wav', 'ogg' => 'audio/ogg', 'mid|midi' => 'audio/midi', 'wma' => 'audio/wma', 'rtf' => 'application/rtf', 'js' => 'application/javascript', 'pdf' => 'application/pdf', 'doc' => 'application/msword', 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', 'wri' => 'application/vnd.ms-write', 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', 'mdb' => 'application/vnd.ms-access', 'mpp' => 'application/vnd.ms-project', 'swf' => 'application/x-shockwave-flash', 'class' => 'application/java', 'tar' => 'application/x-tar', 'zip' => 'application/zip', 'gz|gzip' => 'application/x-gzip', 'exe' => 'application/x-msdownload', // openoffice formats 'odt' => 'application/vnd.oasis.opendocument.text', 'odp' => 'application/vnd.oasis.opendocument.presentation', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'odg' => 'application/vnd.oasis.opendocument.graphics', 'odc' => 'application/vnd.oasis.opendocument.chart', 'odb' => 'application/vnd.oasis.opendocument.database', 'odf' => 'application/vnd.oasis.opendocument.formula', )); $type = false; $ext = false; foreach ($mimes as $ext_preg => $mime_match) { $ext_preg = '!\.(' . $ext_preg . ')$!i'; if ( preg_match($ext_preg, $filename, $ext_matches) ) { $type = $mime_match; $ext = $ext_matches[1]; break; } } return compact('ext', 'type'); } function wp_explain_nonce($action) { if ( $action !== -1 && preg_match('/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches) ) { $verb = $matches[1]; $noun = $matches[2]; $trans = array(); $trans['update']['attachment'] = array(__('Are you sure you want to edit this attachment: "%s"?'), 'get_the_title'); $trans['add']['category'] = array(__('Are you sure you want to add this category?'), false); $trans['delete']['category'] = array(__('Are you sure you want to delete this category: "%s"?'), 'get_catname'); $trans['update']['category'] = array(__('Are you sure you want to edit this category: "%s"?'), 'get_catname'); $trans['delete']['comment'] = array(__('Are you sure you want to delete this comment: "%s"?'), 'use_id'); $trans['unapprove']['comment'] = array(__('Are you sure you want to unapprove this comment: "%s"?'), 'use_id'); $trans['approve']['comment'] = array(__('Are you sure you want to approve this comment: "%s"?'), 'use_id'); $trans['update']['comment'] = array(__('Are you sure you want to edit this comment: "%s"?'), 'use_id'); $trans['bulk']['comments'] = array(__('Are you sure you want to bulk modify comments?'), false); $trans['moderate']['comments'] = array(__('Are you sure you want to moderate comments?'), false); $trans['add']['bookmark'] = array(__('Are you sure you want to add this link?'), false); $trans['delete']['bookmark'] = array(__('Are you sure you want to delete this link: "%s"?'), 'use_id'); $trans['update']['bookmark'] = array(__('Are you sure you want to edit this link: "%s"?'), 'use_id'); $trans['bulk']['bookmarks'] = array(__('Are you sure you want to bulk modify links?'), false); $trans['add']['page'] = array(__('Are you sure you want to add this page?'), false); $trans['delete']['page'] = array(__('Are you sure you want to delete this page: "%s"?'), 'get_the_title'); $trans['update']['page'] = array(__('Are you sure you want to edit this page: "%s"?'), 'get_the_title'); $trans['edit']['plugin'] = array(__('Are you sure you want to edit this plugin file: "%s"?'), 'use_id'); $trans['activate']['plugin'] = array(__('Are you sure you want to activate this plugin: "%s"?'), 'use_id'); $trans['deactivate']['plugin'] = array(__('Are you sure you want to deactivate this plugin: "%s"?'), 'use_id'); $trans['add']['post'] = array(__('Are you sure you want to add this post?'), false); $trans['delete']['post'] = array(__('Are you sure you want to delete this post: "%s"?'), 'get_the_title'); $trans['update']['post'] = array(__('Are you sure you want to edit this post: "%s"?'), 'get_the_title'); $trans['add']['user'] = array(__('Are you sure you want to add this user?'), false); $trans['delete']['users'] = array(__('Are you sure you want to delete users?'), false); $trans['bulk']['users'] = array(__('Are you sure you want to bulk modify users?'), false); $trans['update']['user'] = array(__('Are you sure you want to edit this user: "%s"?'), 'get_author_name'); $trans['update']['profile'] = array(__('Are you sure you want to modify the profile for: "%s"?'), 'get_author_name'); $trans['update']['options'] = array(__('Are you sure you want to edit your settings?'), false); $trans['update']['permalink'] = array(__('Are you sure you want to change your permalink structure to: %s?'), 'use_id'); $trans['edit']['file'] = array(__('Are you sure you want to edit this file: "%s"?'), 'use_id'); $trans['edit']['theme'] = array(__('Are you sure you want to edit this theme file: "%s"?'), 'use_id'); $trans['switch']['theme'] = array(__('Are you sure you want to switch to this theme: "%s"?'), 'use_id'); if ( isset($trans[$verb][$noun]) ) { if ( !empty($trans[$verb][$noun][1]) ) { $lookup = $trans[$verb][$noun][1]; $object = $matches[4]; if ( 'use_id' != $lookup ) $object = call_user_func($lookup, $object); return sprintf($trans[$verb][$noun][0], $object); } else { return $trans[$verb][$noun][0]; } } } return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __('Are you sure you want to do this?'), $matches[4] ); } function wp_nonce_ays($action) { global $pagenow, $menu, $submenu, $parent_file, $submenu_file; $adminurl = get_option('siteurl') . '/wp-admin'; if ( wp_get_referer() ) $adminurl = clean_url(wp_get_referer()); $title = __('WordPress Confirmation'); // Remove extra layer of slashes. $_POST = stripslashes_deep($_POST ); if ( $_POST ) { $q = http_build_query($_POST); $q = explode( ini_get('arg_separator.output'), $q); $html .= "\t<form method='post' action='" . attribute_escape($pagenow) . "'>\n"; foreach ( (array) $q as $a ) { $v = substr(strstr($a, '='), 1); $k = substr($a, 0, -(strlen($v)+1)); $html .= "\t\t<input type='hidden' name='" . attribute_escape(urldecode($k)) . "' value='" . attribute_escape(urldecode($v)) . "' />\n"; } $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n"; $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; } else { $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . clean_url(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; } $html .= "</body>\n</html>"; wp_die($html, $title); } function wp_die( $message, $title = '' ) { global $wp_locale; if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) { if ( empty($title) ) { $error_data = $message->get_error_data(); if ( is_array($error_data) && isset($error_data['title']) ) $title = $error_data['title']; } $errors = $message->get_error_messages(); switch ( count($errors) ) : case 0 : $message = ''; break; case 1 : $message = "<p>{$errors[0]}</p>"; break; default : $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>"; break; endswitch; } elseif ( is_string($message) ) { $message = "<p>$message</p>"; } if ( defined('WP_SITEURL') && '' != WP_SITEURL ) $admin_dir = WP_SITEURL.'/wp-admin/'; elseif (function_exists('get_bloginfo') && '' != get_bloginfo('wpurl')) $admin_dir = get_bloginfo('wpurl').'/wp-admin/'; elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $admin_dir = ''; else $admin_dir = 'wp-admin/'; if ( !function_exists('did_action') || !did_action('admin_head') ) : if( !headers_sent() ){ status_header(500); nocache_headers(); header('Content-Type: text/html; charset=utf-8'); } if ( empty($title) ){ if( function_exists('__') ) $title = __('WordPress › Error'); else $title = 'WordPress › Error'; } ?> <!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" <?php if ( function_exists('language_attributes') ) language_attributes(); ?>> <head> <title><?php echo $title ?> text_direction) ) : ?>

    WordPress

    text_direction) { echo 'directionality : "rtl" ,'; echo 'theme_advanced_toolbar_align : "right" ,'; } } function _mce_load_rtl_plugin($input) { global $wp_locale; if ('rtl' == $wp_locale->text_direction) $input[] = 'directionality'; return $input; } function _mce_add_direction_buttons($input) { global $wp_locale; if ('rtl' == $wp_locale->text_direction) { $new_buttons = array('separator', 'ltr', 'rtl'); $input = array_merge($input, $new_buttons); } return $input; } function smilies_init() { global $wpsmiliestrans, $wp_smiliessearch, $wp_smiliesreplace; // don't bother setting up smilies if they are disabled if ( !get_option('use_smilies') ) return; if (!isset($wpsmiliestrans)) { $wpsmiliestrans = array( ':mrgreen:' => 'icon_mrgreen.gif', ':neutral:' => 'icon_neutral.gif', ':twisted:' => 'icon_twisted.gif', ':arrow:' => 'icon_arrow.gif', ':shock:' => 'icon_eek.gif', ':smile:' => 'icon_smile.gif', ':???:' => 'icon_confused.gif', ':cool:' => 'icon_cool.gif', ':evil:' => 'icon_evil.gif', ':grin:' => 'icon_biggrin.gif', ':idea:' => 'icon_idea.gif', ':oops:' => 'icon_redface.gif', ':razz:' => 'icon_razz.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ':cry:' => 'icon_cry.gif', ':eek:' => 'icon_surprised.gif', ':lol:' => 'icon_lol.gif', ':mad:' => 'icon_mad.gif', ':sad:' => 'icon_sad.gif', '8-)' => 'icon_cool.gif', '8-O' => 'icon_eek.gif', ':-(' => 'icon_sad.gif', ':-)' => 'icon_smile.gif', ':-?' => 'icon_confused.gif', ':-D' => 'icon_biggrin.gif', ':-P' => 'icon_razz.gif', ':-o' => 'icon_surprised.gif', ':-x' => 'icon_mad.gif', ':-|' => 'icon_neutral.gif', ';-)' => 'icon_wink.gif', '8)' => 'icon_cool.gif', '8O' => 'icon_eek.gif', ':(' => 'icon_sad.gif', ':)' => 'icon_smile.gif', ':?' => 'icon_confused.gif', ':D' => 'icon_biggrin.gif', ':P' => 'icon_razz.gif', ':o' => 'icon_surprised.gif', ':x' => 'icon_mad.gif', ':|' => 'icon_neutral.gif', ';)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif', ); } $siteurl = get_option('siteurl'); foreach ( (array) $wpsmiliestrans as $smiley => $img ) { $wp_smiliessearch[] = '/(\s|^)'.preg_quote($smiley, '/').'(\s|$)/'; $smiley_masked = htmlspecialchars(trim($smiley), ENT_QUOTES); $wp_smiliesreplace[] = " $smiley_masked "; } } function wp_parse_args( $args, $defaults = '' ) { if ( is_object($args) ) $r = get_object_vars($args); else if ( is_array( $args ) ) $r =& $args; else wp_parse_str( $args, $r ); if ( is_array( $defaults ) ) return array_merge( $defaults, $r ); else return $r; } function wp_maybe_load_widgets() { if ( !function_exists( 'dynamic_sidebar' ) ) { require_once ABSPATH . WPINC . '/widgets.php'; add_action( '_admin_menu', 'wp_widgets_add_menu' ); } } function wp_widgets_add_menu() { global $submenu; $submenu['themes.php'][7] = array( __( 'Widgets' ), 'switch_themes', 'widgets.php' ); ksort($submenu['themes.php'], SORT_NUMERIC); } // For PHP 5.2, make sure all output buffers are flushed // before our singletons our destroyed. function wp_ob_end_flush_all() { while ( @ob_end_flush() ); } ?> wp-includes/general-template.php0000644013707600007620000010203710674746104014765 0ustar www' . __('Login') . ''; else $link = '' . __('Logout') . ''; echo apply_filters('loginout', $link); } function wp_register( $before = '
  • ', $after = '
  • ' ) { if ( ! is_user_logged_in() ) { if ( get_option('users_can_register') ) $link = $before . '' . __('Register') . '' . $after; else $link = ''; } else { $link = $before . '' . __('Site Admin') . '' . $after; } echo apply_filters('register', $link); } function wp_meta() { do_action('wp_meta'); } function bloginfo($show='') { echo get_bloginfo($show, 'display'); } /** * Note: some of these values are DEPRECATED. Meaning they could be * taken out at any time and shouldn't be relied upon. Options * without "// DEPRECATED" are the preferred and recommended ways * to get the information. */ function get_bloginfo($show = '', $filter = 'raw') { switch($show) { case 'url' : case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED $output = get_option('home'); break; case 'wpurl' : $output = get_option('siteurl'); break; case 'description': $output = get_option('blogdescription'); break; case 'rdf_url': $output = get_feed_link('rdf'); break; case 'rss_url': $output = get_feed_link('rss'); break; case 'rss2_url': $output = get_feed_link('rss2'); break; case 'atom_url': $output = get_feed_link('atom'); break; case 'comments_atom_url': $output = get_feed_link('comments_atom'); break; case 'comments_rss2_url': $output = get_feed_link('comments_rss2'); break; case 'pingback_url': $output = get_option('siteurl') .'/xmlrpc.php'; break; case 'stylesheet_url': $output = get_stylesheet_uri(); break; case 'stylesheet_directory': $output = get_stylesheet_directory_uri(); break; case 'template_directory': case 'template_url': $output = get_template_directory_uri(); break; case 'admin_email': $output = get_option('admin_email'); break; case 'charset': $output = get_option('blog_charset'); if ('' == $output) $output = 'UTF-8'; break; case 'html_type' : $output = get_option('html_type'); break; case 'version': global $wp_version; $output = $wp_version; break; case 'language': $output = get_locale(); $output = str_replace('_', '-', $output); break; case 'text_direction': global $wp_locale; $output = $wp_locale->text_direction; break; case 'name': default: $output = get_option('blogname'); break; } $url = true; if (strpos($show, 'url') === false && strpos($show, 'directory') === false && strpos($show, 'home') === false) $url = false; if ( 'display' == $filter ) { if ( $url ) $output = apply_filters('bloginfo_url', $output, $show); else $output = apply_filters('bloginfo', $output, $show); } return $output; } function wp_title($sep = '»', $display = true) { global $wpdb, $wp_locale, $wp_query; $cat = get_query_var('cat'); $tag = get_query_var('tag_id'); $p = get_query_var('p'); $name = get_query_var('name'); $category_name = get_query_var('category_name'); $author = get_query_var('author'); $author_name = get_query_var('author_name'); $m = get_query_var('m'); $year = get_query_var('year'); $monthnum = get_query_var('monthnum'); $day = get_query_var('day'); $title = ''; // If there's a category if ( !empty($cat) ) { // category exclusion if ( !stristr($cat,'-') ) $title = apply_filters('single_cat_title', get_the_category_by_ID($cat)); } elseif ( !empty($category_name) ) { if ( stristr($category_name,'/') ) { $category_name = explode('/',$category_name); if ( $category_name[count($category_name)-1] ) $category_name = $category_name[count($category_name)-1]; // no trailing slash else $category_name = $category_name[count($category_name)-2]; // there was a trailling slash } $cat = get_term_by('slug', $category_name, 'category', OBJECT, 'display'); if ( $cat ) $title = apply_filters('single_cat_title', $cat->name); } if ( !empty($tag) ) { $tag = get_term($tag, 'post_tag', OBJECT, 'display'); if ( is_wp_error( $tag ) ) return $tag; if ( ! empty($tag->name) ) $title = apply_filters('single_tag_title', $tag->name); } // If there's an author if ( !empty($author) ) { $title = get_userdata($author); $title = $title->display_name; } if ( !empty($author_name) ) { // We do a direct query here because we don't cache by nicename. $title = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_nicename = '$author_name'"); } // If there's a month if ( !empty($m) ) { $my_year = substr($m, 0, 4); $my_month = $wp_locale->get_month(substr($m, 4, 2)); $my_day = intval(substr($m, 6, 2)); $title = "$my_year" . ($my_month ? "$sep $my_month" : "") . ($my_day ? "$sep $my_day" : ""); } if ( !empty($year) ) { $title = $year; if ( !empty($monthnum) ) $title .= " $sep " . $wp_locale->get_month($monthnum); if ( !empty($day) ) $title .= " $sep " . zeroise($day, 2); } // If there is a post if ( is_single() || is_page() ) { $post = $wp_query->get_queried_object(); $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ); } $prefix = ''; if ( !empty($title) ) $prefix = " $sep "; $title = $prefix . $title; $title = apply_filters('wp_title', $title, $sep); // Send it out if ( $display ) echo $title; else return $title; } function single_post_title($prefix = '', $display = true) { global $wpdb; $p = get_query_var('p'); $name = get_query_var('name'); if ( intval($p) || '' != $name ) { if ( !$p ) $p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '$name'"); $post = & get_post($p); $title = $post->post_title; $title = apply_filters('single_post_title', $title); if ( $display ) echo $prefix.strip_tags($title); else return strip_tags($title); } } function single_cat_title($prefix = '', $display = true ) { $cat = intval( get_query_var('cat') ); if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) { $my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat)); if ( !empty($my_cat_name) ) { if ( $display ) echo $prefix.strip_tags($my_cat_name); else return strip_tags($my_cat_name); } } else if ( is_tag() ) { return single_tag_title($prefix, $display); } } function single_tag_title($prefix = '', $display = true ) { if ( !is_tag() ) return; $tag_id = intval( get_query_var('tag_id') ); if ( !empty($tag_id) ) { $my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display'); if ( is_wp_error( $my_tag ) ) return false; $my_tag_name = apply_filters('single_tag_title', $my_tag->name); if ( !empty($my_tag_name) ) { if ( $display ) echo $prefix . $my_tag_name; else return $my_tag_name; } } } function single_month_title($prefix = '', $display = true ) { global $wp_locale; $m = get_query_var('m'); $year = get_query_var('year'); $monthnum = get_query_var('monthnum'); if ( !empty($monthnum) && !empty($year) ) { $my_year = $year; $my_month = $wp_locale->get_month($monthnum); } elseif ( !empty($m) ) { $my_year = substr($m, 0, 4); $my_month = $wp_locale->get_month(substr($m, 4, 2)); } if ( empty($my_month) ) return false; $result = $prefix . $my_month . $prefix . $my_year; if ( !$display ) return $result; echo $result; } /* link navigation hack by Orien http://icecode.com/ */ function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { $text = wptexturize($text); $title_text = attribute_escape($text); $url = clean_url($url); if ('link' == $format) return "\t\n"; elseif ('option' == $format) return "\t\n"; elseif ('html' == $format) return "\t
  • $before$text$after
  • \n"; else // custom return "\t$before$text$after\n"; } function wp_get_archives($args = '') { global $wpdb, $wp_locale; $defaults = array( 'type' => 'monthly', 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => false ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); if ( '' == $type ) $type = 'monthly'; if ( '' != $limit ) { $limit = (int) $limit; $limit = ' LIMIT '.$limit; } // this is what will separate dates on weekly archive links $archive_week_separator = '–'; // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride $archive_date_format_over_ride = 0; // options for daily archive (only if you over-ride the general date format) $archive_day_date_format = 'Y/m/d'; // options for weekly archive (only if you over-ride the general date format) $archive_week_start_date_format = 'Y/m/d'; $archive_week_end_date_format = 'Y/m/d'; if ( !$archive_date_format_over_ride ) { $archive_day_date_format = get_option('date_format'); $archive_week_start_date_format = get_option('date_format'); $archive_week_end_date_format = get_option('date_format'); } $add_hours = intval(get_option('gmt_offset')); $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours)); //filters $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r ); $join = apply_filters('getarchives_join', "", $r); if ( 'monthly' == $type ) { $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { $url = get_month_link($arcresult->year, $arcresult->month); $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year); if ( $show_post_count ) $after = ' ('.$arcresult->posts.')' . $afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ('yearly' == $type) { $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); if ($arcresults) { $afterafter = $after; foreach ($arcresults as $arcresult) { $url = get_year_link($arcresult->year); $text = sprintf('%d', $arcresult->year); if ($show_post_count) $after = ' ('.$arcresult->posts.')' . $afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ( 'daily' == $type ) { $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); if ( $arcresults ) { $afterafter = $after; foreach ( $arcresults as $arcresult ) { $url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth); $date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $arcresult->year, $arcresult->month, $arcresult->dayofmonth); $text = mysql2date($archive_day_date_format, $date); if ($show_post_count) $after = ' ('.$arcresult->posts.')'.$afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } elseif ( 'weekly' == $type ) { $start_of_week = get_option('start_of_week'); $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit); $arc_w_last = ''; $afterafter = $after; if ( $arcresults ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->week != $arc_w_last ) { $arc_year = $arcresult->yr; $arc_w_last = $arcresult->week; $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week')); $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week); $text = $arc_week_start . $archive_week_separator . $arc_week_end; if ($show_post_count) $after = ' ('.$arcresult->posts.')'.$afterafter; echo get_archives_link($url, $text, $format, $before, $after); } } } } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC "; $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"); if ( $arcresults ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) { $url = get_permalink($arcresult); $arc_title = $arcresult->post_title; if ( $arc_title ) $text = strip_tags(apply_filters('the_title', $arc_title)); else $text = $arcresult->ID; echo get_archives_link($url, $text, $format, $before, $after); } } } } } // Used in get_calendar function calendar_week_mod($num) { $base = 7; return ($num - $base*floor($num/$base)); } function get_calendar($initial = true) { global $wpdb, $m, $monthnum, $year, $timedifference, $wp_locale, $posts; $key = md5( $m . $monthnum . $year ); if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { if ( isset( $cache[ $key ] ) ) { echo $cache[ $key ]; return; } } ob_start(); // Quick check. If we have no posts at all, abort! if ( !$posts ) { $gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); if ( !$gotsome ) return; } if ( isset($_GET['w']) ) $w = ''.intval($_GET['w']); // week_begins = 0 stands for Sunday $week_begins = intval(get_option('start_of_week')); $add_hours = intval(get_option('gmt_offset')); $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours)); // Let's figure out when we are if ( !empty($monthnum) && !empty($year) ) { $thismonth = ''.zeroise(intval($monthnum), 2); $thisyear = ''.intval($year); } elseif ( !empty($w) ) { // We need to get the month from MySQL $thisyear = ''.intval(substr($m, 0, 4)); $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')"); } elseif ( !empty($m) ) { $calendar = substr($m, 0, 6); $thisyear = ''.intval(substr($m, 0, 4)); if ( strlen($m) < 6 ) $thismonth = '01'; else $thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2); } else { $thisyear = gmdate('Y', current_time('timestamp')); $thismonth = gmdate('m', current_time('timestamp')); } $unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear); // Get the next and previous month and year with at least one post $previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date < '$thisyear-$thismonth-01' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"); $next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date > '$thisyear-$thismonth-01' AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' ) AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date ASC LIMIT 1"); echo ''; $myweek = array(); for ( $wdcount=0; $wdcount<=6; $wdcount++ ) { $myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7); } foreach ( $myweek as $wd ) { $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd); echo "\n\t\t"; } echo ' '; if ( $previous ) { echo "\n\t\t".''; } else { echo "\n\t\t".''; } echo "\n\t\t".''; if ( $next ) { echo "\n\t\t".''; } else { echo "\n\t\t".''; } echo ' '; // Get days with posts $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date) FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth' AND YEAR(post_date) = '$thisyear' AND post_type = 'post' AND post_status = 'publish' AND post_date < '" . current_time('mysql') . '\'', ARRAY_N); if ( $dayswithposts ) { foreach ( $dayswithposts as $daywith ) { $daywithpost[] = $daywith[0]; } } else { $daywithpost = array(); } if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false) $ak_title_separator = "\n"; else $ak_title_separator = ', '; $ak_titles_for_day = array(); $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " ."FROM $wpdb->posts " ."WHERE YEAR(post_date) = '$thisyear' " ."AND MONTH(post_date) = '$thismonth' " ."AND post_date < '".current_time('mysql')."' " ."AND post_type = 'post' AND post_status = 'publish'" ); if ( $ak_post_titles ) { foreach ( $ak_post_titles as $ak_post_title ) { $post_title = apply_filters( "the_title", $ak_post_title->post_title ); $post_title = str_replace('"', '"', wptexturize( $post_title )); if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one $ak_titles_for_day["$ak_post_title->dom"] = $post_title; else $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title; } } // See how much we should pad in the beginning $pad = calendar_week_mod(date('w', $unixmonth)-$week_begins); if ( 0 != $pad ) echo "\n\t\t".''; $daysinmonth = intval(date('t', $unixmonth)); for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( isset($newrow) && $newrow ) echo "\n\t\n\t\n\t\t"; $newrow = false; if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) ) echo ''; if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) ) $newrow = true; } $pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins); if ( $pad != 0 && $pad != 7 ) echo "\n\t\t".''; echo "\n\t\n\t\n\t
    ' . $wp_locale->get_month($thismonth) . ' ' . date('Y', $unixmonth) . '
    $day_name
    « ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '  ' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' » 
     
    '; else echo ''; if ( in_array($day, $daywithpost) ) // any posts today? echo '$day"; else echo $day; echo ' 
    "; $output = ob_get_contents(); ob_end_clean(); echo $output; $cache[ $key ] = $output; wp_cache_set( 'get_calendar', $cache, 'calendar' ); } function delete_get_calendar_cache() { wp_cache_delete( 'get_calendar', 'calendar' ); } add_action( 'save_post', 'delete_get_calendar_cache' ); add_action( 'delete_post', 'delete_get_calendar_cache' ); add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' ); add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); function allowed_tags() { global $allowedtags; $allowed = ''; foreach ( $allowedtags as $tag => $attributes ) { $allowed .= '<'.$tag; if ( 0 < count($attributes) ) { foreach ( $attributes as $attribute => $limits ) { $allowed .= ' '.$attribute.'=""'; } } $allowed .= '> '; } return htmlentities($allowed); } /***** Date/Time tags *****/ function the_date_xml() { global $post; echo mysql2date('Y-m-d', $post->post_date); //echo ""+$post->post_date; } function the_date($d='', $before='', $after='', $echo = true) { global $id, $post, $day, $previousday; $the_date = ''; if ( $day != $previousday ) { $the_date .= $before; if ( $d=='' ) $the_date .= mysql2date(get_option('date_format'), $post->post_date); else $the_date .= mysql2date($d, $post->post_date); $the_date .= $after; $previousday = $day; } $the_date = apply_filters('the_date', $the_date, $d, $before, $after); if ( $echo ) echo $the_date; else return $the_date; } function the_modified_date($d = '') { echo apply_filters('the_modified_date', get_the_modified_date($d), $d); } function get_the_modified_date($d = '') { if ( '' == $d ) $the_time = get_post_modified_time(get_option('date_format')); else $the_time = get_post_modified_time($d); return apply_filters('get_the_modified_date', $the_time, $d); } function the_time( $d = '' ) { echo apply_filters('the_time', get_the_time( $d ), $d); } function get_the_time( $d = '' ) { if ( '' == $d ) $the_time = get_post_time(get_option('time_format')); else $the_time = get_post_time($d); return apply_filters('get_the_time', $the_time, $d); } function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp global $post; if ( $gmt ) $time = $post->post_date_gmt; else $time = $post->post_date; $time = mysql2date($d, $time); return apply_filters('get_the_time', $time, $d, $gmt); } function the_modified_time($d = '') { echo apply_filters('the_modified_time', get_the_modified_time($d), $d); } function get_the_modified_time($d = '') { if ( '' == $d ) $the_time = get_post_modified_time(get_option('time_format')); else $the_time = get_post_modified_time($d); return apply_filters('get_the_modified_time', $the_time, $d); } function get_post_modified_time( $d = 'U', $gmt = false ) { // returns timestamp global $post; if ( $gmt ) $time = $post->post_modified_gmt; else $time = $post->post_modified; $time = mysql2date($d, $time); return apply_filters('get_the_modified_time', $time, $d, $gmt); } function the_weekday() { global $wp_locale, $id, $post; $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date)); $the_weekday = apply_filters('the_weekday', $the_weekday); echo $the_weekday; } function the_weekday_date($before='',$after='') { global $wp_locale, $id, $post, $day, $previousweekday; $the_weekday_date = ''; if ( $day != $previousweekday ) { $the_weekday_date .= $before; $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date)); $the_weekday_date .= $after; $previousweekday = $day; } $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after); echo $the_weekday_date; } function wp_head() { do_action('wp_head'); } function wp_footer() { do_action('wp_footer'); } function rsd_link() { echo ' \n"; } function noindex() { // If the blog is not public, tell robots to go away. if ( '0' == get_option('blog_public') ) echo "\n"; } function rich_edit_exists() { global $wp_rich_edit_exists; if ( !isset($wp_rich_edit_exists) ) $wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js'); return $wp_rich_edit_exists; } function user_can_richedit() { global $wp_rich_edit, $pagenow; if ( !isset( $wp_rich_edit) ) { if ( get_user_option( 'rich_editing' ) == 'true' && ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) || !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) && 'comment.php' != $pagenow ) { $wp_rich_edit = true; } else { $wp_rich_edit = false; } } return apply_filters('user_can_richedit', $wp_rich_edit); } function the_editor($content, $id = 'content', $prev_id = 'title') { $rows = get_option('default_post_edit_rows'); if (($rows < 3) || ($rows > 100)) $rows = 12; $rows = "rows='$rows'"; if ( user_can_richedit() ) : add_filter('the_editor_content', 'wp_richedit_pre'); // The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. ?>
    \n"); $the_editor_content = apply_filters('the_editor_content', $content); printf($the_editor, $the_editor_content); ?> '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below) 'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number 'total' => 1, 'current' => 0, 'show_all' => false, 'prev_next' => true, 'prev_text' => __('« Previous'), 'next_text' => __('Next »'), 'end_size' => 1, // How many numbers on either end including the end 'mid_size' => 2, // How many numbers to either side of current not including current 'type' => 'plain', 'add_args' => false // array of query args to aadd ); $args = wp_parse_args( $args, $defaults ); extract($args, EXTR_SKIP); // Who knows what else people pass in $args $total = (int) $total; if ( $total < 2 ) return; $current = (int) $current; $end_size = 0 < (int) $end_size ? (int) $end_size : 1; // Out of bounds? Make it the default. $mid_size = 0 <= (int) $mid_size ? (int) $mid_size : 2; $add_args = is_array($add_args) ? $add_args : false; $r = ''; $page_links = array(); $n = 0; $dots = false; if ( $prev_next && $current && 1 < $current ) : $link = str_replace('%_%', 2 == $current ? '' : $format, $base); $link = str_replace('%#%', $current - 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = ""; endif; for ( $n = 1; $n <= $total; $n++ ) : if ( $n == $current ) : $page_links[] = "$n"; $dots = true; else : if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : $link = str_replace('%_%', 1 == $n ? '' : $format, $base); $link = str_replace('%#%', $n, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = "$n"; $dots = true; elseif ( $dots && !$show_all ) : $page_links[] = "..."; $dots = false; endif; endif; endfor; if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : $link = str_replace('%_%', $format, $base); $link = str_replace('%#%', $current + 1, $link); if ( $add_args ) $link = add_query_arg( $add_args, $link ); $page_links[] = ""; endif; switch ( $type ) : case 'array' : return $page_links; break; case 'list' : $r .= "
      \n\t
    • "; $r .= join("
    • \n\t
    • ", $page_links); $r .= "
    • \n
    \n"; break; default : $r = join("\n", $page_links); break; endswitch; return $r; } function wp_admin_css_uri( $file = 'wp-admin' ) { if ( defined('WP_INSTALLING') ) { $_file = add_query_arg( 'version', get_bloginfo( 'version' ), "./$file.css" ); } else { $_file = add_query_arg( 'version', get_bloginfo( 'version' ), get_option( 'siteurl' ) . "/wp-admin/$file.css" ); } return apply_filters( 'wp_admin_css_uri', $_file, $file ); } function wp_admin_css( $file = 'wp-admin' ) { echo apply_filters( 'wp_admin_css', "\n", $file ); if ( 'rtl' == get_bloginfo( 'text_direction' ) ) { $rtl = ( 'wp-admin' == $file ) ? 'rtl' : "$file-rtl"; echo apply_filters( 'wp_admin_css', "\n", $rtl ); } } ?> wp-includes/gettext.php0000644013707600007620000002602410607773114013221 0ustar www. Copyright (c) 2005 Nico Kaiser This file is part of PHP-gettext. PHP-gettext is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PHP-gettext is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PHP-gettext; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * Provides a simple gettext replacement that works independently from * the system's gettext abilities. * It can read MO files and use them for translating strings. * The files are passed to gettext_reader as a Stream (see streams.php) * * This version has the ability to cache all strings and translations to * speed up the string lookup. * While the cache is enabled by default, it can be switched off with the * second parameter in the constructor (e.g. whenusing very large MO files * that you don't want to keep in memory) */ class gettext_reader { //public: var $error = 0; // public variable that holds error code (0 if no error) //private: var $BYTEORDER = 0; // 0: low endian, 1: big endian var $STREAM = NULL; var $short_circuit = false; var $enable_cache = false; var $originals = NULL; // offset of original table var $translations = NULL; // offset of translation table var $pluralheader = NULL; // cache header field for plural forms var $select_string_function = NULL; // cache function, which chooses plural forms var $total = 0; // total string count var $table_originals = NULL; // table for original strings (offsets) var $table_translations = NULL; // table for translated strings (offsets) var $cache_translations = NULL; // original -> translation mapping /* Methods */ /** * Reads a 32bit Integer from the Stream * * @access private * @return Integer from the Stream */ function readint() { if ($this->BYTEORDER == 0) { // low endian $low_end = unpack('V', $this->STREAM->read(4)); return array_shift($low_end); } else { // big endian $big_end = unpack('N', $this->STREAM->read(4)); return array_shift($big_end); } } /** * Reads an array of Integers from the Stream * * @param int count How many elements should be read * @return Array of Integers */ function readintarray($count) { if ($this->BYTEORDER == 0) { // low endian return unpack('V'.$count, $this->STREAM->read(4 * $count)); } else { // big endian return unpack('N'.$count, $this->STREAM->read(4 * $count)); } } /** * Constructor * * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ function gettext_reader($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; return; } // Caching can be turned off $this->enable_cache = $enable_cache; // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565 $MAGIC1 = (int) - 1794895138; // $MAGIC2 = (int)0xde120495; //bug $MAGIC2 = (int) - 569244523; // 64-bit fix $MAGIC3 = (int) 2500072158; $this->STREAM = $Reader; $magic = $this->readint(); if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms $this->BYTEORDER = 0; } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) { $this->BYTEORDER = 1; } else { $this->error = 1; // not MO file return false; } // FIXME: Do we care about revision? We should. $revision = $this->readint(); $this->total = $this->readint(); $this->originals = $this->readint(); $this->translations = $this->readint(); } /** * Loads the translation tables from the MO file into the cache * If caching is enabled, also loads all strings into a cache * to speed up translation lookups * * @access private */ function load_tables() { if (is_array($this->cache_translations) && is_array($this->table_originals) && is_array($this->table_translations)) return; /* get original and translations tables */ $this->STREAM->seekto($this->originals); $this->table_originals = $this->readintarray($this->total * 2); $this->STREAM->seekto($this->translations); $this->table_translations = $this->readintarray($this->total * 2); if ($this->enable_cache) { $this->cache_translations = array (); /* read all strings in the cache */ for ($i = 0; $i < $this->total; $i++) { $this->STREAM->seekto($this->table_originals[$i * 2 + 2]); $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]); $this->STREAM->seekto($this->table_translations[$i * 2 + 2]); $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]); $this->cache_translations[$original] = $translation; } } } /** * Returns a string from the "originals" table * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' */ function get_original_string($num) { $length = $this->table_originals[$num * 2 + 1]; $offset = $this->table_originals[$num * 2 + 2]; if (! $length) return ''; $this->STREAM->seekto($offset); $data = $this->STREAM->read($length); return (string)$data; } /** * Returns a string from the "translations" table * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' */ function get_translation_string($num) { $length = $this->table_translations[$num * 2 + 1]; $offset = $this->table_translations[$num * 2 + 2]; if (! $length) return ''; $this->STREAM->seekto($offset); $data = $this->STREAM->read($length); return (string)$data; } /** * Binary search for string * * @access private * @param string string * @param int start (internally used in recursive function) * @param int end (internally used in recursive function) * @return int string number (offset in originals table) */ function find_string($string, $start = -1, $end = -1) { if (($start == -1) or ($end == -1)) { // find_string is called with only one parameter, set start end end $start = 0; $end = $this->total; } if (abs($start - $end) <= 1) { // We're done, now we either found the string, or it doesn't exist $txt = $this->get_original_string($start); if ($string == $txt) return $start; else return -1; } else if ($start > $end) { // start > end -> turn around and start over return $this->find_string($string, $end, $start); } else { // Divide table in two parts $half = (int)(($start + $end) / 2); $cmp = strcmp($string, $this->get_original_string($half)); if ($cmp == 0) // string is exactly in the middle => return it return $half; else if ($cmp < 0) // The string is in the upper half return $this->find_string($string, $start, $half); else // The string is in the lower half return $this->find_string($string, $half, $end); } } /** * Translates a string * * @access public * @param string string to be translated * @return string translated string (or original, if not found) */ function translate($string) { if ($this->short_circuit) return $string; $this->load_tables(); if ($this->enable_cache) { // Caching enabled, get translated string from cache if (array_key_exists($string, $this->cache_translations)) return $this->cache_translations[$string]; else return $string; } else { // Caching not enabled, try to find string $num = $this->find_string($string); if ($num == -1) return $string; else return $this->get_translation_string($num); } } /** * Get possible plural forms from MO header * * @access private * @return string plural form header */ function get_plural_forms() { // lets assume message number 0 is header // this is true, right? $this->load_tables(); // cache header field for plural forms if (! is_string($this->pluralheader)) { if ($this->enable_cache) { $header = $this->cache_translations[""]; } else { $header = $this->get_translation_string(0); } $header .= "\n"; //make sure our regex matches if (eregi("plural-forms: ([^\n]*)\n", $header, $regs)) $expr = $regs[1]; else $expr = "nplurals=2; plural=n == 1 ? 0 : 1;"; // add parentheses // important since PHP's ternary evaluates from left to right $expr.= ';'; $res= ''; $p= 0; for ($i= 0; $i < strlen($expr); $i++) { $ch= $expr[$i]; switch ($ch) { case '?': $res.= ' ? ('; $p++; break; case ':': $res.= ') : ('; break; case ';': $res.= str_repeat( ')', $p) . ';'; $p= 0; break; default: $res.= $ch; } } $this->pluralheader = $res; } return $this->pluralheader; } /** * Detects which plural form to take * * @access private * @param n count * @return int array index of the right plural form */ function select_string($n) { if (is_null($this->select_string_function)) { $string = $this->get_plural_forms(); if (preg_match("/nplurals\s*=\s*(\d+)\s*\;\s*plural\s*=\s*(.*?)\;+/", $string, $matches)) { $nplurals = $matches[1]; $expression = $matches[2]; $expression = str_replace("n", '$n', $expression); } else { $nplurals = 2; $expression = ' $n == 1 ? 0 : 1 '; } $func_body = " \$plural = ($expression); return (\$plural <= $nplurals)? \$plural : \$plural - 1;"; $this->select_string_function = create_function('$n', $func_body); } return call_user_func($this->select_string_function, $n); } /** * Plural version of gettext * * @access public * @param string single * @param string plural * @param string number * @return translated plural form */ function ngettext($single, $plural, $number) { if ($this->short_circuit) { if ($number != 1) return $plural; else return $single; } // find out the appropriate form $select = $this->select_string($number); // this should contains all strings separated by NULLs $key = $single.chr(0).$plural; if ($this->enable_cache) { if (! array_key_exists($key, $this->cache_translations)) { return ($number != 1) ? $plural : $single; } else { $result = $this->cache_translations[$key]; $list = explode(chr(0), $result); return $list[$select]; } } else { $num = $this->find_string($key); if ($num == -1) { return ($number != 1) ? $plural : $single; } else { $result = $this->get_translation_string($num); $list = explode(chr(0), $result); return $list[$select]; } } } } ?> wp-includes/images/0000755013707600007620000000000010706137424012263 5ustar wwwwp-includes/images/rss.png0000644013707600007620000000641510613235656013611 0ustar wwwPNG  IHDRH- pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-gAMA|Q cHRMz%u0`:o_F(IDATxڌOHTQ&^4H(0"Th-ZԢ]mpT $E-29X:{B,ߏw$maX6FMkhw, 4T:(1o %JK&{19X T!v+b *(hr@:Z81szRvH57v@cѻ~ 5`+`| VXʮG.&<Ї5lu-5=%|@{'RwQz߇-.n"&:*^]+ Bŧ+O7tQŧ#x~v6f᝼B(7Ju}a4-cCIh 1U0Qi'^BAq#6pmةE$OWjBZ# ʫJtCN dSgh7}ZJL%qqa.'Qh&\@ ,)CyH#~ӝ&Oc@GIENDB`wp-includes/images/smilies/0000755013707600007620000000000010706137424013730 5ustar wwwwp-includes/images/smilies/icon_arrow.gif0000644013707600007620000000025210304117240016544 0ustar wwwGIF89a EEE! ,WIjՕpELAgpj BUvsC; `"fs2([Lhբa~fX$;wp-includes/images/smilies/icon_biggrin.gif0000644013707600007620000000025410304117240017035 0ustar wwwGIF89a EEE! ,YI jե"pIL@gpj)wjʛ pJQl:`J PJ4ZNB oYbe6;wp-includes/images/smilies/icon_confused.gif0000644013707600007620000000025310304117240017221 0ustar wwwGIF89a EEE! ,XIjՕpCLA''vqj ?*pƂ!\ 'pd/N3(^0-U&kQ@7 3,Km;wp-includes/images/smilies/icon_cool.gif0000644013707600007620000000025410304117240016350 0ustar wwwGIF89a EEE! ,YIjUpCLAgpj k+;vECp4xevE+mAPiN X:o(`e6;wp-includes/images/smilies/icon_cry.gif0000644013707600007620000000076210304117240016215 0ustar wwwGIF89aEEE؁^^^! NETSCAPE2.0!,\ $AY(T.q 'CA+@An:AJaC" &8tp: 7tgUYj0x !N2Q)<&D#!!, $@HdҜM0lB! ,`@! , @&!! , @HdBI! , `dhB!! ,`@! , @&!! , @Hh "&i;wp-includes/images/smilies/icon_eek.gif0000644013707600007620000000025210304117240016156 0ustar wwwGIF89a EEE! ,WI9jŔ"I"c0@6r +ﱫۮ00P6 F IEy,(i%`'pa6g1܀}g4$;wp-includes/images/smilies/icon_evil.gif0000644013707600007620000000035410304117240016354 0ustar wwwGIF89aEEE*m!,i @h$*2FC5@NG @ ꚱ- h>h)@T]ᰥ"ij,cIwdGk+:G(F()Z#&(!;wp-includes/images/smilies/icon_exclaim.gif0000644013707600007620000000035410304117240017037 0ustar wwwGIF89aEEEuŵ///qoWrpXJG)mkSSO&!,i`'AYhW6q'܂Ak' NG:@!n;"/` tZ(v 8θ,n RپIFr9;})%U)<&#!;wp-includes/images/smilies/icon_idea.gif0000644013707600007620000000026010304117240016313 0ustar wwwGIF89a EEE! ,]I jUR"pL@g 0R;~C%q2d|>ORԌݶ(¢VhB 3 ̰,p;wp-includes/images/smilies/icon_lol.gif0000644013707600007620000000052010304117240016176 0ustar wwwGIF89a EEE! NETSCAPE2.0! ,ZI jեR",AyhTr 1r)\aɎC%<DiJ-A v; Y-4jQ҅xn x1cd"! , I$[8ͫa4 D! ,PH9j! ,0H)j! ,PH9j! ,0H)j;wp-includes/images/smilies/icon_mad.gif0000644013707600007620000000025610304117240016157 0ustar wwwGIF89a EEE! ,[IjեpLA'a'j *`pP9ĞAf-+`W A& ;`mXk\ 0ò&;wp-includes/images/smilies/icon_mrgreen.gif0000644013707600007620000000053510304117240017055 0ustar wwwGIF89aܱگخ֬ҩΦʢȡƟĞ}|yroli~e|dx`!',zP(Sqi( G$@s40t6EcQlx }8 %`$P!F E" E#E%t$\J&EFD%#"! QIJIA;wp-includes/images/smilies/icon_neutral.gif0000644013707600007620000000025310304117240017065 0ustar wwwGIF89a EEE! ,XIjՕpCLA' vpj A88r9ʊ)\ԓbd`a -e&kQ@73,Km;wp-includes/images/smilies/icon_question.gif0000644013707600007620000000037010304117240017262 0ustar wwwGIF89aEEEuϾ/+_W߰of!,u&@YVNq' @k,TAIPgK@L`$[CJgMh%x \Szb Q[0$VF<2])<&G#!;wp-includes/images/smilies/icon_razz.gif0000644013707600007620000000026010304117240016377 0ustar wwwGIF89aEEE333!,]IjեRpLA''𦫖qj *pƂJ" `<+kYa<v *~20̰,5;wp-includes/images/smilies/icon_redface.gif0000644013707600007620000000121210304117240017000 0ustar wwwGIF89al[hhu҇isJEEE˃__H6{! NETSCAPE2.0!,f'MYWND'ڰьM@NnA`8]#c<P*ȈW[d|.8w @ mxD qj:<2ylR)<&D#!! , Q'~D8]0kHN.O\[͐ x H  ̓TAfPIxEhJTE!!2, H'NAJc3]j+WOT-$ERBgJ-ˑ%-3|nQu- ! , P'Ac:uX~n"A6;Fhl4C1`xf"05u0e|< PTADhJE!;wp-includes/images/smilies/icon_rolleyes.gif0000644013707600007620000000074510304117240017257 0ustar wwwGIF89a EEE! NETSCAPE2.0! ,^I jUpL@'g𦫆E:%\PtdPA^;( 0=c2yO J>`c`@ia(fX5! , YVؠg! , F嬳Ԧ.!2 , P$-'! ,  "! , Fe+0ZE! , I!2T]U*B)@LMZXYr! , I%[8WA'&1^! , I!8K[BhPH(F;wp-includes/images/smilies/icon_sad.gif0000644013707600007620000000025310304117240016162 0ustar wwwGIF89a EEE! ,XIjՕpCLA'1%&p'*pnCk3 'pe= ߧN3 U&ݳL@7 3, m;wp-includes/images/smilies/icon_smile.gif0000644013707600007620000000025610304117240016527 0ustar wwwGIF89aEEE333!,[IjUpLA''vqj ?*pƂ!Ӣ X<+kYAb<v5Xj\ 0ò&;wp-includes/images/smilies/icon_surprised.gif0000644013707600007620000000025610304117240017436 0ustar wwwGIF89a EEE! ,[IjU"pILA''𦫆qj *pƂ ":=+`,@VvaA6XT0ò&;wp-includes/images/smilies/icon_twisted.gif0000644013707600007620000000035610304117240017102 0ustar wwwGIF89aEEE*333m!,k DhɘВ$*>DE5@NG @ ꚱ- h> h)8T]°ij,c pّJ<G(F1|FZ(%Z#&(!;wp-includes/images/smilies/icon_wink.gif0000644013707600007620000000025210304117240016362 0ustar wwwGIF89a EEE! ,WIjՕpCLA'00%&p/*p`C%+fP4OpUł:`kLhբanfX$;wp-includes/js/0000755013707600007620000000000010706137424011432 5ustar wwwwp-includes/js/autosave.js0000644013707600007620000001301510573314066013620 0ustar wwwvar autosaveLast = ''; var autosavePeriodical; function autosave_start_timer() { var form = $('post'); autosaveLast = form.post_title.value+form.content.value; // Keep autosave_interval in sync with edit_post(). autosavePeriodical = new PeriodicalExecuter(autosave, autosaveL10n.autosaveInterval); //Disable autosave after the form has been submitted if(form.addEventListener) { form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false); } if(form.attachEvent) { form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; } } addLoadEvent(autosave_start_timer) function autosave_cur_time() { var now = new Date(); return "" + ((now.getHours() >12) ? now.getHours() -12 : now.getHours()) + ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes() + ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds(); } function autosave_update_nonce() { var response = nonceAjax.response; document.getElementsByName('_wpnonce')[0].value = response; } function autosave_update_post_ID() { var response = autosaveAjax.response; var res = parseInt(response); var message; if(isNaN(res)) { message = autosaveL10n.errorText.replace(/%response%/g, response); } else { message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time()); $('post_ID').name = "post_ID"; $('post_ID').value = res; // We need new nonces nonceAjax = new sack(); nonceAjax.element = null; nonceAjax.setVar("action", "autosave-generate-nonces"); nonceAjax.setVar("post_ID", res); nonceAjax.setVar("cookie", document.cookie); nonceAjax.setVar("post_type", $('post_type').value); nonceAjax.requestFile = autosaveL10n.requestFile; nonceAjax.onCompletion = autosave_update_nonce; nonceAjax.method = "POST"; nonceAjax.runAJAX(); $('hiddenaction').value = 'editpost'; } $('autosave').innerHTML = message; autosave_enable_buttons(); } function autosave_loading() { $('autosave').innerHTML = autosaveL10n.savingText; } function autosave_saved() { var response = autosaveAjax.response; var res = parseInt(response); var message; if(isNaN(res)) { message = autosaveL10n.errorText.replace(/%response%/g, response); } else { message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time()); } $('autosave').innerHTML = message; autosave_enable_buttons(); } function autosave_disable_buttons() { var form = $('post'); form.save ? form.save.disabled = 'disabled' : null; form.submit ? form.submit.disabled = 'disabled' : null; form.publish ? form.publish.disabled = 'disabled' : null; form.deletepost ? form.deletepost.disabled = 'disabled' : null; setTimeout('autosave_enable_buttons();', 1000); // Re-enable 1 sec later. Just gives autosave a head start to avoid collisions. } function autosave_enable_buttons() { var form = $('post'); form.save ? form.save.disabled = '' : null; form.submit ? form.submit.disabled = '' : null; form.publish ? form.publish.disabled = '' : null; form.deletepost ? form.deletepost.disabled = '' : null; } function autosave() { var form = $('post'); var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; autosaveAjax = new sack(); /* Gotta do this up here so we can check the length when tinyMCE is in use */ if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { autosaveAjax.setVar("content", form.content.value); } else { // Don't run while the TinyMCE spellcheck is on. if(tinyMCE.selectedInstance.spellcheckerOn) return; tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value); } if(form.post_title.value.length==0 || form.content.value.length==0 || form.post_title.value+form.content.value == autosaveLast) return; autosave_disable_buttons(); autosaveLast = form.post_title.value+form.content.value; cats = document.getElementsByName("post_category[]"); goodcats = ([]); for(i=0;i // WWW: http://www.mattkruse.com/ // // NOTICE: You may use this code for any purpose, commercial or // private, without any further permission from the author. You may // remove this notice from your final code if you wish, however it is // appreciated by the author if at least my web site address is kept. // // You may *NOT* re-distribute this code in any way except through its // use. That means, you can include it in your product, or your web // site, or any other form where the code is actually being used. You // may not put the plain javascript up on your site for download or // include it in your javascript libraries for download. // If you wish to share this code with others, please just point them // to the URL instead. // Please DO NOT link directly to my .js files from your site. Copy // the files to your server and use them there. Thank you. // =================================================================== /* SOURCE FILE: AnchorPosition.js */ /* AnchorPosition.js Author: Matt Kruse Last modified: 10/11/02 DESCRIPTION: These functions find the position of an tag in a document, so other elements can be positioned relative to it. COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small positioning errors - usually with Window positioning - occur on the Macintosh platform. FUNCTIONS: getAnchorPosition(anchorname) Returns an Object() having .x and .y properties of the pixel coordinates of the upper-left corner of the anchor. Position is relative to the PAGE. getAnchorWindowPosition(anchorname) Returns an Object() having .x and .y properties of the pixel coordinates of the upper-left corner of the anchor, relative to the WHOLE SCREEN. NOTES: 1) For popping up separate browser windows, use getAnchorWindowPosition. Otherwise, use getAnchorPosition 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: 3) There must be at least a space between for IE5.5 to see the anchor tag correctly. Do not do with no space. */ // getAnchorPosition(anchorname) // This function returns an object having .x and .y properties which are the coordinates // of the named anchor, relative to the page. function getAnchorPosition(anchorname) { // This function will return an Object with x and y properties var useWindow=false; var coordinates=new Object(); var x=0,y=0; // Browser capability sniffing var use_gebi=false, use_css=false, use_layers=false; if (document.getElementById) { use_gebi=true; } else if (document.all) { use_css=true; } else if (document.layers) { use_layers=true; } // Logic to find position if (use_gebi && document.all) { x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); } else if (use_gebi) { var o=document.getElementById(anchorname); x=AnchorPosition_getPageOffsetLeft(o); y=AnchorPosition_getPageOffsetTop(o); } else if (use_css) { x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); } else if (use_layers) { var found=0; for (var i=0; i tags may cause errors. USAGE: // Create an object for a WINDOW popup var win = new PopupWindow(); // Create an object for a DIV window using the DIV named 'mydiv' var win = new PopupWindow('mydiv'); // Set the window to automatically hide itself when the user clicks // anywhere else on the page except the popup win.autoHide(); // Show the window relative to the anchor name passed in win.showPopup(anchorname); // Hide the popup win.hidePopup(); // Set the size of the popup window (only applies to WINDOW popups win.setSize(width,height); // Populate the contents of the popup window that will be shown. If you // change the contents while it is displayed, you will need to refresh() win.populate(string); // set the URL of the window, rather than populating its contents // manually win.setUrl("http://www.site.com/"); // Refresh the contents of the popup win.refresh(); // Specify how many pixels to the right of the anchor the popup will appear win.offsetX = 50; // Specify how many pixels below the anchor the popup will appear win.offsetY = 100; NOTES: 1) Requires the functions in AnchorPosition.js 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: 3) There must be at least a space between for IE5.5 to see the anchor tag correctly. Do not do with no space. 4) When a PopupWindow object is created, a handler for 'onmouseup' is attached to any event handler you may have already defined. Do NOT define an event handler for 'onmouseup' after you define a PopupWindow object or the autoHide() will not work correctly. */ // Set the position of the popup window based on the anchor function PopupWindow_getXYPosition(anchorname) { var coordinates; if (this.type == "WINDOW") { coordinates = getAnchorWindowPosition(anchorname); } else { coordinates = getAnchorPosition(anchorname); } this.x = coordinates.x; this.y = coordinates.y; } // Set width/height of DIV/popup window function PopupWindow_setSize(width,height) { this.width = width; this.height = height; } // Fill the window with contents function PopupWindow_populate(contents) { this.contents = contents; this.populated = false; } // Set the URL to go to function PopupWindow_setUrl(url) { this.url = url; } // Set the window popup properties function PopupWindow_setWindowProperties(props) { this.windowProperties = props; } // Refresh the displayed contents of the popup function PopupWindow_refresh() { if (this.divName != null) { // refresh the DIV object if (this.use_gebi) { document.getElementById(this.divName).innerHTML = this.contents; } else if (this.use_css) { document.all[this.divName].innerHTML = this.contents; } else if (this.use_layers) { var d = document.layers[this.divName]; d.document.open(); d.document.writeln(this.contents); d.document.close(); } } else { if (this.popupWindow != null && !this.popupWindow.closed) { if (this.url!="") { this.popupWindow.location.href=this.url; } else { this.popupWindow.document.open(); this.popupWindow.document.writeln(this.contents); this.popupWindow.document.close(); } this.popupWindow.focus(); } } } // Position and show the popup, relative to an anchor object function PopupWindow_showPopup(anchorname) { this.getXYPosition(anchorname); this.x += this.offsetX; this.y += this.offsetY; if (!this.populated && (this.contents != "")) { this.populated = true; this.refresh(); } if (this.divName != null) { // Show the DIV object if (this.use_gebi) { document.getElementById(this.divName).style.left = this.x + "px"; document.getElementById(this.divName).style.top = this.y; document.getElementById(this.divName).style.visibility = "visible"; } else if (this.use_css) { document.all[this.divName].style.left = this.x; document.all[this.divName].style.top = this.y; document.all[this.divName].style.visibility = "visible"; } else if (this.use_layers) { document.layers[this.divName].left = this.x; document.layers[this.divName].top = this.y; document.layers[this.divName].visibility = "visible"; } } else { if (this.popupWindow == null || this.popupWindow.closed) { // If the popup window will go off-screen, move it so it doesn't if (this.x<0) { this.x=0; } if (this.y<0) { this.y=0; } if (screen && screen.availHeight) { if ((this.y + this.height) > screen.availHeight) { this.y = screen.availHeight - this.height; } } if (screen && screen.availWidth) { if ((this.x + this.width) > screen.availWidth) { this.x = screen.availWidth - this.width; } } var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ); this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+""); } this.refresh(); } } // Hide the popup function PopupWindow_hidePopup() { if (this.divName != null) { if (this.use_gebi) { document.getElementById(this.divName).style.visibility = "hidden"; } else if (this.use_css) { document.all[this.divName].style.visibility = "hidden"; } else if (this.use_layers) { document.layers[this.divName].visibility = "hidden"; } } else { if (this.popupWindow && !this.popupWindow.closed) { this.popupWindow.close(); this.popupWindow = null; } } } // Pass an event and return whether or not it was the popup DIV that was clicked function PopupWindow_isClicked(e) { if (this.divName != null) { if (this.use_layers) { var clickX = e.pageX; var clickY = e.pageY; var t = document.layers[this.divName]; if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) { return true; } else { return false; } } else if (document.all) { // Need to hard-code this to trap IE for error-handling var t = window.event.srcElement; while (t.parentElement != null) { if (t.id==this.divName) { return true; } t = t.parentElement; } return false; } else if (this.use_gebi && e) { var t = e.originalTarget; while (t.parentNode != null) { if (t.id==this.divName) { return true; } t = t.parentNode; } return false; } return false; } return false; } // Check an onMouseDown event to see if we should hide function PopupWindow_hideIfNotClicked(e) { if (this.autoHideEnabled && !this.isClicked(e)) { this.hidePopup(); } } // Call this to make the DIV disable automatically when mouse is clicked outside it function PopupWindow_autoHide() { this.autoHideEnabled = true; } // This global function checks all PopupWindow objects onmouseup to see if they should be hidden function PopupWindow_hidePopupWindows(e) { for (var i=0; i0) { this.type="DIV"; this.divName = arguments[0]; } else { this.type="WINDOW"; } this.use_gebi = false; this.use_css = false; this.use_layers = false; if (document.getElementById) { this.use_gebi = true; } else if (document.all) { this.use_css = true; } else if (document.layers) { this.use_layers = true; } else { this.type = "WINDOW"; } this.offsetX = 0; this.offsetY = 0; // Method mappings this.getXYPosition = PopupWindow_getXYPosition; this.populate = PopupWindow_populate; this.setUrl = PopupWindow_setUrl; this.setWindowProperties = PopupWindow_setWindowProperties; this.refresh = PopupWindow_refresh; this.showPopup = PopupWindow_showPopup; this.hidePopup = PopupWindow_hidePopup; this.setSize = PopupWindow_setSize; this.isClicked = PopupWindow_isClicked; this.autoHide = PopupWindow_autoHide; this.hideIfNotClicked = PopupWindow_hideIfNotClicked; } /* SOURCE FILE: ColorPicker2.js */ /* Last modified: 02/24/2003 DESCRIPTION: This widget is used to select a color, in hexadecimal #RRGGBB form. It uses a color "swatch" to display the standard 216-color web-safe palette. The user can then click on a color to select it. COMPATABILITY: See notes in AnchorPosition.js and PopupWindow.js. Only the latest DHTML-capable browsers will show the color and hex values at the bottom as your mouse goes over them. USAGE: // Create a new ColorPicker object using DHTML popup var cp = new ColorPicker(); // Create a new ColorPicker object using Window Popup var cp = new ColorPicker('window'); // Add a link in your page to trigger the popup. For example: Pick // Or use the built-in "select" function to do the dirty work for you: Pick // If using DHTML popup, write out the required DIV tag near the bottom // of your page. // Write the 'pickColor' function that will be called when the user clicks // a color and do something with the value. This is only required if you // want to do something other than simply populate a form field, which is // what the 'select' function will give you. function pickColor(color) { field.value = color; } NOTES: 1) Requires the functions in AnchorPosition.js and PopupWindow.js 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: 3) There must be at least a space between for IE5.5 to see the anchor tag correctly. Do not do with no space. 4) When a ColorPicker object is created, a handler for 'onmouseup' is attached to any event handler you may have already defined. Do NOT define an event handler for 'onmouseup' after you define a ColorPicker object or the color picker will not hide itself correctly. */ ColorPicker_targetInput = null; function ColorPicker_writeDiv() { document.writeln(""); } function ColorPicker_show(anchorname) { this.showPopup(anchorname); } function ColorPicker_pickColor(color,obj) { obj.hidePopup(); pickColor(color); } // A Default "pickColor" function to accept the color passed back from popup. // User can over-ride this with their own function. function pickColor(color) { if (ColorPicker_targetInput==null) { alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!"); return; } ColorPicker_targetInput.value = color; } // This function is the easiest way to popup the window, select a color, and // have the value populate a form field, which is what most people want to do. function ColorPicker_select(inputobj,linkname) { if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { alert("colorpicker.select: Input object passed is not a valid form input object"); window.ColorPicker_targetInput=null; return; } window.ColorPicker_targetInput = inputobj; this.show(linkname); } // This function runs when you move your mouse over a color block, if you have a newer browser function ColorPicker_highlightColor(c) { var thedoc = (arguments.length>1)?arguments[1]:window.document; var d = thedoc.getElementById("colorPickerSelectedColor"); d.style.backgroundColor = c; d = thedoc.getElementById("colorPickerSelectedColorValue"); d.innerHTML = c; } function ColorPicker() { var windowMode = false; // Create a new PopupWindow object if (arguments.length==0) { var divname = "colorPickerDiv"; } else if (arguments[0] == "window") { var divname = ''; windowMode = true; } else { var divname = arguments[0]; } if (divname != "") { var cp = new PopupWindow(divname); } else { var cp = new PopupWindow(); cp.setSize(225,250); } // Object variables cp.currentValue = "#FFFFFF"; // Method Mappings cp.writeDiv = ColorPicker_writeDiv; cp.highlightColor = ColorPicker_highlightColor; cp.show = ColorPicker_show; cp.select = ColorPicker_select; // Code to populate color picker window var colors = new Array( "#4180B6","#69AEE7","#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099", "#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099", "#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099", "#FF00CC","#FF00FF","#7FFFFF","#7FFFFF","#7FF7F7","#7FEFEF","#7FE7E7","#7FDFDF","#7FD7D7","#7FCFCF","#7FC7C7","#7FBFBF", "#7FB7B7","#7FAFAF","#7FA7A7","#7F9F9F","#7F9797","#7F8F8F","#7F8787","#7F7F7F","#7F7777","#7F6F6F","#7F6767","#7F5F5F", "#7F5757","#7F4F4F","#7F4747","#7F3F3F","#7F3737","#7F2F2F","#7F2727","#7F1F1F","#7F1717","#7F0F0F","#7F0707","#7F0000", "#4180B6","#69AEE7","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399", "#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399", "#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399", "#FF33CC","#FF33FF","#FF7FFF","#FF7FFF","#F77FF7","#EF7FEF","#E77FE7","#DF7FDF","#D77FD7","#CF7FCF","#C77FC7","#BF7FBF", "#B77FB7","#AF7FAF","#A77FA7","#9F7F9F","#977F97","#8F7F8F","#877F87","#7F7F7F","#777F77","#6F7F6F","#677F67","#5F7F5F", "#577F57","#4F7F4F","#477F47","#3F7F3F","#377F37","#2F7F2F","#277F27","#1F7F1F","#177F17","#0F7F0F","#077F07","#007F00", "#4180B6","#69AEE7","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699", "#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699", "#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699", "#FF66CC","#FF66FF","#FFFF7F","#FFFF7F","#F7F77F","#EFEF7F","#E7E77F","#DFDF7F","#D7D77F","#CFCF7F","#C7C77F","#BFBF7F", "#B7B77F","#AFAF7F","#A7A77F","#9F9F7F","#97977F","#8F8F7F","#87877F","#7F7F7F","#77777F","#6F6F7F","#67677F","#5F5F7F", "#57577F","#4F4F7F","#47477F","#3F3F7F","#37377F","#2F2F7F","#27277F","#1F1F7F","#17177F","#0F0F7F","#07077F","#00007F", "#4180B6","#69AEE7","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999", "#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999", "#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999", "#FF99CC","#FF99FF","#3FFFFF","#3FFFFF","#3FF7F7","#3FEFEF","#3FE7E7","#3FDFDF","#3FD7D7","#3FCFCF","#3FC7C7","#3FBFBF", "#3FB7B7","#3FAFAF","#3FA7A7","#3F9F9F","#3F9797","#3F8F8F","#3F8787","#3F7F7F","#3F7777","#3F6F6F","#3F6767","#3F5F5F", "#3F5757","#3F4F4F","#3F4747","#3F3F3F","#3F3737","#3F2F2F","#3F2727","#3F1F1F","#3F1717","#3F0F0F","#3F0707","#3F0000", "#4180B6","#69AEE7","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99", "#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99", "#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99", "#FFCCCC","#FFCCFF","#FF3FFF","#FF3FFF","#F73FF7","#EF3FEF","#E73FE7","#DF3FDF","#D73FD7","#CF3FCF","#C73FC7","#BF3FBF", "#B73FB7","#AF3FAF","#A73FA7","#9F3F9F","#973F97","#8F3F8F","#873F87","#7F3F7F","#773F77","#6F3F6F","#673F67","#5F3F5F", "#573F57","#4F3F4F","#473F47","#3F3F3F","#373F37","#2F3F2F","#273F27","#1F3F1F","#173F17","#0F3F0F","#073F07","#003F00", "#4180B6","#69AEE7","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99", "#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99", "#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99", "#FFFFCC","#FFFFFF","#FFFF3F","#FFFF3F","#F7F73F","#EFEF3F","#E7E73F","#DFDF3F","#D7D73F","#CFCF3F","#C7C73F","#BFBF3F", "#B7B73F","#AFAF3F","#A7A73F","#9F9F3F","#97973F","#8F8F3F","#87873F","#7F7F3F","#77773F","#6F6F3F","#67673F","#5F5F3F", "#57573F","#4F4F3F","#47473F","#3F3F3F","#37373F","#2F2F3F","#27273F","#1F1F3F","#17173F","#0F0F3F","#07073F","#00003F", "#4180B6","#69AEE7","#FFFFFF","#FFEEEE","#FFDDDD","#FFCCCC","#FFBBBB","#FFAAAA","#FF9999","#FF8888","#FF7777","#FF6666", "#FF5555","#FF4444","#FF3333","#FF2222","#FF1111","#FF0000","#FF0000","#FF0000","#FF0000","#EE0000","#DD0000","#CC0000", "#BB0000","#AA0000","#990000","#880000","#770000","#660000","#550000","#440000","#330000","#220000","#110000","#000000", "#000000","#000000","#000000","#001111","#002222","#003333","#004444","#005555","#006666","#007777","#008888","#009999", "#00AAAA","#00BBBB","#00CCCC","#00DDDD","#00EEEE","#00FFFF","#00FFFF","#00FFFF","#00FFFF","#11FFFF","#22FFFF","#33FFFF", "#44FFFF","#55FFFF","#66FFFF","#77FFFF","#88FFFF","#99FFFF","#AAFFFF","#BBFFFF","#CCFFFF","#DDFFFF","#EEFFFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEFFEE","#DDFFDD","#CCFFCC","#BBFFBB","#AAFFAA","#99FF99","#88FF88","#77FF77","#66FF66", "#55FF55","#44FF44","#33FF33","#22FF22","#11FF11","#00FF00","#00FF00","#00FF00","#00FF00","#00EE00","#00DD00","#00CC00", "#00BB00","#00AA00","#009900","#008800","#007700","#006600","#005500","#004400","#003300","#002200","#001100","#000000", "#000000","#000000","#000000","#110011","#220022","#330033","#440044","#550055","#660066","#770077","#880088","#990099", "#AA00AA","#BB00BB","#CC00CC","#DD00DD","#EE00EE","#FF00FF","#FF00FF","#FF00FF","#FF00FF","#FF11FF","#FF22FF","#FF33FF", "#FF44FF","#FF55FF","#FF66FF","#FF77FF","#FF88FF","#FF99FF","#FFAAFF","#FFBBFF","#FFCCFF","#FFDDFF","#FFEEFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEEEFF","#DDDDFF","#CCCCFF","#BBBBFF","#AAAAFF","#9999FF","#8888FF","#7777FF","#6666FF", "#5555FF","#4444FF","#3333FF","#2222FF","#1111FF","#0000FF","#0000FF","#0000FF","#0000FF","#0000EE","#0000DD","#0000CC", "#0000BB","#0000AA","#000099","#000088","#000077","#000066","#000055","#000044","#000033","#000022","#000011","#000000", "#000000","#000000","#000000","#111100","#222200","#333300","#444400","#555500","#666600","#777700","#888800","#999900", "#AAAA00","#BBBB00","#CCCC00","#DDDD00","#EEEE00","#FFFF00","#FFFF00","#FFFF00","#FFFF00","#FFFF11","#FFFF22","#FFFF33", "#FFFF44","#FFFF55","#FFFF66","#FFFF77","#FFFF88","#FFFF99","#FFFFAA","#FFFFBB","#FFFFCC","#FFFFDD","#FFFFEE","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#FFFFFF","#FBFBFB","#F7F7F7","#F3F3F3","#EFEFEF","#EBEBEB","#E7E7E7","#E3E3E3","#DFDFDF", "#DBDBDB","#D7D7D7","#D3D3D3","#CFCFCF","#CBCBCB","#C7C7C7","#C3C3C3","#BFBFBF","#BBBBBB","#B7B7B7","#B3B3B3","#AFAFAF", "#ABABAB","#A7A7A7","#A3A3A3","#9F9F9F","#9B9B9B","#979797","#939393","#8F8F8F","#8B8B8B","#878787","#838383","#7F7F7F", "#7B7B7B","#777777","#737373","#6F6F6F","#6B6B6B","#676767","#636363","#5F5F5F","#5B5B5B","#575757","#535353","#4F4F4F", "#4B4B4B","#474747","#434343","#3F3F3F","#3B3B3B","#373737","#333333","#2F2F2F","#2B2B2B","#272727","#232323","#1F1F1F", "#1B1B1B","#171717","#131313","#0F0F0F","#0B0B0B","#070707","#030303","#000000","#000000","#000000","#000000","#000000"); var total = colors.length; var width = 72; var cp_contents = ""; var windowRef = (windowMode)?"window.opener.":""; if (windowMode) { cp_contents += "Select Color"; cp_contents += "
    "; } cp_contents += ""; var use_highlight = (document.getElementById || document.all)?true:false; for (var i=0; i '; if ( ((i+1)>=total) || (((i+1) % width) == 0)) { cp_contents += ""; } } // If the browser supports dynamically changing TD cells, add the fancy stuff if (document.getElementById) { var width1 = Math.floor(width/2); var width2 = width = width1; cp_contents += ""; } cp_contents += "
     #FFFFFF
    "; if (windowMode) { cp_contents += "
    "; } // end populate code // Write the contents to the popup object cp.populate(cp_contents+"\n"); // Move the table down a bit so you can see it cp.offsetY = 25; cp.autoHide(); return cp; } wp-includes/js/crop/0000755013707600007620000000000010706137424012375 5ustar wwwwp-includes/js/crop/cropper.css0000644013707600007620000000560610536117602014565 0ustar www.imgCrop_wrap { /* width: 500px; @done_in_js */ /* height: 375px; @done_in_js */ position: relative; cursor: crosshair; } /* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */ .imgCrop_wrap.opera8 .imgCrop_overlay, .imgCrop_wrap.opera8 .imgCrop_clickArea { background-color: transparent; } /* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */ .imgCrop_wrap, .imgCrop_wrap * { font-size: 0; } .imgCrop_overlay { background-color: #000; opacity: 0.5; filter:alpha(opacity=50); position: absolute; width: 100%; height: 100%; } .imgCrop_selArea { position: absolute; /* @done_in_js top: 20px; left: 20px; width: 200px; height: 200px; background: transparent url(castle.jpg) no-repeat -210px -110px; */ cursor: move; z-index: 2; } /* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */ .imgCrop_clickArea { width: 100%; height: 100%; background-color: #FFF; opacity: 0.01; filter:alpha(opacity=01); } .imgCrop_marqueeHoriz { position: absolute; width: 100%; height: 1px; background: transparent url(marqueeHoriz.gif) repeat-x 0 0; z-index: 3; } .imgCrop_marqueeVert { position: absolute; height: 100%; width: 1px; background: transparent url(marqueeVert.gif) repeat-y 0 0; z-index: 3; } .imgCrop_marqueeNorth { top: 0; left: 0; } .imgCrop_marqueeEast { top: 0; right: 0; } .imgCrop_marqueeSouth { bottom: 0px; left: 0; } .imgCrop_marqueeWest { top: 0; left: 0; } .imgCrop_handle { position: absolute; border: 1px solid #333; width: 6px; height: 6px; background: #FFF; opacity: 0.5; filter:alpha(opacity=50); z-index: 4; } /* fix IE 5 box model */ * html .imgCrop_handle { width: 8px; height: 8px; wid\th: 6px; hei\ght: 6px; } .imgCrop_handleN { top: -3px; left: 0; /* margin-left: 49%; @done_in_js */ cursor: n-resize; } .imgCrop_handleNE { top: -3px; right: -3px; cursor: ne-resize; } .imgCrop_handleE { top: 0; right: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleSE { right: -3px; bottom: -3px; cursor: se-resize; } .imgCrop_handleS { right: 0; bottom: -3px; /* margin-right: 49%; @done_in_js */ cursor: s-resize; } .imgCrop_handleSW { left: -3px; bottom: -3px; cursor: sw-resize; } .imgCrop_handleW { top: 0; left: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleNW { top: -3px; left: -3px; cursor: nw-resize; } /** * Create an area to click & drag around on as the default browser behaviour is to let you drag the image */ .imgCrop_dragArea { width: 100%; height: 100%; z-index: 200; position: absolute; top: 0; left: 0; } .imgCrop_previewWrap { /* width: 200px; @done_in_js */ /* height: 200px; @done_in_js */ overflow: hidden; position: relative; } .imgCrop_previewWrap img { position: absolute; }wp-includes/js/crop/cropper.js0000644013707600007620000004014510616707034014411 0ustar www/** * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/) * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * http://www.opensource.org/licenses/bsd-license.php * * See scriptaculous.js for full scriptaculous licence */ var CropDraggable=Class.create(); Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){ this.options=Object.extend({drawMethod:function(){ }},arguments[1]||{}); this.element=$(_1); this.handle=this.element; this.delta=this.currentDelta(); this.dragging=false; this.eventMouseDown=this.initDrag.bindAsEventListener(this); Event.observe(this.handle,"mousedown",this.eventMouseDown); Draggables.register(this); },draw:function(_2){ var _3=Position.cumulativeOffset(this.element); var d=this.currentDelta(); _3[0]-=d[0]; _3[1]-=d[1]; var p=[0,1].map(function(i){ return (_2[i]-_3[i]-this.offset[i]); }.bind(this)); this.options.drawMethod(p); }}); var Cropper={}; Cropper.Img=Class.create(); Cropper.Img.prototype={initialize:function(_7,_8){ this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true},_8||{}); if(this.options.minWidth>0&&this.options.minHeight>0){ this.options.ratioDim.x=this.options.minWidth; this.options.ratioDim.y=this.options.minHeight; } this.img=$(_7); this.clickCoords={x:0,y:0}; this.dragging=false; this.resizing=false; this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent); this.isIE=/MSIE/.test(navigator.userAgent); this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent); this.ratioX=0; this.ratioY=0; this.attached=false; $A(document.getElementsByTagName("script")).each(function(s){ if(s.src.match(/cropper\.js/)){ var _a=s.src.replace(/cropper\.js(.*)?/,""); var _b=document.createElement("link"); _b.rel="stylesheet"; _b.type="text/css"; _b.href=_a+"cropper.css"; _b.media="screen"; document.getElementsByTagName("head")[0].appendChild(_b); } }); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){ var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y); this.ratioX=this.options.ratioDim.x/_c; this.ratioY=this.options.ratioDim.y/_c; } this.subInitialize(); if(this.img.complete||this.isWebKit){ this.onLoad(); }else{ Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this)); } },getGCD:function(a,b){return 1; if(b==0){ return a; } return this.getGCD(b,a%b); },onLoad:function(){ var _f="imgCrop_"; var _10=this.img.parentNode; var _11=""; if(this.isOpera8){ _11=" opera8"; } this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11}); if(this.isIE){ this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]); this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]); this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]); this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]); var _12=[this.north,this.east,this.south,this.west]; }else{ this.overlay=Builder.node("div",{"class":_f+"overlay"}); var _12=[this.overlay]; } this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12); this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"}); this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"}); this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"}); this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"}); this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"}); this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"}); this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); Element.setStyle($(this.selArea),{backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"}); this.imgWrap.appendChild(this.img); this.imgWrap.appendChild(this.dragArea); this.dragArea.appendChild(this.selArea); this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"})); _10.appendChild(this.imgWrap); Event.observe(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.observe(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.observe(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _13=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_13.length;i++){ Event.observe(_13[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.observe(document,"keydown",this.handleKeys.bindAsEventListener(this)); } new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)}); this.setParams(); },setParams:function(){ this.imgW=this.img.width; this.imgH=this.img.height; if(!this.isIE){ Element.setStyle($(this.overlay),{width:this.imgW+"px",height:this.imgH+"px"}); Element.hide($(this.overlay)); Element.setStyle($(this.selArea),{backgroundImage:"url("+this.img.src+")"}); }else{ Element.setStyle($(this.north),{height:0}); Element.setStyle($(this.east),{width:0,height:0}); Element.setStyle($(this.south),{height:0}); Element.setStyle($(this.west),{width:0,height:0}); } Element.setStyle($(this.imgWrap),{"width":this.imgW+"px","height":this.imgH+"px"}); Element.hide($(this.selArea)); var _15=Position.positionedOffset(this.imgWrap); this.wrapOffsets={"top":_15[1],"left":_15[0]}; var _16={x1:0,y1:0,x2:0,y2:0}; this.setAreaCoords(_16); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0&&this.options.displayOnInit){ _16.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2); _16.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); _16.x2=_16.x1+this.options.ratioDim.x; _16.y2=_16.y1+this.options.ratioDim.y; Element.show(this.selArea); this.drawArea(); this.endCrop(); } this.attached=true; },remove:function(){ this.attached=false; this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap); this.imgWrap.parentNode.removeChild(this.imgWrap); Event.stopObserving(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.stopObserving(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.stopObserving(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _17=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_17.length;i++){ Event.stopObserving(_17[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.stopObserving(document,"keydown",this.handleKeys.bindAsEventListener(this)); } },reset:function(){ if(!this.attached){ this.onLoad(); }else{ this.setParams(); } this.endCrop(); },handleKeys:function(e){ var dir={x:0,y:0}; if(!this.dragging){ switch(e.keyCode){ case (37): dir.x=-1; break; case (38): dir.y=-1; break; case (39): dir.x=1; break; case (40): dir.y=1; break; } if(dir.x!=0||dir.y!=0){ if(e.shiftKey){ dir.x*=10; dir.y*=10; } this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]); Event.stop(e); } } },calcW:function(){ return (this.areaCoords.x2-this.areaCoords.x1); },calcH:function(){ return (this.areaCoords.y2-this.areaCoords.y1); },moveArea:function(_1b){ this.setAreaCoords({x1:_1b[0],y1:_1b[1],x2:_1b[0]+this.calcW(),y2:_1b[1]+this.calcH()},true); this.drawArea(); },cloneCoords:function(_1c){ return {x1:_1c.x1,y1:_1c.y1,x2:_1c.x2,y2:_1c.y2}; },setAreaCoords:function(_1d,_1e,_1f,_20,_21){ var _22=typeof _1e!="undefined"?_1e:false; var _23=typeof _1f!="undefined"?_1f:false; if(_1e){ var _24=_1d.x2-_1d.x1; var _25=_1d.y2-_1d.y1; if(_1d.x1<0){ _1d.x1=0; _1d.x2=_24; } if(_1d.y1<0){ _1d.y1=0; _1d.y2=_25; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; _1d.x1=this.imgW-_24; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; _1d.y1=this.imgH-_25; } }else{ if(_1d.x1<0){ _1d.x1=0; } if(_1d.y1<0){ _1d.y1=0; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; } if(typeof (_20)!="undefined"){ if(this.ratioX>0){ this.applyRatio(_1d,{x:this.ratioX,y:this.ratioY},_20,_21); }else{ if(_23){ this.applyRatio(_1d,{x:1,y:1},_20,_21); } } var _26={a1:_1d.x1,a2:_1d.x2}; var _27={a1:_1d.y1,a2:_1d.y2}; var _28=this.options.minWidth; var _29=this.options.minHeight; if((_28==0||_29==0)&&_23){ if(_28>0){ _29=_28; }else{ if(_29>0){ _28=_29; } } } this.applyMinDimension(_26,_28,_20.x,{min:0,max:this.imgW}); this.applyMinDimension(_27,_29,_20.y,{min:0,max:this.imgH}); _1d={x1:_26.a1,y1:_27.a1,x2:_26.a2,y2:_27.a2}; } } this.areaCoords=_1d; },applyMinDimension:function(_2a,_2b,_2c,_2d){ if((_2a.a2-_2a.a1)<_2b){ if(_2c==1){ _2a.a2=_2a.a1+_2b; }else{ _2a.a1=_2a.a2-_2b; } if(_2a.a1<_2d.min){ _2a.a1=_2d.min; _2a.a2=_2b; }else{ if(_2a.a2>_2d.max){ _2a.a1=_2d.max-_2b; _2a.a2=_2d.max; } } } },applyRatio:function(_2e,_2f,_30,_31){ var _32; if(_31=="N"||_31=="S"){ _32=this.applyRatioToAxis({a1:_2e.y1,b1:_2e.x1,a2:_2e.y2,b2:_2e.x2},{a:_2f.y,b:_2f.x},{a:_30.y,b:_30.x},{min:0,max:this.imgW}); _2e.x1=_32.b1; _2e.y1=_32.a1; _2e.x2=_32.b2; _2e.y2=_32.a2; }else{ _32=this.applyRatioToAxis({a1:_2e.x1,b1:_2e.y1,a2:_2e.x2,b2:_2e.y2},{a:_2f.x,b:_2f.y},{a:_30.x,b:_30.y},{min:0,max:this.imgH}); _2e.x1=_32.a1; _2e.y1=_32.b1; _2e.x2=_32.a2; _2e.y2=_32.b2; } },applyRatioToAxis:function(_33,_34,_35,_36){ var _37=Object.extend(_33,{}); var _38=_37.a2-_37.a1; var _3a=Math.floor(_38*_34.b/_34.a); var _3b; var _3c; var _3d=null; if(_35.b==1){ _3b=_37.b1+_3a; if(_3b>_36.max){ _3b=_36.max; _3d=_3b-_37.b1; } _37.b2=_3b; }else{ _3b=_37.b2-_3a; if(_3b<_36.min){ _3b=_36.min; _3d=_3b+_37.b2; } _37.b1=_3b; } if(_3d!=null){ _3c=Math.floor(_3d*_34.a/_34.b); if(_35.a==1){ _37.a2=_37.a1+_3c; }else{ _37.a1=_37.a1=_37.a2-_3c; } } return _37; },drawArea:function(){ if(!this.isIE){ Element.show($(this.overlay)); } var _3e=this.calcW(); var _3f=this.calcH(); var _40=this.areaCoords.x2; var _41=this.areaCoords.y2; var _42=this.selArea.style; _42.left=this.areaCoords.x1+"px"; _42.top=this.areaCoords.y1+"px"; _42.width=_3e+"px"; _42.height=_3f+"px"; var _43=Math.ceil((_3e-6)/2)+"px"; var _44=Math.ceil((_3f-6)/2)+"px"; this.handleN.style.left=_43; this.handleE.style.top=_44; this.handleS.style.left=_43; this.handleW.style.top=_44; if(this.isIE){ this.north.style.height=this.areaCoords.y1+"px"; var _45=this.east.style; _45.top=this.areaCoords.y1+"px"; _45.height=_3f+"px"; _45.left=_40+"px"; _45.width=(this.img.width-_40)+"px"; var _46=this.south.style; _46.top=_41+"px"; _46.height=(this.img.height-_41)+"px"; var _47=this.west.style; _47.top=this.areaCoords.y1+"px"; _47.height=_3f+"px"; _47.width=this.areaCoords.x1+"px"; }else{ _42.backgroundPosition="-"+this.areaCoords.x1+"px "+"-"+this.areaCoords.y1+"px"; } this.subDrawArea(); this.forceReRender(); },forceReRender:function(){ if(this.isIE||this.isWebKit){ var n=document.createTextNode(" "); var d,el,fixEL,i; if(this.isIE){ fixEl=this.selArea; }else{ if(this.isWebKit){ fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0]; d=Builder.node("div",""); d.style.visibility="hidden"; var _4a=["SE","S","SW"]; for(i=0;i<_4a.length;i++){ el=document.getElementsByClassName("imgCrop_handle"+_4a[i],this.selArea)[0]; if(el.childNodes.length){ el.removeChild(el.childNodes[0]); } el.appendChild(d); } } } fixEl.appendChild(n); fixEl.removeChild(n); } },startResize:function(e){ this.startCoords=this.cloneCoords(this.areaCoords); this.resizing=true; this.resizeHandle=Element.classNames(Event.element(e)).toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); Event.stop(e); },startDrag:function(e){ Element.show(this.selArea); this.clickCoords=this.getCurPos(e); this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y}); this.dragging=true; this.onDrag(e); Event.stop(e); },getCurPos:function(e){ return curPos={x:Event.pointerX(e)-this.wrapOffsets.left,y:Event.pointerY(e)-this.wrapOffsets.top}; },onDrag:function(e){ var _4f=null; if(this.dragging||this.resizing){ var _50=this.getCurPos(e); var _51=this.cloneCoords(this.areaCoords); var _52={x:1,y:1}; } if(this.dragging){ if(_50.x0&&this.options.minHeight>0){ this.previewWrap=$(this.options.previewWrap); this.previewImg=this.img.cloneNode(false); this.options.displayOnInit=true; this.hasPreviewImg=true; Element.addClassName(this.previewWrap,"imgCrop_previewWrap"); Element.setStyle(this.previewWrap,{width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); this.previewWrap.appendChild(this.previewImg); } },subDrawArea:function(){ if(this.hasPreviewImg){ var _58=this.calcW(); var _59=this.calcH(); var _5a={x:this.imgW/_58,y:this.imgH/_59}; var _5b={x:_58/this.options.minWidth,y:_59/this.options.minHeight}; var _5c={w:Math.ceil(this.options.minWidth*_5a.x)+"px",h:Math.ceil(this.options.minHeight*_5a.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_5b.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_5b.y)+"px"}; var _5d=this.previewImg.style; _5d.width=_5c.w; _5d.height=_5c.h; _5d.left=_5c.x; _5d.top=_5c.y; } }}); wp-includes/js/crop/marqueeHoriz.gif0000644013707600007620000000214510536117602015536 0ustar wwwGIF89a ! NETSCAPE2.0! ,    "4xp À! , A"`A! , G@ Lxp`A! , G(h C! , ࿁ "4xp À! , A"`A! , @@ Lxp`A!,  @+h ;wp-includes/js/crop/marqueeVert.gif0000644013707600007620000000216510536117602015365 0ustar wwwGIF89a(! NETSCAPE2.0! ,(   "4xp Å! ,(A"`! ,(G@ Lxp` ! ,(G(h C! ,(࿁ "4xp Å! ,(A"`! ,(@@ Lxp` !,( @+h C;wp-includes/js/dbx.js0000644013707600007620000004505210466416706012561 0ustar www// DBX2.05 :: Docking Boxes (dbx) // ***************************************************** // DOM scripting by brothercake -- http://www.brothercake.com/ // GNU Lesser General Public License -- http://www.gnu.org/licenses/lgpl.html //****************************************************** var dbx;function dbxManager(sid){dbx = this;if(!/^[-_a-z0-9]+$/i.test(sid)) { alert('Error from dbxManager:\n"' + sid + '" is an invalid session ID'); return; }this.supported = !(document.getElementsByTagName('*').length == 0 || (navigator.vendor == 'KDE' && typeof window.sidebar == 'undefined'));if(!this.supported) { return; }this.etype = typeof document.addEventListener != 'undefined' ? 'addEventListener' : typeof document.attachEvent != 'undefined' ? 'attachEvent' : 'none';this.eprefix = (this.etype == 'attachEvent' ? 'on' : '');if(typeof window.opera != 'undefined' && parseFloat(navigator.userAgent.toLowerCase().split(/opera[\/ ]/)[1].split(' ')[0], 10) < 7.5){this.etype = 'none';}if(this.etype == 'none') { this.supported = false; return; }this.running = 0;this.sid = sid;this.savedata = {};this.cookiestate = this.getCookieState();};dbxManager.prototype.setCookieState = function(){var now = new Date();now.setTime(now.getTime() + (365*24*60*60*1000));var str = '';for(j in this.savedata){if(typeof this.savedata[j]!='function'){str += j + '=' + this.savedata[j] + '&'}}this.state = str.replace(/^(.+)&$/, '$1');this.cookiestring = this.state.replace(/,/g, '|');this.cookiestring = this.cookiestring.replace(/=/g, ':');if(typeof this.onstatechange == 'undefined' || this.onstatechange()){document.cookie = 'dbx-' + this.sid + '='+ this.cookiestring+ '; expires=' + now.toGMTString()+ '; path=/';}};dbxManager.prototype.getCookieState = function(){this.cookiestate = null;if(document.cookie){if(document.cookie.indexOf('dbx-' + this.sid)!=-1){this.cookie = document.cookie.split('dbx-' + this.sid + '=')[1].split(';')[0].split('&');for(var i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookie[i] = this.cookie[i].replace(/\|/g, ',');this.cookie[i]= this.cookie[i].replace(/:/g, '=');this.cookie[i] = this.cookie[i].split('=');this.cookie[i][1] = this.cookie[i][1].split(',');}}this.cookiestate = {};for(i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookiestate[this.cookie[i][0]] = this.cookie[i][1];}}}}return this.cookiestate;};dbxManager.prototype.addDataMember = function(gid, order){this.savedata[gid] = order;};dbxManager.prototype.createElement = function(tag){return typeof document.createElementNS != 'undefined' ? document.createElementNS('http://www.w3.org/1999/xhtml', tag) : document.createElement(tag);};dbxManager.prototype.getTarget = function(e, pattern, node){if(typeof node != 'undefined'){var target = node;}else{target = typeof e.target != 'undefined' ? e.target : e.srcElement;}var regex = new RegExp(pattern, '');while(!regex.test(target.className)){target = target.parentNode;}return target;};function dbxGroup(gid, dir, thresh, fix, ani, togs, def, open, close, move, toggle, kmove, ktoggle, syntax){if(!/^[-_a-z0-9]+$/i.test(gid)) { alert('Error from dbxGroup:\n"' + gid + '" is an invalid container ID'); return; }this.container = document.getElementById(gid);if(this.container == null || !dbx.supported) { return; }var self = this;this.gid = gid;this.dragok = false;this.box = null;this.vertical = dir == 'vertical';this.threshold = parseInt(thresh, 10);this.restrict = fix == 'yes';this.resolution = parseInt(ani, 10);this.toggles = togs == 'yes';this.defopen = def != 'closed';this.vocab = {'open' : open,'close' : close,'move' : move,'toggle' : toggle,'kmove' : kmove,'ktoggle' : ktoggle,'syntax' : syntax};this.container.style.position = 'relative';this.container.style.display = 'block';if(typeof window.opera != 'undefined'){this.container.style.display = 'run-in';}this.boxes = [];this.buttons = [];this.order = [];this.eles = this.container.getElementsByTagName('*');for(var i=0; i 0)){var sibling = this.boxes[positions[i + (positive ? 1 : -1)][0]];if(this.resolution > 0){var visipos = { 'x' : parent.offsetLeft, 'y' : parent.offsetTop };var siblingpos = { 'x' : sibling.offsetLeft, 'y' : sibling.offsetTop };}var obj = { 'insert' : (positive ? sibling : parent), 'before' : (positive ? parent : sibling) };this.container.insertBefore(obj.insert, obj.before);if(this.resolution > 0){var animators ={'sibling' : new dbxAnimator(this, sibling, siblingpos, this.resolution, true, anchor),'parent' : new dbxAnimator(this, parent, visipos, this.resolution, true, anchor)};}else{anchor.focus();}break;}}}this.getBoxOrder();}};dbxGroup.prototype.compare = function(a, b){return a[1] - b[1];};dbxGroup.prototype.createTooltip = function(isopen, anchor){if(this.keydown){this.tooltip = this.container.appendChild(dbx.createElement('span'));this.tooltip.style.visibility = 'hidden';this.tooltip.className = 'dbx-tooltip';if(isopen != null){this.tooltip.appendChild(document.createTextNode(this.vocab.kmove + this.vocab.ktoggle.replace('%toggle%', isopen ? this.vocab.close : this.vocab.open)));}else{this.tooltip.appendChild(document.createTextNode(this.vocab.kmove));}var parent = dbx.getTarget(null, 'dbx\-box', anchor);this.tooltip.style.left = parent.offsetLeft + 'px';this.tooltip.style.top = parent.offsetTop + 'px';var tooltip = this.tooltip;window.setTimeout(function(){if(tooltip != null) { tooltip.style.visibility = 'visible'; }}, 500);}};dbxGroup.prototype.removeTooltip = function(){if(this.tooltip != null){this.tooltip.parentNode.removeChild(this.tooltip);this.tooltip = null;}};dbxGroup.prototype.mousedown = function(e, box){var node = typeof e.target != 'undefined' ? e.target : e.srcElement;if(node.nodeName == '#text') { node = node.parentNode; }if(!/dbx\-(toggle|box|group)/i.test(node.className)){while(!/dbx\-(handle|box|group)/i.test(node.className)){node = node.parentNode;}}if(/dbx\-handle/i.test(node.className)){this.removeTooltip();this.released = false;this.initial = { 'x' : e.clientX, 'y' : e.clientY };this.current = { 'x' : 0, 'y' : 0 };this.createCloneBox(box);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return false; }}}};dbxGroup.prototype.mousemove = function(e){if(this.dragok && this.box != null){this.positive = this.vertical ? (e.clientY > this.current.y ? true : false) : (e.clientX > this.current.x ? true : false);this.current = { 'x' : e.clientX, 'y' : e.clientY };var overall = { 'x' : this.current.x - this.initial.x, 'y' : this.current.y - this.initial.y };if(((overall.x >= 0 && overall.x <= this.threshold) || (overall.x <= 0 && overall.x >= 0 - this.threshold))&&((overall.y >= 0 && overall.y <= this.threshold) || (overall.y <= 0 && overall.y >= 0 - this.threshold))){this.current.x -= overall.x;this.current.y -= overall.y;}if(this.released || overall.x > this.threshold || overall.x < (0 - this.threshold) || overall.y > this.threshold || overall.y < (0 - this.threshold)){dbx.group = this.container;dbx.box = this.box;dbx.event = e;if(typeof dbx.onboxdrag == 'undefined' || dbx.onboxdrag()){this.released = true;if(!this.restrict || !this.vertical) { this.boxclone.style.left = (this.current.x - this.difference.x) + 'px'; }if(!this.restrict || this.vertical) { this.boxclone.style.top = (this.current.y - this.difference.y) + 'px'; }this.moveOriginalToPosition(this.current.x, this.current.y);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }}}}return true;};dbxGroup.prototype.mouseup = function(e){if(this.box != null){this.moveOriginalToPosition(e.clientX, e.clientY);this.removeCloneBox();this.getBoxOrder();if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return true; }}}this.dragok = false;};dbxGroup.prototype.keypress = function(e, anchor){if(/^(3[7-9])|(40)$/.test(e.keyCode)){this.removeTooltip();if((this.vertical && /^(38|40)$/.test(e.keyCode)) || (!this.vertical && /^(37|39)$/.test(e.keyCode))){this.shiftBoxPosition(e, anchor, /^[3][78]$/.test(e.keyCode) ? false : true);if(typeof e.preventDefault != 'undefined') { e.preventDefault(); }else { return false; }typeof e.stopPropagation != 'undefined' ? e.stopPropagation() : e.cancelBubble = true;this.keydown = false;}}return true;};dbxGroup.prototype.getBoxOrder = function(){this.order = [];var len = this.eles.length;for(var j=0; j boxprops.xy && cloneprops.xy < boxprops.xy)||(!this.positive && cloneprops.xy < boxprops.xy && cloneprops.xy + cloneprops.wh > boxprops.xy)){if(this.boxes[i] == this.box) { return; }var sibling = this.box.nextSibling;while(sibling.className == null || !/dbx\-box/.test(sibling.className)){sibling = sibling.nextSibling;}if(this.boxes[i] == sibling) { return; }if(this.resolution > 0){if(this.box[this.vertical ? 'offsetTop' : 'offsetLeft'] < boxprops.xy){var visibox = this.boxes[i].previousSibling;while(visibox.className == null || !/dbx\-box/.test(visibox.className)){visibox = visibox.previousSibling;}}else{visibox = this.boxes[i];}var visipos = { 'x' : visibox.offsetLeft, 'y' : visibox.offsetTop };}var prepos = { 'x' : this.box.offsetLeft, 'y' : this.box.offsetTop };this.container.insertBefore(this.box, this.boxes[i]);this.initial.x += (this.box.offsetLeft - prepos.x);this.initial.y += (this.box.offsetTop - prepos.y);if(this.resolution > 0 && visibox != this.box){var animator = new dbxAnimator(this, visibox, visipos, this.resolution, false, null);}else{}break;}}};function dbxAnimator(caller, box, pos, res, kbd, anchor){this.caller = caller;this.box = box;this.timer = null;var before = pos[this.caller.vertical ? 'y' : 'x'];var after = this.box[this.caller.vertical ? 'offsetTop' : 'offsetLeft'];if(before != after){if(dbx.running > this.caller.boxes.length - 1) { return; }var clone = this.caller.createClone(this.box, 29999, arguments[2]);clone.style.visibility = 'visible';this.box.style.visibility = 'hidden';this.animateClone(clone,before,after > before ? after - before : 0 - (before - after),this.caller.vertical ? 'top' : 'left',res,kbd,anchor);}};dbxAnimator.prototype.animateClone = function(clone, current, change, dir, res, kbd, anchor){var self = this;var count = 0;dbx.running ++;this.timer = window.setInterval(function(){count ++;current += change / res;clone.style[dir] = current + 'px';if(count == res){window.clearTimeout(self.timer);self.timer = null;dbx.running --;self.caller.container.removeChild(clone);self.box.style.visibility = 'visible';if(kbd){if(anchor != null && anchor.parentNode.style.visibility != 'hidden'){anchor.focus();}else if(self.caller.toggles){var button = self.caller.buttons[parseInt(self.box.className.split('dbxid')[1],10)];if(button != null && typeof button.isactive != 'undefined'){button.focus();}}}}}, 20);};if(typeof window.attachEvent != 'undefined'){window.attachEvent('onunload', function(){var ev = ['mousedown', 'mousemove', 'mouseup', 'mouseout', 'click', 'keydown', 'keyup', 'focus', 'blur', 'selectstart', 'statechange', 'boxdrag', 'boxopen', 'boxclose'];var el = ev.length;var dl = document.all.length;for(var i=0; i35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('k.f2={2r:u(M){E q.1E(u(){if(!M.aR||!M.aZ)E;D el=q;el.2l={aq:M.aq||cO,aR:M.aR,aZ:M.aZ,8e:M.8e||\'fV\',aJ:M.aJ||\'fV\',2Y:M.2Y&&2g M.2Y==\'u\'?M.2Y:I,3i:M.2Y&&2g M.3i==\'u\'?M.3i:I,7U:M.7U&&2g M.7U==\'u\'?M.7U:I,as:k(M.aR,q),8f:k(M.aZ,q),H:M.H||8J,67:M.67||0};el.2l.8f.2G().B(\'W\',\'9R\').eq(0).B({W:el.2l.aq+\'U\',19:\'2B\'}).2T();el.2l.as.1E(u(2N){q.7X=2N}).gC(u(){k(q).2R(el.2l.aJ)},u(){k(q).4i(el.2l.aJ)}).1J(\'5h\',u(e){if(el.2l.67==q.7X)E;el.2l.as.eq(el.2l.67).4i(el.2l.8e).2T().eq(q.7X).2R(el.2l.8e).2T();el.2l.8f.eq(el.2l.67).5w({W:0},el.2l.H,u(){q.14.19=\'1o\';if(el.2l.3i){el.2l.3i.1D(el,[q])}}).2T().eq(q.7X).1Y().5w({W:el.2l.aq},el.2l.H,u(){q.14.19=\'2B\';if(el.2l.2Y){el.2l.2Y.1D(el,[q])}}).2T();if(el.2l.7U){el.2l.7U.1D(el,[q,el.2l.8f.K(q.7X),el.2l.as.K(el.2l.67),el.2l.8f.K(el.2l.67)])}el.2l.67=q.7X}).eq(0).2R(el.2l.8e).2T();k(q).B(\'W\',k(q).B(\'W\')).B(\'2U\',\'2K\')})}};k.fn.gN=k.f2.2r;k.aA={2r:u(M){E q.1E(u(){D el=q;D 7E=2*18.2Q/f1;D an=2*18.2Q;if(k(el).B(\'Y\')!=\'2s\'&&k(el).B(\'Y\')!=\'1P\'){k(el).B(\'Y\',\'2s\')}el.1l={1R:k(M.1R,q),2F:M.2F,6q:M.6q,aD:M.aD,an:an,1N:k.1a.2o(q),Y:k.1a.3w(q),26:18.2Q/2,bi:M.bi,8p:M.6r,6r:[],aG:I,7E:2*18.2Q/f1};el.1l.fB=(el.1l.1N.w-el.1l.2F)/2;el.1l.7D=(el.1l.1N.h-el.1l.6q-el.1l.6q*el.1l.8p)/2;el.1l.2D=2*18.2Q/el.1l.1R.1N();el.1l.ba=el.1l.1N.w/2;el.1l.b9=el.1l.1N.h/2-el.1l.6q*el.1l.8p;D ak=1h.3F(\'22\');k(ak).B({Y:\'1P\',3I:1,Q:0,O:0});k(el).1S(ak);el.1l.1R.1E(u(2N){a6=k(\'1T\',q).K(0);W=T(el.1l.6q*el.1l.8p);if(k.3a.4t){3E=1h.3F(\'1T\');k(3E).B(\'Y\',\'1P\');3E.2J=a6.2J;3E.14.5E=\'gE 9n:9w.9y.cC(1G=60, 14=1, gB=0, gA=0, gv=0, gF=0)\'}P{3E=1h.3F(\'3E\');if(3E.fD){4L=3E.fD("2d");3E.14.Y=\'1P\';3E.14.W=W+\'U\';3E.14.Z=el.1l.2F+\'U\';3E.W=W;3E.Z=el.1l.2F;4L.gu();4L.gO(0,W);4L.gk(1,-1);4L.gp(a6,0,0,el.1l.2F,W);4L.6H();4L.gm="gG-4l";D ap=4L.hy(0,0,0,W);ap.fs(1,"fr(1V, 1V, 1V, 1)");ap.fs(0,"fr(1V, 1V, 1V, 0.6)");4L.hx=ap;if(hA.hB.3J(\'hw\')!=-1){4L.hv()}P{4L.hu(0,0,el.1l.2F,W)}}}el.1l.6r[2N]=3E;k(ak).1S(3E)}).1J(\'9z\',u(e){el.1l.aG=1b;el.1l.H=el.1l.7E*0.1*el.1l.H/18.3S(el.1l.H);E I}).1J(\'8B\',u(e){el.1l.aG=I;E I});k.aA.7T(el);el.1l.H=el.1l.7E*0.2;el.1l.ht=1X.6V(u(){el.1l.26+=el.1l.H;if(el.1l.26>an)el.1l.26=0;k.aA.7T(el)},20);k(el).1J(\'8B\',u(){el.1l.H=el.1l.7E*0.2*el.1l.H/18.3S(el.1l.H)}).1J(\'3D\',u(e){if(el.1l.aG==I){1s=k.1a.4a(e);fz=el.1l.1N.w-1s.x+el.1l.Y.x;el.1l.H=el.1l.bi*el.1l.7E*(el.1l.1N.w/2-fz)/(el.1l.1N.w/2)}})})},7T:u(el){el.1l.1R.1E(u(2N){b8=el.1l.26+2N*el.1l.2D;x=el.1l.fB*18.5H(b8);y=el.1l.7D*18.83(b8);f9=T(2a*(el.1l.7D+y)/(2*el.1l.7D));fk=(el.1l.7D+y)/(2*el.1l.7D);Z=T((el.1l.2F-el.1l.aD)*fk+el.1l.aD);W=T(Z*el.1l.6q/el.1l.2F);q.14.Q=el.1l.b9+y-W/2+"U";q.14.O=el.1l.ba+x-Z/2+"U";q.14.Z=Z+"U";q.14.W=W+"U";q.14.3I=f9;el.1l.6r[2N].14.Q=T(el.1l.b9+y+W-1-W/2)+"U";el.1l.6r[2N].14.O=T(el.1l.ba+x-Z/2)+"U";el.1l.6r[2N].14.Z=Z+"U";el.1l.6r[2N].14.W=T(W*el.1l.8p)+"U"})}};k.fn.hI=k.aA.2r;k.23({G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W},hK:u(p,n,1W,1H,1m){E 1H*(n/=1m)*n*n+1W},fl:u(p,n,1W,1H,1m){E-1H*((n=n/1m-1)*n*n*n-1)+1W},hm:u(p,n,1W,1H,1m){if((n/=1m/2)<1)E 1H/2*n*n*n*n+1W;E-1H/2*((n-=2)*n*n*n-2)+1W},8l:u(p,n,1W,1H,1m){if((n/=1m)<(1/2.75)){E 1H*(7.aB*n*n)+1W}P if(n<(2/2.75)){E 1H*(7.aB*(n-=(1.5/2.75))*n+.75)+1W}P if(n<(2.5/2.75)){E 1H*(7.aB*(n-=(2.25/2.75))*n+.gY)+1W}P{E 1H*(7.aB*(n-=(2.h2/2.75))*n+.gX)+1W}},cr:u(p,n,1W,1H,1m){if(k.G.8l)E 1H-k.G.8l(p,1m-n,0,1H,1m)+1W;E 1W+1H},gW:u(p,n,1W,1H,1m){if(k.G.cr&&k.G.8l)if(n<1m/2)E k.G.cr(p,n*2,0,1H,1m)*.5+1W;E k.G.8l(p,n*2-1m,0,1H,1m)*.5+1H*.5+1W;E 1W+1H},gQ:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m)==1)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E-(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W},gT:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}E a*18.6b(2,-10*n)*18.83((n*1m-s)*(2*18.2Q)/p)+1H+1W},gV:u(p,n,1W,1H,1m){D a,s;if(n==0)E 1W;if((n/=1m/2)==2)E 1W+1H;a=1H*0.3;p=1m*.3;if(a<18.3S(1H)){a=1H;s=p/4}P{s=p/(2*18.2Q)*18.cb(1H/a)}if(n<1){E-.5*(a*18.6b(2,10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p))+1W}E a*18.6b(2,-10*(n-=1))*18.83((n*1m-s)*(2*18.2Q)/p)*.5+1H+1W}}});k.6n={2r:u(M){E q.1E(u(){D el=q;el.1F={1R:k(M.1R,q),1Z:k(M.1Z,q),1M:k.1a.3w(q),2F:M.2F,ax:M.ax,7Y:M.7Y,ge:M.ge,51:M.51,6x:M.6x};k.6n.aH(el,0);k(1X).1J(\'gU\',u(){el.1F.1M=k.1a.3w(el);k.6n.aH(el,0);k.6n.7T(el)});k.6n.7T(el);el.1F.1R.1J(\'9z\',u(){k(el.1F.ax,q).K(0).14.19=\'2B\'}).1J(\'8B\',u(){k(el.1F.ax,q).K(0).14.19=\'1o\'});k(1h).1J(\'3D\',u(e){D 1s=k.1a.4a(e);D 5s=0;if(el.1F.51&&el.1F.51==\'cv\')D aI=1s.x-el.1F.1M.x-(el.4c-el.1F.2F*el.1F.1R.1N())/2-el.1F.2F/2;P if(el.1F.51&&el.1F.51==\'2L\')D aI=1s.x-el.1F.1M.x-el.4c+el.1F.2F*el.1F.1R.1N();P D aI=1s.x-el.1F.1M.x;D fP=18.6b(1s.y-el.1F.1M.y-el.5W/2,2);el.1F.1R.1E(u(2N){45=18.ez(18.6b(aI-2N*el.1F.2F,2)+fP);45-=el.1F.2F/2;45=45<0?0:45;45=45>el.1F.7Y?el.1F.7Y:45;45=el.1F.7Y-45;bB=el.1F.6x*45/el.1F.7Y;q.14.Z=el.1F.2F+bB+\'U\';q.14.O=el.1F.2F*2N+5s+\'U\';5s+=bB});k.6n.aH(el,5s)})})},aH:u(el,5s){if(el.1F.51)if(el.1F.51==\'cv\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())/2-5s/2+\'U\';P if(el.1F.51==\'O\')el.1F.1Z.K(0).14.O=-5s/el.1F.1R.1N()+\'U\';P if(el.1F.51==\'2L\')el.1F.1Z.K(0).14.O=(el.4c-el.1F.2F*el.1F.1R.1N())-5s/2+\'U\';el.1F.1Z.K(0).14.Z=el.1F.2F*el.1F.1R.1N()+5s+\'U\'},7T:u(el){el.1F.1R.1E(u(2N){q.14.Z=el.1F.2F+\'U\';q.14.O=el.1F.2F*2N+\'U\'})}};k.fn.hi=k.6n.2r;k.N={1c:S,8R:S,3A:S,2I:S,4y:S,cl:S,1d:S,2h:S,1R:S,5o:u(){k.N.8R.5o();if(k.N.3A){k.N.3A.2G()}},4w:u(){k.N.1R=S;k.N.2h=S;k.N.4y=k.N.1d.2y;if(k.N.1c.B(\'19\')==\'2B\'){if(k.N.1d.1f.fx){3m(k.N.1d.1f.fx.1u){1e\'c6\':k.N.1c.7a(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\'1z\':k.N.1c.fq(k.N.1d.1f.fx.1m,k.N.5o);1r;1e\'a7\':k.N.1c.g3(k.N.1d.1f.fx.1m,k.N.5o);1r}}P{k.N.1c.2G()}if(k.N.1d.1f.3i)k.N.1d.1f.3i.1D(k.N.1d,[k.N.1c,k.N.3A])}P{k.N.5o()}1X.bH(k.N.2I)},dQ:u(){D 1d=k.N.1d;D 4d=k.N.aY(1d);if(1d&&4d.3o!=k.N.4y&&4d.3o.1g>=1d.1f.aL){k.N.4y=4d.3o;k.N.cl=4d.3o;81={2n:k(1d).1p(\'hj\')||\'2n\',2y:4d.3o};k.hl({1u:\'hk\',81:k.hf(81),he:u(fZ){1d.1f.4e=k(\'3o\',fZ);1N=1d.1f.4e.1N();if(1N>0){D 5p=\'\';1d.1f.4e.1E(u(2N){5p+=\'<8P 4I="\'+k(\'2y\',q).3g()+\'" 8K="\'+2N+\'" 14="9b: ad;">\'+k(\'3g\',q).3g()+\'\'});if(1d.1f.aU){D 3M=k(\'2y\',1d.1f.4e.K(0)).3g();1d.2y=4d.3j+3M+1d.1f.3N+4d.66;k.N.6J(1d,4d.3o.1g!=3M.1g?(4d.3j.1g+4d.3o.1g):3M.1g,4d.3o.1g!=3M.1g?(4d.3j.1g+3M.1g):3M.1g)}if(1N>0){k.N.cj(1d,5p)}P{k.N.4w()}}P{k.N.4w()}},5N:1d.1f.aN})}},cj:u(1d,5p){k.N.8R.3x(5p);k.N.1R=k(\'8P\',k.N.8R.K(0));k.N.1R.9z(k.N.di).1J(\'5h\',k.N.dj);D Y=k.1a.3w(1d);D 1N=k.1a.2o(1d);k.N.1c.B(\'Q\',Y.y+1N.hb+\'U\').B(\'O\',Y.x+\'U\').2R(1d.1f.aM);if(k.N.3A){k.N.3A.B(\'19\',\'2B\').B(\'Q\',Y.y+1N.hb+\'U\').B(\'O\',Y.x+\'U\').B(\'Z\',k.N.1c.B(\'Z\')).B(\'W\',k.N.1c.B(\'W\'))}k.N.2h=0;k.N.1R.K(0).3l=1d.1f.7H;k.N.8Q(1d,1d.1f.4e.K(0),\'7J\');if(k.N.1c.B(\'19\')==\'1o\'){if(1d.1f.bV){D cp=k.1a.aT(1d,1b);D cm=k.1a.6U(1d,1b);k.N.1c.B(\'Z\',1d.4c-(k.dF?(cp.l+cp.r+cm.l+cm.r):0)+\'U\')}if(1d.1f.fx){3m(1d.1f.fx.1u){1e\'c6\':k.N.1c.7f(1d.1f.fx.1m);1r;1e\'1z\':k.N.1c.fo(1d.1f.fx.1m);1r;1e\'a7\':k.N.1c.gb(1d.1f.fx.1m);1r}}P{k.N.1c.1Y()}if(k.N.1d.1f.2Y)k.N.1d.1f.2Y.1D(k.N.1d,[k.N.1c,k.N.3A])}},dO:u(){D 1d=q;if(1d.1f.4e){k.N.4y=1d.2y;k.N.cl=1d.2y;D 5p=\'\';1d.1f.4e.1E(u(2N){2y=k(\'2y\',q).3g().6c();fY=1d.2y.6c();if(2y.3J(fY)==0){5p+=\'<8P 4I="\'+k(\'2y\',q).3g()+\'" 8K="\'+2N+\'" 14="9b: ad;">\'+k(\'3g\',q).3g()+\'\'}});if(5p!=\'\'){k.N.cj(1d,5p);q.1f.9x=1b;E}}1d.1f.4e=S;q.1f.9x=I},6J:u(2n,26,2T){if(2n.b1){D 6t=2n.b1();6t.hp(1b);6t.dI("ck",26);6t.ha("ck",-2T+26);6t.8C()}P if(2n.aF){2n.aF(26,2T)}P{if(2n.5q){2n.5q=26;2n.dN=2T}}2n.6K()},f0:u(2n){if(2n.5q)E 2n.5q;P if(2n.b1){D 6t=1h.6J.dZ();D eX=6t.h9();E 0-eX.dI(\'ck\',-h6)}},aY:u(2n){D 4P={2y:2n.2y,3j:\'\',66:\'\',3o:\'\'};if(2n.1f.aQ){D 8N=I;D 5q=k.N.f0(2n)||0;D 4T=4P.2y.7C(2n.1f.3N);24(D i=0;i<4T.1g;i++){if((4P.3j.1g+4T[i].1g>=5q||5q==0)&&!8N){if(4P.3j.1g<=5q)4P.3o=4T[i];P 4P.66+=4T[i]+(4T[i]!=\'\'?2n.1f.3N:\'\');8N=1b}P if(8N){4P.66+=4T[i]+(4T[i]!=\'\'?2n.1f.3N:\'\')}if(!8N){4P.3j+=4T[i]+(4T.1g>1?2n.1f.3N:\'\')}}}P{4P.3o=4P.2y}E 4P},bU:u(e){1X.bH(k.N.2I);D 1d=k.N.aY(q);D 3K=e.7L||e.7K||-1;if(/13|27|35|36|38|40|9/.48(3K)&&k.N.1R){if(1X.2k){1X.2k.bT=1b;1X.2k.c0=I}P{e.aP();e.aW()}if(k.N.2h!=S)k.N.1R.K(k.N.2h||0).3l=\'\';P k.N.2h=-1;3m(3K){1e 9:1e 13:if(k.N.2h==-1)k.N.2h=0;D 2h=k.N.1R.K(k.N.2h||0);D 3M=2h.5C(\'4I\');q.2y=1d.3j+3M+q.1f.3N+1d.66;k.N.4y=1d.3o;k.N.6J(q,1d.3j.1g+3M.1g+q.1f.3N.1g,1d.3j.1g+3M.1g+q.1f.3N.1g);k.N.4w();if(q.1f.68){4u=T(2h.5C(\'8K\'))||0;k.N.8Q(q,q.1f.4e.K(4u),\'68\')}if(q.7W)q.7W(I);E 3K!=13;1r;1e 27:q.2y=1d.3j+k.N.4y+q.1f.3N+1d.66;q.1f.4e=S;k.N.4w();if(q.7W)q.7W(I);E I;1r;1e 35:k.N.2h=k.N.1R.1N()-1;1r;1e 36:k.N.2h=0;1r;1e 38:k.N.2h--;if(k.N.2h<0)k.N.2h=k.N.1R.1N()-1;1r;1e 40:k.N.2h++;if(k.N.2h==k.N.1R.1N())k.N.2h=0;1r}k.N.8Q(q,q.1f.4e.K(k.N.2h||0),\'7J\');k.N.1R.K(k.N.2h||0).3l=q.1f.7H;if(k.N.1R.K(k.N.2h||0).7W)k.N.1R.K(k.N.2h||0).7W(I);if(q.1f.aU){D aK=k.N.1R.K(k.N.2h||0).5C(\'4I\');q.2y=1d.3j+aK+q.1f.3N+1d.66;if(k.N.4y.1g!=aK.1g)k.N.6J(q,1d.3j.1g+k.N.4y.1g,1d.3j.1g+aK.1g)}E I}k.N.dO.1D(q);if(q.1f.9x==I){if(1d.3o!=k.N.4y&&1d.3o.1g>=q.1f.aL)k.N.2I=1X.9T(k.N.dQ,q.1f.54);if(k.N.1R){k.N.4w()}}E 1b},8Q:u(2n,3o,1u){if(2n.1f[1u]){D 81={};ar=3o.f3(\'*\');24(i=0;i\');k.N.3A=k(\'#ds\')}k(\'2e\',1h).1S(\'<22 id="dr" 14="Y: 1P; Q: 0; O: 0; z-cZ: h3; 19: 1o;"><9h 14="6w: 0;8F: 0; h1-14: 1o; z-cZ: h0;">&7k;\');k.N.1c=k(\'#dr\');k.N.8R=k(\'9h\',k.N.1c)}E q.1E(u(){if(q.4Y!=\'ch\'&&q.5C(\'1u\')!=\'3g\')E;q.1f={};q.1f.aN=M.aN;q.1f.aL=18.3S(T(M.aL)||1);q.1f.aM=M.aM?M.aM:\'\';q.1f.7H=M.7H?M.7H:\'\';q.1f.68=M.68&&M.68.1K==2A?M.68:S;q.1f.2Y=M.2Y&&M.2Y.1K==2A?M.2Y:S;q.1f.3i=M.3i&&M.3i.1K==2A?M.3i:S;q.1f.7J=M.7J&&M.7J.1K==2A?M.7J:S;q.1f.bV=M.bV||I;q.1f.aQ=M.aQ||I;q.1f.3N=q.1f.aQ?(M.3N||\', \'):\'\';q.1f.aU=M.aU?1b:I;q.1f.54=18.3S(T(M.54)||aC);if(M.fx&&M.fx.1K==7M){if(!M.fx.1u||!/c6|1z|a7/.48(M.fx.1u)){M.fx.1u=\'1z\'}if(M.fx.1u==\'1z\'&&!k.fx.1z)E;if(M.fx.1u==\'a7\'&&!k.fx.61)E;M.fx.1m=18.3S(T(M.fx.1m)||8J);if(M.fx.1m>q.1f.54){M.fx.1m=q.1f.54-2a}q.1f.fx=M.fx}q.1f.4e=S;q.1f.9x=I;k(q).1p(\'bU\',\'eN\').6K(u(){k.N.1d=q;k.N.4y=q.2y}).dH(k.N.eJ).6y(k.N.bU).5B(u(){k.N.2I=1X.9T(k.N.4w,hM)})})}};k.fn.hR=k.N.2r;k.1y={2I:S,4Q:S,29:S,2D:10,26:u(el,4J,2D,eG){k.1y.4Q=el;k.1y.29=4J;k.1y.2D=T(2D)||10;k.1y.2I=1X.6V(k.1y.eF,T(eG)||40)},eF:u(){24(i=0;i0&&k.1y.29[i].2X.y+k.1y.29[i].2X.t>69.y){k.1y.29[i].3d-=k.1y.2D}P if(k.1y.29[i].2X.t<=k.1y.29[i].2X.h&&k.1y.29[i].2X.t+k.1y.29[i].2X.hb<69.y+69.hb){k.1y.29[i].3d+=k.1y.2D}if(k.1y.29[i].2X.l>0&&k.1y.29[i].2X.x+k.1y.29[i].2X.l>69.x){k.1y.29[i].3c-=k.1y.2D}P if(k.1y.29[i].2X.l<=k.1y.29[i].2X.hP&&k.1y.29[i].2X.l+k.1y.29[i].2X.1C<69.x+69.1C){k.1y.29[i].3c+=k.1y.2D}}},8o:u(){1X.5T(k.1y.2I);k.1y.4Q=S;k.1y.29=S;24(i in k.1y.29){k.1y.29[i].2X=S}}};k.11={1c:S,F:S,4U:u(){E q.1E(u(){if(q.9I){q.A.5e.3q(\'5v\',k.11.bN);q.A=S;q.9I=I;if(k.3a.4t){q.bE="eN"}P{q.14.hq=\'\';q.14.e1=\'\';q.14.e7=\'\'}}})},bN:u(e){if(k.11.F!=S){k.11.9A(e);E I}D C=q.3U;k(1h).1J(\'3D\',k.11.bX).1J(\'5P\',k.11.9A);C.A.1s=k.1a.4a(e);C.A.4B=C.A.1s;C.A.7q=I;C.A.ho=q!=q.3U;k.11.F=C;if(C.A.5i&&q!=q.3U){bS=k.1a.3w(C.31);bQ=k.1a.2o(C);bR={x:T(k.B(C,\'O\'))||0,y:T(k.B(C,\'Q\'))||0};dx=C.A.4B.x-bS.x-bQ.1C/2-bR.x;dy=C.A.4B.y-bS.y-bQ.hb/2-bR.y;k.3b.5c(C,[dx,dy])}E k.7n||I},ea:u(e){D C=k.11.F;C.A.7q=1b;D 9G=C.14;C.A.7V=k.B(C,\'19\');C.A.4n=k.B(C,\'Y\');if(!C.A.cz)C.A.cz=C.A.4n;C.A.2c={x:T(k.B(C,\'O\'))||0,y:T(k.B(C,\'Q\'))||0};C.A.9B=0;C.A.ai=0;if(k.3a.4t){D bW=k.1a.6U(C,1b);C.A.9B=bW.l||0;C.A.ai=bW.t||0}C.A.1B=k.23(k.1a.3w(C),k.1a.2o(C));if(C.A.4n!=\'2s\'&&C.A.4n!=\'1P\'){9G.Y=\'2s\'}k.11.1c.5o();D 5g=C.fI(1b);k(5g).B({19:\'2B\',O:\'2P\',Q:\'2P\'});5g.14.5K=\'0\';5g.14.5z=\'0\';5g.14.5k=\'0\';5g.14.5j=\'0\';k.11.1c.1S(5g);D 3Y=k.11.1c.K(0).14;if(C.A.bD){3Y.Z=\'9F\';3Y.W=\'9F\'}P{3Y.W=C.A.1B.hb+\'U\';3Y.Z=C.A.1B.1C+\'U\'}3Y.19=\'2B\';3Y.5K=\'2P\';3Y.5z=\'2P\';3Y.5k=\'2P\';3Y.5j=\'2P\';k.23(C.A.1B,k.1a.2o(5g));if(C.A.2V){if(C.A.2V.O){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.2V.O;C.A.1B.x=C.A.1s.x-C.A.2V.O}if(C.A.2V.Q){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.2V.Q;C.A.1B.y=C.A.1s.y-C.A.2V.Q}if(C.A.2V.2L){C.A.2c.x+=C.A.1s.x-C.A.1B.x-C.A.1B.hb+C.A.2V.2L;C.A.1B.x=C.A.1s.x-C.A.1B.1C+C.A.2V.2L}if(C.A.2V.4D){C.A.2c.y+=C.A.1s.y-C.A.1B.y-C.A.1B.hb+C.A.2V.4D;C.A.1B.y=C.A.1s.y-C.A.1B.hb+C.A.2V.4D}}C.A.2v=C.A.2c.x;C.A.2q=C.A.2c.y;if(C.A.8s||C.A.2p==\'94\'){8U=k.1a.6U(C.31,1b);C.A.1B.x=C.8t+(k.3a.4t?0:k.3a.7I?-8U.l:8U.l);C.A.1B.y=C.8G+(k.3a.4t?0:k.3a.7I?-8U.t:8U.t);k(C.31).1S(k.11.1c.K(0))}if(C.A.2p){k.11.c5(C);C.A.5t.2p=k.11.ce}if(C.A.5i){k.3b.ct(C)}3Y.O=C.A.1B.x-C.A.9B+\'U\';3Y.Q=C.A.1B.y-C.A.ai+\'U\';3Y.Z=C.A.1B.1C+\'U\';3Y.W=C.A.1B.hb+\'U\';k.11.F.A.9E=I;if(C.A.gx){C.A.5t.6a=k.11.c7}if(C.A.3I!=I){k.11.1c.B(\'3I\',C.A.3I)}if(C.A.1G){k.11.1c.B(\'1G\',C.A.1G);if(1X.71){k.11.1c.B(\'5E\',\'8V(1G=\'+C.A.1G*2a+\')\')}}if(C.A.7O){k.11.1c.2R(C.A.7O);k.11.1c.K(0).7c.14.19=\'1o\'}if(C.A.4o)C.A.4o.1D(C,[5g,C.A.2c.x,C.A.2c.y]);if(k.1x&&k.1x.8D>0){k.1x.ed(C)}if(C.A.46==I){9G.19=\'1o\'}E I},c5:u(C){if(C.A.2p.1K==b0){if(C.A.2p==\'94\'){C.A.28=k.23({x:0,y:0},k.1a.2o(C.31));D 8S=k.1a.6U(C.31,1b);C.A.28.w=C.A.28.1C-8S.l-8S.r;C.A.28.h=C.A.28.hb-8S.t-8S.b}P if(C.A.2p==\'1h\'){D bY=k.1a.bm();C.A.28={x:0,y:0,w:bY.w,h:bY.h}}}P if(C.A.2p.1K==7F){C.A.28={x:T(C.A.2p[0])||0,y:T(C.A.2p[1])||0,w:T(C.A.2p[2])||0,h:T(C.A.2p[3])||0}}C.A.28.dx=C.A.28.x-C.A.1B.x;C.A.28.dy=C.A.28.y-C.A.1B.y},9H:u(F){if(F.A.8s||F.A.2p==\'94\'){k(\'2e\',1h).1S(k.11.1c.K(0))}k.11.1c.5o().2G().B(\'1G\',1);if(1X.71){k.11.1c.B(\'5E\',\'8V(1G=2a)\')}},9A:u(e){k(1h).3q(\'3D\',k.11.bX).3q(\'5P\',k.11.9A);if(k.11.F==S){E}D F=k.11.F;k.11.F=S;if(F.A.7q==I){E I}if(F.A.44==1b){k(F).B(\'Y\',F.A.4n)}D 9G=F.14;if(F.5i){k.11.1c.B(\'9b\',\'8j\')}if(F.A.7O){k.11.1c.4i(F.A.7O)}if(F.A.6N==I){if(F.A.fx>0){if(!F.A.1O||F.A.1O==\'4j\'){D x=12 k.fx(F,{1m:F.A.fx},\'O\');x.1L(F.A.2c.x,F.A.8y)}if(!F.A.1O||F.A.1O==\'49\'){D y=12 k.fx(F,{1m:F.A.fx},\'Q\');y.1L(F.A.2c.y,F.A.8v)}}P{if(!F.A.1O||F.A.1O==\'4j\')F.14.O=F.A.8y+\'U\';if(!F.A.1O||F.A.1O==\'49\')F.14.Q=F.A.8v+\'U\'}k.11.9H(F);if(F.A.46==I){k(F).B(\'19\',F.A.7V)}}P if(F.A.fx>0){F.A.9E=1b;D dh=I;if(k.1x&&k.1t&&F.A.44){dh=k.1a.3w(k.1t.1c.K(0))}k.11.1c.5w({O:dh?dh.x:F.A.1B.x,Q:dh?dh.y:F.A.1B.y},F.A.fx,u(){F.A.9E=I;if(F.A.46==I){F.14.19=F.A.7V}k.11.9H(F)})}P{k.11.9H(F);if(F.A.46==I){k(F).B(\'19\',F.A.7V)}}if(k.1x&&k.1x.8D>0){k.1x.eO(F)}if(k.1t&&F.A.44){k.1t.fC(F)}if(F.A.2Z&&(F.A.8y!=F.A.2c.x||F.A.8v!=F.A.2c.y)){F.A.2Z.1D(F,F.A.b3||[0,0,F.A.8y,F.A.8v])}if(F.A.3T)F.A.3T.1D(F);E I},c7:u(x,y,dx,dy){if(dx!=0)dx=T((dx+(q.A.gx*dx/18.3S(dx))/2)/q.A.gx)*q.A.gx;if(dy!=0)dy=T((dy+(q.A.gy*dy/18.3S(dy))/2)/q.A.gy)*q.A.gy;E{dx:dx,dy:dy,x:0,y:0}},ce:u(x,y,dx,dy){dx=18.3L(18.3r(dx,q.A.28.dx),q.A.28.w+q.A.28.dx-q.A.1B.1C);dy=18.3L(18.3r(dy,q.A.28.dy),q.A.28.h+q.A.28.dy-q.A.1B.hb);E{dx:dx,dy:dy,x:0,y:0}},bX:u(e){if(k.11.F==S||k.11.F.A.9E==1b){E}D F=k.11.F;F.A.4B=k.1a.4a(e);if(F.A.7q==I){45=18.ez(18.6b(F.A.1s.x-F.A.4B.x,2)+18.6b(F.A.1s.y-F.A.4B.y,2));if(450){k.1x.al(F)}E I},2r:u(o){if(!k.11.1c){k(\'2e\',1h).1S(\'<22 id="e8">\');k.11.1c=k(\'#e8\');D el=k.11.1c.K(0);D 4J=el.14;4J.Y=\'1P\';4J.19=\'1o\';4J.9b=\'8j\';4J.eu=\'1o\';4J.2U=\'2K\';if(1X.71){el.bE="e4"}P{4J.gi=\'1o\';4J.e7=\'1o\';4J.e1=\'1o\'}}if(!o){o={}}E q.1E(u(){if(q.9I||!k.1a)E;if(1X.71){q.gh=u(){E I};q.gj=u(){E I}}D el=q;D 5e=o.3v?k(q).gf(o.3v):k(q);if(k.3a.4t){5e.1E(u(){q.bE="e4"})}P{5e.B(\'-gI-7R-8C\',\'1o\');5e.B(\'7R-8C\',\'1o\');5e.B(\'-gH-7R-8C\',\'1o\')}q.A={5e:5e,6N:o.6N?1b:I,46:o.46?1b:I,44:o.44?o.44:I,5i:o.5i?o.5i:I,8s:o.8s?o.8s:I,3I:o.3I?T(o.3I)||0:I,1G:o.1G?2m(o.1G):I,fx:T(o.fx)||S,6R:o.6R?o.6R:I,5t:{},1s:{},4o:o.4o&&o.4o.1K==2A?o.4o:I,3T:o.3T&&o.3T.1K==2A?o.3T:I,2Z:o.2Z&&o.2Z.1K==2A?o.2Z:I,1O:/49|4j/.48(o.1O)?o.1O:I,6M:o.6M?T(o.6M)||0:0,2V:o.2V?o.2V:I,bD:o.bD?1b:I,7O:o.7O||I};if(o.5t&&o.5t.1K==2A)q.A.5t.7R=o.5t;if(o.4m&&o.4m.1K==2A)q.A.4m=o.4m;if(o.2p&&((o.2p.1K==b0&&(o.2p==\'94\'||o.2p==\'1h\'))||(o.2p.1K==7F&&o.2p.1g==4))){q.A.2p=o.2p}if(o.2O){q.A.2O=o.2O}if(o.6a){if(2g o.6a==\'gz\'){q.A.gx=T(o.6a)||1;q.A.gy=T(o.6a)||1}P if(o.6a.1g==2){q.A.gx=T(o.6a[0])||1;q.A.gy=T(o.6a[1])||1}}if(o.3H&&o.3H.1K==2A){q.A.3H=o.3H}q.9I=1b;5e.1E(u(){q.3U=el});5e.1J(\'5v\',k.11.bN)})}};k.fn.23({aS:k.11.4U,7t:k.11.2r});k.1x={du:u(5J,5G,7Q,7S){E 5J<=k.11.F.A.2v&&(5J+7Q)>=(k.11.F.A.2v+k.11.F.A.1B.w)&&5G<=k.11.F.A.2q&&(5G+7S)>=(k.11.F.A.2q+k.11.F.A.1B.h)?1b:I},cV:u(5J,5G,7Q,7S){E!(5J>(k.11.F.A.2v+k.11.F.A.1B.w)||(5J+7Q)(k.11.F.A.2q+k.11.F.A.1B.h)||(5G+7S)k.11.F.A.4B.x&&5Gk.11.F.A.4B.y?1b:I},5r:I,3Q:{},8D:0,3P:{},ed:u(C){if(k.11.F==S){E}D i;k.1x.3Q={};D bJ=I;24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\'.\'+1j.1i.a)){if(1j.1i.m==I){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));1j.1i.m=1b}if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\'.\'+1j.1i.a,1j);C.14.19=\'1o\';k.1t.cT(1j);1j.1i.ay=k.1t.8x(k.1p(1j,\'id\')).7l;C.14.19=C.A.7V;bJ=1b}if(1j.1i.9i){1j.1i.9i.1D(k.1x.3P[i].K(0),[k.11.F])}}}}if(bJ){k.1t.26()}},dS:u(){k.1x.3Q={};24(i in k.1x.3P){if(k.1x.3P[i]!=S){D 1j=k.1x.3P[i].K(0);if(k(k.11.F).is(\'.\'+1j.1i.a)){1j.1i.p=k.23(k.1a.7G(1j),k.1a.74(1j));if(1j.1i.ac){k.1x.3P[i].2R(1j.1i.ac)}k.1x.3Q[i]=k.1x.3P[i];if(k.1t&&1j.1i.s&&k.11.F.A.44){1j.1i.el=k(\'.\'+1j.1i.a,1j);C.14.19=\'1o\';k.1t.cT(1j);C.14.19=C.A.7V}}}}},al:u(e){if(k.11.F==S){E}k.1x.5r=I;D i;D bK=I;D eQ=0;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(k.1x.5r==I&&k.1x[1j.1i.t](1j.1i.p.x,1j.1i.p.y,1j.1i.p.1C,1j.1i.p.hb)){if(1j.1i.hc&&1j.1i.h==I){k.1x.3Q[i].2R(1j.1i.hc)}if(1j.1i.h==I&&1j.1i.7x){bK=1b}1j.1i.h=1b;k.1x.5r=1j;if(k.1t&&1j.1i.s&&k.11.F.A.44){k.1t.1c.K(0).3l=1j.1i.eV;k.1t.al(1j)}eQ++}P if(1j.1i.h==1b){if(1j.1i.7y){1j.1i.7y.1D(1j,[e,k.11.1c.K(0).7c,1j.1i.fx])}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}1j.1i.h=I}}if(k.1t&&!k.1x.5r&&k.11.F.44){k.1t.1c.K(0).14.19=\'1o\'}if(bK){k.1x.5r.1i.7x.1D(k.1x.5r,[e,k.11.1c.K(0).7c])}},eO:u(e){D i;24(i in k.1x.3Q){D 1j=k.1x.3Q[i].K(0);if(1j.1i.ac){k.1x.3Q[i].4i(1j.1i.ac)}if(1j.1i.hc){k.1x.3Q[i].4i(1j.1i.hc)}if(1j.1i.s){k.1t.7s[k.1t.7s.1g]=i}if(1j.1i.9l&&1j.1i.h==1b){1j.1i.h=I;1j.1i.9l.1D(1j,[e,1j.1i.fx])}1j.1i.m=I;1j.1i.h=I}k.1x.3Q={}},4U:u(){E q.1E(u(){if(q.9j){if(q.1i.s){id=k.1p(q,\'id\');k.1t.5L[id]=S;k(\'.\'+q.1i.a,q).aS()}k.1x.3P[\'d\'+q.c2]=S;q.9j=I;q.f=S}})},2r:u(o){E q.1E(u(){if(q.9j==1b||!o.3C||!k.1a||!k.11){E}q.1i={a:o.3C,ac:o.9J||I,hc:o.a5||I,eV:o.58||I,9l:o.gq||o.9l||I,7x:o.7x||o.dC||I,7y:o.7y||o.fO||I,9i:o.9i||I,t:o.6I&&(o.6I==\'du\'||o.6I==\'cV\')?o.6I:\'1s\',fx:o.fx?o.fx:I,m:I,h:I};if(o.cQ==1b&&k.1t){id=k.1p(q,\'id\');k.1t.5L[id]=q.1i.a;q.1i.s=1b;if(o.2Z){q.1i.2Z=o.2Z;q.1i.ay=k.1t.8x(id).7l}}q.9j=1b;q.c2=T(18.6o()*c9);k.1x.3P[\'d\'+q.c2]=k(q);k.1x.8D++})}};k.fn.23({dR:k.1x.4U,do:k.1x.2r});k.gD=k.1x.dS;k.3B={1c:S,8L:u(){3g=q.2y;if(!3g)E;14={dz:k(q).B(\'dz\')||\'\',4A:k(q).B(\'4A\')||\'\',8Z:k(q).B(\'8Z\')||\'\',dP:k(q).B(\'dP\')||\'\',dT:k(q).B(\'dT\')||\'\',dU:k(q).B(\'dU\')||\'\',c3:k(q).B(\'c3\')||\'\',dY:k(q).B(\'dY\')||\'\'};k.3B.1c.B(14);3x=k.3B.dX(3g);3x=3x.4E(12 bb("\\\\n","g"),"
    ");k.3B.1c.3x(\'gL\');ci=k.3B.1c.K(0).4c;k.3B.1c.3x(3x);Z=k.3B.1c.K(0).4c+ci;if(q.6l.2M&&Z>q.6l.2M[0]){Z=q.6l.2M[0]}q.14.Z=Z+\'U\';if(q.4Y==\'cf\'){W=k.3B.1c.K(0).5W+ci;if(q.6l.2M&&W>q.6l.2M[1]){W=q.6l.2M[1]}q.14.W=W+\'U\'}},dX:u(3g){cg={\'&\':\'&gK;\',\'<\':\'&gJ;\',\'>\':\'>\',\'"\':\'&gs;\'};24(i in cg){3g=3g.4E(12 bb(i,\'g\'),cg[i])}E 3g},2r:u(2M){if(k.3B.1c==S){k(\'2e\',1h).1S(\'<22 id="dE" 14="Y: 1P; Q: 0; O: 0; 3n: 2K;">\');k.3B.1c=k(\'#dE\')}E q.1E(u(){if(/cf|ch/.48(q.4Y)){if(q.4Y==\'ch\'){dB=q.5C(\'1u\');if(!/3g|gr/.48(dB)){E}}if(2M&&(2M.1K==bn||(2M.1K==7F&&2M.1g==2))){if(2M.1K==bn)2M=[2M,2M];P{2M[0]=T(2M[0])||8J;2M[1]=T(2M[1])||8J}q.6l={2M:2M}}k(q).5B(k.3B.8L).6y(k.3B.8L).dH(k.3B.8L);k.3B.8L.1D(q)}})}};k.fn.kc=k.3B.2r;k.4K=u(e){if(/^kd$|^ke$|^ka$|^6L$|^k9$|^k5$|^k4$|^k6$|^k7$|^2e$|^k8$|^kf$|^kg$|^kn$|^ko$|^kp$|^kq$/i.48(e.9N))E I;P E 1b};k.fx.a0=u(e,65){D c=e.7c;D cs=c.14;cs.Y=65.Y;cs.5K=65.3G.t;cs.5j=65.3G.l;cs.5k=65.3G.b;cs.5z=65.3G.r;cs.Q=65.Q+\'U\';cs.O=65.O+\'U\';e.31.ew(c,e);e.31.km(e)};k.fx.9P=u(e){if(!k.4K(e))E I;D t=k(e);D es=e.14;D 73=I;if(t.B(\'19\')==\'1o\'){5Y=t.B(\'3n\');t.B(\'3n\',\'2K\').1Y();73=1b}D V={};V.Y=t.B(\'Y\');V.1q=k.1a.2o(e);V.3G=k.1a.cy(e);D co=e.4Z?e.4Z.ei:t.B(\'hU\');V.Q=T(t.B(\'Q\'))||0;V.O=T(t.B(\'O\'))||0;D eo=\'kl\'+T(18.6o()*c9);D 6u=1h.3F(/^1T$|^br$|^kh$|^hr$|^8C$|^kj$|^8T$|^3A$|^kk$|^k3$|^k2$|^9h$|^dl$|^jM$/i.48(e.9N)?\'22\':e.9N);k.1p(6u,\'id\',eo);D jN=k(6u).2R(\'jO\');D 4h=6u.14;D Q=0;D O=0;if(V.Y==\'2s\'||V.Y==\'1P\'){Q=V.Q;O=V.O}4h.Q=Q+\'U\';4h.O=O+\'U\';4h.Y=V.Y!=\'2s\'&&V.Y!=\'1P\'?\'2s\':V.Y;4h.W=V.1q.hb+\'U\';4h.Z=V.1q.1C+\'U\';4h.5K=V.3G.t;4h.5z=V.3G.r;4h.5k=V.3G.b;4h.5j=V.3G.l;4h.2U=\'2K\';if(k.3a.4t){4h.ei=co}P{4h.jK=co}if(k.3a=="4t"){es.5E="8V(1G="+0.ex*2a+")"}es.1G=0.ex;e.31.ew(6u,e);6u.jF(e);es.5K=\'2P\';es.5z=\'2P\';es.5k=\'2P\';es.5j=\'2P\';es.Y=\'1P\';es.eu=\'1o\';es.Q=\'2P\';es.O=\'2P\';if(73){t.2G();es.3n=5Y}E{V:V,3p:k(6u)}};k.fx.8E={jE:[0,1V,1V],jG:[eD,1V,1V],jH:[e6,e6,jI],jP:[0,0,0],ks:[0,0,1V],jY:[dv,42,42],jZ:[0,1V,1V],k0:[0,0,7w],k1:[0,7w,7w],jX:[cn,cn,cn],jS:[0,2a,0],jR:[jT,jU,eb],jV:[7w,0,7w],kr:[85,eb,47],kP:[1V,eA,0],kN:[kO,50,kx],kF:[7w,0,0],kD:[ku,f8,kt],ky:[kH,0,9C],kL:[1V,0,1V],kM:[1V,kJ,0],kv:[0,6C,0],kA:[75,0,kE],kC:[eD,eB,eA],kG:[kI,kB,eB],kw:[e0,1V,1V],kz:[eL,kK,eL],kQ:[9C,9C,9C],jC:[1V,iy,iz],iA:[1V,1V,e0],iB:[0,1V,0],ix:[1V,0,1V],iv:[6C,0,0],iq:[0,0,6C],ip:[6C,6C,0],ir:[1V,dv,0],it:[1V,ah,iu],iC:[6C,0,6C],iD:[1V,0,0],iK:[ah,ah,ah],iL:[1V,1V,1V],iM:[1V,1V,0]};k.fx.6D=u(4x,dm){if(k.fx.8E[4x])E{r:k.fx.8E[4x][0],g:k.fx.8E[4x][1],b:k.fx.8E[4x][2]};P if(2W=/^6Y\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.a4(4x))E{r:T(2W[1]),g:T(2W[2]),b:T(2W[3])};P if(2W=/6Y\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.a4(4x))E{r:2m(2W[1])*2.55,g:2m(2W[2])*2.55,b:2m(2W[3])*2.55};P if(2W=/^#([a-fA-79-9])([a-fA-79-9])([a-fA-79-9])$/.a4(4x))E{r:T("77"+2W[1]+2W[1]),g:T("77"+2W[2]+2W[2]),b:T("77"+2W[3]+2W[3])};P if(2W=/^#([a-fA-79-9]{2})([a-fA-79-9]{2})([a-fA-79-9]{2})$/.a4(4x))E{r:T("77"+2W[1]),g:T("77"+2W[2]),b:T("77"+2W[3])};P E dm==1b?I:{r:1V,g:1V,b:1V}};k.fx.dD={5Q:1,5b:1,5O:1,4S:1,4D:1,4A:1,W:1,O:1,c3:1,iI:1,5k:1,5j:1,5z:1,5K:1,8b:1,6x:1,8c:1,av:1,1G:1,iE:1,iF:1,5n:1,4X:1,5U:1,5M:1,2L:1,jD:1,Q:1,Z:1,3I:1};k.fx.dA={7i:1,iG:1,iH:1,io:1,im:1,4x:1,i2:1};k.fx.8A=[\'i3\',\'i4\',\'i5\',\'i1\'];k.fx.cc={\'cd\':[\'2E\',\'dK\'],\'a8\':[\'2E\',\'bh\'],\'6w\':[\'6w\',\'\'],\'8F\':[\'8F\',\'\']};k.fn.23({5w:u(5X,H,G,J){E q.1w(u(){D a1=k.H(H,G,J);D e=12 k.dM(q,a1,5X)})},c4:u(H,J){E q.1w(u(){D a1=k.H(H,J);D e=12 k.c4(q,a1)})},8o:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D)})},i0:u(2D){E q.1E(u(){if(q.6d)k.by(q,2D);if(q.1w&&q.1w[\'fx\'])q.1w.fx=[]})}});k.23({c4:u(2f,M){D z=q,3t;z.2D=u(){if(k.fQ(M.21))M.21.1D(2f)};z.2I=6V(u(){z.2D()},M.1m);2f.6d=z},G:{c8:u(p,n,1W,1H,1m){E((-18.5H(p*18.2Q)/2)+0.5)*1H+1W}},dM:u(2f,M,5X){D z=q,3t;D y=2f.14;D fR=k.B(2f,"2U");D 72=k.B(2f,"19");D 2j={};z.9O=(12 7g()).7z();M.G=M.G&&k.G[M.G]?M.G:\'c8\';z.ag=u(2w,43){if(k.fx.dD[2w]){if(43==\'1Y\'||43==\'2G\'||43==\'3R\'){if(!2f.6v)2f.6v={};D r=2m(k.6E(2f,2w));2f.6v[2w]=r&&r>-c9?r:(2m(k.B(2f,2w))||0);43=43==\'3R\'?(72==\'1o\'?\'1Y\':\'2G\'):43;M[43]=1b;2j[2w]=43==\'1Y\'?[0,2f.6v[2w]]:[2f.6v[2w],0];if(2w!=\'1G\')y[2w]=2j[2w][0]+(2w!=\'3I\'&&2w!=\'8Z\'?\'U\':\'\');P k.1p(y,"1G",2j[2w][0])}P{2j[2w]=[2m(k.6E(2f,2w)),2m(43)||0]}}P if(k.fx.dA[2w])2j[2w]=[k.fx.6D(k.6E(2f,2w)),k.fx.6D(43)];P if(/^6w$|8F$|2E$|a8$|cd$/i.48(2w)){D m=43.4E(/\\s+/g,\' \').4E(/6Y\\s*\\(\\s*/g,\'6Y(\').4E(/\\s*,\\s*/g,\',\').4E(/\\s*\\)/g,\')\').d5(/([^\\s]+)/g);3m(2w){1e\'6w\':1e\'8F\':1e\'cd\':1e\'a8\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];24(D i=0;iM.1m+z.9O){5T(z.2I);z.2I=S;24(p in 2j){if(p=="1G")k.1p(y,"1G",2j[p][1]);P if(2g 2j[p][1]==\'8T\')y[p]=\'6Y(\'+2j[p][1].r+\',\'+2j[p][1].g+\',\'+2j[p][1].b+\')\';P y[p]=2j[p][1]+(p!=\'3I\'&&p!=\'8Z\'?\'U\':\'\')}if(M.2G||M.1Y)24(D p in 2f.6v)if(p=="1G")k.1p(y,p,2f.6v[p]);P y[p]="";y.19=M.2G?\'1o\':(72!=\'1o\'?72:\'2B\');y.2U=fR;2f.6d=S;if(k.fQ(M.21))M.21.1D(2f)}P{D n=t-q.9O;D 8w=n/M.1m;24(p in 2j){if(2g 2j[p][1]==\'8T\'){y[p]=\'6Y(\'+T(k.G[M.G](8w,n,2j[p][0].r,(2j[p][1].r-2j[p][0].r),M.1m))+\',\'+T(k.G[M.G](8w,n,2j[p][0].g,(2j[p][1].g-2j[p][0].g),M.1m))+\',\'+T(k.G[M.G](8w,n,2j[p][0].b,(2j[p][1].b-2j[p][0].b),M.1m))+\')\'}P{D bz=k.G[M.G](8w,n,2j[p][0],(2j[p][1]-2j[p][0]),M.1m);if(p=="1G")k.1p(y,"1G",bz);P y[p]=bz+(p!=\'3I\'&&p!=\'8Z\'?\'U\':\'\')}}}};z.2I=6V(u(){z.2D()},13);2f.6d=z},by:u(2f,2D){if(2D)2f.6d.9O-=iO;P{1X.5T(2f.6d.2I);2f.6d=S;k.2H(2f,"fx")}}});k.bl=u(5Z){D 5f={};if(2g 5Z==\'4V\'){5Z=5Z.6c().7C(\';\');24(D i=0;i<5Z.1g;i++){6X=5Z[i].7C(\':\');if(6X.1g==2){5f[k.g6(6X[0].4E(/\\-(\\w)/g,u(m,c){E c.jo()}))]=k.g6(6X[1])}}}E 5f};k.fn.23({g3:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'4F\',G)})},gb:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'4r\',G)})},jl:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'fJ\',G)})},jk:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'O\',G)})},jg:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'2L\',G)})},jf:u(H,J,G){E q.1w(\'1n\',u(){12 k.fx.61(q,H,J,\'fh\',G)})}});k.fx.61=u(e,H,J,2S,G){if(!k.4K(e)){k.2H(e,\'1n\');E I}D z=q;z.el=k(e);z.1N=k.1a.2o(e);z.G=2g J==\'4V\'?J:G||S;if(!e.4s)e.4s=z.el.B(\'19\');if(2S==\'fJ\'){2S=z.el.B(\'19\')==\'1o\'?\'4r\':\'4F\'}P if(2S==\'fh\'){2S=z.el.B(\'19\')==\'1o\'?\'2L\':\'O\'}z.el.1Y();z.H=H;z.J=2g J==\'u\'?J:S;z.fx=k.fx.9P(e);z.2S=2S;z.21=u(){if(z.J&&z.J.1K==2A){z.J.1D(z.el.K(0))}if(z.2S=