<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Adrian Callaghan`s Blog &#187; wordpress</title>
	<atom:link href="http://adriancallaghan.co.uk/Categorys/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://adriancallaghan.co.uk</link>
	<description>A general mix of everything</description>
	<lastBuildDate>Thu, 29 Jul 2010 12:45:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>wordpress comment count as a button</title>
		<link>http://adriancallaghan.co.uk/wordpress-comment-count-as-a-button/</link>
		<comments>http://adriancallaghan.co.uk/wordpress-comment-count-as-a-button/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 13:46:56 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://adriancallaghan.co.uk/?p=533</guid>
		<description><![CDATA[Styling the wordpress comment count as a button/icon etc can be tricky because the normal call to the comments 1 comments_popup_link&#40;__&#40;'Comments (0)'&#41;, __&#40;'Comments (1)'&#41;, __&#40;'Comments (%)'&#41;&#41;; formats the output as an anchor point with the correct link, alt tags etc already set up. So in order to intercept this and then add you own anchor [...]]]></description>
			<content:encoded><![CDATA[<p>Styling the wordpress comment count as a button/icon etc can be tricky because the normal call to the comments</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">comments_popup_link<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments (0)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments (1)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments (%)'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>formats the output as an anchor point with the correct link, alt tags etc already set up.</p>
<p>So in order to intercept this and then add you own anchor point with divs/imagery etc you need to make a custom request</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">// SQL</span>
<span style="color: #000088;">$SQL</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT COUNT(*) AS Count FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;comments</span> WHERE comment_approved='1'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$SQL</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;AND comment_post_ID='&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">intval</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;">&quot;'&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Sort the array into a string prefixed with 'Comments '</span>
<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$SQL</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 	
<span style="color: #000088;">$comments</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Comments ('</span><span style="color: #339933;">.</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// generate the alt and title tags</span>
<span style="color: #000088;">$alt</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Comment on '</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// echo the button if this is not a single and not a page</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// anchor open</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<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;">'&quot; alt=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$alt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// complex formatting rules for the comment pop up, go here</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comments</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// anchor close</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The above does exactly the same, formats the link etc, but now you can access the anchor point directly and format it your own way.</p>
]]></content:encoded>
			<wfw:commentRss>http://adriancallaghan.co.uk/wordpress-comment-count-as-a-button/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress blog to MU</title>
		<link>http://adriancallaghan.co.uk/manually-upgrade-a-wordpress-blog-to-mu-multiuser/</link>
		<comments>http://adriancallaghan.co.uk/manually-upgrade-a-wordpress-blog-to-mu-multiuser/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 14:39:49 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://adriancallaghan.co.uk/?p=368</guid>
		<description><![CDATA[Upgrading to wordpress MU manually from an old blog. At work I had to update an old wordpress installation from 2.3.2 all the way up to the latest version of WordPress Mu (Multi User). I documented the method I used and placed it below here. If you do decide to do this it is done [...]]]></description>
			<content:encoded><![CDATA[<p>Upgrading to wordpress MU manually from an old blog.<br />
<br />
At work I had to update an old wordpress installation from 2.3.2 all the way up to the latest version of WordPress Mu (Multi User).<br />
<br />
I documented the method I used and placed it below here.<br />
<b>If you do decide to do this it is done entirely at your <u>own</u> risk.<br />
<font color="red">ALWAYS MAKE A BACKUP FIRST</font><br />
</b><br />
</p>
<h4>Stage 1</h4>
<p>Install Mu on its own database alongside your existing installation and database, within its own directory in the normal way.</p>
<h4>Stage 2</h4>
<p>Move the data across from Mu performing an upgrade, keeping all the data intact and wordpress Mu functioning correctly.</p>
<h5>How this is done</h5>
<p><span id="more-368"></span><br />
1. On your old blog`s database rename the following tables</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;">	<span style="color: #990099; font-weight: bold;">from</span>				       <span style="color: #990099; font-weight: bold;">to</span>
	<span style="color: #CC0099;">-----------------------------------------------------------------</span>
	wp_comments		       wp_1_comments
	wp_links			       wp_1_links
	wp_options		       wp_1_options
	wp_postmeta		       wp_1_postmeta
        wp_posts		               wp_1_posts
	wp_terms			       wp_1_terms
	wp_term_relationships       wp_1_term_relationships
	wp_term_taxonomy	       wp_1_term_taxonomy</pre></td></tr></table></div>

