Saturday, August 10, 2013

Hot Semi Naked Chicks

Lets see if that title gets me loads of hits on this page.

Picked up a couple of ex battery chooks from Lichfield last weekend, here's one of the little chappettes

They actually look a lot better than the last lot I got, although the comb and wattle are an extremely pale pink and their beaks are a bit odd.

They are fairly timid still, the last lot were much more nosey, mind you the weather is a lot colder at the mo and they have come from a place that was probably heated 24/7 so we will see what happens.
















Around October last year i got my previous battery hens, who looked like the above
and this what the surviving one looks like today
Although its not the best picture her comb and wattle are a lot redder than they seem here.

A cheap laptop

Flicking through Trademe, I saw a laptop with no reserve that seemed to be the model up from my deceased laptop, thinking i could probably combine the two to get a working laptop, I though a $5 bid on it.
A Bargain at twice the price!



And as you can see I won it for the princely sum of $2.50.

So once I had paid $12 shipping it came to $14.50, still cheap, although it could turn out to be a $14.50 paperweight if it doesn't actually go.








It arrived a few days later neatly packaged, opened it up, and there was the first problem, it used an Intel chip whereas my deceased lappie uses AMD, Oh well  excepting the motherboard all the other bits should be compatible.

So i plug it in using my laptop adapter and it posts to the Compaq screen, which is to be expected given there is no hard drive.

Next up I try a Live Linux distro I have lying around on CD, put that in and in a few minutes I am in a linux desktop.

So, so far it works, however a live linux distro on CD is ok for the basics but you can't update things, save settings etc which is a bit of a nusiance everytime you reboot so I decided to try a distro on a USB thumbdrive, I chose Puppy Linux as it small and not too taxing on older machines. Only problem is older laptops/PCs don't support booting from a USB port.

Once again Linux to the rescue, I downloaded PLOP Bootmanager and burnt it to CD, popped the PLOP cd in my CD drive and rebooted the computer. when the computer rebooted, the CD started the PLOP bootmanager with this pretty wee screen
(yes i have cropped the image the actual screen is lovely and crisp looking not at all blurry :) )
Now i have the option to boot from USB, so here we go.








The Puppy Linux Boot Screen


and finally a working desktop

And thats all there was to it $14.50 plus a USB stick and a few parts I had lying around and i have a working laptop.

But wait theres more.
After a bit of use the laptop sounds like a jet trying to take off, so i dismantled it and gave it a clean out, got a bit of dust out etc, reassembeld and still lots of noise, which is odd as my dead laptop was lovely and quiet, went and had a check online, take a wild guess what was listed as one of the Cons of this particular laptop, Noise, as it using a desktop CPU rather than a laptop CPU so the fan is having to really work to keep it lovely and cool.






Sunday, June 2, 2013

Adding a seperate Category Dropdown for the CSS MegaMenu for Zen cart

So you have installed the excellent CSS Mega Menu module from Picaflor Azul available in the zencart add-ons repostory, and you want to either limit the "Shop" dropdown to one category tree, or you want an additional seperate dropdown for a specific category, well here is how I did it.

The Usual Warning
As usual backup everything before you start, this doesn't touch the database (well it reads from it), so everything goes pear shaped you can fix it by replacing with the original files.

Step 1)

Find you category ID number for the category you with to display
The easiest way to do this is to hover over the category and the category number will appear in the link at the bottom of your page, in this case it is category 1379.

Step 2)

Now if you are wanting to limit the existing "Shop" dropdown to a specific category tree,  do the following step and then you are finished, if you want to make a separate dropdown for a category go straight to Step 3
Ok so you just want to limit the existing dropdown to one Category tree
Navigate to

includes/classes/categories_ul_generator.php

Around line 83, you will find the following function

function buildTree($submenu=false)
{
return $this->buildBranch($this->root_category_id, '', $submenu);
}

Edit it so it looks like this, adding in the correct category id for the your site

function buildTreebb($submenu=false)
{
$root_category_id = 1379;
return $this->buildBranch($this->root_category_id, '', $submenu);
}
Save your changes, upload the file

Next we will change the name of the dropdown so it doesn't say "Shop"
Navigate to

includes/templates/YOUR_TEMPLATE/common/tpl_mega_menu.php

around line 46 you will have the following line

<li class="categories-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_CATEGORIES; ?></a><!-- bof cateories -->

Now we can do flash things and pull the category name from the database etc, but its a damn site faster to just type in the name of the category, like so

<li class="categories-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop">Jenni Bowlin</a><!-- bof cateories -->
Save your changes, upload the file

Go to your website and test the dropdown (you may need to refresh the page first) and it should work fine

You are finished you don't need to read any further.

Step 3)


So here we are creating a seperate dropdown and leaving the "Shop " alone

