Posted June 7, 2006 at 9:50 pm in
cat6
Every now and then, the course of human events requires one to sit back and dish out a healthy “what the fuck is wrong with you people?” For example, take the recent comments of US Senator David Vitter (R-LA).
“I don’t believe there’s any issue that’s more important than this one,” said Sen. David Vitter, a Louisiana Republican. “I think this debate is very healthy, and it’s winning a lot of hearts and minds. I think we’re going to show real progress.”
What’s this all important issue? The mess we’ve made in Iraq? The growing trouble with Iran? Border security? Hell no! Those issues pale in comparison to the biggest threat facing our country: gay marriage. That’s right, with only 44 days left in session, this asshat can’t think of a single thing better for our government to be focused on other than gay marriage.
This is, of course, related to the recently revived issue of, and failed vote for, using the US Constitution to define marriage as a union of one man and one woman. Look, I don’t care what your opinion on the issue is, but to say you can’t think of anything more important shows either a) you’re a complete moron or b) you’ve developed a case of intestinal space parasites that’s forcing you to act like a dumbass.
Posted May 14, 2006 at 1:22 pm in
cat9
Those of you who’ve found yourself in need of a static front page for your WordPress powered site have no doubt thought about the addition of the “Mini-Loop” to bring a few blog posts to your front page. I think it’s also safe to say that the majority of you have been disappointed with the example from the documentation:
[code lang="php"]
$how_many=5; //How many posts do you want to show
require_once(”wp-config.php”); // Change this for your path to wp-config.php file ?>
$news=$wpdb->get_results(”SELECT `ID`,`post_title` FROM $wpdb->posts
WHERE `post_status`= \”publish\” ORDER BY ‘ID’ DESC LIMIT “.$how_many);
foreach($news as $np){
print (”
-
echo get_permalink($np->ID);
print (”\”>$np->post_title
“);
}
[/code]
All that and what do you get? Just the headline in an ugly ordered list. No lead-in text, no date, nothing. Now, considering content is king in the world of Search Engine Optimization, I wanted to bring a little more to the plate then just a simple list of headlines. The process is actually very, very simple once you do a little clean up job. Lets take a look at my first pass:
[code lang="php"]
$how_many=5;
require_once(”wp-config.php”);
$news=$wpdb->get_results(”SELECT ID, post_title FROM $wpdb->posts
WHERE post_status=’publish’ ORDER BY ID DESC LIMIT $how_many”);
foreach($news as $np){
echo ‘
$how_many=1;
require_once(”wp-config.php”);
$news=$wpdb->get_results(”SELECT ID, post_title, post_excerpt FROM $wpdb->posts
WHERE post_status=’publish’ ORDER BY ID DESC LIMIT $how_many”);
foreach($news as $np){
echo ‘
$how_many=1;
require_once(”wp-config.php”);
$news=$wpdb->get_results(”SELECT ID, post_title, post_excerpt, post_date FROM $wpdb->posts
WHERE post_status=’publish’ ORDER BY ID DESC LIMIT $how_many”);
foreach($news as $np){
echo ‘
strtotime and date functions. With strtotime(), we can convert the date we’re getting from MySQL into a UNIX timestamp, then, with date(), we can take that timestamp and turn it into a sexy looking format of our choice. For the example above, I choice something like “Monday, July 4th, 2006″ and cut out the time, but you can change that to anything you want. Just check out the PHP manual for a nice table of options.
One note about the date format is that it can be done directly from MySQL. Since it’s been my experience that most people working with WordPress have a very limited understanding of PHP, let alone MySQL, I chose the path of least resistance. If enough people whine about it, I’ll go ahead a put up an example of how that’s done.
Posted April 16, 2006 at 1:29 pm in
Unsorted
Man, have I been busy. In addition to working with my current “paying-all-the-bills” client, I’ve been toying with the idea of launching two new projects. The first, while not exactly new for me, would be a more sociopolitical commentary oriented site. Basically, I’d use it as a platform for the majority of my political rantings. Those whom I’ve known since 2004 will remember the site I did for a whole 4 days before letting ForumFox take over my thoughts. I managed to get a lot of positive feedback from what I posted and always wanted to pick up where I left off.
The second is an idea I’ve been thinking about for more than a year now; an advice column. At one point, I was actively requesting submissions from the various communities I’m a member of, but as usual, real world forces took. That, however, has not put a stop to the emails I still receive on the subject. So, perhaps it’s time to finally pick a name for the project and get to work.
Since I already have the layouts all built, it’s just a matter of picking a good backend, setting it up and filling it with content. The way I figure it, I can launch one this week and get the other one out next week. Though, since nothing ever works out as planned, even I’m not counting on that..lol
Posted April 2, 2006 at 10:43 pm in
cat9
For several months now, this humble little blog has been the target of a massive spam attack. We’re talking 40-100 fake comments every single day from what is clearly the same spambot. After tracing it back to an Israeli communications company, I did the natural thing and contacted them with the offending IP addresses and a very polite request for action. Two weeks later, with no reply, I gave up on the system working the way it should and took things into my own hand.
Order Allow Deny
deny from 82.166.49
deny from 84.54.244.243
allow from all
A wildcard blocks the bulk of the spam and specific IPs clean up the rest. Since I put this up, my inbox is finally free from moderation requests for potential spam.
(Yes, I know this was a half-assed post, but I’m tired :P)
Posted April 1, 2006 at 8:04 pm in
cat7
God I love Slashdot. Every year for April Fools day, they fire off several fake articles that tend to piss off the uptight community. This year, however, they went a little further and launched a “new design” to target a new group of readers. All that needs to be said..”OMG!!! PONIES!!!”