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 :
Posted in : Techno Babble
I've recently found myself in the position where a client has offered to drop ship for me, partly to give me greater freedom of layout/content/style than they'd be happy to risk on their own domain and partly to see if I could come up with some form of drop shipping "template" that could then be rolled out to a wider audience ... either way they're to cheap to pay me the development hours ;) ... So, now I have a conundrum, do I attempt to bend an existing shopping cart to work ( and look ) the way I want it, or do I try and bend b2evo into being an e-commerce solution?
Each has it's own advantages, using off the shelf e-commerce software means that it already does all the tedious stuff required for a shopping cart to function, but I'd spend god knows how many man hours learning the system, and especially the code, before I could begin to use it for a drop shipping site. On the other hand, I'm not to shabby with the evo code base so I'd be able to crack on and add all the custom stuff required to make this all work ... within my lifetime. The downside of using b2evo is that it's not exactly geared up to be an e-commerce solution out of the box.
I guess it all comes down to "which is the better use of my time?", currently my thoughts are "use an e-commerce package and face the 'now make it available to a wider audience' bridge when I get there", by then the chances are that I'd have a much deeper knowledge of the chosen packages code base and in the meantime I could make a few quid ... but ... there's always a "but" huh? ... *if* I went the evo route then I'd save myself a load of learning and, if I needed to, I could change the core in cvs to add any hooks 'n' stuff that would make my life easier long term.
So ... hands up if you think I should go the evo route
¥
Posted in : Pond Pumps
Note : I don't sell pond pumps! If you're looking for a pond pump then visit the Pond Pumps section of my mates online aquatics shop ;).
It's been a fair tad since I last bothered playing with google for pond pumps, but I'm somehow on the second page of google for the search term, and I get a fair bit of traffic from pond related searches, and all because Barry said a blog would never get to the top ... then he made me promise to stop trying because I was getting a smidge to close for comfort ;)
Anyway, this post is nothing about getting to the top of google for
because that'd be childish, I mean, he admitted defeat when I got close ... and I'm waaaaaay to old to be childish .... right? :roll:
He'll kill me if I get to number one ... hmmm, I wonder if his lawyers could successfully claim it was suicide and not murder?
¥
Posted in : 2009 Season
Once again I'm starting a post off with "been a tad since I last posted". It's not because I have nothing to say, it's because I've had bugger all time spare to make a post :p Ideally I'll find the time to create a gallery concept/skin that works, and then I can just upload all the pictures I take on a daily/weekly basis to show how things are coming along .... don't hold your breath though, I've not had the time/inclination to do any coding for many a month now :(
Anyway, back to happier thoughts/times ... we're already at the point where the plot is starting to provide ingredients for our meals, it may only be radish and the occasional lettuce, ohhh and a few herbs, ohhh and some spring greens ... but it's only May, and the season's only just starting to kick in. Most of the beds are now full of stuff, I've one more bed in the large greenhouse that will soon be filled with sweetcorn ( true gold ), squashes ( butternut & courgette ), and the odd runner bean and borlotti beans ( about 10' row of each ) which will keep the broad beans, pak choi and beetroot company. Our own little greenhouse, that's recently had a bloody good spring clean and is looking good as new, has been press ganged into holding some of the less robust seedlings, mainly the sweetcorn and the runner beans, because the small greenhouse is starting to get a smidge full of dahlias.
After spending a bored afternoon, on one of the sunny days, rearranging the piles of bricks that sit on the concrete base, beside our lil greenhouse, I managed to not only find a space for our water butt, I also managed to sneak in a 11'x4' raised bed. Mind you, when Barry noticed his only comment was "why didn't you just dig a bed in the field, it would've been far easier! .... so, being ever the opportunist I mentioned the fact that I was contemplating the possibility of slapping in 4 more 15'x4' beds in the field ( "but only if I cope with the space I have this year, because you'll want that back next year" ) ... god loves a trier and all that huh? ... and I'm living proof because, not only did Barry go "sure, no problem", he followed it with "you may have the same space next year ... if not more" ... damn, how cool would that be? :D At the same time he mentioned that the space I'd slapped the raised bed on was where he was considering building a shed to house our lawn mower(s) ... ooops ... the good news is, it won't be this year.
So, I decided to use the new bed to raise some Asparagus seedlings, after checking that I had enough time to plant seeds this year, as it's faaaaaaaaaaaaaar to late ( and bloody expensive! ) to buy 1 year crowns for this season. Apart from saving me a fortune ( £2.05 compared to £20+ huh ) it'll also allow me to select the best 20 male plants that grow ( males produce more spears than females ) and I won't have to "wait the extra year" that you normally do by growing from seed because I wouldn't be able to buy 1 year old crowns until next year. The bad news is, I have very little time to get the seed ordered and finish prepping the bed up.
I can't remember if I mentioned in my last post, but a couple of weeks ago I went round to my dads and he had some very leggy tomato plants that were crammed together in little 3" pots, the good ones were just about able to support their own weight, so I offered to take them away to see if I could improve them as I had better growing conditions and far more time than they did ... So, off I meandered to the potting shed with them. I decided that I could definitely save 4 of them by slapping them into 12" pots and burying them as deep as I could, the others were pretty much buggered, and that's when the experiment I ran earlier this year paid off. One of the things I'd done with the worst of my plants was to decide "bugger it, they'll die anyway", so I cut the tops off and rooted them .... and it mostly worked ... So, I did the same with Sue's tomatoes.
As you can imagine, decapitation isn't something that a plant enjoys to much and they spent quite a bit of time looking pretty dead. I'd slapped them under the misters in the potting shed so they'd at least get some water through their leaves, after that it was a race to see if they'd grow new roots in time to stop them dying. One week on and not only had the plants recovered but they'd also started to put on some new growth! Meanwhile the ones that I'd slapped into tall pots had decided that they weren't going to be out done and have promptly produced their first set of fruit! Damn, here's me growing my own tomatoes in as close to ideal conditions as I can provide and they're beaten to the fruiting stage by a bunch of gangly plants ... I may never live this down :(
By a lucky coincidence I managed to get some free time, some sunshine and a sledgehammer, all at the same time. A tad of grunting later and I'd dropped both our side and our neighbours side of the coal shed, I even managed to leave the dividing wall intact! Unfortunately since then it's pissed it down every time I've had some free time so I haven't been able to clear up all the rubble and take it to the tip. In true frugal fashion I'm going to be reusing any bricks that I can salvage to build a raised bed along the back of next doors garage. Eventually this will be converted into a kind of 9' x 3' greenhouse / cold frame, but first I have to wait until the strawberries have stopped fruiting as I'll need to dig them up before I can start. Once the bed is built I'll then be able to sort out the tuft of grass that we lovingly call a lawn.
¥