Multiple Blogs Same Content

Ok I’m going a lil crazy on the blogging today. But have had a few people ask me over time how to have multiple wordpress blogs with different domains and themes but with the same content and only have to post it once.

You can see i have it here on this blog and again at http://www.heatherbalagh.com/blog/

So after the request again today I decided to post the knowledge…It’s very easy, have any questions post them here and make sure to subscribe to comments to get notified of my response.. Also make sure to have both the sites on the same server

Upload WP into both directories. Make sure they have the identical wp-config.php file.

In the second sites directory do the following:
In the wp-settings.php file edit the options database value from this:

$wpdb->options = $wpdb->prefix . ‘options’;

to something like

$wpdb->options = ‘YOURNEWPREFIX_options’;

Instead of ‘YOURNEWPREFIX’ put something like ’site2′ or whatever you want with out the ‘.

Then, in PHPmyAdmin duplicate the wp_options table, and rename one of the them to be YOURNEWPREFIX_options, so if you chose ’site2′, it would be ’site2_options’.

Edit the information in the ’site2_options’ table to reflect the correct information for your second site and you will be on your way.

Frontpage vs Dreamweaver

Frontpage vs DreamweaverI haven’t written a post about something like this in a while and after an experience with a client just now who happens to use MS Frontpage (see at bottom of post). I’m going to jump on the bandwagon and add to the hundreds of thousands of people on the internet who write Frontpage vs Dreamweaver blog post, forum post and articles (google search came up with 622,000 results for the phrase frontpage vs dreamweaver).

A few years ago when I was still messing around with design as more or less a hobby I used to use MS Frontpage. You would of never heard me say that Frontpage was evil or that it sucked. But today I can’t tell you enough how bad it is with the horrible code it writes for you (if using wyswyg editor), even if your using the code view it’s still horrible as it seems to have a mind of it’s own and do it’s own thing. Today I am in complete love with Dreamweaver although it too doesn’t do such a great job in wyswyg view but i write everything from scratch and in code view, which most designers should be doing anyhow. I have tried other programs but nothing seems to compare to it. I know the ultimate coder would say to use notepad, i just find using dreamweaver a few steps easier.

Frontpage code is overly bloated
Only good at working with the IE browser
It doesn’t write valid html
To use it to connect with a server you must have frontpage extensions installed (yuck)
The list can go on and on

While doing the search for Frontpage vs Dreamweaver I came acrossed a forum where a guy had posted about being fired from a client because his client had a friend that had frontpage and they thought they could do the job alot cheaper with using it. The client apparently said he would keep him for advice/support. Another poster said, let him be and when he needs your help to fix something or ask your assistance on something boost up your rates. Another poster posted this and I just found it amusing…

“Sell yourself (and his idiocy) not on the tools used, but the knowledge of how to use the tools.”

Shortly to be replied by

“Precisely. When the plumber handed the customer a bill that the customer demanded to have, the customer was shocked!

“A thousand dollars? All you did was knock 3 times on the pipe?”

“Yes sir. 100 dollars a knock, 700 for knowing where to knock.”.

Now on to why I decided to write this post. I had been working on a forum for a client to integrate it into his site so that it would blend right in, It was looking so good, I only had a little bit further to go till I was complete with the job. How ever he decided to take a look at the files, the header file to be exact which happens to be the file I did the most work on. He claims he didn’t touch anything and that he didn’t save the file but now when you view his forum more then half of the work I have done is now gone.

Here is a problem for me, last night I was going around on my computer and cleaning up alot of un needed files and organizing my self. I deleted all the files related to his forum as I assumed they were all safe on the server and I was going to grab fresh copies of them and have them a lil more organized this afternoon while i went to finish up the site.

After he told me what he did I just knew in the back of my head that he must of used Frontpage. I had to ask and as I suspected I was correct. I had to make a comment regarding frontpage and kindly asked him not to touch any of the files till I was done with his forum.

This sucks so bad

Stop Hot Linking and Bandwidth Hogging

What if another web site is stealing your images and your bandwidth by linking directly to your image files from their web site? This can prevent this by adding this to your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ – [F]

Replace yourdomain.com with your actual domain name. With this code in place, your images will only display when the visitor is browsing http://yourdomain.com. Images linked from other domains will appear as broken images.

If you’re feeling particularly nasty, you can even provide an alternative image to display on the hot linked pages — for example, an image that says “Stealing is not nice … visit http://yourdomain.com to see the real picture that belongs here.” Use this code to accomplish that:

RewriteEngine On
rewriteCond %{HTTP_REFERER} !^$
rewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
rewriteRule \.(jpe?g|gif|png|bmp)$ dontsteal.gif [L]

This time, replace yourdomain.com with your domain name, and replace dontsteal.gif with the file name of the image you’ve created to discourage hot linking.

Here is my image
dontsteal.gif

Random Image PHP Code

This will display a random image on a web page. Images are selected from the folder of your choice.

Create a php page with the following (making necessary changes) and upload to your server :

<?php

// Change to the total number of images in the folder
$total = “11″;

// Type of files to use eg. .jpg or .gif
$file_type = “.jpg”;

// Change to the location of the folder with your images
$image_folder = “images/random”;

// You do not need to edit below this line

$start = “1″;

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

echo “<img src=\”$image_folder/$image_name\” alt=\”$image_name\” />”;

?>

Name your images 1.jpg, 2.jpg etc.

Add this line to your page where you want the images to appear:
<?php include “randomimage.php”; ?>

Site Ribbons

Ever want to make your own site ribbon. Here is how…

First create a image about 200px x 200px give or take with the diagonal ribbon with what ever text you want it to say in it if any.

Then add the following code (obviously making code changes to reflect your site, unless you want to support my site) into the body of your site (between <body> and </body>)


<style type="text/css">.ffribbon { position:absolute; z-index:10000; left:0px; top:0px;
height:199px; width:199px; background-color:transparent; margin:0px; padding:0px;
border:0px none;}</style><img class="ffribbon" src="http://heathersblog.com/heathersribbon.gif" usemap="#ffmap" /><map name="ffmap"> <area shape="poly" coords="0,163, 0,198, 198,0, 163,0" href="http://heathersblog.com/" alt="Heather's Blog" /></map>

If you want a blank ribbon contact me and I will send you one..