Monthly Archives: November 2010

find events assosiated with elements

This will alert all functions associated to a given element… var elem = document.getElementById(‘ELEMENT_ID_HERE’); var str = ”; for(var prop in elem) {   if(typeof elem[prop] == ‘function’)     str += prop + ‘\n’; } alert(str);

Posted in javascript | Tagged , , , | Comments Off

get the title of a post

A gemn of a function found of the wordpress codex, very useful is get_the_title(ID) find it here: http://codex.wordpress.org/Function_Reference/get_the_title

Posted in Wordpress | Tagged , , | Comments Off

WordPress Plugin Query

I am often cutting and pasting this in wordpress plugins $query = “SELECT id, post_title FROM ” . $wpdb->prefix . “posts WHERE post_type = ‘wpf_venue’ AND post_status=’publish’”; $venues = $wpdb->get_results ( $query, ARRAY_A );

Posted in plugins, Wordpress | Tagged , , , , | Comments Off

Geographical Data

So may times you want to look up information on cities or suburbs,  here’s the resource http://www.geonames.org You download and use or query via a web service

Posted in Web Programming | Tagged , , | Comments Off

Incrementing values in Mysql

As the saga continue manipulating data this comes in handy to increment all the id’s in a table UPDATE jos_content_old SET id = id + 50 WHERE (id = id) Keep in mind the resulting id being set must be … Continue reading

Posted in MySQL | Tagged , | Comments Off

Centering vertically in a block

This often comes up a whole lot of same sized blocks on a webpage with an image inside. gettting the image to center in the middle is easy but what happens when it needs to sit in the vertical middle … Continue reading

Posted in CSS | Tagged , , | Comments Off

Cheap Software

So everyone likes cheap Software, and there are real places to get Cheap software online but there are also scams to get cheap online software. I was presented with this site http://royal-customers.net and immediately the unreal cheap online prices raised … Continue reading

Posted in Online Purchases | Tagged , , , | Comments Off

Getting rid of files from the command line

Dreamweaver’s check in and check out functionality can be quite useful when working with more than one person on a site but it creates heaps of .LCK files. If you want to remove them from the command line go to … Continue reading

Posted in Unix | Tagged , , , , , | Comments Off

Speed up WordPress

After a bit of digging around inside wp-ecommerce the category images were loading like a 300 k progressive jpg on a 5.6k modem – not cool. So after a forum search on getshopped.org this plugin was recommened http://wordpress.org/extend/plugins/w3-total-cache/

Posted in plugins, Wordpress | Tagged , | Comments Off

moving data in sql

So after searching around the web looking for code to get data from one table intop another I found this example posted on the mysl dev forum mysql> INSERT INTO orders (customer_cust_id, orderdatetime, message, taxrate, shippingprice) -> SELECT ’1′, NOW(), … Continue reading

Posted in MySQL | Tagged , | Comments Off