Archive for the ‘My Code Writing’ Category

Add custom fields to your wordpress write page

Monday, September 24th, 2007

How to Use This Plugin

Custom Fields Plugin for Wordpress

I wanted to show you how to set up your conf.ini file so that you can have the fields you need for your wordpress blog’s write page.

Note: Titles should not have spaces in them.

Radio/Checkbox/Select:

[ItemTitle]

type: {either use “radio”, “select”, or “checkbox”}

value: Yes#No#Maybe#Sometimes#Jumping Dolphins <–separate multiple items with the # sign

default: Jumping Dolphins <–This must be spelled the same as the one above that you want defaulted

description: Type the description of the custom field here.

Textfield:

[ItemTitle]

type: textfield

value: Thanks for all the fish

description: Type the description of the custom field here.

TextArea:

[ItemTitle]

type: textarea

value: text text text, more text

description: Type the description of the custom field here.

Custom Fields Plugin for Wordpress


Updates

I have talked previously about the rc_custom_field_gui plugin and how I modified it to fit the WordPress write page styles, and I added a few other features to it. I posted on the original author’s plugin page about the changes that I made to his plugin, and at last check he had not responded.

I have now updated it again.

Previously, if you made an element that had a value or default of “Yes” or “No” it would not work, because PHP’s parse_ini_file function will parse those as 1&0, respectively. This is good when you are using this as an actual ini file, but this is a sort of hack, so we need to figure something out.

Now, just enter your yes/no values as ‘yes’ or ‘no’ with the quotes. The parse_ini_file function will ignore them as yes/no and the plugin will strip the quotes out, and use the text.

Note: You can use any capitalization of the letters in the words ‘yes’ or ‘no’, it will take care of any of them.

Other updates:

I standardized where the descriptions show, which is under the field element for which they are defined.

I made the checkbox a loop like the radio elements, so now you enter them exactly the same as radio and select elements.

Compatible with WordPress 2.2.3!!

Custom Fields Plugin for Wordpress

Sphere: Related Content

I needed all the zip codes, Latitudes and Longitudes

Monday, September 17th, 2007

I’m an idiot.

I am working on a project doing some work with latitudes and longitudes, and finding the distances between them. I had a dump from somewhere of all the zip codes in the country with all the city names, etc.

So I hooked up with the Google geolocater service and started hitting their server with requests, to return the lat and long.

I hit it with 50,000 + requests, and they shut me out. Unfortunatly this won’t work, as I need to get the project done. So I started looking through the tubes (the internet is series of tubes you know) and right after I pass a goomba, I find this place…

Its called sourceforge. You have heard of it. Even if you dont realize it. They have everything. Apparently, they have the thing I was trying to create too. I should have known.

The moral is: “If you need all the zip codes, all the cities, and their latitudes and longitudes go here“;

All the latitudes and longitudes you need

Also if you are importing it into mysql, and don’t want to fight the importer of your choice you can download the file: zipssql.zip

It has the sql for creating the table, and inserting all the data, as well as indexing.

Sphere: Related Content

Updated rc_customfield_gui plugin

Wednesday, July 18th, 2007

This post has been moved here:

Testing out the rc_customfield_gui plugin

Wednesday, July 18th, 2007

Hey how does it display to the screen?