Twitter Updates
  • someone offered my something pretty cool. my brain now has big decisions to make 17 hours ago

Category Archives: Development

FaceBook Share

/*
Plugin Name: Very Simple FaceBook Share
Plugin URI: http://www.paulOr.net/facebook-share/
Description: A very simple shortcode plugin which will allow you to put a facebook sharecode on any page or post via [fbshare] - you can also style it any way with [fbshare style="color:#ffffff; text-decoration: underline;"]
Author: Paul Fraser
Version: 1
Author URI: http://www.paulOr.net
*/
function FBShare($params, $content = null) {
extract(shortcode_atts(array(
'style' => ''
), $params));
return '<a '.($style == '' ? '' : " style=\"$style\"").' name="fb_share"></a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';
}
add_shortcode('fbshare','FBShare');

Very simple facebook share plugin which allows you to just add a shortcode to a page or post & style it via [fbshare style="blah: blah;"]

Download: FBShare.php

iOS App Adventures – Part 1

I think it was just about a year ago now that I had an idea for an epic iPhone App that (I think) would be useful and more importantly an app that does something better than the current apps out there in this field at the moment. I sat down and drew out what I needed and my train of thought was NATIVE APPS.

I’ve recently been doing a lot of responsive HTML/CSS stuff so my thoughts have changed from native to mobile web however I still wanted a presence in the App Store because its the only way to truly deliver the product.

I had some free time over the past couple days, signed up for a iOS developer account and began.
24 Hours later & my app is ready :)!

You might say “Its ONLY a webview UI – thats nothing special.” and you’d be right, but that is all I need for this app since I’m making the interface on the web – It does however have these two little buttons at the bottom, Home & Settings which are like hotkeys to take you to these pages fast, which is slightly more than ‘ONLY a webview UI’.

I don’t care – Im pretty happy with what I’ve made & also with the end result. Watch this space!

Update!

iPad Version!

Add Product Images into Shopp Receipt

## ADD THIS INTO FUNCTIONS.PHP
add_filter('shopp_tag_purchase_item-image','purchased_image',10, 3);
function purchased_image($result, $options, $Purchase) {
   $item = current($Purchase->purchased);
   $product = new Product($id=$item->product);
   return $product->tag($property='coverimage');
}

## NOW YOU CAN SHOW THE IMAGES INSIDE THE PURCHASED ITEMS WHILE LOOP
shopp('purchase','item-image');

I’ve long said Shopp is a total bellend, they totally missed out putting the product image tags into half the hooks. The above, will allow you to show the product image in the receipt, after all – its always nice to show you what you have bought after you’ve paid good money.

Get a grip Shopp – I’m so moving to WooCommerce.

Remove input field focus

textarea:focus, input:focus{
    outline: 0;
}

I always forgot this rule & forget to add it to my stylesheets. This is what separates the men from the boys.

WordPress Dynamic Navigation

Sometimes in WordPress you don’t want to use the custom menus for some navigation parts, like sub navigations in sidebars or something. Sometimes custom menus are just over kill, especially if every page has a sub navigation made up of child pages.

Heres an easy way of generating the sub navigations of Parent / Child pages & also showing the Parent page title above it.

if($post->post_parent) {
	$post_ancestors = get_post_ancestors($post->ID);
	$post_root = count($post_ancestors)-1;
	$post_parent = $post_ancestors[$post_root];
	$title = get_the_title($post_ancestors[$post_root]);
} else {
	$post_parent = $post->ID;
	$title = get_the_title($post->ID);
}
$children = wp_list_pages("title_li=&child_of=".$post_parent."&echo=0&depth=1");
if($children) {
	echo '<div id="page_left">'."\n";
	echo '	<h3>'.$title.'</h3>'."\n";
	echo '	<ul id="subnav">'."\n";
	echo 	    $children."\n";
	echo '	</ul>'."\n";
	echo '</div>'."\n";
}