WordPress Wednesday: WP-PluginsUsed

Published on Apr 22, 2009   //  WordPress
Off

There are many ways that you can interact with the readers on your blog. Many bloggers enjoy sharing tips and other information, since these tidbits can prove to be very useful to all the other bloggers out there. If you’ve ever wondered how one site managed toinclude a certain feature, you can understand and appreciate the value of this creation.

Lester Chan is well-known in the WordPress community for developing a range of WordPress plug-ins and one of the often overlooked plug-ins in the bunch is WP-PluginsUsed. Now in version 1.40 and compatible with WordPress 2.6/2.7, this plug-in creates a page where your readers can see what plug-ins you are using.

This serves a couple of purposes. First, it offers some link love back to the developers who created the plug-ins that you are using (for free). This can act as a small thank you. Second, such a page can be useful to your readers in case they want to do something similar. Maybe you’re using a plug-in to create polls, generate custom archive pages, or integrate Twitter replies. Now, they can know how you do it.

On the flip side, this could possibly result in an increased security risk, since hackers can know which plugins they may hijack or exploit to harm your blog. As always, you should tread carefully with any blog customization.

For screenshots, a demo, and to download the WP-PluginsUsed 1.40 plugin, head over to LesterChan.net.

Everything PHP: Explode and Split

Published on Apr 22, 2009   //  Development

Everything PHP

When processing and sorting data in PHP, you may occasionally need to split a string at a certain point. For example, if you’re retrieving data from a third-party source which is in a non-structured manner, you’ll need to split the data at certain points to get the data you’re actually after.

Depending on the complexity of how you need to spilt up a string, there are two functions to accomplish this. explode() and split().

explode() allows us to take a string, and split it at the point of another string. It will then output a numerical array, with the first value being the data that was before the splitting string and the second value being the data after the splitting string. If the splitting string occurs more than once in the string, subsequent values in the array will have the afterpart in it.

split() is very similar to explode(). The difference is, the point the string is split at can be a regular expression, which allows for more complex splitting. Otherwise it is the same as explode() in regards to the output and syntax. If you want to use Perl-compatible regular expressions, use preg_split().

Let’s take a look at the syntax of explode() (split() takes the same parameters).

[code='php']explode( $splitter , $string [, $limit] );[/code]

  • $splitter – The string (or regular expression, for the split() function) of where you want the $string to be split.
  • $string – The string that you want to be split at $splitter.
  • $limit – (optional) The maximum number of values in the array (the last value will contain the rest of the string. The default is no limit.

Let’s take a look at an example. In this example, we’ll split a string by the string |.

[code='php']$string = 'one|two|three|four';
$explode = explode('|', $string);
print_r($explode);[/code]

Which would give us this result:

Array
(
[0] => one
[1] => two
[2] => three
[3] => four
)

If we were to add a limit parameter, let’s say 3, to this code, we would get:

Array
(
[0] => one
[1] => two
[2] => three|four
)

By using these functions, you can make quick work of processing raw, non-structured data.

Business 101: The Incentive to Try

Published on Apr 21, 2009   //  Business Topics

For the next couple of weeks, McDonald’s locations in Canada will be giving away free small coffees to anyone who asks for them. The promotion is only during breakfast hours, but it comes with zero strings attached. While they would certainly appreciate if you bought something, this is not a requirement for getting your free small coffee.

To some people, this may sound like a wildly absurd promotion, because it does not generate any revenue directly for McDonald’s. However, the small loss incurred from giving away the small coffees may be easily covered through the possible increase in breakfast meal sales. The customer that may have otherwise gone to Tim Hortons for breakfast would now buy their morning muffin from the golden arches.

But the real scope of this promotion extends far beyond the two weeks of free coffee. Many people may prefer to get their morning coffee from Starbucks or Tim Hortons, so they have no incentive to change up that morning routine. In this way, they may have never given McDonald’s a fair shot at being their preferred breakfast coffee location.

The price of zero dollars and zero cents is a huge incentive. This will get people through the door and, presumably, filled up with two weeks of free coffee. By the time the promotion ends, McDonald’s may have gained many customers that it may not have otherwise been able to reach. The short term loss can generate a long term gain.

In looking to your own business, are you providing enough of an incentive for potential customers to give you a try? Are you motivating people to switch from a competitor?

Fantastico Update

Published on Apr 21, 2009   //  Fantastico Updates
Off

Software Updates

Last night Netenberg updated Drupal, Joomla, Open-Realty, TikiWiki and WebCalendar…

Updates:

- Drupal: 6.9 -> 6.10
- Joomla 1.5: 1.5.9 -> 1.5.10
- Open-Realty: 2.5.3 -> 2.5.6
- TikiWiki: 2.2 -> 2.4
- WebCalendar: 1.0.5 -> 1.2.0

If you are using these software’s I suggest you upgrade.

Web Development: Javascript Control Structures

Published on Apr 21, 2009   //  Development

Web Development

Javascript may just be a client-side scripting language, but it still contains the essence of more powerful, server-side languages. Javascript contains control structures, such as if/else if/else statements and for loops.

Since Javascript is a much more powerful language than just manipulating the Document Object Model, possibilities with it become almost endless. Take Adobe Flash for example, its powerful scripting language (ActionScript) is based on the same standard as Javascript is. Another example: you can even use Javascript to create desktop applications with Adobe AIR.

We’re going to look at the if/else if/else statements today. The if statement allows you to check if a certain condition evaluates to true. The else if statement will check another condition if the previous one is false. The else statement will be evaluated if all the preceding if and else if statements are false. Let’s take a look at the syntax of these statements:

[code='javascript']if (condition_1)
{
// If this condition is true, the code inside this block will be executed
}
else if (condition_2)
{ // If the previous if condition is false, this will be evaluated
// If this condition is true, this block will be executed
}
else {
// If none of the preceding conditions are true, this block will be executed
}[/code]

As you can see, control structures such as if/else if/else statements allow you to use Javascript in a more advanced manner.

Great Gadgets: Carabiner Flash Drive from Imation

Published on Apr 20, 2009   //  Gadgets

carabiner

One of the smallest but most useful pieces of gadgetry that you will likely use in your business (and everyday life) is the USB flash drive. It’s just not appropriate to use any ancient floppy disk anymore, nor is it as convenient to use any sort of optical media. If you want to quickly save and carry files with you on the go, the trusty flash drive is a great way to go. However, these thumb drives can also be quite easy to lose.

Imation has come with a simple yet effective solution that is easily in line with the rugged “outdoor lifestyle” that many West Coasters (and others across the nation) enjoy leading. Rather than leaving the flash drive as a plain old stick, they’ve created something called the Imation Clip Flash Drive. The rubberized shell on this drive will be able to survive a little bit of damage, but the more notable feature is the included carabiner. Some people call these bike hooks.

The metal carabiner can be easily clipped to a backpack, messenger bag, suitcase, or even your jacket. This way, you’ll also have a place to stash your documents and it gets much less likely that you’ll lose those precious files. Flash drives may be relatively inexpensive these days, but the documents you store on them could very well be invaluable. You don’t want those secret business docs to get into the wrong hands, right?

The Imation 1GB USB 2.0 Clip Flash Drive is available on Amazon for $16.99.

Page 4 of 11« First...23456...10...Last »