Tribes Review

Published on Mar 5, 2009   //  Reviews

tribesI have been a long time fan of Seth Godin’s books. I have previous reviewed Meatball Sundae, Purple Cow and The Dip. Today I decided to purchase the audio book of Seth’s newest book Tribes. This was available on iTunes and is about a 4 hour listen. This book is a great book for those people in business who are looking to find a way to grow through social media.

This book touches on how to grow your own tribe around your business. It can be an external tribe like customers or an internal tribe like your co-workers. You do not need to be the boss to be a leader of the tribe with today’s technology, anyone that can rally others to a cause are today’s heretics and leaders.

He goes on to say that people choose not to lead out of fear. That we all fear criticism. If we can learn to accept the criticism and even embrace constructive criticism we would have more leaders in the world. The book explains the difference between a manager and a leader and that you should not be sucked in to the belief that just because you are not a manager that you can not be a leader is no longer true.

This book touches on Twitter and blogging as well.

If you have read this book what did you think?

Marketing 101: Make It Simply Easy

Published on Mar 5, 2009   //  Marketing Tips

You already have to face enough challenges to get new customers through the door and buying your products, so why erect any additional speedbumps that may impair your ability to sell your products and services. You want the customer experience to be as easy and seamless as possible. People don’t want to work to find your stuff.

No matter what advertising strategy you are employing, it is of paramount importance that you keep at least two or three of these elements in plain view. First, the name of your company or highlighted product should be very obvious. There is something to be said about teaser campaigns, but the conventional route can work just as well. You don’t want someone to remember that there was “some ad” in the newspaper if they can’t remember it was your ad.

Next, you want your website URL to be featured where it is easy to see and easy to read. If you are purchasing some television commercial time, be sure to feature your website URL during or near the end of the commercial. This way, if your TV spot was reasonably effective and the prospective client wants to learn more about what you have to offer, they’ll know exactly where to look. This is particularly important if your search engine rankings are not as good as they should be.

Third, you want to have a phone number available. This will vary from business to business, industry to industry, but you may have customers who aren’t as inclined to read the content on your site. They may just want to talk to you directly, possibly placing an order on the spot. For a radio spot, be sure to repeat your phone number more than once, because the prospective customer may miss it the first time around.

Make it as easy as possible for your customers to find you and to buy from you. They don’t need the extra hassle of trying to find you.

WordPress Development: WPDB Insert and Update

Published on Mar 4, 2009   //  Development
Off

WordPress Development

Continuing on with our mini-series on the WordPress Database class, today we’ll be talking about using the class to insert and update data in the database. The WPDB class makes this super simple, no SQL queries required.

Inserting Data

Using the WPDB class, you can insert an array of data into a table in the database. The syntax of this function is simple:

[code='php']$wpdb->insert( $table, $data );[/code]

$table is the name of the table you want to insert the data into and $data is an array of field names and data you want added to $table. For the data array, the field name should be the key, while the value should be the data for that field name. So, if we (for example purposes) wanted to use this function to add an option to the options table, we we do so like this:

[code='php']$data_array = array('option_name' => 'example_option',
'option_value' => 'This is an example option!');
$wpdb->insert( $wpdb->prefix . 'options', $data_array );[/code]

Which would add a new row in the options table, with an option_name of example_option and an option_value of This is an example option!. You only need to specify the field names that you would like data added to. $data should not be escaped first. Obviously, we could accomplish the same result much easier using add_option, but this is simply for example purposes.

Notice the $wpdb->prefix part. Because it is possible to set WordPress up with a prefix different from wp_, it is good programming practice to always use $wpdb->prefix for the prefix in table names.

Updating Data

If you want to update an existing row in the database, we can use a WPDB function for this. This function is almost the same as insert, but it also allows you to specify the WHERE clause. Thus, the syntax is:

[code='php']$wpdb->update( $table, $data, $where );[/code]

The $table and $data values are the same as in the insert function. $where is an array where the keys are column names and the values are what their values should be; therefore creating the WHERE clause. So, if we wanted to update our example option from above, we could do this:

[code='php']$data_array = array('option_value' => 'This is a *new* example option!');
$where_array = array('option_name' => 'example_option');
$wpdb->update( $wpdb->prefix . 'options', $data_array, $where_array );[/code]

Which would update any row whose option_name is example_option, in the options table, with the new value for option_value. Again, $data should not be escaped before hand.

To conclude

This concludes our mini-series on the WordPress Database class. If you have any questions, feel free to ask them in the comments.

Community Poll

Published on Mar 4, 2009   //  Polls
Off

Weekly Community Poll

