<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>PHP-Scripts Blog &#187; Wordpress</title>
	<link>http://www.php-scripts.com</link>
	<description>Writing about PHP scripting since 12/99. Learn something new every day.</description>
	<pubDate>Thu, 09 Oct 2008 14:17:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>Talk like a pirate text filter suite by Dougal Campbell</title>
		<link>http://www.php-scripts.com/20070919/106/</link>
		<comments>http://www.php-scripts.com/20070919/106/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 13:56:37 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20070919/106/</guid>
		<description><![CDATA[Today is Talk Like A Pirate Day. Appropriate day to implement Dougal Campbell&#8217;s text filter suite Wordpress plugin which includes the Talk Like a Pirate filter. Every post and every comment today only on September 19 will have the text converted to pirate speak.
It works with the most recent version of Wordpress, 2.2.3. To install [...]]]></description>
			<content:encoded><![CDATA[<p>Today is <a href="http://www.talklikeapirate.com/">Talk Like A Pirate Day</a>. Appropriate day to implement Dougal Campbell&#8217;s <a href="http://dougal.gunters.org/blog/2004/08/30/text-filter-suite">text filter suite</a> Wordpress plugin which includes the Talk Like a Pirate filter. Every post and every comment today only on September 19 will have the text converted to pirate speak.</p>
<p>It works with the most recent version of Wordpress, 2.2.3. To install on your blog, do the following:</p>
<p>1. copy the zzz_tts-core.php and tts-pirate.php to you wp-content/plugins directory<br />
2. activate plugin.<br />
3. have fun!</p>
<p>Wordpress, coded in PHP, powers the php-scripts blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20070919/106/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting up a new Wordpress blog</title>
		<link>http://www.php-scripts.com/20051102/56/</link>
		<comments>http://www.php-scripts.com/20051102/56/#comments</comments>
		<pubDate>Wed, 02 Nov 2005 17:52:29 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[Installation and configuration]]></category>

		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=56</guid>
		<description><![CDATA[This guide assumes you have already downloaded and unzipped/untarred the most current Wordpress version. These instructions do not cover the multi-user WP version.
Steps for setting up a new Wordpress (WP) blog:
1. Database created? Create a MySQL database for the domain.
Note: If you have more than one WP blog installed in the same database then open [...]]]></description>
			<content:encoded><![CDATA[<p>This guide assumes you have already downloaded and unzipped/untarred the most current <a href="http://wordpress.org/download/">Wordpress version</a>. These instructions do <i>not</i> cover the <a href="http://mu.wordpress.org/">multi-user WP version</a>.</p>
<p>Steps for setting up a new Wordpress (WP) blog:</p>
<p>1. Database created? Create a MySQL database for the domain.</p>
<p>Note: If you have more than one WP blog installed in the same database then open up wp-config.php and change the &#8216;wp_&#8217; to something else like &#8216;wp2_&#8217; so that you can run multiple wordpress blogs in the same database.</p>
<p>2. Edit wp-config.php with the database information. Create a subdirectory in the WP version locally so you can backup the wp-config locally there.<br />
3. FTP all WP files to the target domain, including the customized wp-config.php file in step #2.<br />
4. Run the install file from your browser. Default install location is:</p>
<p>domain.com/wp-admin/install.php</p>
<p>5. Record the admin username and password somewhere safe.<br />
6. Delete the install files: install.php, install-helper.php<br />
7. Create a primary user: Users -> Authors &#038; Users -> Add New User<br />
8. Promote this user to Level 9 (which is one level beneath the Admin level of 10).<br />
9. Add whatever plugins you want to use. Here&#8217;s some you might try:</p>
<p><a href="http://www.ioerror.us/software/bad-behavior/">bad behavior</a> - shut down the spambots<br />
<a href="http://blog.enargi.com/codesnippet/">codesnippet</a> - allows you to include code snippets inside posts<br />
<a href="http://cjbehm.dyndns.org/wingingit/dashboard-options/">dashboard options</a> - add PHP code snippets, RSS feeds and more to your dashboard<br />
<a href="http://blog.taragana.com/index.php/archive/wordpress-15-plugin-strip-nofollow-tag-from-comment-urls/">follow</a> - removes the rel=nofollow links from comments<br />
<a href="http://mnm.uib.es/gallir/wp-cache-2/">wp-cache 2.0</a> - cache pages to speed up loading<br />
page navigation - adds page spanning 1,2,3&#8230; to WP pages<br />
<a href="http://somethingunpredictable.com/wp-dash/">WP-Dash</a> - replace the default admin area</p>
<p>10. Clean up the default Links area, adding/removing any default links.<br />
11. Delete the test post and make a first test placeholder post. Something like &#8220;Hello World&#8221; but by this new user.<br />
12. Choose a template or design your own. Starting with the default template might be helpful. There are detailed instructions at the WP codex for how to make custom WP templates.<br />
13. Start posting!</p>
<p>This post will be updated over time as I&#8217;m using this for my own reference too, so might want to bookmark this one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051102/56/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to add Yahoo MyWeb to Wordpress, Blogger and other weblog systems</title>
		<link>http://www.php-scripts.com/20051028/54/</link>
		<comments>http://www.php-scripts.com/20051028/54/#comments</comments>
		<pubDate>Fri, 28 Oct 2005 15:46:47 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=54</guid>
		<description><![CDATA[Last night I added the Yahoo MyWeb button to the end of each post. The screenshot shows where you can find it (next to the &#8220;Listen to this post&#8221; link). Clicking this button lets users tag and save posts they find useful to their Yahoo MyWeb space. Don&#8217;t like how we categorized something? That&#8217;s fine, [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I added the Yahoo MyWeb button to the end of each post. The screenshot shows where you can find it (next to the &#8220;Listen to this post&#8221; link). Clicking this button lets users tag and save posts they find useful to their <a href="http://myweb.yahoo.com/">Yahoo MyWeb</a> space. Don&#8217;t like how we categorized something? That&#8217;s fine, you can tag it however you want in your space and search it in the future through your MyWeb space.</p>
<p>I&#8217;ve been asked a few times how I added this to each post so I thought I&#8217;d whip up the instructions for the different blog engines we are currently using. Those instructions are below and I also add information on some other blogging clients. This post will be updated as I add more instructions for other blogging clients or links to others who have shared the instructions.</p>
<p><img src="http://www.php-scripts.com/images/wordpress.gif" border="0" ALT="Wordpress blog system - open source"/><br />
<b>Wordpress</b><br />
1. In the WP admin area, navigate to the &#8220;Presentation&#8221; tab.<br />
2. Choose &#8220;Theme Editor&#8221;<br />
3. Choose &#8220;Post Template&#8221;<br />
4. Find the feedback section of the code that looks like this:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php comments_popup_link<span class="br0">&#40;</span>__<span class="br0">&#40;</span><span class="st0">&#8216;Comments (0)&#8217;</span><span class="br0">&#41;</span>, __<span class="br0">&#40;</span><span class="st0">&#8216;Comments (1)&#8217;</span><span class="br0">&#41;</span>, __<span class="br0">&#40;</span><span class="st0">&#8216;Comments (%)&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
</div>
<p>and add the following <a name="mywebcode">MyWeb JavaScript code</a> directly after this:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;script language=<span class="st0">&#8220;javascript&#8221;</span> src=<span class="st0">&#8220;http://sm.feeds.yahoo.com/Buttons/V1.0/yactions.js&#8221;</span>&gt;&lt;/script&gt;<br />
&lt;script language=<span class="st0">&#8220;javascript&#8221;</span>&gt;<br />
yactions.<span class="me1">buildButton</span><span class="br0">&#40;</span> <span class="st0">&#8217;save&#8217;</span>, <span class="st0">&#8216;My_Web&#8217;</span> <span class="br0">&#41;</span>;<br />
&lt;/script&gt;</div>
</div>
<p>5. Click &#8220;Update file&#8221; and the MyWeb button should now appear on every post.</p>
<p><img src="http://www.php-scripts.com/images/blogger.gif" border="0" ALT="Blogger blog system - host it yourself, or they will host through Blogspot for free"/><br />
<b>Blogger</b><br />
1. Login to your blogger account.<br />
2. Choose the &#8220;Template&#8221; tab.<br />
3. Find the post-body code that looks like this:</p>
<p>&lt;Item Page&gt;</p>
<p>and immediately after this code, add the <a href="#mywebcode">MyWeb button code</a>. </p>
<p>4. Choose to &#8220;Save Template Changes&#8221;<br />
5. Republish your entire blog so all posts are updated with the button.<br />
6. <a href="http://gmailtalk.blogspot.com/2005/10/extreme-tech-gmail-tips.html#comments">See example here</a></p>
<p><img src="http://www.php-scripts.com/images/pivot.gif" border="0" ALT="Pivot blog system - open source"/><br />
<b>Pivot</b><br />
1.  Login to the admin area.<br />
2. Click the &#8220;Administration&#8221; link.<br />
3. Click the &#8220;Templates&#8221; link.<br />
4. Choose the on the entry_standard.html template or the template you used for the main posting area.<br />
5. Find the following code:</p>
<div class="codesnip-container" >
<div class="codesnip">[[introduction]] [[body]] [[message]] [[comments]] [[commentform]]</div>
</div>
<p>and immediately BEFORE the [[comments]] tag, add the <a href="#mywebcode">MyWeb button code</a>. In <a href="http://www.tdcasino.com/pivotblg2/entry.php?id=89">my Pivot blog example</a> I wrapped the code in p align right so the button would show up along the right side at the bottom of each post like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="br0">&#91;</span><span class="br0">&#91;</span>introduction<span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>body<span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>message<span class="br0">&#93;</span><span class="br0">&#93;</span><br />
&lt;p align=<span class="st0">&#8220;right&#8221;</span>&gt;<br />
&lt;script language=<span class="st0">&#8220;javascript&#8221;</span> src=<span class="st0">&#8220;http://sm.feeds.yahoo.com/Buttons/V1.0/yactions.js&#8221;</span>&gt;&lt;/script&gt;<br />
&lt;script language=<span class="st0">&#8220;javascript&#8221;</span>&gt;<br />
yactions.<span class="me1">buildButton</span><span class="br0">&#40;</span> <span class="st0">&#8217;save&#8217;</span>, <span class="st0">&#8216;My_Web&#8217;</span> <span class="br0">&#41;</span>;<br />
&lt;/script&gt;<br />
&lt;/p&gt;<br />
<span class="br0">&#91;</span><span class="br0">&#91;</span>comments<span class="br0">&#93;</span><span class="br0">&#93;</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>commentform<span class="br0">&#93;</span><span class="br0">&#93;</span></div>
</div>
<p>6. Save changes.<br />
7. Rebuild All Files by clicking on the &#8220;Maintainence&#8221; link and then choosing &#8220;Rebuild All Files&#8221;</p>
<p><img src="http://www.php-scripts.com/images/typepad.gif" border="0" ALT="TypePad blog system - third party pay blog hosting"/><br />
<b>TypePad</b><br />
Researching/recording how this can be done. If you know how to do this using this system, please post in the comments area so this can be updated. </p>
<p><img src="http://www.php-scripts.com/images/movabletype.gif" border="0" ALT="MovableType blog system - commercial blog program, you host"/><br />
<b>MovableType</b><br />
Researching/recording how this can be done, if it can be done. If you know how to add this using this system, please post in the comments area so this can be updated. </p>
<p><img src="http://www.php-scripts.com/images/radiouserland.gif" border="0" ALT="Radio Userland blog system - commercial blog program"/><br />
<b>Radio Userland</b><br />
Researching/recording how this can be done. If you know how to add this using this system, please post in the comments area so this can be updated. </p>
<h3><font color="red">No JavaScript Allowed</font></h3>
<p>Some blog systems, mostly third party free hosted blogs, do not allow any JavaScript inserted into their templates. Some don&#8217;t even allow any template customization, so most likely there is no way without some special hack to add the Yahoo MyWeb, or any other type of JavaScript. The reason they do this is to avoid subjecting their users to malicious code, but unfortunately this also cripples a lot of useful code. These free third party blog systems include:</p>
<p><img src="http://www.php-scripts.com/images/yahoo360.gif" border="0" ALT="Yahoo360 blog system - third party free blog hosting"/><br />
<b>Yahoo 360</b><br />
I&#8217;ve added a <a href="http://www.ysearchblog.com/archives/000206.html">comment on the Yahoo blog</a> asking them to please add this as a function. Seems like it should be a given for their own blog system, yes? If you know some other way to do this, then please use the comments/trackback and share.</p>
<p><img src="http://www.php-scripts.com/images/opera.gif" border="0" ALT="Opera blog system - third party free blog hosting"/><br />
<b>Opera</b><br />
Know how to do this? Please use the comments/trackback and share.</p>
<p><img src="http://www.php-scripts.com/images/msnspaces.gif" border="0" ALT="MSN Spaces blog system - third party free blog hosting"/><br />
<b>MSN Spaces</b><br />
Know how to do this? Please use the comments/trackback and share.</p>
<p><img src="http://www.php-scripts.com/images/aoljournals.gif" border="0" ALT="AOL Journals blog system - third party free blog hosting"/><br />
<b>AOL Journals</b><br />
Know how to do this? Please use the comments/trackback and share.</p>
<h3>Your blog system not listed?</h3>
<p>There are 100+ different blog systems out there at least, so to receive instructions for your blog system you have two choices: </p>
<p>1) provide me with a test account so I can work out how to do it, and/or<br />
2) provide the instructions in the comments or via trackback.</p>
<p>I always enjoy checking out new blog systems, especially if they are written in PHP. Happy coding to you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051028/54/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Markdown Extra</title>
		<link>http://www.php-scripts.com/20051020/48/</link>
		<comments>http://www.php-scripts.com/20051020/48/#comments</comments>
		<pubDate>Thu, 20 Oct 2005 18:40:57 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Reviews]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[Installation and configuration]]></category>

		<category><![CDATA[Free Scripts]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=48</guid>
		<description><![CDATA[Script/website: michelf.com/projects/php-markdown/
Requirements: PHP
Installation time: Varies. Wordpress plugin installation takes less than a minute
Difficulty: Easy
License: Free, BSD-style open source
Download: PHP source in zip
API: N/A
Author Description: &#8220;The Markdown syntax allows you to write text naturally and format it without using HTML tags. More importantly: in Markdown format, your text stays enjoyable to read for a human being, [...]]]></description>
			<content:encoded><![CDATA[<p><b>Script/website</b>: <a href="http://michelf.com/projects/php-markdown/">michelf.com/projects/php-markdown/</a><br />
<b>Requirements</b>: PHP<br />
<b>Installation time</b>: Varies. Wordpress plugin installation takes less than a minute<br />
<b>Difficulty</b>: Easy<br />
<b>License</b>: Free, BSD-style open source<br />
<b>Download</b>: PHP source in zip<br />
<b>API</b>: N/A<br />
<b>Author Description</b>: &#8220;The Markdown syntax allows you to write text naturally and format it without using HTML tags. More importantly: in Markdown format, your text stays enjoyable to read for a human being, and this is true enough that it makes a Markdown document publishable as-is, as plain text. If you are using text-formatted email, you already know some part of the syntax.&#8221;</p>
<p><img src="http://www.php-scripts.com/images/2005/phpmarkdown1.jpg" border="0" ALT="screenshot of using PHP Markdown through Dingus demo preview"/></p>
<p>Based on <a href="http://daringfireball.net/projects/markdown">John Gruber&#8217;s Markdown</a> (Perl), PHP Markdown can be used a Wordpress plugin by copying over the markdown.php file from the zip file to the wp-content/plugins directory. There is an <a href="http://michelf.com/projects/php-markdown/dingus/">official demo called Dingus here</a>. The screenshot above shows my example of using PHP Markdown syntax through Dingus.</p>
<p>The function Markdown($text) inside markdown.php is passed a text string and returns the marked down version, so incorporating this into another program where you want to markdownify the text is pretty straightforward, although the file is a bit on the bulky side at 55k. Would be more convenient if a version without Wordpress and bBlog code inside it were provided in the zip package.  The most recent version as of this writing was September 5, 2005.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051020/48/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading the built-in WP search</title>
		<link>http://www.php-scripts.com/20051011/35/</link>
		<comments>http://www.php-scripts.com/20051011/35/#comments</comments>
		<pubDate>Wed, 12 Oct 2005 02:07:32 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[Installation and configuration]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=35</guid>
		<description><![CDATA[Producing search results from a Wordpress-powered blog that look like something a traditional search engine would produce is not as difficult as it might seem, thanks to a comprehensive plugin and template design. While making some changes, you can also try using a different search results algorithm than the default one. 
The Search Reloaded Wordpress [...]]]></description>
			<content:encoded><![CDATA[<p>Producing search results from a Wordpress-powered blog that look like something a traditional search engine would produce is not as difficult as it might seem, thanks to a comprehensive plugin and template design. While making some changes, you can also try using a different search results algorithm than the default one. </p>
<p>The <a href="http://www.semiologic.com/projects/search-reloaded/">Search Reloaded Wordpress Plugin</a> by Denis at semiologic seeks to improve upon the built-in WP search.</p>
<p><img src="http://www.php-scripts.com/images/2005/search-reloaded1.jpg" border="0" ALT="search reloaded plugin plus page navigation screenshot"/></p>
<p>To use just download, unzip, and FTP to the wp-content/plugins directory. Then go into the admin area and activate the plugin.</p>
<p>If you want to adjust the look of the search results you&#8217;ll need to edit:</p>
<div class="codesnip-container" >function sem_search_results()</div>
<p>This function is at the end of the included sem-search-reloaded.php file and contains code that looks very similar to what is in the default template search.php file.</p>
<p>In the example pictured above, we also used a slightly modified version of GaMerZ <a href="http://www.lesterchan.net/portfolio/programming.php">Page Navigation plugin</a>. This plugin is useful for spanning page, category and search results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051011/35/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Editing and customizing error messages in Wordpress: wp-db.php</title>
		<link>http://www.php-scripts.com/20050926/27/</link>
		<comments>http://www.php-scripts.com/20050926/27/#comments</comments>
		<pubDate>Mon, 26 Sep 2005 22:06:21 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=27</guid>
		<description><![CDATA[Wordpress has a cool plugin system that allows for various template changes. Sometimes, though, some defaults are planted in the program that require hacking the code to remove. By creating your own 404.php template and storing in the template are you can have it match the design of the rest of your blog, but what [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress has a cool plugin system that allows for various template changes. Sometimes, though, some defaults are planted in the program that require hacking the code to remove. By creating your own <a href="http://codex.wordpress.org/Creating_an_Error_404_Page">404.php template</a> and storing in the template are you can have it match the design of the rest of your blog, but what about if there is a database error?</p>
<p>These messages seem (?) to require the direct editing of wp-db.php and in particular the following functions inside that Wordpress script file:</p>
<div class="codesnip-container" >
<div class="codesnip">function wpdb($dbuser,$dbpassword,$dbname,$dbhost)<br />
function select($db)<br />
function bail($message)</div>
</div>
<p>The top/bottom header and CSS portion is handled in the bail() function. The wpdb() function handles whether a connection can be made to the server or not and the select() function determines if it is possible to connect to the database table.</p>
<p>If there is a plugin filter which allows direct hacking of wp-db.php please use the comments or trackback to tell me about it. I looked through the codex at the various filters but didn&#8217;t see one that handled this part of Wordpress. This information was accurate as of version 1.5.2, future versions might make these database error messages allow user-defined templating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050926/27/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fixing the start PHP spacing bug in Code Snippet v1.4 WP plugin</title>
		<link>http://www.php-scripts.com/20050915/16/</link>
		<comments>http://www.php-scripts.com/20050915/16/#comments</comments>
		<pubDate>Thu, 15 Sep 2005 20:34:39 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=16</guid>
		<description><![CDATA[Noticed yesterday that the WP PHP code snippet plugin we&#8217;re using (thanks Lestat, for pointing to it)  is adding an erroneous space between the < and ?. Those who are using this plugin v1.4 and readers should beware that the code examples with the start PHP tag may have an erroneous space being added [...]]]></description>
			<content:encoded><![CDATA[<p>Noticed yesterday that the WP <a href="http://blog.enargi.com/codesnippet/">PHP code snippet plugin</a> we&#8217;re using (thanks Lestat, for <a href="http://www.beginnercode.com/index.php/2005/08/26/code-snippet-plugin/">pointing to it</a>)  is adding an erroneous space between the < and ?. Those who are using this plugin v1.4 and readers should beware that the code examples with the start PHP tag may have an erroneous space being added to them.</p>
<p>Hard to find bugs like this, so it's worthwhile discussing this one here. I decided today to look through the code and see if I could fix this one really quick. Turns out that I could, see this test:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span><br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8216;this is just a test&#8217;</span>; <span class="co1">// just a test comment</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>Ahh yes, good. To fix this in your Code Snippet plugin version 1.4 do the following. </p>
<p><b>STEP 1.</b> Backup your existing copy of codesnippet.php. If something goes wrong in your modification then you just need to reFTP the original copy. Otherwise you have to try and undo your changes. That&#8217;s rarely fun.</p>
<p><b>STEP 2.</b> Open codesnippet.php in your favorite text editor.</p>
<p><b>STEP 3.</b> Around line 288, inside the performHighlight() function, find the line of code that looks like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">addContainer</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span>;</div>
</div>
<p><b>STEP 4.</b> Change the above code to read:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$result</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&#8220;&amp;lt; ?php&#8221;</span>, <span class="st0">&#8220;&amp;lt;?php&#8221;</span>,<span class="re0">$result</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">addContainer</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span>;</div>
</div>
<p><b>STEP 5.</b> FTP in ASCII mode over the top of your existing codesnippet.php plugin to activate the changes.</p>
<p>I have emailed the author of the Code Snippet plugin, Roman Roan, about this issue. Hopefully version 1.5 will make this change that will deal with this PHP start tag issue.</p>
<p><b>Update 1:58pm PST:</b> After posting this it occured to me that there is another annoying bug of sorts. The code is being changed to Word-style quoting which will error out the parsing as well. Make sure you don&#8217;t copy/paste the code exactly when there are double quotes (the symbol next to the enter key) in the PHP code which is not the same as Word-style double quotes. If you are getting weird parsing errors, this is likely the problem, so just type the double quotes out, don&#8217;t copy/paste them.</p>
<p><b>Update 9/19/05 10:06am PDT:</b> As noted in the comment area by the plugin author, Roman has <a href="http://blog.enargi.com/blogging/codesnippet-wordpress-plugin-verison-15/">fixed the spacing issue in the plugin version 1.5</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050915/16/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Showing most recent blog posts on non-Wordpress pages</title>
		<link>http://www.php-scripts.com/20050907/3/</link>
		<comments>http://www.php-scripts.com/20050907/3/#comments</comments>
		<pubDate>Wed, 07 Sep 2005 15:23:08 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=3</guid>
		<description><![CDATA[
Wordpress makes it easy to create a loop of recent posts to put on other PHP-enabled, non-Wordpress pages. For example, on the home page of this website (pictured above), I wanted to include the most recent post titles and related category links from this new blog. As new posts are added, they will flow to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.php-scripts.com/images/2005/phpblog-integrate1.jpg" ALT="php-scripts.com integrating phpblog within non-Wordpress page screenshot" border="0"/></p>
<p>Wordpress makes it easy to create a loop of recent posts to put on other PHP-enabled, non-Wordpress pages. For example, on the <a href="http://www.php-scripts.com/">home page</a> of this website (pictured above), I wanted to include the most recent post titles and related category links from this new blog. As new posts are added, they will flow to the top and the old will push to the bottom and then off the page. Also, I wanted to have the date/time to show site visitors how often new content is being added (I was becoming pretty tardy with my diary entries). To do what&#8217;s shown in the screenshot above with the red arrows pointing I used the following PHP code:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php <br />
<span class="kw1">require</span><span class="br0">&#40;</span><span class="st0">&#8216;./wp-blog-header.php&#8217;</span><span class="br0">&#41;</span>; <span class="co1">// alter to path to wp-blog-header.php script on your site</span><br />
<span class="kw2">?&gt;</span><br />
&lt;!&#8211; <span class="kw1">if</span> you want to have a title graphic it goes here &#8211;&gt;</p>
<p>&lt;?php <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$posts</span><span class="br0">&#41;</span> : <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$posts</span> <span class="kw1">as</span> <span class="re0">$post</span><span class="br0">&#41;</span> : start_wp<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co2"># &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: &lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;small&gt; in &lt;?php the_category(&#8217;, &#8216;) ?&gt; &amp;nbsp;&lt;/small&gt;&lt;small&gt;&lt;?php the_time(&#8217;m-d-Y&#8217;); ?&gt; &lt;?php the_time(&#8217;g:i a&#8217;); ?&gt;&lt;/small&gt;&lt;br /&gt;</span></p>
<p>&lt;?php endforeach; <span class="kw1">else</span>: <span class="kw2">?&gt;</span><br />
&lt;!&#8211; put what you want here when there are no posts &#8211;&gt;<br />
&lt;?php <span class="kw1">endif</span>; <span class="kw2">?&gt;</span></div>
</div>
<p>Copy and paste that and easily add your recent posts to your non-Wordpress page, <i>slick!</i></p>
<p><span class="technoratitag">tags: <a href="http://www.technorati.com/tags/wordpress" rel="tag">Wordpress</a>, <a href="http://www.technorati.com/tags/blog+integration" rel="tag">blog integration</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050907/3/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

