kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Block Countries in Apache

Posted on November 18, 2008

Assuming you have mod_geoip installed in apache we can block certain countries in 6 lines of code.

I had a client who was experiencing an inhumane amount of spam on their phpBB forums, which are notorious for bot attacks. Luckily this forum was geographically specific - so we can block all the countries we aren't interested in.

Convert phpBB IP Addresses

Posted on October 9, 2008

phpBB stores its IP addresses in a funky format. They're useless to the human eye!

Convert them to normal IPs with the following code

SELECT CONCAT( CONV( substring( poster_ip, 1, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 3, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 5, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 7, 2 ) , 16, 10 ) ) AS IP
FROM phpbb_posts
WHERE `poster_id` = USERID
LIMIT 0 , 30 

This code will convert all know IPs from a selected user (In my case 51).

Tagged as: , 7 Comments

Using WordPress header and footers externally

Posted on September 24, 2008

I needed to integrate a WordPress header (header.php) and footer (footer.php) into an external application.

There are quite a few ways round this, but none are really ideal. For example, if you want to include an external page in WordPress for whatever reason, you could use the Exec-PHP plugin. Simple, hey? No.

Anonymous apache & PHP for cPanel

Posted on September 11, 2008

So I've started playing with cPanel/WHM recently. I've got to say it does make my life immensely easier, at, in my opinion, reduced security. So I'm working on security cPanel/WHM. Apart from the obvious, which I won't go into in this post, we'll make apache and PHP anonymous.

How to move WordPress directory or server – properly

Posted on August 24, 2008

I ran into an annoying, but easily avoided problem the other day. When moving a clients WordPress site from the development/staging area to it's live domain, I did the usual update "WordPress address" and "Blog address" in the WordPress settings.
Thats all you need to do, right? No.

Who needs credit cards?

Posted on August 2, 2008

I don't! Times are hard. We're in a credit crunch, spiralling to recession. Apparently.

WP Super Cache – I’m impressed

Posted on July 31, 2008

Pictures speak better than words...

Site Performance Quick Fixes

Posted on July 31, 2008

I've been playing around with YSlow for a while now, now I decided to a quick test on this blog.

This blog, according to YSlow rates a frumpy Grade D, with a score of 61. Not bad, but not great.
A bit of .htaccess trickery should give me a few extra points... Excellent Grade C, with a score of 73.

Single Line WordPress Install

Posted on July 20, 2008

I'm getting a pro at installing WordPress now.I'm trying to cut down my install time to a minimum.

WordPress 2.6

Posted on July 16, 2008

So I upgraded WordPress 2.6! Turbo rules!

Tagged as: , 3 Comments
Page 21 of 34« First...10...1920212223...30...Last »