<?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>George&#039;s weblog &#187; wordpress</title>
	<atom:link href="http://www.helyar.net/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helyar.net</link>
	<description>From the desktop of George Helyar</description>
	<lastBuildDate>Thu, 26 Aug 2010 14:27:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>wp-syntax to look like Visual Studio</title>
		<link>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/</link>
		<comments>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 13:08:50 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=471</guid>
		<description><![CDATA[wp-syntax is a nice plugin for WordPress using GeSHi to produce syntax highlighted blocks of code. The default colours aren&#8217;t very nice though, and there is no way to easily change them. wp-syntax-colorizer (horrible name) makes it easier to set the colours, but defaults to even worse colours. Most of us want readable colours that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/wp-syntax/">wp-syntax</a> is a nice plugin for <a href="http://wordpress.org/">WordPress</a> using <a href="http://qbnz.com/highlighter/">GeSHi</a> to produce syntax highlighted blocks of code.</p>
<p>The default colours aren&#8217;t very nice though, and there is no way to easily change them. <a href="http://articles.akgfx.com/2008/04/wp-syntax-colorizer/">wp-syntax-colorizer</a> (horrible name) makes it easier to set the colours, but defaults to even worse colours.</p>
<p>Most of us want readable colours that we are used to from IDEs, and most of us will be using either Visual Studio or Eclipse. I mainly use the former. To get it to use the visual studio colours I edit wp-syntax-colorizer as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: black;"><span style="color: #000000; font-weight: bold;color: blue;">function</span> my_custom_geshi_styles<span style="color: #009900;color: black;">&#40;</span><span style="color: #339933;color: black;">&amp;</span><span style="color: #000088;">$geshi</span><span style="color: #009900;color: black;">&#41;</span>
<span style="color: #009900;color: black;">&#123;</span>
  <span style="color: #000088;">$overall</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;black&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$keyword</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;blue&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$literal</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;maroon&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$comment</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;green&quot;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_overall_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">2</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">3</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">4</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_symbols_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_methods_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_regexps_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_strings_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$literal</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_numbers_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$literal</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_comments_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$comment</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_comments_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;">'MULTI'</span><span style="color: #339933;color: black;">,</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$comment</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
<span style="color: #009900;color: black;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving comments in WordPress</title>
		<link>http://www.helyar.net/2010/moving-comments-in-wordpress/</link>
		<comments>http://www.helyar.net/2010/moving-comments-in-wordpress/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 15:03:02 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=440</guid>
		<description><![CDATA[In MySQL, first move the comment: UPDATE wp_comments SET comment_post_ID = P_TO_ID WHERE comment_ID = C_ID; P_TO_ID is the ID of the post you are moving it to. C_ID is the ID of the comment you are moving. You can find both of these IDs easily from the dashboard. Then correct the comment counts for [...]]]></description>
			<content:encoded><![CDATA[<p>In MySQL, first move the comment:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;color: black;"><span style="color: #993333; font-weight: bold;color: blue;">UPDATE</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">SET</span> comment_post_ID <span style="color: #66cc66;color: black;">=</span> P_TO_ID <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_ID <span style="color: #66cc66;color: black;">=</span> C_ID;</pre></div></div>

<p>P_TO_ID is the ID of the post you are moving it to. C_ID is the ID of the comment you are moving. You can find both of these IDs easily from the dashboard.</p>
<p>Then correct the comment counts for the posts:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;color: black;"><span style="color: #993333; font-weight: bold;color: blue;">UPDATE</span> wp_posts <span style="color: #993333; font-weight: bold;color: blue;">SET</span> comment_count <span style="color: #66cc66;color: black;">=</span> <span style="color: #66cc66;color: black;">&#40;</span><span style="color: #993333; font-weight: bold;color: blue;">SELECT</span> count<span style="color: #66cc66;color: black;">&#40;</span><span style="color: #66cc66;color: black;">*</span><span style="color: #66cc66;color: black;">&#41;</span> <span style="color: #993333; font-weight: bold;color: blue;">FROM</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_post_id <span style="color: #66cc66;color: black;">=</span> id <span style="color: #993333; font-weight: bold;color: blue;">AND</span> comment_approved <span style="color: #66cc66;color: black;">=</span> <span style="color: #cc66cc;color: maroon;">1</span><span style="color: #66cc66;color: black;">&#41;</span>
<span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_count !<span style="color: #66cc66;color: black;">=</span> <span style="color: #66cc66;color: black;">&#40;</span><span style="color: #993333; font-weight: bold;color: blue;">SELECT</span> count<span style="color: #66cc66;color: black;">&#40;</span><span style="color: #66cc66;color: black;">*</span><span style="color: #66cc66;color: black;">&#41;</span> <span style="color: #993333; font-weight: bold;color: blue;">FROM</span> wp_comments <span style="color: #993333; font-weight: bold;color: blue;">WHERE</span> comment_post_id <span style="color: #66cc66;color: black;">=</span> id <span style="color: #993333; font-weight: bold;color: blue;">AND</span> comment_approved <span style="color: #66cc66;color: black;">=</span> <span style="color: #cc66cc;color: maroon;">1</span><span style="color: #66cc66;color: black;">&#41;</span>;</pre></div></div>

<p>The second line in this query is not strictly necessary but it lets you know how many posts were affected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/moving-comments-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
