kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Repair and optimize all tables in all MySQL databases

Posted on July 14, 2011

MySQL tables can crash or become corrupt quite easily if you don't shut down the server correctly, for example hard reboot or power outage.

Thankfully there is a quick way of repairing all the tables.

  1. mysqlcheck --auto-repair --check --optimize --all-databases

You may need to specify the username and/or password -u or -p

See the mysqlcheck docs for more information.

Filed under: MySQL No Comments

[Snippet] How (Not) To Vertically Center Content

Posted on July 13, 2011

Vertically Centering content in divs isn't as straight forward as it used to be in classic table based layouts.

http://phrogz.net/CSS/vertical-align/index.html explains all.

Controling Compatibility View in IE

Posted on July 13, 2011

After hours of frustration trying to make some CSS look right for a selection of people using IE8 I gave up.

There has to be a better solution.

Internet Explorer 8 and Internet Explorer 9 include a Compatibility View feature that displays websites that were created for older browsers as they were designed to appear with Internet Explorer 7. You can enable Compatibility View in Internet Explorer, most users don't even know they are in Compatibility View  - which is where the problems arise!

Custom Post Type Index/Archives

Posted on July 11, 2011

Custom Post Types have come a long way recently.

Custom Post Type index/archives have been around in WordPress since 3.1., but very few people seem to use them. They came out of a bug (#13818) on the WP Trac.

Force jQuery Version in WordPress

Posted on July 8, 2011

Here's the right way to load a specific version of jQuery in WordPress. With each new version of WordPress we generally get a new version of jQuery, this can sometimes cause issues with other jQuery scripts you've loaded.

  1. function force_jquery_version() {
  2. wp_deregister_script( 'jquery' );
  3. wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js');
  4. wp_enqueue_script( 'jquery' );
  5. }
  6.  
  7. add_action('init', 'force_jquery_version');
Tagged as: No Comments

Sorting a multidimensional array

Posted on July 7, 2011

PHP's sort() or asort() functions are only single dimensional. What happens when you need to sort a multidimensional array based on a specific key?

Use this.

Filed under: PHP Continue reading

Looping over dates in PHP

Posted on July 5, 2011

I recently had to loop over the difference between two dates.
For example to create checkboxes for individual dates within a date range? Should be simple, right?

Rebranding WordPress 3.2

Posted on July 5, 2011

Woah. The new WordPress 3.2 admin interface is much better! Theres a lot of much welcome improvements.

I've upgraded a few blogs as test cases. Rebranding is mainly portable from 3.1 and below with one notable change.

Programmatically adding items to the cart in Shopp

Posted on June 28, 2011

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

Top of teh Google!

Posted on June 27, 2011

A Google search for CubeCart Programmer brings me up as the top organic result! If you don't already know, I'm an independent CubeCart programmer available for any type of CubeCart job.

Filed under: CubeCart No Comments
Page 6 of 34« First...45678...2030...Last »