<?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>Chris Hardcastle &#187; php</title>
	<atom:link href="http://chrishardcastle.co.uk/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://chrishardcastle.co.uk</link>
	<description>Techical developer for websites in London</description>
	<lastBuildDate>Wed, 14 Oct 2009 20:26:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TinyMCE or NicEdit for CodeIgniter?</title>
		<link>http://chrishardcastle.co.uk/codeigniter-wysiwyg</link>
		<comments>http://chrishardcastle.co.uk/codeigniter-wysiwyg#comments</comments>
		<pubDate>Sat, 25 Jul 2009 23:33:59 +0000</pubDate>
		<dc:creator>chris.hardcastle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://chrishardcastle.co.uk/?p=59</guid>
		<description><![CDATA[I have been writing a content management system at work using CodeIgniter. Since it will be used by many people to add content, making an editor available is essential for the system. At the time, two candidates stood out for me, both of which, I want to mention in this short post. They are:

NicEdit
TinyMCE


Whilst a [...]]]></description>
			<content:encoded><![CDATA[<p>I have been writing a content management system at work using <a href="http://codeigniter.com">CodeIgniter</a>. Since it will be used by many people to add content, making an editor available is essential for the system. At the time, two candidates stood out for me, both of which, I want to mention in this short post. They are:</p>
<ul>
<li><a href="http://nicedit.com/">NicEdit</a></li>
<li><a href="http://tinymce.moxiecode.com/">TinyMCE</a></li>
</ul>
<p><span id="more-59"></span><br />
Whilst a decision on which editor is the best for you&#8217;re project depends entirely on your own circumstances. I am only focusing on these two for now and don&#8217;t claim to be a master on either.</p>
<p><strong>Downloading</strong></p>
<p>There&#8217;s one thing that bugs me about the process of downloading NicEdit. It smells of the Mootools Javascript framework for one particular reason. There&#8217;s a range of additional extras and packages that are included in the download. The problem is that if you need to download it again for any reason. How can you be sure you include everything that you need?</p>
<p>I much prefer the editor to arrive as a complete core package, rather than it being a combination of various features. I feel that TinyMCE make it easier for you by offering the whole lot, even with a version designed entirely for the JQuery javascript framework.</p>
<p><strong>Size</strong></p>
<p>Looking at the downloads for each editor, I was impressed with NicEdit for having on single JS file and and sprite image for the buttons. Since CodeIgniter is super trim and lightweight, it immediately felt like the right thing to use. Some say that a full blown template library like <a href="http://smarty.net">smarty</a> is overkill for CodeIgniter. I use smarty all the time in CodeIgniter, as such, perhaps TinyMCE is an acceptable size. Also, the TinyMCE folder structure includes a designated plugins directory. Which brings me onto my next topic.</p>
<p><strong>Plugins</strong></p>
<p>It&#8217;s clear for every developer that every wysiwyg editor needs to be customisable so it can meet its technical or design requirements. So the main questions are which offers the easiest integration and which offer the most power. I am afraid to confess that I have not written a plugin for TinyMCE yet so cannot comment on how it works out for that. However, I have been able to extend NicEdit quite easily. It&#8217;s possible to override the data that&#8217;s provided to buttons. For instance I have supplied my editor with a tree of available links and a library of images to choose from. I could post the code if the interest is there.</p>
<p><strong>Documentation</strong></p>
<p>There&#8217;s a <a href="http://wiki.nicedit.com/">wiki</a> and a small section of<a href="http://nicedit.com/demos.php"> demonstrations</a> for NicEdit. The wiki includes some information about how to interact with it using plugins. But the content is limited. On the contrary, the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API">TinyMCE api documentation</a> is fantastic. I think those two points were the deciding factors in which wysiwyg to use for my CodeIgniter project. I wanted to pick it up and run with it. It felt like I could get everything done quicker using NicEdit as it was easier to digest. And thankfully. it all worked straight away.</p>
<p><strong>Conclusion</strong></p>
<p>I am yet to determine if it&#8217;s possible to isolate the cursor position within the content. That would be helpful for a range of tasks, like image insertion from an alternative source. I am happy with using NicEdit for now, it suites my needs. However, I am really worried that I will need a feature that it does not support. Even worse, it does, but was not downloaded with the package included.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrishardcastle.co.uk/codeigniter-wysiwyg/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress site preview</title>
		<link>http://chrishardcastle.co.uk/wordpress-site-preview</link>
		<comments>http://chrishardcastle.co.uk/wordpress-site-preview#comments</comments>
		<pubDate>Wed, 17 Jun 2009 00:26:13 +0000</pubDate>
		<dc:creator>chris.hardcastle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://chrishardcastle.co.uk/?p=48</guid>
		<description><![CDATA[Once you have finished building a Wordpress based website. Wouldn&#8217;t it be great to test it on the live website host, without interrupting any existing files or pages? This is just the kind of scenario that I have been asked about in the past. So, I have recently developed my own suggestion as to how [...]]]></description>
			<content:encoded><![CDATA[<p>Once you have finished building a Wordpress based website. Wouldn&#8217;t it be great to test it on the live website host, without interrupting any existing files or pages? This is just the kind of scenario that I have been asked about in the past. So, I have recently developed my own suggestion as to how this can be achieved.<br />
<span id="more-48"></span><br />
Once your Wordpress database has been set up and all the files for the site are in place. The next step is to replace the existing index.php / html file with the one from the root of your Wordpress build. From that moment Wordpress with be in control of all incoming requests to your site.</p>
<p>Given that the existing home page has to remain the same until your ready to &#8220;activate&#8221; the new one. You can modify the .htaccess file so the Wordpress site will only respond if the homepage has been called with a particular query string. This means you can test the Wordpress build without interrupting the main index page. </p>
<p>In order to do this, you have to modify your .htaccess file in the website root. Below is the modified .htaccess file, take a backup before testing!</p>
<p><code><br />
# BEGIN WordPress<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_URI} !^/wp-content/<br />
RewriteCond %{REQUEST_URI} !^/wp-includes/<br />
RewriteRule . /$1/?test=true [L]<br />
# END WordPress<br />
</code></p>
<p>Replace your existing .htaccess file with the code above and you are half way. Next modify your index.php in the wordpress site.</p>
<p><code><br />
if(isset($_GET["test"])){<br />
    define('WP_USE_THEMES', true);<br />
    /* Loads the WordPress Environment and Template */<br />
    require('./wp-blog-header.php');<br />
}else{<br />
    /* Your holding page HTML / include file */<br />
}<br />
</code></p>
<p>You can redirect to, or include the existing index page within the else clause as described above. The links should still be intact because the .htaccess file is appending your url with the required query string.</p>
<p>So when you visit the site your existing homepage should remain the same. When you visit http://yoursite.com<strong>/?test=true</strong> your wordpress site should wake up and run accordingly. </p>
]]></content:encoded>
			<wfw:commentRss>http://chrishardcastle.co.uk/wordpress-site-preview/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