<p>2. Copy only these tables across from the MU database to the old blog database.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;">	wp_blogs
	wp_blog_versions
   <span style="color: #CC0099;">--&gt;</span>	wp_posts 		<span style="color: #FF00FF;">&#40;</span>THIS CAN BE OVER WRITTEN BECAREFULL<span style="color: #FF00FF;">&#41;</span>
	wp_registration_log
	wp_signups
	wp_site
	wp_site_categories</pre></td></tr></table></div>

<p>3. Alter the table wp_users in the old database by adding the following fields to its structure</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;">	<span style="color: #000099;">Field</span>		        <span style="color: #990099; font-weight: bold;">Type</span>		  <span style="color: #000099;">Collation</span>	  Attributes	<span style="color: #9900FF; font-weight: bold;">Null</span>   	<span style="color: #990099; font-weight: bold;">default</span>   Extra
	<span style="color: #CC0099;">----------------------------------------------------------------------------------------------------------------------</span>
	spam 		<span style="color: #999900; font-weight: bold;">tinyint</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">2</span><span style="color: #FF00FF;">&#41;</span>					        <span style="color: #990099; font-weight: bold;">No</span>	        <span style="color: #008080;">0</span>
	deleted		<span style="color: #999900; font-weight: bold;">tinyint</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">2</span><span style="color: #FF00FF;">&#41;</span>					        <span style="color: #990099; font-weight: bold;">No</span>	        <span style="color: #008080;">0</span></pre></td></tr></table></div>

<p>4. Add the following information into the table wp_1_options in the old database</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
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;">	option_id	blog_id		option_name			option_value			        autoload
	<span style="color: #CC0099;">--------------------------------------------------------------------------------------------------------------------------------------------</span>
	<span style="color: #008080;">75</span>		<span style="color: #008080;">0</span>		avatar_default			        mystery				        yes
	<span style="color: #008080;">68</span>		<span style="color: #008080;">0</span>		avatar_rating			        G				                yes
	<span style="color: #008080;">84</span>		<span style="color: #008080;">0</span> 		close_comments_days_old		<span style="color: #008080;">14</span>				                yes
	<span style="color: #008080;">83</span>		<span style="color: #008080;">0</span>		close_comments_for_old_posts	<span style="color: #008080;">0</span>				                yes
	<span style="color: #008080;">88</span>		<span style="color: #008080;">0</span> 		comments_per_page		        <span style="color: #008080;">50</span>				                yes
	<span style="color: #008080;">116</span>		<span style="color: #008080;">0</span>		current_theme			        <span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">107</span>		<span style="color: #008080;">0</span>		dashboard_widget_options   	<span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">97</span>		<span style="color: #008080;">0</span>		dismissed_update_core		a:<span style="color: #008080;">0</span>:<span style="color: #FF00FF;">&#123;</span><span style="color: #FF00FF;">&#125;</span>				                yes
	<span style="color: #008080;">76</span>		<span style="color: #008080;">0</span>		enable_app			        <span style="color: #008080;">0</span>				                yes
	<span style="color: #008080;">77</span>		<span style="color: #008080;">0</span>		enable_xmlrpc			        <span style="color: #008080;">0</span>				                yes
	<span style="color: #008080;">99</span>		<span style="color: #008080;">0</span>		fileupload_url			        <span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">82</span>		<span style="color: #008080;">0</span>		image_default_align						                        yes
	<span style="color: #008080;">80</span>		<span style="color: #008080;">0</span>		image_default_link_type		file				                yes
	<span style="color: #008080;">81</span>		<span style="color: #008080;">0</span>		image_default_size						                        yes
	<span style="color: #008080;">79</span>		<span style="color: #008080;">0</span>		large_size_h			        <span style="color: #008080;">1024</span>				                yes	
	<span style="color: #008080;">78</span>		<span style="color: #008080;">0</span>		large_size_w			        <span style="color: #008080;">1024</span>				                yes
	<span style="color: #008080;">74</span>		<span style="color: #008080;">0</span>		medium_size_h			        <span style="color: #008080;">300</span>				                yes
	<span style="color: #008080;">73</span>		<span style="color: #008080;">0</span>		medium_size_w			        <span style="color: #008080;">300</span>				                yes
	<span style="color: #008080;">108</span>		<span style="color: #008080;">0</span>		nonce_salt			                <span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">87</span>		<span style="color: #008080;">0</span>		page_comments			<span style="color: #008080;">1</span>				                yes
	<span style="color: #008080;">100</span>		<span style="color: #008080;">0</span>		post_count			        <span style="color: #008080;">1</span>				                yes
	<span style="color: #008080;">61</span>		<span style="color: #008080;">0</span>		random_seed			        <span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">67</span>		<span style="color: #008080;">0</span>		show_avatars			        <span style="color: #008080;">1</span>				                yes
	<span style="color: #008080;">92</span>		<span style="color: #008080;">0</span>		sticky_posts			        a:<span style="color: #008080;">0</span>:<span style="color: #FF00FF;">&#123;</span><span style="color: #FF00FF;">&#125;</span>				                yes
	<span style="color: #008080;">85</span>		<span style="color: #008080;">0</span>		thread_comments			<span style="color: #008080;">0</span>				                yes
	<span style="color: #008080;">86</span>		<span style="color: #008080;">0</span>		thread_comments_depth		<span style="color: #008080;">5</span>				                yes
	<span style="color: #008080;">72</span>		<span style="color: #008080;">0</span>		thumbnail_crop			        <span style="color: #008080;">1</span>				                yes
	<span style="color: #008080;">71</span>		<span style="color: #008080;">0</span>		thumbnail_size_h		        <span style="color: #008080;">150</span>				                yes
	<span style="color: #008080;">70</span>		<span style="color: #008080;">0</span>		thumbnail_size_w		        <span style="color: #008080;">150</span>				                yes
	<span style="color: #008080;">106</span>		<span style="color: #008080;">0</span>		update_themes			        <span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes
	<span style="color: #008080;">69</span>		<span style="color: #008080;">0</span>		upload_url_path							                        yes
	<span style="color: #008080;">91</span>		<span style="color: #008080;">0</span>		use_ssl				        <span style="color: #008080;">0</span>				                yes
	<span style="color: #008080;">95</span>		<span style="color: #008080;">0</span>		widget_rss			                a:<span style="color: #008080;">0</span>:<span style="color: #FF00FF;">&#123;</span><span style="color: #FF00FF;">&#125;</span>				                yes
	<span style="color: #008080;">94</span>		<span style="color: #008080;">0</span>		widget_text			        a:<span style="color: #008080;">0</span>:<span style="color: #FF00FF;">&#123;</span><span style="color: #FF00FF;">&#125;</span>				                yes
	<span style="color: #008080;">102</span>		<span style="color: #008080;">0</span>		WPLANG								                        yes
	<span style="color: #008080;">98</span>		<span style="color: #008080;">0</span>		wp_1_user_roles			<span style="color: #FF00FF;">&#40;</span>the <span style="color: #990099; font-weight: bold;">value</span> <span style="color: #990099; font-weight: bold;">from</span> the <span style="color: #990099; font-weight: bold;">database</span><span style="color: #FF00FF;">&#41;</span>	yes</pre></td></tr></table></div>