First we navigate to this folder

 includes/classes/

Now we make a copy of the following file

categories_ul_generator.php

We will call it in this exercise

 categories_ul_generator_bb.php

Now we open the copy we have just made


includes/classes/categories_ul_generator_bb.php

 Around line 24, you will find the following line

  class zen_categories_ul_generator {
var $root_category_id = 0,

Change it to

  class zen_categories_ul_bb_generator {
var $root_category_id = 1379,



 Around line 39, you will find the following line

  function zen_categories_ul_generator($load_from_database = true) 

Change it to

  function zen_categories_ul_bb_generator($load_from_database = true)





Around line 83, you will find the following function

function buildTree($submenu=false)
{
return $this->buildBranch($this->root_category_id, '', $submenu);
}

Edit it so it looks like this, adding in the correct category id for the your site, and changing the name of the function to buildTreebb

function buildTreebb($submenu=false)
{
$root_category_id = 1379;
return $this->buildBranch($this->root_category_id, '', $submenu);
}
Save your changes, upload the file

The next step is to make the dropdown appear on your menu bar

Navigate to

includes/templates/YOUR_TEMPLATE/common/tpl_mega_menu.php

What we are going to do is copy the entire section of code that displays the "Shop" dropdown
in the file above, this should be lines 45 - 69 inclusive so thats all this code

<li class="categories-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_CATEGORIES; ?></a><!-- bof cateories -->

<div class="dropdown_1column">
<div class="col_1 firstcolumn">
<div class="levels">
<?php

// load the UL-generator class and produce the menu list dynamically from there
require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
$zen_CategoriesUL = new zen_categories_ul_generator;
$menulist = $zen_CategoriesUL->buildTree(true);
$menulist = str_replace('"level4"','"level5"',$menulist);
$menulist = str_replace('"level3"','"level4"',$menulist);
$menulist = str_replace('"level2"','"level3"',$menulist);
$menulist = str_replace('"level1"','"level2"',$menulist);
$menulist = str_replace('<li class="submenu">','<li class="submenu">',$menulist);
$menulist = str_replace("</li>\n</ul>\n</li>\n</ul>\n","</li>\n</ul>\n",$menulist);
echo $menulist;
?>
</div>
</div>
</div>
</li><!-- eof categories -->

And then we paste it directly underneath so paste it in at about line 70 just above the manufacturers section

Now in you freshly pasted code you need to find the following so we can change the name of the dropdown

<li class="categories-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_CATEGORIES; ?></a><!-- bof cateories -->

Now we can do flash things and pull the category name from the database etc, but its a damn site faster to just type in the name of the category, like so

<li class="categories-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop">Jenni Bowlin</a><!-- bof cateories -->

Next we need to make the dropdown use our copied dropdown class so find this bit

require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
$zen_CategoriesUL = new zen_categories_ul_generator;
$menulist = $zen_CategoriesUL->buildTree(true);

and replace with this; note all 3 lines have changes, if you don't change them all you page will drop dead directly after the menu title

  require_once (DIR_WS_CLASSES . 'categories_ul_generator_bb.php');
$zen_CategoriesUL = new zen_categories_ul_bb_generator;
$menulist = $zen_CategoriesUL->buildTreebb(true);

Now save and upload the file, then go to your site and test it, you may need to refresh the page

Now you should have a dropdown menu next to the existing "shop" menu
Good Luck

Wednesday, January 16, 2013

Mail Chimp plugin for Zencart - adding extra fields

This is a little more tricky that you think, although once you have had a long read of mailchimps docs it is dead simple.

First of grab the Mail Chimp plugin  by SwGuy from the zencart plugins repository.

By default this only takes your email address, do for our example we will make it take first name and last name of your subscriber.

First step

Install the MailChimp Plugin as per the instructions given.

Second Step

Make sure your MailChimp Account is able to receive the extra fields

Third Step

Open includes/templates/template_default/sideboxes/tpl_mailchimp_sidebox.php

find this piece of code

$content .= ENTRY_EMAIL_ADDRESS;
$content .= '
';


Replace it with this

$content .= ENTRY_EMAIL_ADDRESS;
$content .= '
';
$content .= ENTRY_FIRST_NAME;
$content .= '
';
$content .= ENTRY_LAST_NAME;
$content .= '
';


Save the file

Fourth Step

In /includes/modules/your-template/create_account.php
 find this

mailchimp_add($email_address, $email_format);

and replace with

mailchimp_add($email_address, $firstname, $lastname, $email_format);


Fifth Step

In includes/functions/extra_functions/mailchimp_functions.php
Find this code (line 6-ish)

$merge_vars = array('');

Replace it with this

$merge_vars = Array(
'EMAIL' => $email_address,
'FNAME' => $firstname,
'LNAME' => $lastname
);



And thats all there is to it.