Bringing High Tech to the Low Tech World.

|
Extract Image From WordPress Post |
Tags: code, hint, php, wordpress Posted in Blog, Hints, Technical · April 28th, 2010 · Comments (0) |
This will extract an image from a wordpress post. You can use it in the loop with get_content() or get_excerpt(). There are a hundred other different uses for something like this as well. Good snippet to have.
// Pull first image thumbnail from post if none exist, default to a category image.
//
// Required:
$pattern = '/<img[^>]+src[\\s=\'"]';
$pattern .= '+([^"\'>\\s]+)/is';
// Optional:
$style = "height:50px;width:60px;margin-top:15px;";
$defaultImgURL = "http://www.yoursite.com/image/url.png";
$imgAlt = "Alt Text Here";
$imgID = "";
$imgName = "";
// If we have an Image ...
if(preg_match($pattern,get_the_content(),$match)) {
echo "<img alt=\"\" style=\"" . $style . "\" src=\"" . $match[1] . "\" />";
// If there is no img Tag ...
} else {
echo "<img alt=\"\" style=\"" . $style . "\" src=\"". $defaultImgURL ."\" />";
}
// Thats it!

|
Change iPhone Carrier Name |
Tags: cellular, iphone, phone, unlock Posted in Hints, Software, Technical · March 3rd, 2010 · Comments (1) |

First off, this hint will only work on iPhones that have been “jailbroken”. For more information on “jailbreaking” your iPhone, please visit the unofficial iPhone Dev Team’s Blog.
Check out “MakeItMine” app under Cydia. This application is a must for tweakers, as it changes your carrier name. Once the app is installed, and you have made the change, you can remove the app, and your custom setting remains.
Have fun!

|
Tab to Drop Down Field in Leopard |
Tags: hint, leopard, tab Posted in Hints, Software, Technical · May 6th, 2009 · Comments (2) |
For some reason I couldn’t tab to drop down fields within Firefox. The problem was also present in most other 3rd party applications.
For whatever reason, there is actually a Keyboard & Mouse Preference option that enables this:
