<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Tristan Waddington</title>
	
	<link>http://blog.twaddington.com</link>
	<description>Web Development and Strategic Communication</description>
	<lastBuildDate>Sat, 13 Feb 2010 07:38:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/twaddington" /><feedburner:info uri="twaddington" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Export data as a CSV using PHP</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/2mLW7YBXSpM/</link>
		<comments>http://blog.twaddington.com/2010/02/create-a-csv-with-php/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:04:44 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=622</guid>
		<description><![CDATA[This is a very simple class for constructing basic comma-separated value (CSV) files in PHP. The export method forces the correct headers to initiate a file download. More information can be had in the PHP documentation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
&#60;?php
&#160;
	class CSV &#123;
		protected $data;
&#160;
		/*
		 * @params array $columns
		 * @returns void
		 */
		public function __construct&#40;$columns&#41; &#123;
			$this-&#62;data = '&#34;' . implode&#40;'&#34;,&#34;', $columns&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple class for constructing basic comma-separated value (CSV) files in PHP. The export method forces the correct headers to initiate a file download. More information can be had in the <a href="http://us3.php.net/manual/en/function.header.php">PHP documentation</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> CSV <span style="color: #009900;">&#123;</span>
		protected <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/*
		 * @params array $columns
		 * @returns void
		 */</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$columns</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;,&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$columns</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">/*
		 * @params array $row
		 * @returns void
		 */</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addRow<span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;,&quot;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">/*
		 * @returns void
		 */</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> export<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: application/csv'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition: attachment; filename=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.csv&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$csv</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CSV<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addRow</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2/2/2010'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'John'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Portland, OR'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// export csv as a download</span>
	<span style="color: #000088;">$csv</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">export</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'names.csv'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// pass the csv data to a variable as a string</span>
        <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$csv</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/twaddington/~4/2mLW7YBXSpM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2010/02/create-a-csv-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2010/02/create-a-csv-with-php/</feedburner:origLink></item>
		<item>
		<title>JSON-RPC 2.0 Implementation</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/PlzQ9s4R0cU/</link>
		<comments>http://blog.twaddington.com/2009/12/json-rpc-2-librar/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 21:02:27 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Braindump]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=617</guid>
		<description><![CDATA[Here&#8217;s another quick braindump post. A custom JSON-RPC library I wrote for a project at my last job. It should follow the JSON-RPC 2.0 Spec pretty closely. It does require the jQuery library as well.
You can pretty much ignore the MIKU references. Basically it&#8217;s just a way of namespacing objects to make them globally available. [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another quick braindump post. A custom JSON-RPC library I wrote for a project at my last job. It should follow the <a href="http://groups.google.com/group/json-rpc/web/json-rpc-1-2-proposal?pli=1">JSON-RPC 2.0 Spec</a> pretty closely. It does require the <a href="http://jquery.com/">jQuery library</a> as well.</p>
<p>You can pretty much ignore the <code>MIKU</code> references. Basically it&#8217;s just a way of namespacing objects to make them globally available. Try reading up on the <a href="http://www.google.com/#hl=en&#038;source=hp&#038;q=yahoo+yui&#038;aq=f&#038;aqi=g10&#038;oq=&#038;fp=49bb1336baeea163">YUI</a> library for more information.</p>
<p>As always, feel free to post with any questions.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> MIKU<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Method to allow namespacing of new objects within MIKU;
 *
 * Example:
 * MIKU.namespace('objectname');
 * MIKU.objectname = function() { return {'...'} }
 *
 */</span>
MIKU <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>MIKU<span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">throw</span> <span style="color: #3366CC;">'Namespace exists.'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">throwError</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
MIKU.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'throwError'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Method to catch MIKU errors
 */</span>
MIKU.<span style="color: #660066;">throwError</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>console<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    console.<span style="color: #660066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">message</span> <span style="color: #339933;">||</span> <span style="color: #3366CC;">'MikuError:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Init the JsonRpc namespace into the MIKU object.
 */</span>
MIKU.<span style="color: #003366; font-weight: bold;">namespace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'JsonRpc'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Miku Json-RPC Implementation
 */</span>
&nbsp;
MIKU.<span style="color: #660066;">JsonRpc</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'json-rpc/call'</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _timeout <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _requests <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _responses <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _callbacks <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _requestId <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> _failures <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> _send<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    _request<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    _t <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    _requests <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> _request<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>_url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">throw</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'undefined post url.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'POST'</span><span style="color: #339933;">,</span>
        url<span style="color: #339933;">:</span> _url<span style="color: #339933;">,</span>
        data<span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
          request<span style="color: #339933;">:</span> JSON.<span style="color: #660066;">stringify</span><span style="color: #009900;">&#40;</span>_requests<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        dataFilter<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> type<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #006600; font-style: italic;">//check for php errors</span>
          <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> JSON.<span style="color: #660066;">parse</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> phpError <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/^.*?(Error|Warning|Notice).*?\:\s*(.*?) in .*?(\/[0-9A-Za-z\/\.\-\_\ ]+).* on line .*?([0-9]+).*$/i</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> lines <span style="color: #339933;">=</span> data.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\n/g</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>lines<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              <span style="color: #003366; font-weight: bold;">var</span> error <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span>phpError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>error<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                MIKU.<span style="color: #660066;">throwError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                  message<span style="color: #339933;">:</span> error<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">': '</span> <span style="color: #339933;">+</span> error<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                  file<span style="color: #339933;">:</span> error<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                  line<span style="color: #339933;">:</span> error<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          _success<span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>XMLHttpRequest<span style="color: #339933;">,</span> textStatus<span style="color: #339933;">,</span> errorThrown<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #006600; font-style: italic;">// retry after connection failures</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>XMLHttpRequest.<span style="color: #000066;">status</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'200'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            _failures <span style="color: #339933;">++;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>_failures <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              _request<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
          <span style="color: #009900;">&#125;</span>
&nbsp;
          <span style="color: #006600; font-style: italic;">// give up and throw errors...</span>
          MIKU.<span style="color: #660066;">throwError</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>XMLHttpRequest<span style="color: #339933;">,</span> textStatus<span style="color: #339933;">,</span> errorThrown<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      MIKU.<span style="color: #660066;">throwError</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> _success<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>jQuery.<span style="color: #660066;">makeArray</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">error</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #006600; font-style: italic;">// check for error</span>
          <span style="color: #000066; font-weight: bold;">throw</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">error</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #006600; font-style: italic;">// trigger callback</span>
          <span style="color: #003366; font-weight: bold;">var</span> callback <span style="color: #339933;">=</span> _callbacks<span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          callback<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        MIKU.<span style="color: #660066;">throwError</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// reset callbacks</span>
    _callbacks <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> _genId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">++</span>_requestId<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
    version<span style="color: #339933;">:</span> <span style="color: #3366CC;">'2.0'</span><span style="color: #339933;">,</span>
    delay<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span>
    setUrl<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      _url <span style="color: #339933;">=</span> url<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    call<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #339933;">=</span> _genId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #003366; font-weight: bold;">var</span> request <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        jsonrpc<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">version</span><span style="color: #339933;">,</span>
        method<span style="color: #339933;">:</span> args.<span style="color: #660066;">method</span><span style="color: #339933;">,</span>
        params<span style="color: #339933;">:</span> args.<span style="color: #660066;">params</span><span style="color: #339933;">,</span>
        id<span style="color: #339933;">:</span> id
      <span style="color: #009900;">&#125;</span>
&nbsp;
      _requests.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>request<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      _callbacks<span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> args.<span style="color: #660066;">onSuccess</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>_timeout<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        clearTimeout<span style="color: #009900;">&#40;</span>_timeout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      _timeout <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span>_send<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">delay</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">return</span> request<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
 * Testing Below
 */</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> rpc <span style="color: #339933;">=</span> MIKU.<span style="color: #660066;">JsonRpc</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
  rpc.call({
    method: 'System.getTitle',
    params: [
      'this is a title'
    ],
    onSuccess: function() {
      console.log('w00t');
    }
  });
*/</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/twaddington/~4/PlzQ9s4R0cU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/12/json-rpc-2-librar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/12/json-rpc-2-librar/</feedburner:origLink></item>
		<item>
		<title>Writing a custom Wordpress multi-instance widget</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/jrDO9GnvCec/</link>
		<comments>http://blog.twaddington.com/2009/12/custom-wordpress-widget-tutorial/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 07:45:29 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Braindump]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[2.8]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=608</guid>
		<description><![CDATA[
While working on a soon-to-be finished Wordpress theme for a client, I ran into a situation where it would be useful to create a custom widget that they could use to organize content on their site. Basically, they wanted to be able to select a random post or page and display some associated meta data. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/10/wplogoblue-hoz-rgb.png" rel="lightbox[608]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/10/wplogoblue-hoz-rgb.png" alt="wplogoblue-hoz-rgb" title="wplogoblue-hoz-rgb" width="500" height="167" class="alignnone size-full wp-image-585" /></a></p>
<p>While working on a soon-to-be finished Wordpress theme for a client, I ran into a situation where it would be useful to create a custom widget that they could use to organize content on their site. Basically, they wanted to be able to select a random post or page and display some associated meta data. Essentially a custom image and content teaser. They were going to be doing this several times throughout the site, but in slightly different configurations. A post here, a page there. It seemed silly to hard-code these features. Using a widget would allow them to swap them out for a Twitter stream, or an RSS news feed in the future.</p>
<p>Making multi-instance widgets in Wordpress 2.8+ couldn&#8217;t be easier. Here is a good example to start with from the <a href="http://codex.wordpress.org/Widgets_API">Wordpress codex</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> My_Widget <span style="color: #000000; font-weight: bold;">extends</span> WP_Widget <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> My_Widget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// widget actual processes</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> widget<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// outputs the content of the widget</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_instance</span><span style="color: #339933;">,</span> <span style="color: #000088;">$old_instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// processes widget options to be saved</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// outputs the options form on admin</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
register_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'My_Widget'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>And here is my finished widget (evolved from the above example).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
 * Custom mini-post widget
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> FGX_MiniPost_Widget <span style="color: #000000; font-weight: bold;">extends</span> WP_Widget <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> FGX_MiniPost_Widget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// widget actual processes</span>
		parent<span style="color: #339933;">::</span><span style="color: #004000;">WP_Widget</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Floragenex MiniPost'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Display a teaser for a post or a page.'</span>
		<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> widget<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// outputs the content of the widget</span>
			<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$args</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			
			<span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$include</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">// Set up query for posts with the provided filters</span>
			query_posts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
				<span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$type</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'post__in'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$include</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'post__not_in'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'cat'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$category</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'post_status'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'publish'</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'meta_key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'teaser_value'</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'meta_value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'meta_compare'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'!='</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'rand'</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'posts_per_page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span>
			<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">// Output widget, if a post exists that matches our query</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
				<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000088;">$post_meta</span> <span style="color: #339933;">=</span> get_post_custom<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_meta</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'image_value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> get_page_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span>
							 <span style="color: #0000ff;">'&lt;img alt=&quot;image&quot; src=&quot;'</span> <span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/scripts/timthumb.php?src='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_meta</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'image_value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;h=62&amp;w=180&amp;zc=1&quot; /&gt;'</span> <span style="color: #339933;">.</span>
							 <span style="color: #0000ff;">'&lt;/a&gt;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span>
							 <span style="color: #0000ff;">'&lt;h3&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> get_page_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;&lt;/h3&gt;'</span> <span style="color: #339933;">.</span>
							 <span style="color: #0000ff;">'&lt;p&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_meta</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'teaser_value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span> <span style="color: #339933;">.</span>
							 <span style="color: #0000ff;">'&lt;p&gt;&lt;a class=&quot;learn-more&quot; href=&quot;'</span> <span style="color: #339933;">.</span> get_page_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;learn more&lt;/a&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">else</span><span style="color: #339933;">:</span>
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;No posts found.&lt;/p&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">// Very important to reset the query here.</span>
			wp_reset_query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$after_widget</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_instance</span><span style="color: #339933;">,</span> <span style="color: #000088;">$old_instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// processes widget options to be saved</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$new_instance</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// outputs the options form on admin		</span>
		<span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$include</span> <span style="color: #339933;">=</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// Get the existing categories and build a simple select dropdown for the user.</span>
		<span style="color: #000088;">$categories</span> <span style="color: #339933;">=</span> get_categories<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$cat_options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$cat_options</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;option value=&quot;BLANK&quot;&gt;Select one...&lt;/option&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$categories</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$category</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cat_ID</span> ? <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$cat_options</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;option value=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cat_ID</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$selected</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/option&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;p&gt;
				&lt;label for=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content type:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/label&gt;
				&lt;select id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;widefat&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					&lt;option value=&quot;post&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'post'</span> ? <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;Post&lt;/option&gt;
					&lt;option value=&quot;page&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'page'</span> ? <span style="color: #0000ff;">' selected=&quot;selected&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;Page&lt;/option&gt;
				&lt;/select&gt;
			&lt;/p&gt;
			&lt;p&gt;
				&lt;label for=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Include post IDs (optional):'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/label&gt;
				&lt;input id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;widefat&quot; type=&quot;text&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$include</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
			&lt;/p&gt;
			&lt;p&gt;
				&lt;label for=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Include category (optional):'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/label&gt;
				&lt;select id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;widefat&quot; name=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_field_name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cat_options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/select&gt;
			&lt;/p&gt;				
		<span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// register widget</span>
register_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FGX_MiniPost_Widget'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Just paste this code in your theme&#8217;s <code>functions.php</code> file and the widget should appear under your available widgets.</p>
<p>This was a quick braindump post, so please feel free to post with any specific questions.</p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/jrDO9GnvCec" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/12/custom-wordpress-widget-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/12/custom-wordpress-widget-tutorial/</feedburner:origLink></item>
		<item>
		<title>Create and list new tickets through the Assembla API</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/nAh6wx4UoT4/</link>
		<comments>http://blog.twaddington.com/2009/10/php-library-for-assembl/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 16:20:25 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Assembla]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ticket tracking]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=460</guid>
		<description><![CDATA[A while back I created a PHP library for interacting with the Assembla Ticket API. I thought it might be useful to someone, so here it is.
You can use this library to create and list tickets that exist for one of your Assembla spaces. It&#8217;s useful for integrating bug reporting and other feedback features into [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I created a PHP library for interacting with the <a href="https://www.assembla.com/wiki/show/breakoutdocs/Ticket_REST_API">Assembla Ticket API</a>. I thought it might be useful to someone, so here it is.</p>
<p>You can use this library to create and list tickets that exist for one of your <a href="http://assembla.com">Assembla</a> spaces. It&#8217;s useful for integrating bug reporting and other feedback features into an application that you may be developing. This code is very much a work in progress, so please let me know if you encounter any bugs or have any new feature requests.</p>
<p>You can view and download the code on GitHub:</p>
<p><a href="http://github.com/twaddington/phpAssemblaTicket"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/github-logo.png" alt="github-logo" title="github-logo" width="138" height="71" class="alignnone size-full wp-image-597" /></a></p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/nAh6wx4UoT4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/10/php-library-for-assembl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/10/php-library-for-assembl/</feedburner:origLink></item>
		<item>
		<title>Moving your blog off Blogger to a self-hosted Wordpress site</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/43JDzvboLe0/</link>
		<comments>http://blog.twaddington.com/2009/10/how-to-move-your-site-from-blogger-to-wordpress/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 05:20:22 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Blogger]]></category>
		<category><![CDATA[enom]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=569</guid>
		<description><![CDATA[
I have a client who absolutely loves Wordpress, but one of her long-time blogs has been hosted at Blogger since the dawn of time. Luckily, thanks to some persistence and a handy Wordpress plugin, she&#8217;s now happily blogging with Wordpress.
Step 1: Set up and configure Wordpress
First thing to do is get yourself a self-hosted Wordpress [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/10/wplogoblue-hoz-rgb.png" rel="lightbox[569]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/10/wplogoblue-hoz-rgb.png" alt="wplogoblue-hoz-rgb" title="wplogoblue-hoz-rgb" width="500" height="167" class="alignnone size-full wp-image-585" /></a></p>
<p>I have a client who absolutely loves Wordpress, but one of her long-time blogs has been hosted at Blogger since the dawn of time. Luckily, thanks to some persistence and a handy Wordpress plugin, she&#8217;s now happily blogging with Wordpress.</p>
<p><strong>Step 1: Set up and configure Wordpress</strong><br />
First thing to do is get yourself a self-hosted Wordpress install. Many hosts these days even offer easy &#8220;one-click&#8221; installs of Wordpress through their control panels. Otherwise check out the <a href="http://codex.wordpress.org/New_To_WordPress_-_Where_to_Start">Wordpress docs</a> for help getting started.</p>
<p>If you need hosting recommendations shoot me an email or leave a comment. I&#8217;d be glad to recommend some of my favorites.</p>
<p><strong>Step 2: Import your Blogger content</strong><br />
Once you&#8217;ve got Wordpress installed and hooked into your database, it&#8217;s time to import your old Blogger content. Log into the Wordpress admin panel and go to &#8220;Tools->Import->Blogger.&#8221; Follow the onscreen directions to complete this step.</p>
<p>Double check the imported posts and pages to make sure that all your content is there. Pay special attention to images in posts.</p>
<p><strong>Step 3: Install plugins</strong><br />
Now, we all know you&#8217;ve developed a huge following on your blog, at least, that&#8217;s what you tell your friends. You don&#8217;t want all your incoming links to go dark once you move off Blogger, ideally you&#8217;d like them to point to the same posts on your new Wordpress site. The solution here is to use a nifty plugin called &#8220;wp-maintain-blogger-permalinks.&#8221; Following the directions at the link below will make this happen:</p>
<p><a href="http://justinsomnia.org/2006/10/maintain-permalinks-moving-from-blogger-to-wordpress/">http://justinsomnia.org/2006/10/maintain-permalinks-moving-from-blogger-to-wordpress/</a></p>
<p>Now, if you don&#8217;t want to mess around with your <code>.htaccess</code> file to go &#8220;.html-less.&#8221; You can simply append &#8220;.html&#8221; to the end of your permalink structure. In Wordpress go to &#8220;Settings->Permalinks&#8221; and check the &#8220;Custom Structure&#8221; radio button. Modify this structure by removing the trailing &#8220;slash&#8221; and adding &#8220;.html&#8221; to the end. Don&#8217;t forget to save your changes!</p>
<p><strong>Step 4: Update the DNS settings for your custom domain</strong><br />
It took me a while to find out how to update the DNS settings for a custom domain bought through the Blogger interface. It&#8217;s actually pretty easy. Just go to the following URL:</p>
<p>http://www.google.com/a/cpanel/yourdomainhere.com/</p>
<p>Log in to Google Apps using your Blogger ID and password. Then navigate to &#8220;Domain Settings ->Domain Names&#8221; and click on the &#8220;Advanced DNS settings&#8221; link.</p>
<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/10/google-blogger-custom-domain-dns-settings.png" rel="lightbox[569]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/10/google-blogger-custom-domain-dns-settings-500x177.png" alt="google-blogger-custom-domain-dns-settings" title="google-blogger-custom-domain-dns-settings" width="500" height="177" class="alignnone size-medium wp-image-586" /></a></p>
<p><strong>Step 5: Get your custom domain transferred to a new registrar</strong></p>
<p>You can certainly leave your domain hosted with Google&#8217;s affiliate registrar, but if you are hosting other domains elsewhere, it may make sense to consolidate your resources. To initiate the transfer process, you&#8217;ll need to obtain your domain&#8217;s authorization code from Google&#8217;s affiliate registrar.</p>
<blockquote><p>If you&#8217;d like to transfer your domain to another domain registrar, you&#8217;ll need your domain&#8217;s authorization code. To obtain your authorization code, sign in to the DNS console of your domain host. Instructions vary by domain host.</p></blockquote>
<p><a href=" https://www.google.com/support/a/bin/answer.py?hl=en&#038;answer=112049">https://www.google.com/support/a/bin/answer.py?hl=en&#038;answer=112049</a></p>
<p>Your domain will either be registered at ENOM or GoDaddy through Google. The Google Apps. panel will tell you where your domain is registered. You&#8217;ll need to contact the registrar directly to obtain the transfer authorization code. ENOM can be contacted at <a href="mailto:GoogleClients@enom.com">GoogleClients@enom.com</a> or by phone at 425-974-4623. Although you may need to pester them to get a response.</p>
<p>Good luck and let me know if you have any advice I may have overlooked!</p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/43JDzvboLe0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/10/how-to-move-your-site-from-blogger-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/10/how-to-move-your-site-from-blogger-to-wordpress/</feedburner:origLink></item>
		<item>
		<title>Elisabeth Diaz-Herrera | Dec. 19, 1934 – Sept. 7, 2009</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/vrmIbakyuX8/</link>
		<comments>http://blog.twaddington.com/2009/09/elisabeth-diaz-herrera/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 04:18:33 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Off Topic]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=544</guid>
		<description><![CDATA[
This is my grandmother Bettina. She passed away last week on labor day morning.
Technically she was my step-grandmother, as my mom&#8217;s birth mother Ellen passed away when my mom was a teenager 7. So I&#8217;ve always known Bettina to be my grandmother.
Bettina was a fantastic lady, who, I&#8217;m sorry to say, I was just beginning [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/09/bettina.png" rel="lightbox[544]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/09/bettina-500x527.png" alt="Elisabeth Diaz-Herrera" title="Elisabeth Diaz-Herrera" width="500" height="527" class="alignnone size-medium wp-image-548" /></a></p>
<p>This is my grandmother Bettina. She passed away last week on labor day morning.</p>
<p>Technically she was my step-grandmother, as my mom&#8217;s birth mother Ellen passed away when my mom was <s>a teenager</s> 7. So I&#8217;ve always known Bettina to be my grandmother.</p>
<p>Bettina was a fantastic lady, who, I&#8217;m sorry to say, I was just beginning to get to know. She was always cheerful, even through the last few years of her life, when she was very sick.</p>
<p>Whenever I spoke to her on the phone she would happily answer &#8220;Hola, hola!&#8221;, which always made me smile. She always had something wonderful to say about how I was doing, even when I was feeling at the end of my rope.</p>
<p>I remember taking walks with her and my grandfather in the woods behind her house when I was little. There was this fantastic stone wall way out behind their house that opened up into a field. They had a huge basement, with all sorts of exciting things to discover. I used to ride around on this long wooden car, that was sort of like a bench with wheels and handlebars. I&#8217;d ride around their basement and peruse my uncle&#8217;s old toys &#8211; everything from a box of old electric trains, to long abandoned remote-controlled airplanes.</p>
<p>Bettina understood the importance of computers and new technology, even if it advanced faster than she could. She gave my family our first computer, an old 486 running MS-DOS, which sat idle for months with no monitor. Finally, Christmas morning, I woke up to find a big CRT under the tree, courtesy of my uncle Mike. That computer was undoubtedly one of the most important gifts I ever received.</p>
<p>I regret that I wasn&#8217;t able to see Bettina one more time before she left us. While she had been sick for quite some time, her passing seemed sudden and unexpected. I had lots of things I hoped to tell her, like how I had discovered <a href="http://en.wikipedia.org/wiki/Mate_%28beverage%29">Mate</a> with my friend Josh, a beverage she drank almost every morning. I also hoped she would live to see me graduate from college, something that would have been very difficult for me financially, if it weren&#8217;t for her and my grandfather&#8217;s support.</p>
<p>I&#8217;ve included a copy of the obituary below, written collectively by my family, which will go out to the local paper sometime this week.</p>
<p>Thank you so much for all your love and care Bettina. We&#8217;ll miss you.</p>
<blockquote><p>
Bettina was born December 19, 1934 in Buenos Aries, Argentina to Ricardo and Elizabeth Diaz Herrera. Bettina led a varied and unusual life as a young woman in Buenos Aries and on the family ranch in Argentina. It was here, on the family ranch, that she developed a deep appreciation and love of animals and nature that continued throughout her life. She became an adept equestrian and learned to pilot bush planes as a young woman on the Pampas of Argentina. </p>
<p>Bettina came to the United States in 1966 were she pursued graduate studies in macroeconomics and business at the University of Wisconsin, Madison and at Stanford University.  She worked with women and minorities in small business development and consulting.  </p>
<p>Bettina was very active in and served as President of the League of Women Voters of Dane County.  After growing up under repressive regimes in Argentina she truly valued the democratic process and freedom of speech she experienced here.  She became a citizen of the United States in 1983.  </p>
<p>Elisabeth is survived by her husband: Don Kanel, her children: Mike Kanel and Elizabeth Kanel, her grandchildren: Avery and William Kanel and Tristan and Galen Waddington. Many friends and family in Argentina and the United States also survive Elisabeth. Her own reflections on her life included the following; “ For myself, living in this world has been very interesting, very demanding and very rewarding. I think that I would do it all again (given the advantage of this practice run!)”. We will all miss her.
</p></blockquote>
<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/09/bettina2.png" rel="lightbox[544]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/09/bettina2-495x600.png" alt="Elisabeth Diaz-Herrera" title="Elisabeth Diaz-Herrera" width="495" height="600" class="alignnone size-medium wp-image-554" /></a></p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/vrmIbakyuX8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/09/elisabeth-diaz-herrera/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/09/elisabeth-diaz-herrera/</feedburner:origLink></item>
		<item>
		<title>New Post on Open-Source in Academia [EMU Marketing]</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/yWWcwaEmrbo/</link>
		<comments>http://blog.twaddington.com/2009/09/new-post-on-open-source-in-academia-emu-marketing/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:28:24 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=541</guid>
		<description><![CDATA[Just wanted to direct your attention to my new post over at EMU Marketing on open-source software in academia:
http://emumarketing.uoregon.edu/tristan/2009/09/04/coding-open-the-benefits-of-free-and-open-source-software-in-academia/
Check it out and leave us a comment!
]]></description>
			<content:encoded><![CDATA[<p>Just wanted to direct your attention to my new post over at <a href="http://emumarketing.uoregon.edu/">EMU Marketing</a> on open-source software in academia:</p>
<p><a href="http://emumarketing.uoregon.edu/tristan/2009/09/04/coding-open-the-benefits-of-free-and-open-source-software-in-academia/">http://emumarketing.uoregon.edu/tristan/2009/09/04/coding-open-the-benefits-of-free-and-open-source-software-in-academia/</a></p>
<p>Check it out and leave us a comment!</p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/yWWcwaEmrbo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/09/new-post-on-open-source-in-academia-emu-marketing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/09/new-post-on-open-source-in-academia-emu-marketing/</feedburner:origLink></item>
		<item>
		<title>Virtuemart – Shipping Method List – Invalid Markup</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/iuUQtamH9q4/</link>
		<comments>http://blog.twaddington.com/2009/08/virtuemart-shipping-method-list-invalid-markup/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 04:18:34 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[invalid]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[not-well formed]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shipping method list]]></category>
		<category><![CDATA[shipping methods]]></category>
		<category><![CDATA[Virtuemart]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=526</guid>
		<description><![CDATA[
A user recently reported an odd problem on a Virtuemart site I maintain. They weren&#8217;t able to properly select the bottom two shipping methods listed (both USPS options).
I took a gander at the cart and quickly found the problem. The UPS shipping module was outputting the radio buttons wrapped in a &#60;label&#62; tag. Problem was, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/08/virtuemart-shipping-method-list.png" rel="lightbox[526]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/virtuemart-shipping-method-list-500x166.png" alt="virtuemart-shipping-method-list" title="virtuemart-shipping-method-list" width="500" height="166" class="alignnone size-medium wp-image-533" /></a></p>
<p>A user recently reported an odd problem on a Virtuemart site I maintain. They weren&#8217;t able to properly select the bottom two shipping methods listed (both USPS options).</p>
<p>I took a gander at the cart and quickly found the problem. The UPS shipping module was outputting the radio buttons wrapped in a <code>&lt;label&gt;</code> tag. Problem was, it wasn&#8217;t doing this consistently, and the last UPS shipping option had an open tag that was encompassing all the remaining radio buttons. This meant that anywhere you clicked in that region would result in the last UPS option being selected.</p>
<p>Now for some reason the USPS shipping module didn&#8217;t output labels at all. So I figured the most consistent solution would be to simply prevent the UPS module from outputting those <code>&lt;label&gt;</code> tags.</p>
<p>The method you&#8217;re looking for is <code>ups::list_rates()</code>, which is in the <code>./administrator/components/com_virtuemart/classes/shipping/ups.php</code> file.</p>
<p>You can see the changes I made below on lines <em>362</em> and <em>384</em>. The lines that are commented out are the original ones.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$shipping_rate_id</span> <span style="color: #339933;">=</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__CLASS__</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;|UPS|&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ServiceName'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;|&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$charge</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000088;">$d</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;shipping_rate_id&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">&quot;checked=<span style="color: #000099; font-weight: bold;">\&quot;</span>checked<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$shipment</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$checked</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;checked=<span style="color: #000099; font-weight: bold;">\&quot;</span>checked<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//$html .= '&lt;label for=&quot;'.$shipping_rate_id.'&quot;&gt;'.&quot;\n&lt;input type=\&quot;radio\&quot; name=\&quot;shipping_rate_id\&quot; $checked value=\&quot;$shipping_rate_id\&quot; id=\&quot;$shipping_rate_id\&quot; /&gt;\n&quot;;</span>
<span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>radio<span style="color: #000099; font-weight: bold;">\&quot;</span> name=<span style="color: #000099; font-weight: bold;">\&quot;</span>shipping_rate_id<span style="color: #000099; font-weight: bold;">\&quot;</span> <span style="color: #006699; font-weight: bold;">$checked</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$shipping_rate_id</span><span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$shipping_rate_id</span><span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$shipping_rate_id</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ServiceName'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;strong&gt;(&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'TransportationCharges'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&lt;/strong&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>DEBUG<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$VM_LANG</span><span style="color: #339933;">-&gt;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PHPSHOP_PRODUCT_FORM_WEIGHT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$order_weight</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$weight_measure</span><span style="color: #339933;">.</span>
        <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$VM_LANG</span><span style="color: #339933;">-&gt;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PHPSHOP_RATE_FORM_VALUE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;: [[&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$charge_unrated</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;(&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$fsc_rate</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)]+&quot;</span><span style="color: #339933;">.</span>UPS_HANDLING_FEE<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;](&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$taxrate</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)]&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// DELIVERY QUOTE</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Show_Delivery_Days_Quote <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'GuaranteedDaysToDelivery'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'GuaranteedDaysToDelivery'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$VM_LANG</span><span style="color: #339933;">-&gt;</span>_<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PHPSHOP_UPS_SHIPPING_GUARANTEED_DAYS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Show_Delivery_ETA_Quote <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ScheduledDeliveryTime'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&amp;nbsp;(ETA:&amp;nbsp;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ScheduledDeliveryTime'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Show_Delivery_Warning <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'RatedShipmentWarning'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//$html .= &quot;&lt;/label&gt;&lt;br/&gt;\n&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;&lt;em&gt;&quot;.$value['RatedShipmentWarning'].&quot;&lt;/em&gt;\n&quot;;</span>
        <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;br/&gt;<span style="color: #000099; font-weight: bold;">\n</span>&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;&lt;em&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'RatedShipmentWarning'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/em&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/twaddington/~4/iuUQtamH9q4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/08/virtuemart-shipping-method-list-invalid-markup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/08/virtuemart-shipping-method-list-invalid-markup/</feedburner:origLink></item>
		<item>
		<title>14 Social Media Icon Sets</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/UaJ1ZfbUEAw/</link>
		<comments>http://blog.twaddington.com/2009/08/free-social-media-icon-sets/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 06:33:27 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=500</guid>
		<description><![CDATA[As many of you know, there are some crappy icon sets out there. Here are a few that I deem acceptable for general consumption. Enjoy!
Aquaticus Social icons

High Gloss Web 2.0 Icons

108 Free Matte White Square Social Networking Icons

154 Matte Black Social Media Icons

Web 2 Icons

Webtoolkit Icon Set Vol. 1

Free Vectors &#8211; 20 Free Social Bookmarking [...]]]></description>
			<content:encoded><![CDATA[<p>As many of you know, there are some crappy icon sets out there. Here are a few that I deem acceptable for general consumption. Enjoy!</p>
<p><strong><a href="http://www.iconspedia.com/pack/aquaticus-social-1367/">Aquaticus Social icons</a></strong><br />
<a href="http://www.iconspedia.com/pack/aquaticus-social-1367/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/AquaticusSocialIcons-500x314.jpg" alt="AquaticusSocialIcons" title="AquaticusSocialIcons" width="500" height="314" class="alignnone size-medium wp-image-503" /></a></p>
<p><strong><a href="http://www.aoddesign.com/blog/resources/high-gloss-web-20-icons/">High Gloss Web 2.0 Icons</a></strong><br />
<a href="http://www.aoddesign.com/blog/resources/high-gloss-web-20-icons/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/web_20.jpg" alt="High Gloss Web Icons" title="High Gloss Web Icons" width="393" height="274" class="alignnone size-full wp-image-501" /></a></p>
<p><strong><a href="http://webtreats.mysitemyway.com/108-free-matte-white-square-social-networking-icons/">108 Free Matte White Square Social Networking Icons</a></strong><br />
<a href="http://webtreats.mysitemyway.com/108-free-matte-white-square-social-networking-icons/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/53__620x620_01-free-matte-white-square-social-networking-icons-webtreats-preview-499x297.jpg" alt="108 Free Matte White Square Social Networking Icons" title="108 Free Matte White Square Social Networking Icons" width="499" height="297" class="alignnone size-medium wp-image-505" /></a></p>
<p><strong><a href="http://webtreats.mysitemyway.com/154-matte-black-social-media-icons/">154 Matte Black Social Media Icons</a></strong><br />
<a href="http://webtreats.mysitemyway.com/154-matte-black-social-media-icons/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/166__608x608_01-matte-black-social-media-icons-webtreats-preview-499x297.jpg" alt="166__608x608_01-matte-black-social-media-icons-webtreats-preview" title="166__608x608_01-matte-black-social-media-icons-webtreats-preview" width="499" height="297" class="alignnone size-medium wp-image-507" /></a></p>
<p><strong><a href="http://fasticon.com/freeware/index.php/web-2-icons/">Web 2 Icons</a></strong><br />
<a href="http://fasticon.com/freeware/index.php/web-2-icons/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/web2_icons.jpg" alt="web2_icons" title="web2_icons" width="425" height="420" class="alignnone size-full wp-image-508" /></a></p>
<p><strong><a href="http://webtoolkit4.me/2008/09/05/webtoolkit4me-releases-the-first-icon-set/">Webtoolkit Icon Set Vol. 1</a></strong><br />
<a href="http://webtoolkit4.me/2008/09/05/webtoolkit4me-releases-the-first-icon-set/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/webicons_new-500x144.jpg" alt="Webtoolkit Icon Set Vol. 1" title="Webtoolkit Icon Set Vol. 1" width="500" height="144" class="alignnone size-medium wp-image-509" /></a></p>
<p><strong><a href="http://thinkdesignblog.com/free-vectors-20-free-social-bookmarking-icons.htm/">Free Vectors &#8211; 20 Free Social Bookmarking Icons</a></strong><br />
<a href="http://thinkdesignblog.com/free-vectors-20-free-social-bookmarking-icons.htm/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/picforpost4.jpg" alt="Free Vectors - 20 Free Social Bookmarking Icons" title="Free Vectors - 20 Free Social Bookmarking Icons" width="500" height="500" class="alignnone size-full wp-image-513" /></a></p>
<p><strong><a href="http://www.blogperfume.com/social-media-icons-pack-in-3-sizes-for-download/">Social Media Icons Pack</a></strong><br />
<a href="http://www.blogperfume.com/social-media-icons-pack-in-3-sizes-for-download/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/preview-500x201.jpg" alt="Social Media Icons Pack" title="Social Media Icons Pack" width="500" height="201" class="alignnone size-medium wp-image-514" /></a></p>
<p><strong><a href="http://www.soulvisual.com/blog/2008/03/04/12-boutons-gratuits-pour-votre-site/">34 (ou plus) boutons gratuits pour votre site</a></strong><br />
<a href="http://www.soulvisual.com/blog/2008/03/04/12-boutons-gratuits-pour-votre-site/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/btns.png" alt="34 (ou plus) boutons gratuits pour votre site" title="34 (ou plus) boutons gratuits pour votre site" width="490" height="150" class="alignnone size-full wp-image-515" /></a></p>
<p><strong><a href="http://dryicons.com/free-icons/preview/socialize-icons-set/">Socialize Icons</a></strong><br />
<a href="http://dryicons.com/free-icons/preview/socialize-icons-set/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/socialize_preview-500x361.jpg" alt="Socialize Icons" title="Socialize Icons" width="500" height="361" class="alignnone size-medium wp-image-516" /></a></p>
<p><strong><a href="http://narjisnaqvi.deviantart.com/art/Web-social-icons-117562335/">Web social icons</a></strong><br />
<a href="http://narjisnaqvi.deviantart.com/art/Web-social-icons-117562335"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/Web_social_icons_by_NarjisNaqvi.jpg" alt="Web social icons" title="Web social icons" width="300" height="424" class="alignnone size-full wp-image-517" /></a></p>
<p><strong><a href="http://www.marcofolio.net/icon/social_post_stamps_free_icon_set.html">Social Post Stamps: Free icon set </a></strong><br />
<a href="http://www.marcofolio.net/icon/social_post_stamps_free_icon_set.html"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/poststamps.png" alt="Social Post Stamps: Free icon set " title="Social Post Stamps: Free icon set " width="424" height="424" class="alignnone size-full wp-image-518" /></a></p>
<p><strong><a href="http://webtoolkit4.me/2009/03/17/polaroid-icon-set/">Polaroid icon set</a></strong><br />
<a href="http://webtoolkit4.me/2009/03/17/polaroid-icon-set/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/polaroid_icon_set-500x237.jpg" alt="Polaroid icon set" title="Polaroid icon set" width="500" height="237" class="alignnone size-medium wp-image-519" /></a></p>
<p><strong><a href="http://tydlinka.deviantart.com/art/Set-of-social-icons-no-2-110250447/">Set of social icons no.3</a></strong><br />
<a href="http://tydlinka.deviantart.com/art/Set-of-social-icons-no-2-110250447"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/724-500x510.jpg" alt="Set of social icons no.3" title="Set of social icons no.3" width="500" height="510" class="alignnone size-medium wp-image-520" /></a></p>
<p><strong>Bonus: <a href="http://jimmac.musichall.cz/log/?p=431/">Twitm Icon</a> (very slick app-icon)</strong><br />
<a href="http://jimmac.musichall.cz/log/?p=431/"><img src="http://blog.twaddington.com/wp-content/uploads/2009/08/twitter.png" alt="Twitm Icon" title="Twitm Icon" width="400" height="300" class="alignnone size-full wp-image-523" /></a></p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/UaJ1ZfbUEAw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/08/free-social-media-icon-sets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/08/free-social-media-icon-sets/</feedburner:origLink></item>
		<item>
		<title>New Skins – EMU Marketing</title>
		<link>http://feedproxy.google.com/~r/twaddington/~3/SZsvT4lwhY0/</link>
		<comments>http://blog.twaddington.com/2009/07/new-skins-emu-marketing/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 11:51:53 +0000</pubDate>
		<dc:creator>Tristan Waddington</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.twaddington.com/?p=480</guid>
		<description><![CDATA[
I decided it was time to freshen up the EMU Marketing blog a bit, so after a little hunting, I swapped out the old theme for the fantastic (and free) deStyle Wordpress theme &#8211; from ThemeShift.
I was pleasantly surprised by the quality of the deStyle theme. It features a custom theme options page; integrated Twitter [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.twaddington.com/wp-content/uploads/2009/07/emu-marketing-destyle-theme.png" rel="lightbox[480]"><img src="http://blog.twaddington.com/wp-content/uploads/2009/07/emu-marketing-destyle-theme-500x292.png" alt="emu-marketing-destyle-theme" title="emu-marketing-destyle-theme" width="500" height="292" class="alignnone size-medium wp-image-484" /></a></p>
<p>I decided it was time to freshen up the <a href="http://emumarketing.uoregon.edu/">EMU Marketing</a> blog a bit, so after a little hunting, I swapped out the old theme for the fantastic (and free) <a href="http://themeshift.com/destyle/">deStyle</a> Wordpress theme &#8211; from <a href="http://themeshift.com/">ThemeShift</a>.</p>
<p>I was pleasantly surprised by the quality of the deStyle theme. It features a custom theme options page; integrated Twitter and Flickr modules; ad-support; author bios; and really nice looking markup. The whole theme is just nicely polished.</p>
<p>ThemeShift has two other premium themes, <a href="http://themeshift.com/degusto/">deGusto</a> and <a href="http://themeshift.com/decasa/">deCasa</a>.</p>
<p>EMU Marketing is where I work. We do web development and and print design for student groups and University services housed within the <a href="http://emu.uoregon.edu/">Erb Memorial Union</a>. Keep an eye out for some exciting news in the next few days. Hopefully we&#8217;ll have something fun to show you.</p>
<img src="http://feeds.feedburner.com/~r/twaddington/~4/SZsvT4lwhY0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.twaddington.com/2009/07/new-skins-emu-marketing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.twaddington.com/2009/07/new-skins-emu-marketing/</feedburner:origLink></item>
	</channel>
</rss>
