Updates from October, 2009

  • WordpressMU: changing domain names.

    oremj 12:12 pm on October 27, 2009 | 0 Permalink | Reply

    Unfortunately, changing domain names in WordpressMU is a manual process. It’s something I’ve come across often and have to look it up each time. Here’s what I did, so I don’t have to look it up again. Original idea from Boris Masis.

    1. Drop and run this script in the root wpmu directory:

    <?php
    define('WP_INSTALLING', true);
    require_once('wp-load.php');
    
    $old_domain = 'olddomain.com';
    $new_domain = 'newdomain.com';
    
    $query = "UPDATE wp_site SET domain = '$new_domain' where domain = '$old_domain'";
    $wpdb->query($query);
    
    $query = "UPDATE wp_blogs SET domain = REPLACE(domain, '$old_domain', '$new_domain')";
    $wpdb->query($query);
    
    $querystr ="SHOW TABLES LIKE 'wp_%_options'";
    
    $tables = $wpdb->get_results($querystr, ARRAY_N);
    
    echo count($tables);
    $query = "";
    if ($tables){
      foreach ($tables as $table){
        $query = 'UPDATE '.$table[0]." SET option_value = REPLACE(option_value,'$old_domain','$new_domain')";
        $wpdb->query($query);
      }
    }
    ?>
    

    2. Edit wp-config.php and set “DOMAIN_CURRENT_SITE” to the appropriate domain.

    That’s it, everything should work properly.

     
  • My Life is a Little Bit Easier Now

    oremj 2:56 pm on September 12, 2008 | 1 Permalink | Reply

    Lately, I’ve found the process of assigning a bug to myself slightly cumbersome and wanted to speed up the process. I happen to be a fan of Ubiquity, so I decided to write a command.

    The command assigntome, by default, changes the assigned to field to your user. The whole process can be automated by tacking on the submit noun, which will simulate clicking the “Commit” button.

    To install assigntome subscribe to my Ubiquity feed.

    Cross-post from blog.oremj.com.

     
  • MediaWiki: HttpAuth Plugin

    oremj 8:29 pm on January 29, 2007 | 8 Permalink | Reply

    Using MediaWiki behind http authetication was always slightly annoying in the past. One would have to:

    1. Login with their htpasswd credentials
    2. Create account if it did not exist already
    3. Login with their wiki credentials
    4. Remember both sets of credentials

    This extension reduces the previous four steps into one simple step.

    1. Login with htpasswd credentials

    The extension can be downloaded at http://people.mozilla.com/~oremj/HttpAuthPlugin.php and setup instructions at MediaWiki.

     
  • SimpleCaptcha Plugin

    oremj 3:46 pm on December 28, 2006 | 0 Permalink | Reply

    The other day spent several hours searching for a Wordpress MU(WPMU) compatible captcha plugin with no success. I didn’t care about a robust spam fighting packages with Bayesian filtering etc; all I wanted was very simple and accessible plugin. Yesterday, I came up with SimpleCaptcha. So far SimpleCaptcha seems to be working very well against spam bots.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel