Web Development: Tables

Published on Sep 17, 2009   //  Development

Web Development

Organizing data to be presented on the web may seem like a daunting task, but it isn’t. We can use tables to easily organize our data into columns and rows. Today, we’ll be going over the basics of how to use tables to organize data.

Tables are broken up into rows and columns. You must begin with a row, which will then contain one or more columns. In theory, you may have an unlimited number of rows and columns. Practically, there is a limit to the number of columns you can cleaning present within limited screen resolutions.

Today, we’ll be looking at three HTML tags for creating tables: table, tr and td. table obviously begins the table, wrapping around the other tags. tr begins a row and wraps around the column tag, td. Let’s have a look at an example of a simple table:

[html]<table cellspacing="3" cellpadding="3">
<tr>
<td>
Row 1, Column 1
</td>
<td>
Row 1, Column 2
</td>
</tr>
<tr>
<td>
Row 2, Column 1
</td>
<td>
Row 2, Column 2
</td>
</tr>
</table>[/html]

You’ll notice how we used cellspacing and cellpadding attributes in our table tag. These allow us to adjust the amount of spacing between each “cell”, and the amount of padding in each “cell”. Visually, our table will look like this:

Row 1, Column 1 Row 1, Column 2
Row 2, Column 1 Row 2, Column 2

While our example isn’t much to look at, you can see the potential here for easy data presentation. Next week we’ll go over some more advanced stuff on tables.

WordPress Wednesday: Simple Press Forum

Published on Sep 16, 2009   //  WordPress

One of the major advantages that a WordPress-based blog has over a conventional static website is the level of interactivity that you can have with your audience. A blog is much more powerful when its readers are vocal and the comment section can be great for sparking discussions about the topics that are suggested by the blog posts themselves. However, what if your readers want to start a few conversations of their own?

Many bloggers have considered adding a forums section to their blogs, but they’re not sure how to approach software like phpBB and vBulletin. These always require a separate installation from WordPress and this may create a lot of added work or frustration for the site administrator. An alternative option is a new WordPress plugin called Simple Press Forum. This plugin effectively inserts a forum into your WordPress-based website.

According to the official page, Simple Press Forum is completely integrated with WordPress user registrations and logins. This means that if your readers have already created an account for themselves on your site, this login information will also transfer to the forum. The same can be said about your admin account. Other highlights include SEO-friendly permalinks, a private messaging system, post moderation, integrated search, optional signatures, spam prevention tools, and inter-linking between blog posts and forum topics.

For more information and to download the Simple Press Forum plugin for WordPress, check the official website. Has anyone tried this yet? It seems like it could be a very valuable tool for popular blogs.

Business 101: When Retiring Is Not Retiring

Published on Sep 15, 2009   //  Business Topics

As he has been known to do several times in the past, Jerry Seinfeld made a very poignant observation last night. He was the first guest on the new Jay Leno Show and he said that back in his day, when you said that you were retiring or ending a show, you really were retiring or ending a show. When he said that Seinfeld would be reaching its series finale, he meant it. We never saw a true “new” episode of Seinfeld ever again.

With Jay Leno, he said several months ago that he was done as the host with the Tonight Show. We knew that day was coming for a few years already, since it was announced that Conan O’Brien would be taking over as host for the show. Shortly thereafter, it was announced that Jay would be getting his own new late night talk show at the 10pm time slot. This effectively “unretired” Leno and, based on my viewing of the Jay Leno Show last night, the new show is just a slightly altered version of his old Tonight Show gig.

Is this really the right way to go about conducting business? Does this hurt the integrity of Jay Leno and NBC? Does this hurt NBC’s relationship with Conan O’Brien?

In similar manner, we’ve already witnessed Brett Favre retire from football twice. We’ve also witnessed the star NFL quarterback come out of retirement twice. The sports world was so frustrated with being jerked around on both of those occasions, since Favre said that he retired and then he said that he would think about “unretiring,” not committing to a new decision until several months later. It made for a media circus and an unnecessary level of drama.

In running your own business, when is it acceptable for you to say that something is coming to an end only to say that it is going to come back a few months later?

Great Gadgets: Coffee Cup Power Inverter

Published on Sep 14, 2009   //  Gadgets

 Coffee Cup Power Inverter

Whether you are a sales professional going out to close a deal or you are an executive heading to an important board meeting, there is a good chance that you may be spending a lot of time on the road. When you are behind the steering wheel, you want to keep focused on the road, but you also want to be as connected to the world as possible, especially if you have other associates in the car.

There are other power inverters available on the market that can convert your standard 12V DC outlet (the cigarette jack) in the car into a usable AC outlet for regular chargers and power supplies, but very few are quite as creative as this coffee cup power inverter from ThinkGeek. One end of the cable plugs into the cigarette jack as normal, but the top of this faux coffee cup actually provides a pair of regular wall outlet-style jacks, as well as a powered USB port.

This means that you can charge your iPhone while on the road, as well as provide power to a notebook computer or any number of other gadgets that you may have in your car at the time. This is much more seamless than many of the more industrial-looking alternatives on the market and it is just as effective.

Find the Coffee Cup Power Inverter for $29.99 on ThinkGeek.com.

WordPress Development: Automatic Feed Links

Published on Sep 14, 2009   //  Development
Off

WordPress Development

In the most recent post of our Web Development series, we discussed specifying feeds for browsers to discover. Today, we’ll be going over how to easily do this with WordPress themes, using some built-in functionality.

In some portions of WordPress, there may be multiple feeds that apply to one page. The two main feeds are the posts feed and the comments feed. When you’re visiting a post or page with comments enabled, a feed of comments on that post is available. There are also feeds available for categories and tags.

As you can imagine, ensuring you are specifying these feeds to the browser when appropriate can get complicated. Beginning in WordPress 2.8, a simply way to achieve this has been available. The function that allows us to do this is automatic_feed_links(). This function will output the appropriate feed specifications to the wp_head of your theme, taking all the guess work out of doing this manually.

To implement this, you must first ensure that you have a wp_head() call in the head of your theme. Otherwise, this method will not work. Then, all you have to do is add a call to automatic_feed_links() in your theme’s functions.php file (don’t forget the opening PHP tag if this file is blank current). Then viola, you will have feed links placed in your theme automatically.

Everything PHP: MySQL Primary Keys

Published on Sep 12, 2009   //  Development

Everything PHP

When performing a select query on a database, you’ll likely be specifying a where clause to narrow your results. Searching through a database can be “expensive” (CPU and time intensive). Today we’ll be looking at a case where you can make this search less-expensive.

First of all, let’s talk about a use case for this article. If you want to retrieve a single row from the database, based off a field that will always contain unique data. For example, if you were retrieving a blog post from the database, you might search for it by a unique id.

If you have a use similar to the one described above, you may be able to speed up your select query. By adding a primary key to the described unique field, MySQL will keep an index of these fields for quick searching. This will allow you to perform quick select queries using the primary key field for the where clause.

As you may imagine, this has many use cases. From selecting a blog post by its “url slug”, selecting a product by its id and infinitely so-on.

Page 3 of 612345...Last »