kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Programmatically adding items to the cart in Shopp

Posted on June 28, 2011

Posted by Kieran

One of the Shopp Support Reps - Adam has posted a good article on his site about how to add items to the Shopp cart from outside Shopp.

Programmatically adding items to the cart in Shopp.

Filed under: Shopp, WordPress No Comments

Shopp Product Importer Download

Posted on June 3, 2011

Posted by Kieran

Here are the latest versions of the Shopp Product Importer.

I did not write these, I'm simply hosting them because the original site is down.

 

[Snippet] Formatting an IMEI Number in PHP

Posted on March 4, 2011

Posted by Kieran

Formatting an IMEI number in PHP is reasonably simple. The IMEI (14 decimal digits plus a check digit) or IMEISV (16 digits) includes information on the origin, model, and serial number of the device.

The format of the IMEI is AA-BBBBBB-CCCCCC-D, although it may not always be displayed this way. The IMEISV drops the Luhn check digit in favour of an additional two digits for the Software Version Number (SVN), making the format AA-BBBBBB-CCCCCC-EE

 

[Snippet] Simplified UK/US Date Conversion

Posted on March 4, 2011

Posted by Kieran

One of my major annoyances in PHP & MySQL world is the different formats when working with dates.

US format: mm-dd-yy, UK format: dd-mm-yy and MySQL's date,datetime, timestamp columns yy-mm-dd. How do you cope with them all? I've been working on a rich UI recently which includes the jQuery date picker, by default thats in US format. UK users expect a date in UK format.

Tagged as: , , Continue reading

Not your usual WordPress IO Error

Posted on March 3, 2011

Posted by Kieran

Today I noticed I was getting the dreaded WordPress IO Error when uploading media. I've fixed this before, for me and other clients but this wasn't the usual error.

Not  file permissions, not an anally retentive PHP install, not user error. Besides, media uploads worked via the HTTP uploader, just not the Flash uploader.

Multiple loops or making your own loop in WP-Ecommerce

Posted on February 28, 2011

Posted by Kieran

A client of mine needed a feature that could only be solved with a second WP-Ecommerce loop and another feature that required looping WP-Ecommerce out of it's comfort zone (index.php)

You could use this code for custom loops, for example newest products, top selling products, newest products in a category.

Tagged as: Continue reading

Using WP-Ecommerce Product Downloads without checking out

Posted on February 23, 2011

Posted by Kieran

I've used WP-Ecommerce for a few clients who required an online catalogue, rather than an online store.

One client required a  custom product display and wanted to print out the product downloads in the single_product.php file. Apparently its not possible as we're using Product Downloads for something other than what it was designed for.

It was originally designed for electronic products, you add to basket, pay and you can download the product downloads.

Truncate a string to the nearest word

Posted on February 18, 2011

Posted by Kieran

Truncating a string in PHP is easy, substr($start,$finish), but its annoying when it truncates the string mid-word isn't it? Here's how I overcame the issue to truncate the string to the nearest word.

This is a modified function found on the PHP site.

Tagged as: Continue reading

Disk Considerations for a SolusVM Installation on CentOS

Posted on December 7, 2010

Posted by Kieran

The Xen® hypervisor, the powerful open source industry standard for virtualization, offers a powerful, efficient, and secure feature set for virtualization of x86, x86_64, IA64, ARM, and other CPU architectures. It supports a wide range of guest operating systems including Windows®, Linux®, Solaris®, and various versions of the BSD operating systems.

Solus Virtual Manager (SolusVM) is a powerful GUI based VPS management system with full  Xen Paravirtualization and Xen HVM support.  SolusVM allows you and your clients to manage a VPS cluster with security & ease. It can be a little rtricky to install for the first timer.

tcptrack

Posted on November 23, 2010

Posted by Kieran

tcptrack is a sniffer which displays information about TCP connections it sees on a network interface. It passively watches for connections on the network interface, keeps track of their state and displays a list of connections in a manner similar to the unix 'top' command. It displays source and destination addresses and ports, connection state, idle time and superbly impressive - bandwidth usage.

A server admin must have.

Tagged as: Continue reading
Page 1 of 2412345...1020...Last »