<?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>Florent Clairambault &#187; WP Codebox</title>
	<atom:link href="http://florent.clairambault.fr/tag/wp-codebox/feed" rel="self" type="application/rss+xml" />
	<link>http://florent.clairambault.fr</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 23:45:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>WP-Codebox fix so that it doesn&#8217;t prevent posts export</title>
		<link>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wp-codebox-fix-so-that-it-doesnt-prevent-posts-export</link>
		<comments>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export#comments</comments>
		<pubDate>Sat, 15 May 2010 07:00:08 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WP Codebox]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2695</guid>
		<description><![CDATA[If you have a PHP configured with some open_basedir restriction (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog. Go to your blog, go in the &#8220;wp-content/plugins/wp-codebox&#8221; dir and edit the &#8220;wp-codebox.php&#8221; file : On line 27, you should have : 1 2 include_once &#34;../../../wp-config.php&#34;; include_once &#34;../../../wp-settings.php&#34;; Well, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a PHP configured with some <a href="http://www.php.net/manual/en/ini.core.php#ini.open-basedir">open_basedir restriction</a> (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog.</p>
<p>Go to your blog, go in the &#8220;wp-content/plugins/wp-codebox&#8221; dir and edit the &#8220;wp-codebox.php&#8221; file :<br />
On line 27, you should have :</p>

<div class="wp_codebox"><table><tr id="p26953"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p2695code3"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">&quot;../../../wp-config.php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">&quot;../../../wp-settings.php&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Well, it fails because the plugin doesn&#8217;t use the good practices, so it&#8217;s pretty easy to fix :</p>

<div class="wp_codebox"><table><tr id="p26954"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p2695code4"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-config.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-settings.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I&#8217;d like to thank the developer of this plugin for doing such a great job. It brings the power of <a href="http://qbnz.com/highlighter/">geshi</a> (not the latest version by the way) into <a href="http://wordpress.org/">wordpress</a>.</p>
<div style="display: none">
BTW, why change :<br />
* include_once to require_once : Why should we accept that a file couldn&#8217;t be included on go on ?<br />
* double quote to simple quote : php reads it faster because it doesn&#8217;t parse vars (&#8220;$&#8221; starting words).<br />
* no parenthesis to parenthesis : Well, it&#8217;s a method isn&#8217;t it ?
</div>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Codebox Quick fix for WordPress 2.9</title>
		<link>http://florent.clairambault.fr/wp-codebox-quick-fix-for-wordpress-2-9?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wp-codebox-quick-fix-for-wordpress-2-9</link>
		<comments>http://florent.clairambault.fr/wp-codebox-quick-fix-for-wordpress-2-9#comments</comments>
		<pubDate>Mon, 07 Dec 2009 19:00:02 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WP Codebox]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2120</guid>
		<description><![CDATA[This bug has been fixed ! I like to have the latest version of WordPress, this is why I use the SVN version. And recently the CSS of the &#8220;WP Codebox&#8221; plugin stopped working. Here the explanation and the solution : It seems that starting with the 2.9 version, you can register the styles in [...]]]></description>
			<content:encoded><![CDATA[<p><strong style="color: red">This bug has been fixed !</strong></p>
<p>I like to have the latest version of WordPress, this is why I use <a href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion">the SVN version</a>. And recently the CSS of the &#8220;WP Codebox&#8221; plugin stopped working. Here the explanation and the solution :</p>
<p>It seems that starting with the 2.9 version, you can register the styles in the &#8220;wp_print_scripts&#8221; action method. So in the wp-codebox.php file, you have to put this :</p>

<div class="wp_codebox"><table><tr id="p21206"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p2120code6"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Codebox_ScriptsAction'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> Codebox_ScriptsAction <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$cb_path</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wp-content/plugins/wp-codebox&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//URL to the plugin directory</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'codebox'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cb_path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/js/codebox.js'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'0.1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_print_styles'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Codebox_StylesAction'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> Codebox_StylesAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$cb_path</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wp-content/plugins/wp-codebox&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//URL to the plugin directory</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                wp_enqueue_style<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'codebox'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cb_path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/css/codebox.css'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'0.1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'screen'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And it will work&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/wp-codebox-quick-fix-for-wordpress-2-9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
