Posted in : Silly O'clock quotes
yabba_hh: heh, I just dislike playing with wp :P
yabba_hh: having said that, I really should learn wp core, I could make a bloody fortune
tuxnus: maybe I'll switch themes and see what happens
tuxnus: yep @ core
yabba_hh: it really is fugly though ... feels like waking up next to a fat chick with the hangover of your life :|
¥
Posted in : Techno Babble
Unlike most of our other plugins this one does bugger all by itself, it's only reason for existence is to be used by other plugins and at the moment the only plugin that uses it is one that we're currently developing. So, what does it do? What this plugin does is allow your own plugins to easily add their own custom tabs to the admin area. Now, before any of yah point out that plugins already have the ability to easily add their own tab to the tools tab, I know, but this plugin allows you to add tabs to any of the evo tab pages ;)
There's a couple of rules that your plugin has to play by to make all this work. The first and most obvious one is that it needs to declare this plugin as a dependency to ensure that it's always installed when you need it. You tell evo about dependencies by adding the following code snippet to your plugin.
/**
* This plugin requires the AM Admin Pages plugin
*
* @return array dependencies
*/
function GetDependencies()
{
return array( 'requires' => array(
'plugins' => array( array( 'am_adminpages_plugin', 1 ) ), // requires at least version 1 of the plugin
));
}
Next you need to create a shiny new method in your plugin called GetAdminTabs() which should return an array of all tabs that you wish to add your tabs to, and the tabs that you wish to add ... it's probably simpler to just show you some code ;)
/**
* Add our tabs to the admin tabs
*
* @param array $params
* string 'main_tab' : This is the main b2evo tab that is currently being displayed
* @return array : our tabs
*/
function GetAdminTabs($params)
{
global $admin_url, $blog, $current_User, $user_ID;
global $AdminUI;
$admin_tabs = false;
switch( $params['main_tab'] )
{
case 'dashboard' :
case 'blog_settings' :
global $blog;
$bCache = get_Cache( 'BlogCache' );
if( $blog && $sBlog = $bCache->get_by_ID($blog ) )
{
$shop_ID = $sBlog->owner_user_ID;
}
break;
case 'users' :
$shop_ID = param( 'user_ID', 'integer' );
break;
}
if( empty( $shop_ID ) )
{
$shop_ID = 0;
}
switch( $params['main_tab'] )
{
/* start snippet */
case 'blog_settings' :
if( $this->ShopSettings->get('enabled', $shop_ID ) || $current_User->check_perm('blog_properties', 'edit', false, $blog ) )
{
$admin_tabs = array(
'blogs' => array(
'amsc_settings' => array(
'text' => $this->T_('Shop Settings' ),
'href' => url_add_param( $admin_url, 'ctrl=coll_settings&blog='.$blog.'&amat_tab=amsc_settings' ),
),
),
);
}
break;
/* end snippet */
}
return $admin_tabs;
}
The important thing to note in that code is the bit of the href which reads 'amat_tab=amsc_settings', this is the parameter that's used to tell our plugin which one of your custom pages you want to display, and it must have a corresponding function with the following naming convention function AdminTabPayload_your_unique_tab_value(). In the above example the corresponding function would be called AdminTabPayload_amsc_settings(), the following is our code for that function :
/**
* Display our settings
*
* @param array $params
* string 'main_tab' : This is the main b2evo tab that is currently being displayed
*/
function AdminTabPayload_amsc_settings($params)
{
global $AdminUI;
switch( $ctrl = param('ctrl', 'string' ) )
{
case 'dashboard' :
case 'coll_settings' :
global $blog;
$bCache = get_Cache( 'BlogCache' );
if( $blog && $sBlog = $bCache->get_by_ID($blog ) )
{
$shop_ID = $sBlog->owner_user_ID;
}
break;
case 'users' :
$shop_ID = param( 'user_ID', 'integer' );
break;
}
if( empty( $shop_ID ) )
{
$shop_ID = 0;
}
$edited_settings = $this->ShopSettings;
$edited_settings->ID = $shop_ID;
global $Blog;
amsc_load_disp( 'shopsettings' );
}
The final thing you need to do is to inform evo of your shiny new abilities :
/**
* List of events that we handle
*
* @return array : events
*/
function GetExtraEvents()
{
return array(
'GetAdminTabs' => 'Adds all our required tabs',
'AdminTabPayload_amsc_settings' => 'Displays our settings',
'AdminTabPayload_amsc_info' => 'Displays our info',
'AdminTabPayload_amsc_customers' => 'Displays our customers',
'AdminTabPayload_amsc_invoices' => 'Displays our invoices',
);
}
To make life a tad easier I've also coded a demo plugin that uses this plugin so you can (hopefully) see how it all works.
Anyway, enough blather from me, you can download the plugin here am_adminpages_plugin.zip and the demo plugin from here am_adminpagesdemo_plugin.zip
¥
Posted in : Home made
This meal was inspired by the popper thread on the chillisgalore forums ( @chilliesgalore.co.uk : popper thread ). I'd like to thank Davetaylor for posting it :D
I've had to wait ages to try this recipe since I first saw it on the chillisgalore forums, and I mean ages! As with all good meals it started with a compromise, the problem was that I didn't have any chillis that were big enough to stuff so I had to use a pepper instead and add chilli to the stuffing. Other than that I pretty much followed the original recipe.
The Chicken Poppers
The rest
You can find a few more images in the gallery
¥
Posted in : Home made
I can't begin to describe the feeling you get when you can grab a load of veg that you've grown yourself, slap it in a pan with a few other bits and bobs and then sit down and eat it, all in a matter of hours after the veg was in the ground/on a plant. If you haven't experienced it yourself then I heartily recommend that you do. Anyway, this weekend I brought some veggies home from the field and I was in the mood for a curry so I decided to throw one together.
Feeds as many people as you throw ingredients in for :|
Home grown :D
Bought stuff :(
Feel free to adapt this workflow to suit your own needs, but this is what I did :