• The eternal confessions of a beautiful mind...
  • DamianM.Co.UK
  • Home
  • About
  • Archives
  • Contact
  • Sitemap
  • My Flickr

    IMG_9585IMG_9115IMG_9113IMG_9111IMG_9078IMG_9075IMG_9069IMG_9065IMG_9041IMG_9032IMG_8963IMG_8928IMG_8916IMG_8915IMG_8904IMG_8876IMG_8858IMG_8830IMG_8828IMG_8826

  • Recent Posts

    • Strictly for the office
    • Failing the exam with dignity
    • New Ohio Roller Coaster - INSANE!!!
    • Speeding
    • Captions not required
    • Unfortunate Backgrounds
    • Unfortunate Signs
    • OMG!!
    • Women as explained by engineer
    • The Monty Hall Problem
    • ahhh still love them - Motivational Posters
    • What does Mona Lisa do when the Museum is closed………
    • 21st Century kids books
    • Cool Origami
    • AWESOME Pictures!
  • My Tools

    • Blog_LinkIt
    • DCoda Theme
    • DCoda Widgets
    • RSS_Sticky
    • WordPress.org
    • WP_BlogNetworking
    • WP_BlogRollSync
    • WP_BoilerPlate
    • WP_Censor
    • WP_ContactMe
    • WP_DeliciousPost
    • WP_EasyReply
    • WP_HeadNFoot
    • WP_LinkIt
    • WP_OneInstall
    • WP_PostDate
    • WP_PostNotes
    • WP_RssSticky
    • WP_Spoiler
    • WP_Submission
  • My Web

    • ASPAlliance
    • ClaimID
    • del.ico.us
    • Digg
    • DSLRBlog
    • DVDProfiler
    • Flickr
    • Honeyed SPAM
    • My Blog
    • My company
    • MYSpace
    • WordPress.org
    • YouTube

    Multiple blogs, one installation.

    October 1st, 2007

    I have a number of blogs, one personal one for work, one for testing , development, one for training and one for demonstration and on occasion i have need for more. It became such a bind to keep all the installations and all the plugins on the installations current so i began to look for a solution.

    I first tried out WordpressMU this is a multi-user version of WordPress which shares most of the same code and is really for larger organisations to manage multiple blogs. Since its not 100% WordPress this wouldn’t work that well for my demo and testing installations, but most of all it seems to need URL rewriting and I’m on a windows platform that i can’t install the necessary drivers on i had to find an alternative.

    The simplest of solutions to the problem is to use WordPress and play around a little with the wp_config.PHP. wp_config contains everything WordPress needs to connect your blogs database.

    A regular wp_confifg will look a little like this

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    
    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'putyourdbnamehere');    // The name of the database
    define('DB_USER', 'usernamehere');     // Your MySQL username
    define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
     
    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
     
    // Change this to localize WordPress.  A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');
     
    /* That's all, stop editing! Happy blogging. */
     
    define('ABSPATH', dirname(__FILE__).'/');
    require_once(ABSPATH.'wp-settings.php');
    ?>

    As you can see the standard wp_config with the $table_prefix, to allow you to use one database for multiply blogs, if you replace this with a PHP switch statement you can easily access these blogs from the same installation.

    For example

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    switch (strtolower($_SERVER["SERVER_NAME"]))
    {
    case "www.site1.com":
    $table_prefix  = 'wp_site1_';
    break;
    case "www.site2.com":
    $table_prefix  = 'wp_test_';
    break;
    }

    You are not limited to using the same database, you could move the definitions for the host and user details into the case statement, but its best to keep it simple.

    I’ve been running my blogs like this for a few months now with no problems.

    Giveita try see is it works for you.

    Posted in Wordpress | 1 Comment »

    WP_RSS_Sticky

    July 9th, 2007

    I’ve just release a WordPress plugin over on My company site, WP_RSS_Sticky. A plugin to allow you to insert copyright or other messages in the articles in your RSS Feed.

    Posted in Coding, Wordpress | 1 Comment »

    A new look

    July 8th, 2007

    I’ve just finished the main work on a new theme for the site. I’ll bed in in for a few days to find the little things i’ve missed, then check that it validates correctly. So it should be available for download in about a week.

    Check out the panorama, it goes on for ever, just stretch you browser as much as you can.  The wonders of Canons photostitch.

    Posted in Blurb, Wordpress | No Comments »

    Wordpress 2.2.1

    June 22nd, 2007

    Just upgraded both my sites to WordPress 2.2.1.
    It was very painful to do. The new release has a few minor bug fixes but the main reason to do the upgrade is a few security issues that are sorted out.
    Because of these issues it recommends you delete your WordPress files and reinstall. This means the site will be down for the duration.
    Apart from a crappy ftp connection the upgrade when well, if a little slow.

    Posted in Blurb, Wordpress | 2 Comments »

    Cool new plugin

    June 20th, 2007

    WP_EasyReply is a cool WordPress plugin making it much easier to reply to posts to many commenter’s.
    For Full disclosure it was written by DCoda which is My company.
    I hope you can give it a try and find it useful.
    WP_EasyReply can be found here.

    Posted in Review, Software, Wordpress | No Comments »

    « Older Entries