mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986
git-svn-id: https://develop.svn.wordpress.org/trunk@4495 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -128,7 +128,7 @@ case 'add-category' : // On the Fly
|
||||
break;
|
||||
case 'add-cat' : // From Manage->Categories
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
die('-1');
|
||||
if ( !$cat = wp_insert_category( $_POST ) )
|
||||
die('0');
|
||||
if ( !$cat = get_category( $cat ) )
|
||||
|
||||
+23
-23
@@ -48,7 +48,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
|
||||
if ( ! $user->has_cap('edit_others_posts') ) {
|
||||
if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
|
||||
return array($user->id);
|
||||
else
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ function wp_insert_category($catarr) {
|
||||
$update = false;
|
||||
|
||||
$cat_name = apply_filters('pre_category_name', $cat_name);
|
||||
|
||||
|
||||
if (empty ($category_nicename))
|
||||
$category_nicename = sanitize_title($cat_name);
|
||||
else
|
||||
@@ -198,7 +198,7 @@ function wp_delete_category($cat_ID) {
|
||||
$cats = array($default_cat);
|
||||
else
|
||||
$cats = array_diff($cats, array($cat_ID));
|
||||
wp_set_post_categories($post_id, $cats);
|
||||
wp_set_post_categories($post_id, $cats);
|
||||
}
|
||||
|
||||
$default_link_cat = get_option('default_link_category');
|
||||
@@ -209,9 +209,9 @@ function wp_delete_category($cat_ID) {
|
||||
$cats = array($default_link_cat);
|
||||
else
|
||||
$cats = array_diff($cats, array($cat_ID));
|
||||
wp_set_link_cats($link_id, $cats);
|
||||
wp_set_link_cats($link_id, $cats);
|
||||
}
|
||||
|
||||
|
||||
wp_cache_delete($cat_ID, 'category');
|
||||
wp_cache_delete('all_category_ids', 'category');
|
||||
|
||||
@@ -285,9 +285,9 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
|
||||
function wp_revoke_user($id) {
|
||||
$id = (int) $id;
|
||||
|
||||
|
||||
$user = new WP_User($id);
|
||||
$user->remove_all_caps();
|
||||
$user->remove_all_caps();
|
||||
}
|
||||
|
||||
function wp_insert_link($linkdata) {
|
||||
@@ -385,15 +385,15 @@ function wp_update_link($linkdata) {
|
||||
$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'])
|
||||
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'];
|
||||
$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;
|
||||
$linkdata['link_category'] = $link_cats;
|
||||
|
||||
return wp_insert_link($linkdata);
|
||||
}
|
||||
@@ -402,7 +402,7 @@ function wp_delete_link($link_id) {
|
||||
global $wpdb;
|
||||
|
||||
do_action('delete_link', $link_id);
|
||||
|
||||
|
||||
$categories = wp_get_link_cats($link_id);
|
||||
if( is_array( $categories ) ) {
|
||||
foreach ( $categories as $category ) {
|
||||
@@ -418,9 +418,9 @@ function wp_delete_link($link_id) {
|
||||
function wp_get_link_cats($link_ID = 0) {
|
||||
global $wpdb;
|
||||
|
||||
$sql = "SELECT category_id
|
||||
FROM $wpdb->link2cat
|
||||
WHERE link_id = $link_ID
|
||||
$sql = "SELECT category_id
|
||||
FROM $wpdb->link2cat
|
||||
WHERE link_id = $link_ID
|
||||
ORDER BY category_id";
|
||||
|
||||
$result = $wpdb->get_col($sql);
|
||||
@@ -441,8 +441,8 @@ function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
|
||||
|
||||
// First the old categories
|
||||
$old_categories = $wpdb->get_col("
|
||||
SELECT category_id
|
||||
FROM $wpdb->link2cat
|
||||
SELECT category_id
|
||||
FROM $wpdb->link2cat
|
||||
WHERE link_id = $link_ID");
|
||||
|
||||
if (!$old_categories) {
|
||||
@@ -457,9 +457,9 @@ function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
|
||||
if ($delete_cats) {
|
||||
foreach ($delete_cats as $del) {
|
||||
$wpdb->query("
|
||||
DELETE FROM $wpdb->link2cat
|
||||
WHERE category_id = $del
|
||||
AND link_id = $link_ID
|
||||
DELETE FROM $wpdb->link2cat
|
||||
WHERE category_id = $del
|
||||
AND link_id = $link_ID
|
||||
");
|
||||
}
|
||||
}
|
||||
@@ -470,11 +470,11 @@ function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
|
||||
if ($add_cats) {
|
||||
foreach ($add_cats as $new_cat) {
|
||||
$wpdb->query("
|
||||
INSERT INTO $wpdb->link2cat (link_id, category_id)
|
||||
INSERT INTO $wpdb->link2cat (link_id, category_id)
|
||||
VALUES ($link_ID, $new_cat)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update category counts.
|
||||
$all_affected_cats = array_unique(array_merge($link_categories, $old_categories));
|
||||
foreach ( $all_affected_cats as $cat_id ) {
|
||||
|
||||
@@ -1139,10 +1139,10 @@ function touch_time( $edit = 1, $for_post = 1 ) {
|
||||
?>
|
||||
</select>
|
||||
<input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"/>
|
||||
<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @
|
||||
<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> :
|
||||
<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||
<input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @
|
||||
<input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> :
|
||||
<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||
<?php
|
||||
if ( $edit ) {
|
||||
_e( 'Existing timestamp' );
|
||||
@@ -1387,7 +1387,7 @@ function user_can_access_admin_page() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -35,16 +35,16 @@ if (!empty($post_title))
|
||||
else
|
||||
$post->post_title = $popuptitle;
|
||||
|
||||
|
||||
|
||||
$content = wp_specialchars($_REQUEST['content']);
|
||||
$popupurl = wp_specialchars($_REQUEST['popupurl']);
|
||||
if ( !empty($content) ) {
|
||||
$post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
|
||||
} else {
|
||||
$post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
|
||||
}
|
||||
if ( !empty($content) ) {
|
||||
$post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
|
||||
} else {
|
||||
$post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
|
||||
}
|
||||
|
||||
/* /big funky fixes */
|
||||
/* /big funky fixes */
|
||||
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
@@ -77,15 +77,15 @@ $popupurl = wp_specialchars($_REQUEST['popupurl']);
|
||||
}
|
||||
|
||||
#wpbookmarklet .wrap {
|
||||
border: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
#wpbookmarklet #postdiv {
|
||||
margin-bottom: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
#wpbookmarklet #titlediv {
|
||||
margin-bottom: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
-->
|
||||
|
||||
@@ -48,10 +48,10 @@ 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');
|
||||
require_once ('admin-header.php');
|
||||
$cat_ID = (int) $_GET['cat_ID'];
|
||||
$category = get_category_to_edit($cat_ID);
|
||||
include('edit-category-form.php');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ function customFieldsAddIn() {
|
||||
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); };
|
||||
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); };
|
||||
inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ switch ( $_GET['pagenow'] ) :
|
||||
break;
|
||||
case 'page.php' :
|
||||
case 'page-new.php' :
|
||||
$man = 'pagemeta';
|
||||
$man = 'pagemeta';
|
||||
break;
|
||||
case 'link.php' :
|
||||
$man = 'linkmeta';
|
||||
|
||||
@@ -22,8 +22,8 @@ if ( ! empty($cat_ID) ) {
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
|
||||
<tr>
|
||||
<th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>
|
||||
<td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" /></td>
|
||||
<th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>
|
||||
<td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category slug:') ?></label></th>
|
||||
|
||||
@@ -143,7 +143,7 @@ $start = " start='$offset'";
|
||||
++$i; $class = '';
|
||||
$authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
|
||||
$comment_status = wp_get_comment_status($comment->comment_ID);
|
||||
if ('unapproved' == $comment_status)
|
||||
if ('unapproved' == $comment_status)
|
||||
$class .= ' unapproved';
|
||||
if ($i % 2)
|
||||
$class .= ' alternate';
|
||||
@@ -153,7 +153,7 @@ $start = " start='$offset'";
|
||||
|
||||
<?php comment_text() ?>
|
||||
|
||||
<p><?php comment_date('M j, g:i A'); ?> — [
|
||||
<p><?php comment_date('M j, g:i A'); ?> — [
|
||||
<?php
|
||||
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>';
|
||||
@@ -181,7 +181,7 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||
|
||||
?>
|
||||
<p>
|
||||
<strong><?php _e('No comments found.') ?></strong></p>
|
||||
<strong><?php _e('No comments found.') ?></strong></p>
|
||||
|
||||
<?php
|
||||
} // end if ($comments)
|
||||
|
||||
@@ -8,8 +8,7 @@ $messages[3] = __('Custom field deleted.');
|
||||
<?php endif; ?>
|
||||
|
||||
<form name="post" action="post.php" method="post" id="post">
|
||||
<?php if ( (isset($mode) && 'bookmarklet' == $mode) ||
|
||||
isset($_GET['popupurl']) ): ?>
|
||||
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
|
||||
<input type="hidden" name="mode" value="bookmarklet" />
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -121,7 +120,7 @@ if ( $authors && count( $authors ) > 1 ) :
|
||||
<h3 class="dbx-handle"><?php _e('Post Author'); ?>:</h3>
|
||||
<div class="dbx-content">
|
||||
<select name="post_author_override" id="post_author_override">
|
||||
<?php
|
||||
<?php
|
||||
foreach ($authors as $o) :
|
||||
$o = get_userdata( $o->ID );
|
||||
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
|
||||
@@ -140,8 +139,8 @@ endforeach;
|
||||
</div>
|
||||
|
||||
<fieldset id="titlediv">
|
||||
<legend><?php _e('Title') ?></legend>
|
||||
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
|
||||
<legend><?php _e('Title') ?></legend>
|
||||
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>">
|
||||
@@ -208,7 +207,7 @@ if (current_user_can('upload_files')) {
|
||||
</div>
|
||||
<div class="dbx-content-wrapper">
|
||||
<div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>)
|
||||
<?php
|
||||
<?php
|
||||
if ( ! empty($pings) )
|
||||
echo $pings;
|
||||
?>
|
||||
@@ -227,7 +226,7 @@ if ( ! empty($pings) )
|
||||
<table cellpadding="3">
|
||||
<?php
|
||||
$metadata = has_meta($post_ID);
|
||||
list_meta($metadata);
|
||||
list_meta($metadata);
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
@@ -54,8 +54,8 @@ addLoadEvent(focusit);
|
||||
<tr>
|
||||
<th scope="row" valign="top"><?php _e('Comment Status') ?>:</th>
|
||||
<td><label for="comment_status_approved" class="selectit"><input id="comment_status_approved" name="comment_status" type="radio" value="1" <?php checked($comment->comment_approved, '1'); ?> /> <?php _e('Approved') ?></label><br />
|
||||
<label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label><br />
|
||||
<label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td>
|
||||
<label for="comment_status_moderated" class="selectit"><input id="comment_status_moderated" name="comment_status" type="radio" value="0" <?php checked($comment->comment_approved, '0'); ?> /> <?php _e('Moderated') ?></label><br />
|
||||
<label for="comment_status_spam" class="selectit"><input id="comment_status_spam" name="comment_status" type="radio" value="spam" <?php checked($comment->comment_approved, 'spam'); ?> /> <?php _e('Spam') ?></label></td>
|
||||
</tr>
|
||||
|
||||
<?php if ( current_user_can('edit_posts') ) : ?>
|
||||
|
||||
@@ -54,17 +54,17 @@ edCanvas = document.getElementById('content');
|
||||
<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?>
|
||||
<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>
|
||||
|
||||
<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
|
||||
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
|
||||
<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
|
||||
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
|
||||
|
||||
<?php if ( current_user_can('edit_posts') ) : ?>
|
||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
|
||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ('bookmarklet' != $mode) {
|
||||
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />';
|
||||
} ?>
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />
|
||||
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />';
|
||||
} ?>
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />
|
||||
</p>
|
||||
|
||||
<?php do_action('simple_edit_form', ''); ?>
|
||||
|
||||
@@ -30,7 +30,7 @@ function xfn_check($class, $value = '', $type = 'check') {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="wrap">
|
||||
<h2><?php echo $heading ?></h2>
|
||||
<?php echo $form ?>
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
@@ -48,7 +48,7 @@ function xfn_check($class, $value = '', $type = 'check') {
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Target') ?></h3>
|
||||
<h3 class="dbx-handle"><?php _e('Target') ?></h3>
|
||||
<div class="dbx-content">
|
||||
<label for="link_target_blank" class="selectit">
|
||||
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
|
||||
@@ -63,7 +63,7 @@ function xfn_check($class, $value = '', $type = 'check') {
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
|
||||
<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
|
||||
<div class="dbx-content">
|
||||
<label for="link_visible_yes" class="selectit">
|
||||
<input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
|
||||
|
||||
@@ -16,7 +16,7 @@ if (0 == $post_ID) {
|
||||
$sendto = wp_get_referer();
|
||||
|
||||
if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
|
||||
$sendto = 'redo';
|
||||
$sendto = 'redo';
|
||||
$sendto = wp_specialchars( $sendto );
|
||||
|
||||
?>
|
||||
@@ -27,7 +27,7 @@ $sendto = wp_specialchars( $sendto );
|
||||
wp_nonce_field($nonce_action);
|
||||
|
||||
if (isset($mode) && 'bookmarklet' == $mode) {
|
||||
echo '<input type="hidden" name="mode" value="bookmarklet" />';
|
||||
echo '<input type="hidden" name="mode" value="bookmarklet" />';
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
@@ -103,7 +103,7 @@ addLoadEvent(focusit);
|
||||
<h3 class="dbx-handle"><?php _e('Page Author'); ?>:</h3>
|
||||
<div class="dbx-content">
|
||||
<select name="post_author_override" id="post_author_override">
|
||||
<?php
|
||||
<?php
|
||||
foreach ($authors as $o) :
|
||||
$o = get_userdata( $o->ID );
|
||||
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
|
||||
@@ -117,7 +117,7 @@ endforeach;
|
||||
<?php endif; ?>
|
||||
|
||||
<fieldset id="pageorder" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Page Order') ?></h3>
|
||||
<h3 class="dbx-handle"><?php _e('Page Order') ?></h3>
|
||||
<div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div>
|
||||
</fieldset>
|
||||
|
||||
@@ -168,9 +168,9 @@ if (current_user_can('upload_files')) {
|
||||
<h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
|
||||
<div id="postcustomstuff" class="dbx-content">
|
||||
<table cellpadding="3">
|
||||
<?php
|
||||
<?php
|
||||
$metadata = has_meta($post_ID);
|
||||
list_meta($metadata);
|
||||
list_meta($metadata);
|
||||
?>
|
||||
|
||||
</table>
|
||||
@@ -186,7 +186,7 @@ list_meta($metadata);
|
||||
</div>
|
||||
|
||||
<?php if ('edit' == $action) :
|
||||
$delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );
|
||||
$delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID );
|
||||
if ( current_user_can('delete_page', $post->ID) ) ?>
|
||||
<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -10,12 +10,12 @@ require_once('admin-header.php');
|
||||
<h2><?php _e('Page Management'); ?></h2>
|
||||
<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page »'); ?></a></p>
|
||||
|
||||
<form name="searchform" action="" method="get">
|
||||
<fieldset>
|
||||
<legend><?php _e('Search Pages…') ?></legend>
|
||||
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" />
|
||||
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
|
||||
</fieldset>
|
||||
<form name="searchform" action="" method="get">
|
||||
<fieldset>
|
||||
<legend><?php _e('Search Pages…') ?></legend>
|
||||
<input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" />
|
||||
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
@@ -53,10 +53,10 @@ page_rows(0, 0, $posts, $all);
|
||||
<p><?php _e('No pages yet.') ?></p>
|
||||
<?php
|
||||
} // end if ($posts)
|
||||
?>
|
||||
?>
|
||||
|
||||
<h3><a href="page-new.php"><?php _e('Create New Page »'); ?></a></h3>
|
||||
|
||||
</div>
|
||||
|
||||
<?php include('admin-footer.php'); ?>
|
||||
<?php include('admin-footer.php'); ?>
|
||||
|
||||
+30
-30
@@ -12,11 +12,11 @@ $drafts = get_users_drafts( $user_ID );
|
||||
$other_drafts = get_others_drafts( $user_ID);
|
||||
|
||||
if ($drafts || $other_drafts) {
|
||||
?>
|
||||
?>
|
||||
<div class="wrap">
|
||||
<?php if ($drafts) { ?>
|
||||
<p><strong><?php _e('Your Drafts:') ?></strong>
|
||||
<?php
|
||||
<p><strong><?php _e('Your Drafts:') ?></strong>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($drafts as $draft) {
|
||||
if (0 != $i)
|
||||
@@ -27,13 +27,13 @@ if ($drafts || $other_drafts) {
|
||||
echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
|
||||
++$i;
|
||||
}
|
||||
?>
|
||||
.</p>
|
||||
?>
|
||||
.</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($other_drafts) { ?>
|
||||
<p><strong><?php _e('Other’s Drafts:') ?></strong>
|
||||
<?php
|
||||
<?php if ($other_drafts) { ?>
|
||||
<p><strong><?php _e('Other’s Drafts:') ?></strong>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($other_drafts as $draft) {
|
||||
if (0 != $i)
|
||||
@@ -44,8 +44,8 @@ if ($drafts || $other_drafts) {
|
||||
echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
|
||||
++$i;
|
||||
}
|
||||
?>
|
||||
.</p>
|
||||
?>
|
||||
.</p>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@@ -88,7 +88,7 @@ if ( count($arc_result) ) { ?>
|
||||
<form name="viewarc" id="viewarc" action="" method="get">
|
||||
<fieldset>
|
||||
<legend><?php _e('Browse Month…') ?></legend>
|
||||
<select name='m'>
|
||||
<select name='m'>
|
||||
<?php
|
||||
foreach ($arc_result as $arc_row) {
|
||||
if ( $arc_row->yyear == 0 )
|
||||
@@ -127,12 +127,12 @@ if ( count($arc_result) ) { ?>
|
||||
<?php
|
||||
// define the columns to display, the syntax is 'internal name' => 'display name'
|
||||
$posts_columns = array(
|
||||
'id' => __('ID'),
|
||||
'date' => __('When'),
|
||||
'title' => __('Title'),
|
||||
'categories' => __('Categories'),
|
||||
'comments' => __('Comments'),
|
||||
'author' => __('Author')
|
||||
'id' => __('ID'),
|
||||
'date' => __('When'),
|
||||
'title' => __('Title'),
|
||||
'categories' => __('Categories'),
|
||||
'comments' => __('Comments'),
|
||||
'author' => __('Author')
|
||||
);
|
||||
$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
|
||||
|
||||
@@ -143,7 +143,7 @@ $posts_columns['control_delete'] = '';
|
||||
|
||||
?>
|
||||
|
||||
<table class="widefat">
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -160,7 +160,7 @@ $bgcolor = '';
|
||||
while (have_posts()) : the_post();
|
||||
add_filter('the_title','wp_specialchars');
|
||||
$class = ('alternate' == $class) ? '' : 'alternate';
|
||||
?>
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'>
|
||||
|
||||
<?php
|
||||
@@ -195,9 +195,9 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
|
||||
case 'comments':
|
||||
?>
|
||||
<td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1">
|
||||
<?php comments_number(__('0'), __('1'), __('%')) ?>
|
||||
</a></td>
|
||||
<td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1">
|
||||
<?php comments_number(__('0'), __('1'), __('%')) ?>
|
||||
</a></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
@@ -259,9 +259,9 @@ if ( 1 == count($posts) ) {
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
|
||||
if ($comments) {
|
||||
?>
|
||||
<h3 id="comments"><?php _e('Comments') ?></h3>
|
||||
<ol id="the-comment-list" class="commentlist">
|
||||
?>
|
||||
<h3 id="comments"><?php _e('Comments') ?></h3>
|
||||
<ol id="the-comment-list" class="commentlist">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($comments as $comment) {
|
||||
@@ -269,7 +269,7 @@ foreach ($comments as $comment) {
|
||||
++$i; $class = '';
|
||||
$authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"));
|
||||
$comment_status = wp_get_comment_status($comment->comment_ID);
|
||||
if ('unapproved' == $comment_status)
|
||||
if ('unapproved' == $comment_status)
|
||||
$class .= ' unapproved';
|
||||
if ($i % 2)
|
||||
$class .= ' alternate';
|
||||
@@ -299,8 +299,8 @@ if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
echo '</ol>';
|
||||
}//end if comments
|
||||
?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
include('admin-footer.php');
|
||||
?>
|
||||
?>
|
||||
|
||||
+3
-3
@@ -72,7 +72,7 @@ $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_dat
|
||||
<!-- You will be taken through the simple import procedure. -->
|
||||
|
||||
<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"-->
|
||||
<rss version="2.0"
|
||||
<rss version="2.0"
|
||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
||||
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
@@ -108,7 +108,7 @@ $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_dat
|
||||
<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
|
||||
<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
|
||||
<?php
|
||||
$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
|
||||
$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
|
||||
if ( $postmeta ) {
|
||||
?>
|
||||
<?php foreach( $postmeta as $meta ) { ?>
|
||||
@@ -119,7 +119,7 @@ if ( $postmeta ) {
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
|
||||
if ( $comments ) { foreach ( $comments as $c ) { ?>
|
||||
<wp:comment>
|
||||
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
|
||||
|
||||
@@ -517,7 +517,7 @@ class Blogger_Import {
|
||||
$did_one = true;
|
||||
}
|
||||
$output.= "<p>$archivename $status</p>\n";
|
||||
}
|
||||
}
|
||||
if ( ! $did_one )
|
||||
$this->set_next_step(7);
|
||||
die( $this->refresher(1000) . $output );
|
||||
|
||||
@@ -20,7 +20,7 @@ class BW_Import {
|
||||
$trans_tbl = array_flip($trans_tbl);
|
||||
return strtr($string, $trans_tbl);
|
||||
}
|
||||
|
||||
|
||||
function greet() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>'.__('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.').'</p>';
|
||||
@@ -30,7 +30,7 @@ class BW_Import {
|
||||
|
||||
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
|
||||
@@ -39,7 +39,7 @@ class BW_Import {
|
||||
preg_match_all('|(<item[^>]+>(.*?)</item>)|is', $importdata, $posts);
|
||||
$posts = $posts[1];
|
||||
unset($importdata);
|
||||
echo '<ol>';
|
||||
echo '<ol>';
|
||||
foreach ($posts as $post) {
|
||||
flush();
|
||||
preg_match('|<item type=\"(.*?)\">|is', $post, $post_type);
|
||||
@@ -102,7 +102,7 @@ class BW_Import {
|
||||
|
||||
preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments);
|
||||
$comments = $comments[1];
|
||||
|
||||
|
||||
if ( $comments ) {
|
||||
$comment_post_ID = $post_id;
|
||||
$num_comments = 0;
|
||||
@@ -157,7 +157,7 @@ class BW_Import {
|
||||
$this->file = $file['file'];
|
||||
$this->import_posts();
|
||||
wp_import_cleanup($file['id']);
|
||||
|
||||
|
||||
echo '<h3>';
|
||||
printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
|
||||
echo '</h3>';
|
||||
@@ -170,7 +170,7 @@ class BW_Import {
|
||||
$step = (int) $_GET['step'];
|
||||
|
||||
$this->header();
|
||||
|
||||
|
||||
switch ($step) {
|
||||
case 0 :
|
||||
$this->greet();
|
||||
@@ -179,12 +179,12 @@ class BW_Import {
|
||||
$this->import();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function BW_Import() {
|
||||
// Nothing.
|
||||
// Nothing.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
**/
|
||||
if(!function_exists('get_catbynicename'))
|
||||
{
|
||||
function get_catbynicename($category_nicename)
|
||||
function get_catbynicename($category_nicename)
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
@@ -60,57 +60,58 @@ if(!function_exists('link_exists'))
|
||||
//
|
||||
// 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_1byte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0x80) == 0x00;
|
||||
}
|
||||
|
||||
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 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)) {
|
||||
@@ -151,7 +152,7 @@ class Dotclear_Import {
|
||||
echo '</form></div>';
|
||||
}
|
||||
|
||||
function get_dc_cats()
|
||||
function get_dc_cats()
|
||||
{
|
||||
global $wpdb;
|
||||
// General Housekeeping
|
||||
@@ -186,7 +187,7 @@ class Dotclear_Import {
|
||||
// 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);
|
||||
ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A);
|
||||
}
|
||||
|
||||
function get_dc_comments()
|
||||
@@ -211,7 +212,7 @@ class Dotclear_Import {
|
||||
return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A);
|
||||
}
|
||||
|
||||
function cat2wp($categories='')
|
||||
function cat2wp($categories='')
|
||||
{
|
||||
// General Housekeeping
|
||||
global $wpdb;
|
||||
@@ -221,7 +222,7 @@ class Dotclear_Import {
|
||||
if(is_array($categories))
|
||||
{
|
||||
echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
|
||||
foreach ($categories as $category)
|
||||
foreach ($categories as $category)
|
||||
{
|
||||
$count++;
|
||||
extract($category);
|
||||
@@ -283,7 +284,7 @@ class Dotclear_Import {
|
||||
'display_name' => $Realname)
|
||||
);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$ret_id = wp_insert_user(array(
|
||||
'user_login' => $user_id,
|
||||
@@ -384,7 +385,7 @@ class Dotclear_Import {
|
||||
'comment_count' => $post_nb_comment + $post_nb_trackback)
|
||||
);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$ret_id = wp_insert_post(array(
|
||||
'post_author' => $authorid,
|
||||
@@ -460,7 +461,7 @@ class Dotclear_Import {
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// Insert comments
|
||||
$ret_id = wp_insert_comment(array(
|
||||
@@ -547,7 +548,7 @@ class Dotclear_Import {
|
||||
return false;
|
||||
}
|
||||
|
||||
function import_categories()
|
||||
function import_categories()
|
||||
{
|
||||
// Category Import
|
||||
$cats = $this->get_dc_cats();
|
||||
@@ -565,7 +566,7 @@ class Dotclear_Import {
|
||||
function import_users()
|
||||
{
|
||||
// User Import
|
||||
$users = $this->get_dc_users();
|
||||
$users = $this->get_dc_users();
|
||||
$this->users2wp($users);
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=3" method="post">';
|
||||
@@ -655,7 +656,7 @@ class Dotclear_Import {
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
function dispatch()
|
||||
function dispatch()
|
||||
{
|
||||
|
||||
if (empty ($_GET['step']))
|
||||
@@ -664,7 +665,7 @@ class Dotclear_Import {
|
||||
$step = (int) $_GET['step'];
|
||||
$this->header();
|
||||
|
||||
if ( $step > 0 )
|
||||
if ( $step > 0 )
|
||||
{
|
||||
if($_POST['dbuser'])
|
||||
{
|
||||
@@ -689,25 +690,25 @@ class Dotclear_Import {
|
||||
{
|
||||
if(get_option('dchost'))
|
||||
delete_option('dchost');
|
||||
add_option('dchost',$_POST['dbhost']);
|
||||
add_option('dchost',$_POST['dbhost']);
|
||||
}
|
||||
if($_POST['dccharset'])
|
||||
{
|
||||
if(get_option('dccharset'))
|
||||
delete_option('dccharset');
|
||||
add_option('dccharset',$_POST['dccharset']);
|
||||
add_option('dccharset',$_POST['dccharset']);
|
||||
}
|
||||
if($_POST['dbprefix'])
|
||||
{
|
||||
if(get_option('dcdbprefix'))
|
||||
delete_option('dcdbprefix');
|
||||
add_option('dcdbprefix',$_POST['dbprefix']);
|
||||
add_option('dcdbprefix',$_POST['dbprefix']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
switch ($step)
|
||||
switch ($step)
|
||||
{
|
||||
default:
|
||||
case 0 :
|
||||
@@ -736,7 +737,7 @@ class Dotclear_Import {
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function Dotclear_Import()
|
||||
function Dotclear_Import()
|
||||
{
|
||||
// Nothing.
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ class GM_Import {
|
||||
$string = str_replace("|*|","<br />\n",$string);
|
||||
return($string);
|
||||
}
|
||||
|
||||
|
||||
function import() {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
$wpvarstoreset = array('gmpath', 'archivespath', 'lastentry');
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
@@ -136,11 +136,11 @@ class GM_Import {
|
||||
<li><?php _e('importing posts, comments, and karma...') ?><br /><ul><?php
|
||||
|
||||
chdir($archivespath);
|
||||
|
||||
|
||||
for($i = 0; $i <= $lastentry; $i = $i + 1) {
|
||||
|
||||
|
||||
$entryfile = "";
|
||||
|
||||
|
||||
if ($i<10000000) {
|
||||
$entryfile .= "0";
|
||||
if ($i<1000000) {
|
||||
@@ -194,7 +194,7 @@ class GM_Import {
|
||||
$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)');
|
||||
@@ -303,7 +303,7 @@ class GM_Import {
|
||||
}
|
||||
|
||||
function GM_Import() {
|
||||
// Nothing.
|
||||
// Nothing.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ class MT_Import {
|
||||
$pass = 'changeme';
|
||||
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
|
||||
++ $this->j;
|
||||
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
|
||||
$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 (!$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.
|
||||
@@ -399,7 +399,7 @@ class MT_Import {
|
||||
|
||||
function import() {
|
||||
$this->id = (int) $_GET['id'];
|
||||
|
||||
|
||||
$this->file = get_attached_file($this->id);
|
||||
$this->get_authors_from_post();
|
||||
$this->get_entries();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
**/
|
||||
if(!function_exists('get_catbynicename'))
|
||||
{
|
||||
function get_catbynicename($category_nicename)
|
||||
function get_catbynicename($category_nicename)
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
@@ -70,13 +70,13 @@ class Textpattern_Import {
|
||||
$prefix = get_option('tpre');
|
||||
|
||||
// Get Categories
|
||||
return $txpdb->get_results('SELECT
|
||||
id,
|
||||
name,
|
||||
title
|
||||
FROM '.$prefix.'txp_category
|
||||
WHERE type = "article"',
|
||||
ARRAY_A);
|
||||
return $txpdb->get_results('SELECT
|
||||
id,
|
||||
name,
|
||||
title
|
||||
FROM '.$prefix.'txp_category
|
||||
WHERE type = "article"',
|
||||
ARRAY_A);
|
||||
}
|
||||
|
||||
function get_txp_users()
|
||||
@@ -90,12 +90,12 @@ class Textpattern_Import {
|
||||
// Get Users
|
||||
|
||||
return $txpdb->get_results('SELECT
|
||||
user_id,
|
||||
name,
|
||||
RealName,
|
||||
email,
|
||||
privs
|
||||
FROM '.$prefix.'txp_users', ARRAY_A);
|
||||
user_id,
|
||||
name,
|
||||
RealName,
|
||||
email,
|
||||
privs
|
||||
FROM '.$prefix.'txp_users', ARRAY_A);
|
||||
}
|
||||
|
||||
function get_txp_posts()
|
||||
@@ -106,22 +106,22 @@ class Textpattern_Import {
|
||||
$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);
|
||||
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()
|
||||
@@ -143,18 +143,18 @@ class Textpattern_Import {
|
||||
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);
|
||||
return $txpdb->get_results('SELECT
|
||||
id,
|
||||
date,
|
||||
category,
|
||||
url,
|
||||
linkname,
|
||||
description
|
||||
FROM '.$prefix.'txp_link',
|
||||
ARRAY_A);
|
||||
}
|
||||
|
||||
function cat2wp($categories='')
|
||||
function cat2wp($categories='')
|
||||
{
|
||||
// General Housekeeping
|
||||
global $wpdb;
|
||||
@@ -164,7 +164,7 @@ class Textpattern_Import {
|
||||
if(is_array($categories))
|
||||
{
|
||||
echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
|
||||
foreach ($categories as $category)
|
||||
foreach ($categories as $category)
|
||||
{
|
||||
$count++;
|
||||
extract($category);
|
||||
@@ -226,7 +226,7 @@ class Textpattern_Import {
|
||||
'display_name' => $name)
|
||||
);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$ret_id = wp_insert_user(array(
|
||||
'user_login' => $name,
|
||||
@@ -302,35 +302,35 @@ class Textpattern_Import {
|
||||
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)
|
||||
);
|
||||
'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)
|
||||
);
|
||||
}
|
||||
else
|
||||
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)
|
||||
);
|
||||
'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)
|
||||
);
|
||||
}
|
||||
$txpposts2wpposts[$ID] = $ret_id;
|
||||
|
||||
@@ -379,29 +379,29 @@ class Textpattern_Import {
|
||||
{
|
||||
// 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)
|
||||
);
|
||||
'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
|
||||
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)
|
||||
);
|
||||
'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;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ class Textpattern_Import {
|
||||
'link_updated' => $date)
|
||||
);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$ret_id = wp_insert_link(array(
|
||||
'link_url' => $url,
|
||||
@@ -472,7 +472,7 @@ class Textpattern_Import {
|
||||
return false;
|
||||
}
|
||||
|
||||
function import_categories()
|
||||
function import_categories()
|
||||
{
|
||||
// Category Import
|
||||
$cats = $this->get_txp_cats();
|
||||
@@ -490,7 +490,7 @@ class Textpattern_Import {
|
||||
function import_users()
|
||||
{
|
||||
// User Import
|
||||
$users = $this->get_txp_users();
|
||||
$users = $this->get_txp_users();
|
||||
$this->users2wp($users);
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=3" method="post">';
|
||||
@@ -578,7 +578,7 @@ class Textpattern_Import {
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
function dispatch()
|
||||
function dispatch()
|
||||
{
|
||||
|
||||
if (empty ($_GET['step']))
|
||||
@@ -587,7 +587,7 @@ class Textpattern_Import {
|
||||
$step = (int) $_GET['step'];
|
||||
$this->header();
|
||||
|
||||
if ( $step > 0 )
|
||||
if ( $step > 0 )
|
||||
{
|
||||
if($_POST['dbuser'])
|
||||
{
|
||||
@@ -612,19 +612,19 @@ class Textpattern_Import {
|
||||
{
|
||||
if(get_option('txphost'))
|
||||
delete_option('txphost');
|
||||
add_option('txphost',$_POST['dbhost']);
|
||||
add_option('txphost',$_POST['dbhost']);
|
||||
}
|
||||
if($_POST['dbprefix'])
|
||||
{
|
||||
if(get_option('tpre'))
|
||||
delete_option('tpre');
|
||||
add_option('tpre',$_POST['dbprefix']);
|
||||
add_option('tpre',$_POST['dbprefix']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
switch ($step)
|
||||
switch ($step)
|
||||
{
|
||||
default:
|
||||
case 0 :
|
||||
@@ -653,7 +653,7 @@ class Textpattern_Import {
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function Textpattern_Import()
|
||||
function Textpattern_Import()
|
||||
{
|
||||
// Nothing.
|
||||
}
|
||||
|
||||
@@ -58,9 +58,9 @@ class WP_Import {
|
||||
$pass = 'changeme';
|
||||
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
|
||||
++ $this->j;
|
||||
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
|
||||
$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 (!$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.
|
||||
@@ -273,7 +273,7 @@ class WP_Import {
|
||||
|
||||
function import() {
|
||||
$this->id = (int) $_GET['id'];
|
||||
|
||||
|
||||
$this->file = get_attached_file($this->id);
|
||||
$this->get_authors_from_post();
|
||||
$this->get_entries();
|
||||
|
||||
+5
-5
@@ -46,11 +46,11 @@ if ( $comments || $numcomments ) :
|
||||
<?php endif; ?>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
<?php
|
||||
if ( $comments ) {
|
||||
foreach ($comments as $comment) {
|
||||
echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
|
||||
edit_comment_link(__("Edit"), ' <small>(', ')</small>');
|
||||
edit_comment_link(__("Edit"), ' <small>(', ')</small>');
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ foreach ($recentposts as $post) {
|
||||
|
||||
<?php
|
||||
if ( $scheduled = $wpdb->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") ) :
|
||||
?>
|
||||
?>
|
||||
<div>
|
||||
<h3><?php _e('Scheduled Entries:') ?></h3>
|
||||
<ul>
|
||||
@@ -90,7 +90,7 @@ foreach ($scheduled as $post) {
|
||||
$post->post_title = sprintf(__('Post #%s'), $post->ID);
|
||||
echo "<li>" . sprintf(__('%1$s in %2$s'), "<a href='post.php?action=edit&post=$post->ID' title='" . __('Edit this post') . "'>$post->post_title</a>", human_time_diff( current_time('timestamp', 1), strtotime($post->post_date_gmt. ' GMT') )) . "</li>";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -99,7 +99,7 @@ foreach ($scheduled as $post) {
|
||||
<h3><?php _e('Blog Stats'); ?></h3>
|
||||
<?php
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
|
||||
if (0 < $numposts) $numposts = number_format($numposts);
|
||||
if (0 < $numposts) $numposts = number_format($numposts);
|
||||
|
||||
$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
|
||||
if (0 < $numcomms) $numcomms = number_format($numcomms);
|
||||
|
||||
+85
-85
@@ -9,21 +9,21 @@ $debug = 0;
|
||||
** false on error
|
||||
*/
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,22 +33,22 @@ function maybe_create_table($table_name, $create_ddl) {
|
||||
** 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<br />");
|
||||
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;
|
||||
global $wpdb, $debug;
|
||||
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
|
||||
if ($debug) echo("checking $column == $column_name<br />");
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,21 +59,21 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
|
||||
** 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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,45 +92,45 @@ function maybe_drop_column($table_name, $column_name, $drop_ddl) {
|
||||
** 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;
|
||||
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 "<p>testing</p>";
|
||||
echo "<pre>";
|
||||
|
||||
//check_column('wp_links', 'link_description', 'mediumtext');
|
||||
//check_column('wp_links', 'link_description', 'mediumtext');
|
||||
//if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
|
||||
// echo "ok\n";
|
||||
$error_count = 0;
|
||||
@@ -138,14 +138,14 @@ $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);
|
||||
$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 <br />';
|
||||
$res .= $tablename . ' - ok <br />';
|
||||
} else {
|
||||
$res .= 'There was a problem with ' . $tablename . '<br />';
|
||||
++$error_count;
|
||||
$res .= 'There was a problem with ' . $tablename . '<br />';
|
||||
++$error_count;
|
||||
}
|
||||
echo "</pre>";
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,9 @@ $parent_file = 'link-manager.php';
|
||||
|
||||
|
||||
wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
|
||||
'description', 'visible', 'target', 'category', 'link_id',
|
||||
'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
|
||||
'notes', 'linkcheck[]'));
|
||||
'description', 'visible', 'target', 'category', 'link_id',
|
||||
'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
|
||||
'notes', 'linkcheck[]'));
|
||||
|
||||
wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') );
|
||||
if ( current_user_can( 'manage_categories' ) )
|
||||
|
||||
@@ -143,8 +143,8 @@ if ($links)
|
||||
echo $link->link_description . "</td>";
|
||||
echo "<td><a href=\"$link->link_url\" title=\"".sprintf(__('Visit %s'), $link->link_name)."\">$short_url</a></td>";
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$cat_names = array();
|
||||
foreach ($link->link_category as $category) {
|
||||
@@ -157,8 +157,8 @@ if ($links)
|
||||
echo implode(', ', $cat_names);
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $link->link_rel; ?></td>
|
||||
<td align='center'><?php echo $visible; ?></td>
|
||||
<td><?php echo $link->link_rel; ?></td>
|
||||
<td align='center'><?php echo $visible; ?></td>
|
||||
<?php
|
||||
|
||||
echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>';
|
||||
|
||||
@@ -4,12 +4,12 @@ require_once('../wp-config.php');
|
||||
// columns we wish to find are: link_url, link_name, link_target, link_description
|
||||
// we need to map XML attribute names to our columns
|
||||
$opml_map = array('URL' => 'link_url',
|
||||
'HTMLURL' => 'link_url',
|
||||
'TEXT' => 'link_name',
|
||||
'TITLE' => 'link_name',
|
||||
'TARGET' => 'link_target',
|
||||
'DESCRIPTION' => 'link_description',
|
||||
'XMLURL' => 'link_rss'
|
||||
'HTMLURL' => 'link_url',
|
||||
'TEXT' => 'link_name',
|
||||
'TITLE' => 'link_name',
|
||||
'TARGET' => 'link_target',
|
||||
'DESCRIPTION' => 'link_description',
|
||||
'XMLURL' => 'link_rss'
|
||||
);
|
||||
|
||||
$map = $opml_map;
|
||||
@@ -20,24 +20,24 @@ $map = $opml_map;
|
||||
**/
|
||||
function startElement($parser, $tagName, $attrs) {
|
||||
global $updated_timestamp, $all_links, $map;
|
||||
global $names, $urls, $targets, $descriptions, $feeds;
|
||||
global $names, $urls, $targets, $descriptions, $feeds;
|
||||
|
||||
if ($tagName == 'OUTLINE') {
|
||||
foreach (array_keys($map) as $key) {
|
||||
if (isset($attrs[$key])) {
|
||||
$$map[$key] = $attrs[$key];
|
||||
}
|
||||
}
|
||||
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]<br />\n");
|
||||
//echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n");
|
||||
|
||||
// save the data away.
|
||||
$names[] = $link_name;
|
||||
$urls[] = $link_url;
|
||||
$targets[] = $link_target;
|
||||
// save the data away.
|
||||
$names[] = $link_name;
|
||||
$urls[] = $link_url;
|
||||
$targets[] = $link_target;
|
||||
$feeds[] = $link_rss;
|
||||
$descriptions[] = $link_description;
|
||||
} // end if outline
|
||||
$descriptions[] = $link_description;
|
||||
} // end if outline
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,9 +55,9 @@ $xml_parser = xml_parser_create();
|
||||
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)));
|
||||
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
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ switch ($action) {
|
||||
$deleted = 0;
|
||||
foreach ($linkcheck as $link_id) {
|
||||
$link_id = (int) $link_id;
|
||||
|
||||
|
||||
if ( wp_delete_link($link_id) )
|
||||
$deleted++;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ foreach ($menu as $item) {
|
||||
if ( isset($submenu["$parent_file"]) ) :
|
||||
?>
|
||||
<ul id="submenu">
|
||||
<?php
|
||||
foreach ($submenu["$parent_file"] as $item) :
|
||||
<?php
|
||||
foreach ($submenu["$parent_file"] as $item) :
|
||||
if ( !current_user_can($item[1]) )
|
||||
continue;
|
||||
|
||||
@@ -65,7 +65,7 @@ else :
|
||||
<div id="minisub"></div>
|
||||
<?php
|
||||
|
||||
endif;
|
||||
endif;
|
||||
|
||||
do_action('admin_notices');
|
||||
|
||||
|
||||
+2
-2
@@ -83,14 +83,14 @@ foreach ($submenu as $parent => $sub) {
|
||||
$_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.
|
||||
// submenu in line be assigned as the new menu parent.
|
||||
foreach ( $menu as $id => $data ) {
|
||||
if ( empty($submenu[$data[2]]) )
|
||||
continue;
|
||||
|
||||
+17
-17
@@ -31,7 +31,7 @@ case 'update':
|
||||
foreach($comment as $key => $value) {
|
||||
if ($feelinglucky && 'later' == $value)
|
||||
$value = 'delete';
|
||||
switch($value) {
|
||||
switch($value) {
|
||||
case 'later':
|
||||
// do nothing with that comment
|
||||
// wp_set_comment_status($key, "hold");
|
||||
@@ -41,10 +41,10 @@ case 'update':
|
||||
wp_set_comment_status($key, 'delete');
|
||||
++$item_deleted;
|
||||
break;
|
||||
case 'spam':
|
||||
wp_set_comment_status($key, 'spam');
|
||||
++$item_spam;
|
||||
break;
|
||||
case 'spam':
|
||||
wp_set_comment_status($key, 'spam');
|
||||
++$item_spam;
|
||||
break;
|
||||
case 'approve':
|
||||
wp_set_comment_status($key, 'approve');
|
||||
if ( get_option('comments_notify') == true ) {
|
||||
@@ -52,7 +52,7 @@ case 'update':
|
||||
}
|
||||
++$item_approved;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$file = basename(__FILE__);
|
||||
@@ -85,13 +85,13 @@ if ( isset($_GET['deleted']) || isset($_GET['approved']) || isset($_GET['ignored
|
||||
echo sprintf(__("%s comments deleted"), $deleted) . " <br/>\n";
|
||||
}
|
||||
}
|
||||
if ($spam) {
|
||||
if ('1' == $spam) {
|
||||
if ($spam) {
|
||||
if ('1' == $spam) {
|
||||
echo __("1 comment marked as spam") . " <br/>\n";
|
||||
} else {
|
||||
echo sprintf(__("%s comments marked as spam"), $spam) . " <br/>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo sprintf(__("%s comments marked as spam"), $spam) . " <br/>\n";
|
||||
}
|
||||
}
|
||||
if ($ignored) {
|
||||
if ('1' == $ignored) {
|
||||
echo __("1 comment unchanged") . " <br/>\n";
|
||||
@@ -151,13 +151,13 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ol>
|
||||
</ol>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments »') ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php _e('Bulk Moderate Comments »') ?>" /></p>
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
function markAllForDelete() {
|
||||
@@ -197,10 +197,10 @@ document.write('<ul><li><a href="javascript:markAllForApprove()"><?php _e('Mark
|
||||
<input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked "defer." <strong>Warning: This can’t be undone.</strong>'); ?></label>
|
||||
</p>
|
||||
</noscript>
|
||||
</form>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
// nothing to approve
|
||||
// nothing to approve
|
||||
echo '<p>'.__("Currently there are no comments for you to moderate.") . "</p>\n";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -7,9 +7,9 @@ $parent_file = 'options-general.php';
|
||||
include('admin-header.php');
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Miscellaneous Options') ?></h2>
|
||||
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Miscellaneous Options') ?></h2>
|
||||
<form method="post" action="options.php">
|
||||
<?php wp_nonce_field('update-options') ?>
|
||||
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /></p>
|
||||
@@ -43,10 +43,10 @@ include('admin-header.php');
|
||||
|
||||
<p class="submit">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" />
|
||||
<input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" />
|
||||
<input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include('./admin-footer.php'); ?>
|
||||
@@ -144,7 +144,7 @@ $structures = array(
|
||||
<?php if ( !in_array($permalink_structure, $structures) ) { ?>
|
||||
checked="checked"
|
||||
<?php } ?>
|
||||
/>
|
||||
/>
|
||||
<?php _e('Custom, specify below'); ?>
|
||||
</label>
|
||||
<br />
|
||||
|
||||
@@ -6,30 +6,30 @@ $parent_file = 'options-general.php';
|
||||
|
||||
include('./admin-header.php');
|
||||
?>
|
||||
|
||||
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Privacy Options') ?></h2>
|
||||
<form method="post" action="options.php">
|
||||
<form method="post" action="options.php">
|
||||
<?php wp_nonce_field('update-options') ?>
|
||||
<table class="optiontable">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Blog visibility:') ?> </th>
|
||||
<table class="optiontable">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Blog visibility:') ?> </th>
|
||||
<td>
|
||||
<p><input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
|
||||
<label for="blog-public"><?php _e('I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers');?></label></p>
|
||||
<p><input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
|
||||
<label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal visitors'); ?></label></p>
|
||||
<?php do_action('blog_privacy_selector'); ?>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" />
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="page_options" value="blog_public" />
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="page_options" value="blog_public" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include('./admin-footer.php') ?>
|
||||
|
||||
@@ -65,7 +65,7 @@ endforeach;
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Mail server:') ?></th>
|
||||
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
|
||||
<label for="mailserver_port"><?php _e('Port:') ?></label>
|
||||
<label for="mailserver_port"><?php _e('Port:') ?></label>
|
||||
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
|
||||
</td>
|
||||
</tr>
|
||||
@@ -113,11 +113,11 @@ endforeach;
|
||||
</fieldset>
|
||||
|
||||
<p class="submit">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,rich_editing,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_balanceTags,default_link_category" />
|
||||
<input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" />
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,rich_editing,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_balanceTags,default_link_category" />
|
||||
<input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include('./admin-footer.php') ?>
|
||||
+23
-23
@@ -61,8 +61,8 @@ default:
|
||||
<?php if (isset($_GET['a'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
<?php
|
||||
<div class="wrap">
|
||||
<?php
|
||||
if (is_writeable($real_file)) {
|
||||
echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), $file) . '</h2>';
|
||||
} else {
|
||||
@@ -75,39 +75,39 @@ default:
|
||||
<?php
|
||||
if ($plugin_files) :
|
||||
?>
|
||||
<ul>
|
||||
<?php foreach($plugin_files as $plugin_file) : ?>
|
||||
<ul>
|
||||
<?php foreach($plugin_files as $plugin_file) : ?>
|
||||
<li><a href="plugin-editor.php?file=<?php echo "$plugin_file"; ?>"><?php echo $plugins[$plugin_file]['Name']; ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!$error) { ?>
|
||||
<form name="template" id="template" action="plugin-editor.php" method="post">
|
||||
<?php wp_nonce_field('edit-plugin_' . $file) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
<?php if (!$error) { ?>
|
||||
<form name="template" id="template" action="plugin-editor.php" method="post">
|
||||
<?php wp_nonce_field('edit-plugin_' . $file) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
</div>
|
||||
<?php if ( is_writeable($real_file) ) : ?>
|
||||
<p class="submit">
|
||||
<?php
|
||||
echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";
|
||||
?>
|
||||
</p>
|
||||
<p class="submit">
|
||||
<?php
|
||||
echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";
|
||||
?>
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<p><em><?php _e('If this file were writable you could edit it.'); ?></em></p>
|
||||
<p><em><?php _e('If this file were writable you could edit it.'); ?></em></p>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
|
||||
include("admin-footer.php") ?>
|
||||
include("admin-footer.php") ?>
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ case 'post':
|
||||
$parent_file = 'post-new.php';
|
||||
$submenu_file = 'post-new.php';
|
||||
check_admin_referer('add-post');
|
||||
|
||||
|
||||
$post_ID = 'post' == $action ? write_post() : edit_post();
|
||||
|
||||
// Redirect.
|
||||
@@ -89,7 +89,7 @@ case 'editattachment':
|
||||
case 'editpost':
|
||||
$post_ID = (int) $_POST['post_ID'];
|
||||
check_admin_referer('update-post_' . $post_ID);
|
||||
|
||||
|
||||
$post_ID = edit_post();
|
||||
|
||||
if ( 'post' == $_POST['originalaction'] ) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
require_once('admin.php');
|
||||
|
||||
$title = __('Profile');
|
||||
@@ -121,13 +121,13 @@ if ( $show_password_fields ) :
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
|
||||
<?php
|
||||
if(count($profileuser->caps) > count($profileuser->roles)):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Additional Capabilities:') ?></th>
|
||||
<td><?php
|
||||
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
|
||||
<?php
|
||||
if(count($profileuser->caps) > count($profileuser->roles)):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Additional Capabilities:') ?></th>
|
||||
<td><?php
|
||||
$output = '';
|
||||
foreach($profileuser->caps as $cap => $value) {
|
||||
if(!$wp_roles->is_role($cap)) {
|
||||
|
||||
+75
-75
@@ -2,7 +2,7 @@
|
||||
define('WP_INSTALLING', true);
|
||||
|
||||
if (!file_exists('../wp-config-sample.php'))
|
||||
die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
|
||||
die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
|
||||
|
||||
$configFile = file('../wp-config-sample.php');
|
||||
|
||||
@@ -82,103 +82,103 @@ if (file_exists('../wp-config.php'))
|
||||
|
||||
switch($step) {
|
||||
case 0:
|
||||
?>
|
||||
?>
|
||||
|
||||
<p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>
|
||||
<ol>
|
||||
<li>Database name</li>
|
||||
<li>Database username</li>
|
||||
<li>Database password</li>
|
||||
<li>Database host</li>
|
||||
<li>Table prefix (if you want to run more than one WordPress in a single database) </li>
|
||||
</ol>
|
||||
<p>Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.</p>
|
||||
<ol>
|
||||
<li>Database name</li>
|
||||
<li>Database username</li>
|
||||
<li>Database password</li>
|
||||
<li>Database host</li>
|
||||
<li>Table prefix (if you want to run more than one WordPress in a single database) </li>
|
||||
</ol>
|
||||
<p><strong>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 <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>. </strong></p>
|
||||
<p>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, <a href="setup-config.php?step=1">let’s go</a>! </p>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 1:
|
||||
?>
|
||||
</p>
|
||||
?>
|
||||
</p>
|
||||
<form method="post" action="setup-config.php?step=2">
|
||||
<p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
|
||||
<table>
|
||||
<tr>
|
||||
<th scope="row">Database Name</th>
|
||||
<td><input name="dbname" type="text" size="25" value="wordpress" /></td>
|
||||
<td>The name of the database you want to run WP in. </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">User Name</th>
|
||||
<td><input name="uname" type="text" size="25" value="username" /></td>
|
||||
<td>Your MySQL username</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Password</th>
|
||||
<td><input name="pwd" type="text" size="25" value="password" /></td>
|
||||
<td>...and MySQL password.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Database Host</th>
|
||||
<td><input name="dbhost" type="text" size="25" value="localhost" /></td>
|
||||
<td>99% chance you won't need to change this value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Table Prefix</th>
|
||||
<td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td>
|
||||
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 class="step">
|
||||
<input name="submit" type="submit" value="Submit" />
|
||||
</h2>
|
||||
</form>
|
||||
<p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
|
||||
<table>
|
||||
<tr>
|
||||
<th scope="row">Database Name</th>
|
||||
<td><input name="dbname" type="text" size="25" value="wordpress" /></td>
|
||||
<td>The name of the database you want to run WP in. </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">User Name</th>
|
||||
<td><input name="uname" type="text" size="25" value="username" /></td>
|
||||
<td>Your MySQL username</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Password</th>
|
||||
<td><input name="pwd" type="text" size="25" value="password" /></td>
|
||||
<td>...and MySQL password.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Database Host</th>
|
||||
<td><input name="dbhost" type="text" size="25" value="localhost" /></td>
|
||||
<td>99% chance you won't need to change this value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Table Prefix</th>
|
||||
<td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td>
|
||||
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 class="step">
|
||||
<input name="submit" type="submit" value="Submit" />
|
||||
</h2>
|
||||
</form>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$dbname = trim($_POST['dbname']);
|
||||
$uname = trim($_POST['uname']);
|
||||
$passwrd = trim($_POST['pwd']);
|
||||
$dbhost = trim($_POST['dbhost']);
|
||||
$uname = trim($_POST['uname']);
|
||||
$passwrd = trim($_POST['pwd']);
|
||||
$dbhost = trim($_POST['dbhost']);
|
||||
$prefix = trim($_POST['prefix']);
|
||||
if (empty($prefix)) $prefix = 'wp_';
|
||||
|
||||
// Test the db connection.
|
||||
define('DB_NAME', $dbname);
|
||||
define('DB_USER', $uname);
|
||||
define('DB_PASSWORD', $passwrd);
|
||||
define('DB_HOST', $dbhost);
|
||||
// Test the db connection.
|
||||
define('DB_NAME', $dbname);
|
||||
define('DB_USER', $uname);
|
||||
define('DB_PASSWORD', $passwrd);
|
||||
define('DB_HOST', $dbhost);
|
||||
|
||||
// We'll fail here if the values are no good.
|
||||
require_once('../wp-includes/wp-db.php');
|
||||
// We'll fail here if the values are no good.
|
||||
require_once('../wp-includes/wp-db.php');
|
||||
$handle = fopen('../wp-config.php', 'w');
|
||||
|
||||
foreach ($configFile as $line_num => $line) {
|
||||
switch (substr($line,0,16)) {
|
||||
case "define('DB_NAME'":
|
||||
fwrite($handle, str_replace("wordpress", $dbname, $line));
|
||||
break;
|
||||
case "define('DB_USER'":
|
||||
fwrite($handle, str_replace("'username'", "'$uname'", $line));
|
||||
break;
|
||||
case "define('DB_PASSW":
|
||||
fwrite($handle, str_replace("'password'", "'$passwrd'", $line));
|
||||
break;
|
||||
case "define('DB_HOST'":
|
||||
fwrite($handle, str_replace("localhost", $dbhost, $line));
|
||||
break;
|
||||
foreach ($configFile as $line_num => $line) {
|
||||
switch (substr($line,0,16)) {
|
||||
case "define('DB_NAME'":
|
||||
fwrite($handle, str_replace("wordpress", $dbname, $line));
|
||||
break;
|
||||
case "define('DB_USER'":
|
||||
fwrite($handle, str_replace("'username'", "'$uname'", $line));
|
||||
break;
|
||||
case "define('DB_PASSW":
|
||||
fwrite($handle, str_replace("'password'", "'$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);
|
||||
default:
|
||||
fwrite($handle, $line);
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
chmod('../wp-config.php', 0666);
|
||||
?>
|
||||
<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p>
|
||||
?>
|
||||
<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ form {
|
||||
padding: 3px;
|
||||
}
|
||||
.sidebar-categories {
|
||||
display: block;
|
||||
height: 6.6em;
|
||||
overflow: auto;
|
||||
background-color: #f4f4f4;
|
||||
display: block;
|
||||
height: 6.6em;
|
||||
overflow: auto;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.sidebar-categories label {
|
||||
font-size: 10px;
|
||||
display: block;
|
||||
width: 90%;
|
||||
display: block;
|
||||
width: 90%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -65,9 +65,9 @@ Post:
|
||||
<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
|
||||
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
|
||||
<?php if ( current_user_can('publish_posts') ) : ?>
|
||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
|
||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
+24
-24
@@ -82,7 +82,7 @@ default:
|
||||
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
<div class="wrap">
|
||||
<?php
|
||||
if (is_writeable($real_file)) {
|
||||
echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), wp_specialchars($file) ) . '</h2>';
|
||||
@@ -91,8 +91,8 @@ if (is_writeable($real_file)) {
|
||||
}
|
||||
?>
|
||||
<div id="templateside">
|
||||
<?php
|
||||
if ( $recents ) :
|
||||
<?php
|
||||
if ( $recents ) :
|
||||
?>
|
||||
<h3><?php _e('Recent'); ?></h3>
|
||||
<?php
|
||||
@@ -110,21 +110,21 @@ endif;
|
||||
if (file_exists(ABSPATH . $old_file))
|
||||
$common_files[] = $old_file;
|
||||
} ?>
|
||||
<ul>
|
||||
<?php foreach ($common_files as $common_file) : ?>
|
||||
<li><a href="templates.php?file=<?php echo $common_file?>"><?php echo get_file_description($common_file); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<ul>
|
||||
<?php foreach ($common_files as $common_file) : ?>
|
||||
<li><a href="templates.php?file=<?php echo $common_file?>"><?php echo get_file_description($common_file); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if (!$error) { ?>
|
||||
<form name="template" id="template" action="templates.php" method="post">
|
||||
<?php wp_nonce_field('edit-file_' . $file) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id='newcontent' tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
</div>
|
||||
<form name="template" id="template" action="templates.php" method="post">
|
||||
<?php wp_nonce_field('edit-file_' . $file) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id='newcontent' tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
</div>
|
||||
<?php if ( is_writeable($real_file) ) : ?>
|
||||
<p class="submit">
|
||||
<p class="submit">
|
||||
<?php
|
||||
echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";
|
||||
?>
|
||||
@@ -132,8 +132,8 @@ endif;
|
||||
<?php else : ?>
|
||||
<p><em><?php _e('If this file were writable you could edit it.'); ?></em></p>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
|
||||
}
|
||||
@@ -143,14 +143,14 @@ endif;
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Other Files') ?></h2>
|
||||
|
||||
<p><?php _e('To edit a file, type its name here. You can edit any file <a href="http://codex.wordpress.org/Changing_File_Permissions" title="Read more about making files writable">writable by the server</a>, e.g. CHMOD 666.') ?></p>
|
||||
<form name="file" action="templates.php" method="get">
|
||||
<input type="text" name="file" />
|
||||
<input type="submit" name="submit" value="<?php _e('Edit file »') ?>" />
|
||||
</form>
|
||||
<p><?php _e('To edit a file, type its name here. You can edit any file <a href="http://codex.wordpress.org/Changing_File_Permissions" title="Read more about making files writable">writable by the server</a>, e.g. CHMOD 666.') ?></p>
|
||||
<form name="file" action="templates.php" method="get">
|
||||
<input type="text" name="file" />
|
||||
<input type="submit" name="submit" value="<?php _e('Edit file »') ?>" />
|
||||
</form>
|
||||
|
||||
<p><?php _e('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.') ?></p>
|
||||
</div>
|
||||
<p><?php _e('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.') ?></p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
+17
-17
@@ -80,7 +80,7 @@ default:
|
||||
<div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
<form name="theme" action="theme-editor.php" method="post">
|
||||
<form name="theme" action="theme-editor.php" method="post">
|
||||
<?php _e('Select theme to edit:') ?>
|
||||
<select name="theme" id="theme">
|
||||
<?php
|
||||
@@ -106,30 +106,30 @@ default:
|
||||
}
|
||||
?>
|
||||
<div id="templateside">
|
||||
<h3><?php printf(__("<strong>'%s'</strong> theme files"), $theme) ?></h3>
|
||||
<h3><?php printf(__("<strong>'%s'</strong> theme files"), $theme) ?></h3>
|
||||
|
||||
<?php
|
||||
if ($allowed_files) :
|
||||
?>
|
||||
<ul>
|
||||
<ul>
|
||||
<?php foreach($allowed_files as $allowed_file) : ?>
|
||||
<li><a href="theme-editor.php?file=<?php echo "$allowed_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo get_file_description($allowed_file); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (!$error) {
|
||||
?>
|
||||
<form name="template" id="template" action="theme-editor.php" method="post">
|
||||
<?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
<input type="hidden" name="theme" value="<?php echo $theme ?>" />
|
||||
?>
|
||||
<form name="template" id="template" action="theme-editor.php" method="post">
|
||||
<?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
|
||||
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="file" value="<?php echo $file ?>" />
|
||||
<input type="hidden" name="theme" value="<?php echo $theme ?>" />
|
||||
</div>
|
||||
<?php if ( is_writeable($real_file) ) : ?>
|
||||
<p class="submit">
|
||||
<p class="submit">
|
||||
<?php
|
||||
echo "<input type='submit' name='submit' value=' " . __('Update File »') . "' tabindex='2' />";
|
||||
?>
|
||||
@@ -137,16 +137,16 @@ if ($allowed_files) :
|
||||
<?php else : ?>
|
||||
<p><em><?php _e('If this file were writable you could edit it.'); ?></em></p>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
|
||||
}
|
||||
?>
|
||||
<div class="clear"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
|
||||
include("admin-footer.php") ?>
|
||||
include("admin-footer.php") ?>
|
||||
|
||||
+4
-4
@@ -112,10 +112,10 @@ if ( count($broken_themes) ) {
|
||||
|
||||
$theme = ('class="alternate"' == $theme) ? '' : 'class="alternate"';
|
||||
echo "
|
||||
<tr $theme>
|
||||
<td>$title</td>
|
||||
<td>$description</td>
|
||||
</tr>";
|
||||
<tr $theme>
|
||||
<td>$title</td>
|
||||
<td>$description</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
@@ -28,13 +28,13 @@ if ( false !== ( $fs = @fsockopen('api.pingomatic.com', 80, $errno, $errstr, 5)
|
||||
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) );
|
||||
|
||||
@@ -120,7 +120,7 @@ We hope you enjoy your new weblog. Thanks!
|
||||
http://wordpress.org/
|
||||
"), $blog_url, $name, $password);
|
||||
|
||||
@wp_mail($email, __('New WordPress Blog'), $message, $message_headers);
|
||||
@wp_mail($email, __('New WordPress Blog'), $message, $message_headers);
|
||||
}
|
||||
endif;
|
||||
|
||||
@@ -137,7 +137,7 @@ function wp_upgrade() {
|
||||
wp_cache_flush();
|
||||
make_db_current_silent();
|
||||
upgrade_all();
|
||||
wp_cache_flush();
|
||||
wp_cache_flush();
|
||||
}
|
||||
endif;
|
||||
|
||||
@@ -187,7 +187,7 @@ function upgrade_100() {
|
||||
$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) {
|
||||
if ('' == $post->post_name) {
|
||||
$newtitle = sanitize_title($post->post_title);
|
||||
$wpdb->query("UPDATE $wpdb->posts SET post_name = '$newtitle' WHERE ID = '$post->ID'");
|
||||
}
|
||||
@@ -196,7 +196,7 @@ function upgrade_100() {
|
||||
|
||||
$categories = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories");
|
||||
foreach ($categories as $category) {
|
||||
if ('' == $category->category_nicename) {
|
||||
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'");
|
||||
}
|
||||
@@ -251,19 +251,19 @@ function upgrade_101() {
|
||||
function upgrade_110() {
|
||||
global $wpdb;
|
||||
|
||||
// Set user_nicename.
|
||||
// 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'");
|
||||
}
|
||||
}
|
||||
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.'\'');
|
||||
$wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\'');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,57 +305,57 @@ function upgrade_110() {
|
||||
}
|
||||
|
||||
function upgrade_130() {
|
||||
global $wpdb;
|
||||
global $wpdb;
|
||||
|
||||
// Remove extraneous backslashes.
|
||||
// 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));
|
||||
$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'");
|
||||
$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.
|
||||
// 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'");
|
||||
$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.
|
||||
// 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'");
|
||||
$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'");
|
||||
}
|
||||
// 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');
|
||||
$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);
|
||||
}
|
||||
// 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');
|
||||
@@ -499,7 +499,7 @@ function upgrade_210() {
|
||||
// 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 )
|
||||
@@ -508,7 +508,7 @@ function upgrade_210() {
|
||||
if ( $wp_current_db_version < 3570 ) {
|
||||
// Create categories for link categories if a category with the same
|
||||
// name doesn't exist. Create a map of link cat IDs to cat IDs.
|
||||
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
|
||||
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
|
||||
foreach ( $link_cats as $link_cat) {
|
||||
if ( $cat_id = category_exists($link_cat->cat_name) ) {
|
||||
$link_cat_id_map[$link_cat->cat_id] = $cat_id;
|
||||
@@ -527,9 +527,9 @@ function upgrade_210() {
|
||||
if (!$cat && 0 != $link->link_category) {
|
||||
$wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id)
|
||||
VALUES ('$link->link_id', '$link_cat')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set default to the last category we grabbed during the upgrade loop.
|
||||
update_option('default_link_category', $default_link_cat);
|
||||
|
||||
@@ -548,21 +548,21 @@ function upgrade_210() {
|
||||
|
||||
// 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;
|
||||
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) {
|
||||
@@ -591,22 +591,22 @@ function add_clean_index($table, $index) {
|
||||
** 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<br />");
|
||||
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;
|
||||
global $wpdb, $debug;
|
||||
foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
|
||||
if ($debug) echo("checking $column == $column_name<br />");
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ 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,
|
||||
// "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);
|
||||
@@ -646,20 +646,20 @@ function __get_option($setting) {
|
||||
}
|
||||
|
||||
function deslash($content) {
|
||||
// Note: \\\ inside a regex denotes a single backslash.
|
||||
// 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 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 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);
|
||||
// Replace one or more backslashes with one backslash.
|
||||
$content = preg_replace("/\\\+/", "\\", $content);
|
||||
|
||||
return $content;
|
||||
return $content;
|
||||
}
|
||||
|
||||
function dbDelta($queries, $execute = true) {
|
||||
@@ -826,7 +826,7 @@ function dbDelta($queries, $execute = true) {
|
||||
$index_columns .= '('.$column_data['subpart'].')';
|
||||
}
|
||||
}
|
||||
// Add the column list to the index create string
|
||||
// Add the column list to the index create string
|
||||
$index_string .= ' ('.$index_columns.')';
|
||||
|
||||
if(!(($aindex = array_search($index_string, $indices)) === false)) {
|
||||
|
||||
@@ -223,7 +223,7 @@ function populate_options() {
|
||||
add_option('uploads_use_yearmonth_folders', 1);
|
||||
add_option('upload_path', 'wp-content/uploads');
|
||||
}
|
||||
|
||||
|
||||
// 2.0.3
|
||||
add_option('secret', md5(uniqid(microtime())));
|
||||
|
||||
|
||||
@@ -56,6 +56,6 @@ switch($step) {
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
+13
-13
@@ -186,13 +186,13 @@ if ( $show_password_fields ) :
|
||||
<?php do_action('edit_user_profile'); ?>
|
||||
|
||||
<br clear="all" />
|
||||
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
|
||||
<?php
|
||||
if(count($profileuser->caps) > count($profileuser->roles)):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Additional Capabilities:') ?></th>
|
||||
<td><?php
|
||||
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
|
||||
<?php
|
||||
if(count($profileuser->caps) > count($profileuser->roles)):
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Additional Capabilities:') ?></th>
|
||||
<td><?php
|
||||
$output = '';
|
||||
foreach($profileuser->caps as $cap => $value) {
|
||||
if(!$wp_roles->is_role($cap)) {
|
||||
@@ -202,15 +202,15 @@ if ( $show_password_fields ) :
|
||||
}
|
||||
echo $output;
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</table>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</table>
|
||||
<p class="submit">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="user_id" id="user_id" value="<?php echo $user_id; ?>" />
|
||||
<input type="submit" value="<?php _e('Update User »') ?>" name="submit" />
|
||||
<input type="submit" value="<?php _e('Update User »') ?>" name="submit" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -283,7 +283,7 @@ form#upload #post_content {
|
||||
}
|
||||
|
||||
.commentlist li {
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 1em 1em .2em;
|
||||
margin: 0;
|
||||
}
|
||||
@@ -954,8 +954,8 @@ input.delete:hover {
|
||||
}
|
||||
|
||||
/* A handy div class for hiding controls.
|
||||
Some browsers will disable them when you
|
||||
set display:none; */
|
||||
Some browsers will disable them when you
|
||||
set display:none; */
|
||||
.zerosize {
|
||||
height: 0px;
|
||||
width: 0px;
|
||||
@@ -995,9 +995,9 @@ input.delete:hover {
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
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
|
||||
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;
|
||||
|
||||
+4
-4
@@ -10,10 +10,10 @@ function GetElementsWithClassName(elementName, className) {
|
||||
}
|
||||
|
||||
function meChecked() {
|
||||
var undefined;
|
||||
var eMe = document.getElementById('me');
|
||||
if (eMe == undefined) return false;
|
||||
else return eMe.checked;
|
||||
var undefined;
|
||||
var eMe = document.getElementById('me');
|
||||
if (eMe == undefined) return false;
|
||||
else return eMe.checked;
|
||||
}
|
||||
|
||||
function upit() {
|
||||
|
||||
Reference in New Issue
Block a user