I've been setting this up for the last day, and yes, I chose tech merely as a test. I wanted to roll this into my goal to start building a blogfarm this weekend. I'll warn you, I just reread this after I wrote it, and it's a bit long.
I am using WordPress MU, which is a bit different than standard WP as it can do the whole blogname1.domain.com virtual hosting. This lets me have a bunch of related autoblogs of this type all from one WP install.
I'll warn you, my "day job" is as a linux webserver admin monkey, so I do things very directly, editing plugins and themes directly on the disk. I know not every blackhatter here is a systems guy (or gal), so sorry if this is over your head.
I installed WPMU under a domain, and set the dns up for the domain with a wildcard, meaning that *.domain.com pointed at my IP. This has every possible "blogname" pointing at the same copy of WPMU.
Here's the root site:
It's still using elegant box, which won't stay, but I used it so I could more easily follow the OP's set of instructions.
I didn't like any of the favicon solutions, so I made my own directly in the theme.
I realized that I wanted the original source site name in the info bar, except it wasn't stored anywhere, and if I could get it, I could use that to pull favicons from a local cache.
I edited the wpomatic.php plugin file (1.0RC4).
Code:
$meta = array(
'wpo_campaignid' => $campaign->id,
'wpo_feedid' => $feed->id,
'wpo_feedname' => $feed->title,
'wpo_sourcepermalink' => $item->get_permalink()
);
I added the wpo_feedname line below the wpo_feedid line, this sticks the feed title into each post in a custom variable.
In the theme's index.php:
Code:
<img style="float: left; margin-right: 15px;"
src="/icons/<?php $key="wpo_feedname"; echo get_post_meta($post->ID, $key, true); ?>.png" />
I added this right above the line with the_permalink and the_title. This just adds an img tag to the left of each entry's title and gives a few pixels of padding.
I created/downloaded icons for the sites in my feeds and threw them into an /icons directory. I renamed all of the files to be the title of the feed, so AppleInsider became AppleInsider.png. Had to be careful to make sure to get spaces in the filenames, as some feed names have them. So the icon for TUAW is 'The Unofficial Apple Weblog (TUAW).png'
I played around with the CSS and structure a bit to get everything looking right, colors and font sizes the way I wanted, and then commented out the bit of php that throws up the comment count.
Code:
# if (function_exists('wp_list_comments')) {
# comments_template('', true);
# } else {
# comments_template();
# }
If you're not a PHP weenie, the # at the start of each line comments it out.
I then realized I had problems with the cached images that WPO was saving not having extensions like .gif. Under Apache this isn't a problem, but nginx has no mod_mime_magic to detect mimetype and uses file extensions 100% to set the mimetype. So an image that was downloaded as "aa34.cgi?foo=bar" and had no ".gif" at the end wouldn't display.
I fixed this in two parts. Those of you using Apache won't have to do this as mod_mime_magic will make it "just work". I prefer nginx for it's ultra small footprint and wickedly fast speeds.
First, in the cache directory, I put this script:
Code:
#!/usr/bin/perl
use strict;
use File::MimeInfo::Magic;
opendir(DIR, ".");
my @files = grep { !/\.(png|gif|jpg|jpeg)$/i && -f "$_" } readdir(DIR);
closedir DIR;
foreach my $file (@files) {
if ($file eq "marceau") {
next;
}
my $mime = mimetype($file);
my ($base, $type) = split(/\//, $mime, 2);
if (! $base eq "image") {
next;
} else {
if ($type eq "jpeg") {
$type = "jpg";
}
rename($file, $file . "." . $type);
}
}
I named it "marceau" (Marcel Marceau... Mimes... never mind) and set cron to run it five minutes after each wp-o-matic run. All it does is find every file in that directory that DOESN'T have an extension, checks for its type with the File::MimeInfo::Magic module, and if it's gif/jpg/png, rename it.
The problem is, WPO/Thumbnails-For-Excerpts are still looking for the file without the extension. So (Warning: Advanced Geekery) I did this in nginx's conf file:
Code:
location /wp-content/plugins/wp-o-matic/cache {
set $extension '';
if (-f $request_filename) {
break;
}
if (-e $request_filename.gif) {
set $extension '.gif';
}
if (-e $request_filename.jpg) {
set $extension '.jpg';
}
if (-e $request_filename.png) {
set $extension '.png';
}
rewrite ^(.+)$ $1$extension last;
}
Which basically uses nginx's rewrite engine to change the request to use the extension after checking if the filename requested exists with one of the three extensions.
I also edited the thumbnailsforexcerpts.php to change the way they were displayed, so that I could get full sized images and move the text below.
One remaining problem with TFE is that it's pulling things like 1x1 transparent gifs and using them as thumbnails.
I can now create a sub-blog in about 20min.
- Logged into any subdomain's admin, I go to the WPMU admin screen.
- Under "blogs" is a set of fields to create a new subdomain, I give it the "blackhat" portion of the url, and a title, "Geekstream Blackhat" and click "Create".
- The site is now live with default wordpress content, so I activate all the plugins.
- Configure WP-O-Matic with about 12 feeds. I like http://www.blogged.com/directory/ for finding them.
- Set wp-o-matic to create under a correctly named category. For this one I'd quick-create "BlackHat".
- Set wp-o-matic to pull one at a time, on whatever schedule makes sense. The feeds are slow on the weekends so I'm pulling every 20min. This will get cranked down.
- Click "fetch"
- Add the wp-o-matic url to cron on the box.
Done. hxxp://blackhat.geeks... is live and chugging. (Not really, I didn't create a blackhat)
I've still got some issues. Since the same theme files are used for every site I have the same youtube bar for all the subdomains. I need to edit the single.php still to change the keywords in the youtube bar based on the hostname.
In the same manner, wp-o-matic only caches in a single directory, which is inside the /wp-content/wp-o-matic directory. Since WPMU uses the same plugins dir for all sites, it's problematic to change, it won't save outside it's own dir, and every subdomain dumps its images in the same directory. This makes the gallery stuff really quite pointless. I am going to try to see if I can tweak wpo to get it WPMU-aware.
So as you can tell, none of the sites (main, mac, linux, gadgets, anime so far) have any adsense, any CPA or other types of ads. Also the blogs themselves don't link together. That's next.
Also I am not doing any pinging except for stock wp pinging, as I haven't even looked at onlywire yet.
My goal for this project was to start building a blogfarm. I want the intertwined links. I'll probably add adsense and the like at some point.
What else does one want do with a TechChuck style site?