<p>5. alter the value of upload_path in wp_1_options in the old database to wp-content/blogs.dir/1/files</p>
<h2>The blog will now be active</h2>
<p>&#8230;but the back office is broken!, to fix this&#8230;.</p>
<p>6. in wp_usermeta change every entry of wp_capabilities to wp_1_capabilities (use the mysql below)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> wp_usermeta <span style="color: #990099; font-weight: bold;">SET</span> meta_key<span style="color: #CC0099;">=</span><span style="color: #008000;">'wp<span style="color: #008080; font-weight: bold;">_</span>1<span style="color: #008080; font-weight: bold;">_</span>capabilities'</span> <span style="color: #990099; font-weight: bold;">WHERE</span> meta_key<span style="color: #CC0099;">=</span><span style="color: #008000;">'wp<span style="color: #008080; font-weight: bold;">_</span>capabilities'</span></pre></td></tr></table></div>

<p>7. create some extra fields based upon the user (run the php code below)</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// custom code for upgrade</span>
&nbsp;
<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$maxId</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SELECT max(umeta_id) AS startPoint FROM wp_usermeta'</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SELECT ID FROM wp_users'</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$userId</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h3&gt;Updating user: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$userId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/h3&gt;&lt;p&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// execute all the querys</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$queryNumber</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$queryNumber</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$queryNumber</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span> 
				<span style="color: #000088;">$SQL1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$SQL2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$userId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;, 'comment_shortcuts', 'false');&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$queryNumber</span><span style="color: #339933;">++;</span> 
				<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> 
				<span style="color: #000088;">$SQL1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$SQL2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$userId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;, 'admin_color', 'fresh');&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$queryNumber</span><span style="color: #339933;">++;</span>
				<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span> 
				<span style="color: #000088;">$SQL1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$SQL2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$userId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;, 'source_domain', 'YOURBLOGDOMAIN');&quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #000088;">$queryNumber</span><span style="color: #339933;">++;</span>
				<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
				<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Query out of bounds exception:  '</span><span style="color: #339933;">.</span><span style="color: #000088;">$queryNumber</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// check the slot is available</span>
		<span style="color: #000088;">$check</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM wp_usermeta WHERE umeta_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$maxId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'startPoint'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">while</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;">$check</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
			<span style="color: #000088;">$maxId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'startPoint'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span> 
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Incrementing to: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$maxId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'startPoint'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$check</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM wp_usermeta WHERE umeta_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$maxId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'startPoint'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000088;">$SQL</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$SQL1</span><span style="color: #339933;">.</span><span style="color: #000088;">$maxId</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'startPoint'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$SQL2</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Executing query '</span><span style="color: #339933;">.</span><span style="color: #000088;">$queryNumber</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'       : '</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$SQL</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'Success'</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">'Failed'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span>		
		<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>8. point the MU config.php to the old database, you will need to change the permissions from 644 to 666 use CHMOD<br />
    or duplicate the config file, alter it, rename the old config file, and then rename the new file as config.php</p>