Last week we asked do you use To Do Lists and 63% said yes. This weeks question is…

 

{democracy:71}

WordPress Wednesday: WP Content Filter

Published on Mar 4, 2009   //  WordPress
Off

Do you find that the readers on your blog have a tendency to use “colorful” language when they leave comments. It can be a real pain having to go through the moderation queue to check up on any comments that got caught by your keyword filter, assuming that you do screen for foul language on your blog. This is a personal choice, of course, but if your blog is used as a front for your business, it is probably in your best interest to keep a careful eye on what commentators are saying.

By default in WordPress, you have the ability to screen for your chosen “banned” words and any comments that contain these words will end up in the moderation queue. Just because someone decides to use certain coarse language, however, does not mean that they don’t have something valuable to contribute. It may mean that you do want to censor some of that language, but manually editing each of these comments can be very time-consuming.

The new WP Content Filter WordPress plug-in addresses this very issue, scanning through any comments left on your blog for your pre-defined “flagged” terms. From there, you can choose how far you want to take your censorship. You can have all the letters replaced with a wildcard (the default setting uses an asterisk), keep the first letter, or keep both the first and last letter.

For example, if “bluefur” is one of your flagged terms, you can choose to have it automatically censored to *******, b******, or b*****r. You can also choose whether the specified keywords are or are not case-sensitive.

For more information on the plugin, including installation instructions, check out the download page at gwycon.com.

Everything PHP: For Loops

Published on Mar 3, 2009   //  Development

Everything PHP

For this week’s episode of Everything PHP, we are going to be talking about the final looping method in PHP. For loops are the most complex loop available in PHP. Being the most complex loop in PHP, they are also the most powerful. As with other loops in PHP, you can nest loops within other loops.

A for loop can accept multiple expressions to be evaluated. The basic for loop has three expressions, only one of which determines if the loop will be executed or not. The other expressions are for executing expressions whenever the loop is run (more on this in a bit). Here’s one of the most commonly used examples for the for loop:

[code='php']for ($i = 0; 10 > $i; $i++) {
echo $i;
}[/code]

Which results in the output of:

0123456789

The for loop is broken up into three groups of expressions, which are separated by semi-colons. The first group will only be run once, at the first iteration of the loop. The second group determines whether the loop will proceed or not. If the expression results to true, the loop will be executed, if the result is false, the loop will stop. The third group will be executed at the end of each loop iteration (after the code inside the loop has been executed).

The first expression group is used for setting variables that you will use within the second expression group. The second group is an expression which should result in either true or false (like something you would use in an if). You can use variables and functions (a note on using functions here later in the post) within this group. The third group is usually used for incrementing a variable used in the second group. Is it possible to leave any (or all) of the expression groups blank. If you leave the second expression blank, the loop will run indefinitely (which isn’t useless, as you may initially assume).

You can specify multiple expressions to be executed within any expression group. Simply separate the expression with commas. In the case of the second group, multiple expressions can still be used, but only the last expression in the list will be used to determine whether the loop will run or not.

When using functions in the second group, if you do not need the function to be run on each iteration of the loop, you should put the functions inside a variable in the first group. Otherwise, your loop will run slowly, because that function will be executed each time the loop iterates again. Take the example below, where we’re using count() on an array:

[code='php']$array = array('a', 'b', 'c');
for ($i = 0; $i <= count($array); $i++) {
echo $i;
}[/code]

Because the count of $array is not going to change, we do not need to calculate it with every iteration of the loop. Therefore, we should add in to a variable within the first group, which will only be run once.

[code='php']$array = array('a', 'b', 'c');
for ($i = 0, $array_count = count($array); $i <= $array_count; $i++) {
echo $i;
}[/code]

This will result in a faster loop.

Continue, Break and Infinite Loops

Remember how leaving the second group of expressions empty would result in an indefinite loop? Well, there actually are uses for this, because we can end the looping in a different way. We can use the break control structure to break out of the current loop (stop it from iterating again). Let's look at an example:

[code='php']for ($i = 0; ; $i++) {
if ($i == 26) {
break;
}
echo $i;
}[/code]

In this example, when $i reaches 26, the loop will be broken, and will stop iterating. If you have nested loops, you can specify the number of loops it should break out of (such as break 2;). break is different from exit in that the script will not end, just the current loop.

If is also possible to skip to the end of the current iteration of a loop, and continue on with the expression. We do this by using the continue control structure. It is used in the same way as break, and also accepts the number of loops it should skip to the end of.

break;

;) That concludes our article on for loops. Next week we'll be going over switch control structures.

Page 10 of 12« First...89101112