Please Stop

John has done the right thing, so let us all say thanks.  And John if you read this, I would love to help you out with some CSS stuff, just leave me a comment or shoot me an email.  And my thanks to all of you who voiced your support, and then some... I am looking at YOU Indranil.

For the love of God, whoever you are just stop.

Did you think I wouldn't find you?  That I would some how be happy that you have aped my work without asking?  Taking inspiration from another designer is one thing, wholesale theft is quite another.  Bad Karma man, bad Karma.

I have released an open source theme for WordPress called Persian you can use that.  But as you can see the design and code of this sites layout are copyrighted to me not you.

Please have some decency here and cease and desist.  If you are a friend of the site, help me out with leaving some... persuasive comments over at his site.

 

Post a job. Find one. authenticjobs.com

 

Whadya know

I had not intended on posting another update on Red Curtain so soon, but last night was an amazingly productive night of coding.

Red Curtain 0.1 Starscream Update #2

So apparently the first Player to be created will be for Movies.  Which makes sense really, it was my bittorent addiction that got me going on this project, and I only aquire HD television shows.  The only bit I have left is to figure out the private API enough to force fullscreen.

Once I have fullscreen working, I will fully integrate it into the Stage and move onto the next Player, which will either be the DVD Player, or the iTunes interface.  Not sure which yet... Or maybe a module to access my game system emulators, that sounds nice.

Moving right along.  At this point I need to start thinking about the UI a bit more.  A friend of mine has given me some UI mockups he was working on, and I like them, I am just not sure they fit in with the developement direction that Red Curtain is taking.  The future will tell though, won't it?

Once I get the Movie Player integrated and fullscreen capable I hope to post some screenshots of it in action.  Keep your eyes open people.

 

Project Update

Just thought I would post a quick update on my Media Manager Project.

Things are moving along slower than I would have liked, but my involvement in Shuttle and various other projects are sapping away my time.  Speaking on Shuttle I thought I would take the time to update you my loyal readers on just what in the Sam Hill is happening with Shuttle.

Read the rest »

 

This ones for Morydd

Today on #wordpress my buddy Morydd (pronounced Mo - ry - th) was making some suggestions for novel uses of gravatars which sparked something in my mind.

I am a fan of heatmaps, but could never get excited about having one here.  I don't care how many posts I have in each of my categories or any of that jazz.  Now what I am interested in is commenters and the amount of commenting that is going on here at Sillyness.

This lead me to create Commenter Heat Map.  You can see it in action over at this page.  Now as the page says this is a work in progress and not ready to be released into the wild, but I am hoping to have it ready for anyone who wants it by the end of the week, along with my commenter coloring plugin.

So you know the drill, check it out and leave me some feedback.

 

Commenter Heat Map

Commenter Heat Map

Below is a heat map of the commenters here. The size of the gravatars are based on the total number of comments for each person.  This is a work in progress, so keep that in mind.

cjd_comment_heat();

 

Features, features

I really should have provided a link to a post that had alot of the coloring going on so you could really see it in action, so here you go.

So I have a new plugin running on my site at the moment that I whipped up today.

I have been styling my comments differently that everyone elses for awhile, but I thought it would be nice to apply some formatting to other commenters, for instance those that comment quite frequently, or those that I am pretty well aquainted with.

So I am beta testing the new plugin here... it is pretty simple really.  I set up "profiles" for each person that link to some CSS.  Now some people in the IRC channel have mentioned that they would like to have a version of this plugin that styles commenters by total number of comments, so I will be writing one of those as well.

So long story short, leave me some feedback as to the merit of this latest hackery.  Is it worth having, or is it too distracting?

I will await your thoughts.

 

Our First Doctors Appointment

Heather and I had our first baby related doctors appointment yesterday (Thursday February 17th).

Heather's parents came down to take us to the appointment, they have 3 grandchildren already, but they are acting as though this is the first!  It is very encouraging to see the capacity for love that the human heart possesses.  It is very humbling as well.

Heather has gained 3 pounds in the last two weeks which is a miracle in and of itself since she has a difficult time putting on weight.  The results of the tests performed were all favorable and Mother and Child are healthy.

 

Adding WordPress to an existing site

Over at the WordPress Support Forums a user asked how he/she could incorporate WP into thier existing site.

That prompted me to finally get around to writing some tutorials on WP, and how to better integrate it into your existing site.

So here is the first installment.  Basically you can think of WP as a collection of functions or scripts that do specific things.  If you want to have your site title to be somewhere on the page, you simply type in:<?php bloginfo('name'); ?>This piece of code is all that is required on your part to achieve the desired affect.

So let's get down to brass tacks.  Say you have a site all ready to go, and you only want to use WP to power the text of your site; that is easy enough to do.

First lets set the stage.  For this example we will assume you have the following DIV's defined in your CSS:

  1. .header
  2. .menu
  3. .content
  4. .footer
Now all we will be concerned with in regards to WP is the .content DIV.  Here is where you will need to insert your functions.  I am going to assume that one would like to have the date, category, author name, time and comments in the .content area, following is how you would do that.

First things first

First you need to add this to the top of your index page:<?php $blog = 1; require('wp-blog-header.php'); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
I am assuming that you are using XHTML 1.1 here, I mean isn't everyone?  The <?php... line is required for WP to function.

Now, within the .content DIV add these functions:<?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>This is the "motor" that starts WP off pulling your content from the database.  Alright next you would add this: <?php the_date('','<h2>','</h2>'); ?>Then one of these:<a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a>Now this bit of code calls to the database and grabs the title of your post, the way it is set up here is to make the title your permalink; a permalink is the permanent URI of this article.  I f you don't want it to be a link, leave off all the <a href=""></a> code.

Okay so far we have the date and the post title showing up in the .content DIV, now on to the actual post content.

Next we want to throw this function in:<?php the_content(); ?>That will call the body of your post and spit it out in the .content DIV.  Pretty straightforward huh?  Now we move onto the meta information, i.e. the category it was posted in (if any), the author who posted it (if you have more than one, or just like to see your name in lights), the time it was posted, and a link to any comments for that post.  Here is the function code to make that happen:<?php link_pages("<br />Pages: ","<br />","number"); ?> :: <?php the_category(); ?> :: <?php the_author(); ?> @ <a href="<?php echo get_permalink(); ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_time(); ?> :: </a> <?php show_post_count($post->ID, $before="Read Count (", $after=")"); ?> <?php comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)'); ?>This will spit out the appropriate values looking something like this:

Pages: (if multiple pages for post) :: TheCategory :: Mr Author @ 4:44 PM/AM :: Comments (0)

Next you need to add this code immediately after the above:<?php include('wp-comments.php'); ?><?php if ($p > 0) { add_count($p);}?><?php endforeach; else: ?><p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

That is all there is too it really, except that you will have to save this page with a .php extension(added 05.10.2004).  Now you will obviously want to style these, and add some sort of seperation between functions, like <br />'s or throwing each funciton in it's own DIV nested within the .content DIV, it is really all up to you.

Let me know if this was helpful and if so, what other tutorials you would like to see on WP in the future.

 

Themeing in WordPress 1.5

I have mentioned themes briefly before, but in light of some questions I have been fielding I have decided to dedicate some time to a proper tutorial.  Hopefully we can flesh this out a bit more fully, just remember the mantra: "We write the theme, We love the theme, We are the theme."

cjd_word_count();

Read the rest »

 

WordPress as CMS

Here you will find my multi-part series on WordPress CMS in one location.  No longer valid as of WP 1.5+

Faking it: WordPress as CMS pt. 1

In this tutorial we will cover the steps necessary to use WordPress as a CMS.  This tutorial will cover the basic concepts and steps to get something up and running as quickly as possible, part 2 will cover more advanced tricks to get the most out of your WPCMS.

The first step is to identify exactly what you want to get out of a CMS, just because you can make WordPress function as a CMS doesn't mean you should.  Be sure before you begin that you are not creating more work for yourself than neccessary.

Okay so I assume since you are still with me that you have decided that a WPCMS is for you.  Now, we need to identify how your new shiny sight will be organized.  For the purposes of this tutorial lets assume that you will have the following site structure:

  • index/home page
  • colophon/information page
  • about me/about us page
  • movie/music reviews
We all set?  Good lets get going.

The how and the Why

The core of our approach will be to utilize the category system built into WordPress to "fake" static areas of your site.  First off, create the new categories that correspond to our "sections".  Go ahead and do that, I'll wait.

Done?  Good, now we need to go to our index.php page and make some changes to how we grab and display our categories to the world.  But first things first; we need to find out the id number of each of our new categories, so off to ~/wp-admin/categories.php!  Once there, locate the categories we have added and take note of the id, for our purposes we will assume they are 8,9 and 10.

Now having our id's we open index.php in your favorite editor and add the following to the top of the file just below$cat="1 2 3 4 5 6 7";Edit: Now you might be asking your self as one of my readers asked me already, why not just use $cat = "-8 -9 -10"; instead of listing the allowed cats?  Well as I responded to him, currently in WP you can only have one negative value in the $cat=""; statement.  This might be something that will be changing in the future, but until then the only way you can make the magic work is to follow my instructions.

So the top of your index.php page should now look like this:<?php
$cat="1 2 3 4 5 6 7";
require('./wp-blog-header.php');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="eng"><head profile="http://gmpg.org/xfn/1">

What we have just done is tell the index page to load any content it finds in categories 1 -7, but to absolutely, positively ignore 8 - 10.  Now this is a good solution when you have multiple categories that you want to exclude, but if you only have one, say you only want to have an aboutme.php page, then you would simply place this: $cat = "-9"; which would tell your index.php page to pass over any posts that belong to the aboutme category.  Pretty simple huh?

Hidden weapon: categories

Now on to your single category pages, e.g. colophon.php, aboutme.php and reviews.php.  These are even easier than setting up your index page.  Remember those id numbers you grabbed to exclude from index.php?  Now you need to add the appropriate category number to each page.  For this example lets assume that the cat id's correspond to the category names in the following order:

  • 8 = colophon
  • 9 = aboutme
  • 10 = reviews
Now that we know what category corresponds to what id it is simple to create the pages.  My advice would be to simply open up index.php again and change the first couple of lines to the following:<?php
$blog = 1;
$cat="8";
require('./wp-blog-header.php');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="eng"><head profile="http://gmpg.org/xfn/1">
Now save this page as colophon.php and you are officially done with setting up your colophon.  Now you can easily log into your wp-admin area and create as many entries as you would like for the colophon, and they will magically appear on colophon.php but never show up on index.php.  Do this for each of your other pages changing the $cat="(n)"; to match whichever category you are wanting to echo out on that page.

You really have nothing left to do for your individual pages, so we can move onto cleaning up a couple of loose ends on index.php.  You have very sagely removed any post content that corresponds to your new categories from index.php, but neglected to do something about your categories list on index.php!  Now this only applies to those people who have not seen the light as I and a few others have, and still have categories listed on your index page.  But I digress, back on topic.

So we now need to ensure that our category listing on index.php only shows the categories that we had specified with $cat="blah balah"; and yes I meant to write blah balah, it is fun to say you should try it sometime.  So lets open index.php again if you closed it and locate this snippet of WordPress code:<?php wp_list_cats(); ?>You should find it around line 71 or so, and change it to this:<?php wp_list_cats('exclude=8,9,10'); ?>Now of course you would want to change the id values to whatever your cat id's are, but you already knew that didn't you?

Well that is it for now, you should now have a working CMS system powered by WordPress.  In part 2 I will cover semi-caching of your pages to increase speed on those pages that are not always changing, and how to perform some nifty magic with your apache server.  See you then.

Faking it: WordPress as CMS pt. 2

Now we comes the part where we throw in some cache-action.  Brought to you by the Dynamic Duo Mattman and Zeller the Boy Wonder.  Now Staticize Reloaded is not the best thing since sliced bread, but it is pretty great regardless.

Now I am not going to get into the "how" the plugin works, I mean who wants that!  We are Americans, we just want it to work now!  So anywhoo, follow these easy steps to set up a little cache action:

  • I assume you have followed the above link and downloaded the plugin from Matt's site?  Well if not then go and download away, I will wait.  Done?  Good.
  • Now, you want to drop that badboy into your /plugins/ directory located within the /wp-content/ directory.
  • While you are in the /wp-content/ dir, go ahead and create another dir called cache within /wp-content/ and make sure to chmod, or set permissions to 777.
  • Now login to your admin area and go to plugins, you will now see Staticize Reloaded listed, go ahead and activate it.
That is it, the plugin performs all its tasks behind the scenes.  One caveat, you must deselect gzip compression from the "reading" screen of your options, this is being worked on and should no longer be a factor in the near future.  If you leave it selected it will bork the whole process.

Okay so now we have our pseudo-static sections caching (as well as our non-pseudo-static sections), so what is the next weapon to add to our arsenal?  Read on and find out.

Customizing Apache

The next part of this tutorial requires you to be able to make changes to your apache setup, either through editing of httpd.conf or through .htaccess.  Sooo... if you can't do one of these two things, please skip ahead.  Those of you still with me, lets get to the hackin!  What we are trying to accomplish here is to add some flare to our newly created and cached sections.  Most sites that have aboutme and colophon sections use a site uri something like this: mysite/colophon/, now our solution poses a problem since they are not files in sub-domains, they are php files residing in our $siteroot, or wp directory.  There are two ways to approach this:

  1. Create folders for each section, and move the files we created earlier into them, making sure to either a.) make symlinks from $siteroot to the corresponding files in thier sub-directories, or b.) edit each of our pages to point to one directory up, e.g. ../wp-blog-header.php instead of wp-blog-header.php.
  2. Or we could perfom some apache magic and eliminate the need for file extensions.  What this gives you is the ability to input say mysite.com/index and have it resolve to index.php.  This also means that if you type in mysite.com/colophon/ it will resolve, no questions asked to mysite.com/colophon.php without updating the URI field.  I think you can see where I am going with this, and the possibilities that this presents.
Also, you can congratulate yourself for being forward thinking.  Eventually everyone will wake up and realize that running your server this way is better for the user.  With this method I could easily move from using php to power my site to cgi or asp (not that I would want to) and my users would never know, and more importantly thier bookmarks and permalinks would not break since they were pointing to chrisjdavis.org/index.

So, what we need to do is fire up the old terminal and edit either httpd.conf or .htaccess.  I will let you find out where these files are located since each distro handles placement differently.  For this haxie we simply need to add this snippet of code:<Directory /home/www/sitename/htdocs>Options + MultiViews
</Directory>
to your httpd.conf file or your .htaccess and then once saved, restart apache.  I prefer the lovely:apachectl gracefulcommand to restart apache, since it politely kills the child processes instead of just hacking them off wholesale. ; Now there could be a performance impact by doing the above, but unless you are running with a couple million hits a day, it is minimal.

The look and the feel

Okay now we have our site running without file extensions, and caching.  So what is left?  Good question, to close I wanted to suggest some cosmetic changes.  On our pages like aboutme and colophon, we really don't want to have people leave comments, and we don't really need to display the time, day, category and author for each of these "entries" so we should get rid of those function calls.  Keep in mind that what we might want is a last updated on bit of code, that would find the date and time for the newest entry on that cat and echo it out.

That can be accomplished by using a bit of custom code, or by exploiting some of the functions already built into WordPress.  That my friends is your homework.  Well that is it for now, let me know if there is anything else you would like to hear on this topic, or if anything I have stated is not as clear as it could be.

Cheers.

Speaking

Buy my book!

Blog Design Solutions