<p>9. Log into the back office goto to settings->permalinks and click save, your posts/pages can now be found</p>
<p>Your upgrade should now be complete and you can go ahead and delete the MU database installation, not your old but now upgraded database.</p>
<p>I will be happy to answer any questions, and comments as always, are welcome</p>
<p>Additionally:<br />
Ensure that both the field umeta_id in table wp_usermeta and the field ID in table wp_users are set to auto_increment.</p>
]]></content:encoded>
			<wfw:commentRss>http://adriancallaghan.co.uk/manually-upgrade-a-wordpress-blog-to-mu-multiuser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>clikStats</title>
		<link>http://adriancallaghan.co.uk/clikstats/</link>
		<comments>http://adriancallaghan.co.uk/clikstats/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 16:54:25 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://adriancallaghan.co.uk/?p=278</guid>
		<description><![CDATA[clikStats is a wordpress plugin that automatically detects the current links within each post. ClikStats is retrofitable, and requires no special provision from any classes or code. Once activated, clikStats will compile who, when, what data which can be viewed through the back office. The beauty of this plugin is in its portability, it can [...]]]></description>
			<content:encoded><![CDATA[<p>clikStats is a wordpress plugin that automatically detects the current links within each post.</p>
<p>ClikStats is retrofitable, and requires no special provision from any classes or code.</p>
<p>Once activated, clikStats will compile who, when, what data which can be viewed through the back office.</p>
<p>The beauty of this plugin is in its portability, it can be used straight out of the box, and provide usefull visitor information, without the need to reverse engineer your posts.</p>
<p>Download the latest version (v0.7) of clikStats from <a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://adriancallaghan.co.uk/wp-content/downloads/clikstats.zip">here</a></p>
<p>Simply add the unzipped folder to your pluggins folder, and make it active to start logging clicks.</p>
<p>Have fun</p>
<style>
.current_release td {color:#ffff00;}
.revision_history td {padding:0 10px;}
table.revision_history {padding:10px; border:1px solid #333333;}
</style>
<table class="revision_history">
<tr>
<th>RELEASE NOTES</th>
</tr>
<tr>
<td>v0.3 04.01.09</td>
<td>Provision for pagenation, deletion and better url parsing</td>
</tr>
<tr>
<td>v0.4 05.01.09</td>
<td>Required update, due to a naming convention issue</td>
</tr>
<tr>
<td valign="top">v0.5 18.01.09</td>
<td>Fixed security issues, enhanced UI, extra pages<br />
<b>Big thankyou to Alexandre Araújo for his testing</b></td>
</tr>
<tr>
<td valign="top">v0.6 15.02.09</td>
<td>Added search and some nice aesthetics
</td>
</tr>
<tr class="current_release">
<td>v0.7 09.05.09</td>
<td>Added clik page/post sourcename, improved date filter system</td>
</tr>
</table>
<p><u>Some of the best reviews</u></p>
<p><a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://vansantos.com/2009/01/05/concerned-about-where-your-traffic-goes-check-out-the-clikstats-plugin/" target="_BLANK">VanSantos</a><br />
<a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://www.dailyseoblog.com/2008/12/track-links-and-clicks-on-each-post-with-clickstats-plugin/" target="_BLANK">Daily Seo Blog</a><br />
<a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://hauntingthunder.wordpress.com/2009/01/07/clikstats-plugin-for-wordpress/" target="_BLANK">Haunting thunder</a><br />
<a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://techravings.info/2009/01/wordpress-plugin-to-track-links-clickstats.html" target="_BLANK">Tech Ravings</a><br />
<a href="http://adriancallaghan.co.uk/wp-content/plugins/clikstats/ck.php?Ck_id=278&Ck_lnk=http://www.thuk.co.uk/blog/2009/01/08/new-seo-plugin-clikstats-for-wordpress/" target="_BLANK">THUK Media</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adriancallaghan.co.uk/clikstats/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
