<?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>Ryan Pharis &#187; Web Development</title>
	<atom:link href="http://ryanpharis.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://ryanpharis.com</link>
	<description>Dallas Forth Worth Metroplex, Texas Freelance PHP CodeIgniter Web Developer &#38; WordPress as a CMS Consultant</description>
	<lastBuildDate>Mon, 15 Mar 2010 17:29:50 +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>Weird and Strange Characters After Parsing RSS Feeds?</title>
		<link>http://ryanpharis.com/2010/03/weird-and-strange-characters-after-parsing-rss-feeds/</link>
		<comments>http://ryanpharis.com/2010/03/weird-and-strange-characters-after-parsing-rss-feeds/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 17:29:50 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://ryanpharis.com/?p=103</guid>
		<description><![CDATA[I ran into the &#8220;weird characters&#8221; problem when I used PHP (specifically the SimplePie script) to parse an rss feed and output the results to a page. These characters can be apostrophes and quotes among others. If you need to fix the problem, it&#8217;s pretty easy to do. Change the charset at the top of [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into the &#8220;weird characters&#8221; problem when I used PHP (specifically the <a href="http://simplepie.org/">SimplePie</a> script) to parse an rss feed and output the results to a page.</p>
<p>These characters can be apostrophes and quotes among others.</p>
<p>If you need to fix the problem, it&#8217;s pretty easy to do. Change the charset at the top of your page to match the output of the rss parser results. Or vice versa and it should work. To see more of an explanation and how to do that visit <a title="Weird Characters in RSS Feeds Parsing" href="http://simplepie.org/wiki/faq/i_m_seeing_weird_characters">SimplePie&#8217;s docs</a> regarding the matter.</p>
<p>In my case, I set the encoding of my results page to UTF-8, (which is what SimplePie uses) and that fixed it. Now the weird characters are gone and I&#8217;m left with regular looking apostrophes.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanpharis.com/2010/03/weird-and-strange-characters-after-parsing-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Set Up a Local PHP Web Development Environment</title>
		<link>http://ryanpharis.com/2009/11/set-up-a-local-php-web-development-environment/</link>
		<comments>http://ryanpharis.com/2009/11/set-up-a-local-php-web-development-environment/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 22:14:44 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://ryanpharis.com/?p=82</guid>
		<description><![CDATA[Set up a local development environment and access your projects as their own domain name like http://myproject.dev instead of subdirectories. I'll show you how using Ubuntu and Apache VirtualHosts.]]></description>
			<content:encoded><![CDATA[<p>I came to the realization that it would probably be best to do all of my heavy testing and development on a Ubuntu server locally. I use <a title="VirtualBox for Mac OS X" href="http://www.virtualbox.org/">VirtualBox</a> with Mac OS X as my host and installed Ubuntu 9.10 as a guest. This allows me to use Synaptic Package Manger to install Zend Server which has everything I need to start testing. This is by far the easiest way I have used to set up a local server. Having done that on Windows and Mac, I love the way Synaptic Package Manager handles everything. My only problem came when I needed to have multiple projects going on and wanted a nice way to access them on localhost without using subdirectories.</p>
<p>After a bit of searching, I found <a href="http://stackoverflow.com/questions/1117557/php-local-development-apache-www-directory-permissions">this thread</a> and it helped me set up a nice little dev environment. For PHP programmers who are using subdirectories (like I used to), I would recommend using this approach on Ubuntu, because it&#8217;s just so easy and very clean. It uses Apache VirtualHosts to access your projects like http://myproject.dev instead of having it in a subdirectory like http://localhost/myproject. This post will also serve as my reference guide for when I need to set up more projects.</p>
<p>This is specifically for setting up a new Zend Framework project on Ubuntu running the Zend Server stack (Apache, MySQL, PHP 5.3, etc.), but could be used for any PHP application or script. One thing to note is that I place all my projects in /home/ryan/web/php. If you have a different place, be sure to change the path where needed.</p>
<p>1. Create an empty file named &#8220;projectname&#8221; in /home/yourusername/web/sites-enabled and add:</p>
<pre>&lt;VirtualHost *:80&gt;
ServerName projectname.dev
DocumentRoot /home/yourusername/web/php/projectname/public
&lt;/VirtualHost&gt;</pre>
<p>2. Create a symlink to sites-enabled (this step only needs to be done one time, once this directory symlink is established, it will always work):</p>
<p><strong>sudo ln -s /home/yourusername/web/sites-enabled /etc/apache2/sites-enabled</strong></p>
<p>3. Edit your hosts file, <strong>sudo gedit /etc/hosts</strong>, and add another host to the end:</p>
<p><strong>127.0.0.1 projectname.dev</strong></p>
<p>4. Restart apache: <strong>sudo /etc/init.d/apache2 restart</strong></p>
<p>5. Test: http://projectname.dev</p>
<p>So there you have it. While it does take a <em>little</em> longer to set up than a regular subdirectory, (I just tested this out, and took literally 1 minute), it&#8217;s definitely worth the extra effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanpharis.com/2009/11/set-up-a-local-php-web-development-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax for WordPress Plugins Using jQuery Tutorial</title>
		<link>http://ryanpharis.com/2008/10/ajax-for-wordpress-plugins-using-jquery/</link>
		<comments>http://ryanpharis.com/2008/10/ajax-for-wordpress-plugins-using-jquery/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 01:30:22 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://ryanpharis.com/?p=33</guid>
		<description><![CDATA[I recently had the need to perform some ajax functions on the backend of Texas Tech Today and wasn&#8217;t sure exactly how to go about it. So after a search, I found this great explanation: Simplified AJAX For WordPress Plugin Developers using Jquery. But it stops short of explaining how to receive some data from [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to perform some ajax functions on the backend of <a title="Texas Tech Today" href="http://today.ttu.edu" target="_blank">Texas Tech Today</a> and wasn&#8217;t sure exactly how to go about it. So after a search, I found this great explanation: <a title="Simplified AJAX For WordPress Plugin Developers using Jquery" href="http://amiworks.co.in/talk/simplified-ajax-for-wordpress-plugin-developers-using-jquery" target="_blank">Simplified AJAX For WordPress Plugin Developers using Jquery</a>. But it stops short of explaining how to receive some data from a POST, give it to PHP to do something with, and then return a result back to the form.</p>
<p>So, I thought I would detail how to do that in WordPress in a plugin.</p>
<p>The plugin just has a basic options page (Settings -&gt; Ajax4WP) and lets you save an option to the database via ajax. Go ahead and <a title="Ajax for WordPress plugins" href="http://ryanpharis.com/wp-content/uploads/2008/10/ajax4wp.zip">download</a> and install it; you&#8217;ll see how simple it is.</p>
<p><strong>1. Create a php file that will have our javascript code, and save it into your plugins folder.</strong></p>
<p>The reason we need our javascript code to be in a PHP file is to get the &#8220;get_option(&#8216;siteurl&#8217;)&#8221; value dynamically, since we&#8217;ll need that to reference our PHP file with the ajax function.</p>
<p>js-Ajax4WP.php (<a title="Ajax for WordPress plugins" href="http://ryanpharis.com/wp-content/uploads/2008/10/ajax4wp.zip">download</a> the plugin files)</p>
<pre>&lt;?php
include('../../../wp-config.php');
$site_url = get_option('siteurl');
?&gt;
jQuery(document).ready(function() {

   //when the link with the id of save_settings is clicked, get the value of the text field and start doing the ajax stuff
   jQuery('#save_settings').click(function() {

      var Ajax4WP_test_setting = jQuery("#Ajax4WP_test_setting").val();

      //action is the name of the php function in your main plugin file
      jQuery.post("&lt;?php echo $site_url; ?&gt;/wp-admin/admin-ajax.php", {action:"Ajax4WP_save_settings", 'cookie': encodeURIComponent(document.cookie), Ajax4WP_test_setting:Ajax4WP_test_setting},
      function(res)
      {
         var message_result = eval('(' + res + ')');
         if (!message_result.success) {
            jQuery("#Ajax4WP_test_setting").css("border","2px solid #cc0000");
         }
         alert(message_result.message + ' ' + message_result.setting);
      });

      return false;
   });

});</pre>
<p>This is jQuery ajax code that takes the value of a text field and passes it to Ajax4WP_save_settings() in our plugin file. We use <a title="jQuery.post" href="http://docs.jquery.com/Ajax/jQuery.post" target="_blank">jQuery.post</a> to define a post variable (Ajax4WP_test_setting) that PHP can use.</p>
<p>Once the plugin code does its thing on the server (step 2 below), it returns the result back to this function at &#8220;function(res)&#8221;. Then we eval the json result and use an alert to display a message.</p>
<p><strong>2. Create your standard plugin file and put in the Ajax4WP_save_settings function.</strong></p>
<p>Ajax4WP.php (<a title="Ajax for WordPress plugins" href="http://ryanpharis.com/wp-content/uploads/2008/10/ajax4wp.zip">download</a> the plugin files)</p>
<pre>...

// our ajax action:
add_action('wp_ajax_Ajax4WP_save_settings', array(&amp;$this, 'Ajax4WP_save_settings'), 10);

function Ajax4WP_save_settings()
		{
		   $name = 'Ajax4WP_test_setting';
			$value = $_POST['Ajax4WP_test_setting'];

			if ($value == "") {
				$message_result = array(
					'setting' =&gt; "",
					'message' =&gt; 'Please enter a Setting Value!',
					'success' =&gt; FALSE
	         );
			}
			else {
			   update_option($name, $value);
				$message_result = array(
					'setting' =&gt; $value,
					'message' =&gt; 'Saved! You entered:',
				   'success' =&gt; TRUE
	         );
			}
			echo json_encode($message_result);
			exit;
		}
...</pre>
<p>This is standard PHP to process a POST request. When we&#8217;re through, we echo the <a title="json_encode - php 5.2 only" href="http://us.php.net/manual/en/function.json-encode.php" target="_blank">json_encode()</a> result. NOTE: json_encode is a PHP &gt;= 5.2 only function, so be sure you are up to date on your PHP install.</p>
<p><strong>3. Make a php file that will contain basic html and will get included on our settings page</strong></p>
<p>Ajax4WP-settings.php (<a title="Ajax for WordPress plugins" href="http://ryanpharis.com/wp-content/uploads/2008/10/ajax4wp.zip">download</a> the plugin files)</p>
<pre>&lt;div id="Ajax4WP Settings" class="inside" style="margin-left: 29px; width: 200px;"&gt;

   &lt;h3&gt;Ajax4WP Settings&lt;/h3&gt;

   &lt;div id="loading_message"&gt;&lt;/div&gt;

   &lt;p&gt;
   &lt;label for="Ajax4WP_test_setting"&gt;Setting Value:&lt;/label&gt;
   &lt;br /&gt;
   &lt;input type="text" id="Ajax4WP_test_setting" name="Ajax4WP_test_setting" value="&lt;?php if (isset($this-&gt;Ajax4WP_test_setting)) { echo $this-&gt;Ajax4WP_test_setting; } ?&gt;" size="20" /&gt;
   &lt;/p&gt;

   &lt;p&gt;&lt;a href="#" id="save_settings" class="button button-highlighted"&gt;Save Settings&lt;/a&gt;&lt;/p&gt;

&lt;/div&gt;</pre>
<p>This is just a &#8220;stub&#8221; and gets included in our plugin. That way we don&#8217;t have a lot of html code mucking up the main plugin file. You can see what&#8217;s going on better in the source code when you <a title="How to use Ajax in your WordPress plugins" href="http://ryanpharis.com/wp-content/uploads/2008/10/ajax4wp.zip">download the files</a>.</p>
<p>I hope that helps you out if you are wondering how to use jQuery and ajax in your WordPress plugins. Please leave a comment if you have any questions. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanpharis.com/2008/10/ajax-for-wordpress-plugins-using-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>New Project: PassOrCatch2008.com &#8211; Crabtree and Harrell</title>
		<link>http://ryanpharis.com/2008/09/new-project-passorcatch2008com-crabtree-and-harrell/</link>
		<comments>http://ryanpharis.com/2008/09/new-project-passorcatch2008com-crabtree-and-harrell/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 00:10:31 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://ryanpharis.com/?p=22</guid>
		<description><![CDATA[We just launched my favorite project I&#8217;ve worked on so far, for obvious reasons for any of you that know me This new site is http://www.passorcatch2008.com and it&#8217;s a showcase for two of Texas Tech&#8217;s top players: quarterback Graham Harrell and wide receiver Michael Crabtree. If we can keep winning and finish off a great [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left; margin-right: 10px;"><a title="PassOrCatch2008.com" href="http://passorcatch2008.com"><img title="passorcatch2008.com" src="http://ryanpharis.com/wp-content/uploads/2008/09/passorcatch2008.jpg" alt="" width="300" height="203" /></a></div>
<p>We just launched my favorite project I&#8217;ve worked on so far, for obvious reasons for any of you that know me <img src='http://ryanpharis.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This new site is <a href="http://www.passorcatch2008.com">http://www.passorcatch2008.com</a> and it&#8217;s a showcase for two of Texas Tech&#8217;s top players: quarterback Graham Harrell and wide receiver Michael Crabtree. If we can keep winning and finish off a great season, both have a shot at the Heisman at the end of the year.</p>
<p>The site features a great design developed by our athletics department. They also shot some fun videos and gave us some nice photos to put up in the gallery.</p>
<p>My job was to take the design and mock it up in photoshop. I then did the html and css conversion. I also added the photo gallery using the <a title="jquery lightbox plugin" href="http://leandrovieira.com/projects/jquery/lightbox/">jQuery-lightbox plugin</a>.</p>
<p>I received the videos in .avi format so I converted them to .flv format and used the <a title="JW FLV Player" href="http://www.jeroenwijering.com/?item=JW_FLV_Player">JW FLV Player</a> to play them in flash.</p>
<p>The excellent content work and design was done by our web writer, <a title="Lisa Low" href="http://www.depts.ttu.edu/communications/staff/lisa-low.php">Lisa Low</a>.</p>
<p>It was a fun site and I&#8217;m very happy with the way it turned out. I hope Texas Tech fans everywhere enjoy it and spread the word.</p>
<p>GO TECH!</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanpharis.com/2008/09/new-project-passorcatch2008com-crabtree-and-harrell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Texas Tech Today 2.0 is LIVE!</title>
		<link>http://ryanpharis.com/2008/07/texas-tech-today-20-is-live/</link>
		<comments>http://ryanpharis.com/2008/07/texas-tech-today-20-is-live/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 23:29:00 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://ryanpharis.com/?p=6</guid>
		<description><![CDATA[Whew! A few hard months of planning and preparation have come to a culmination with the launch of the new Texas Tech Today. TTT is our news and information site that holds all of our news releases, clips, stories, and videos. It all runs on WordPress with the help of some custom plugins and templates. [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left; margin-right: 10px;"><a title="Texas Tech Today" href="http://today.ttu.edu" target="_blank"><img src="http://ryanpharis.com/wp-content/uploads/2008/07/ttt-screenshot.png" alt="Texas Tech Today Screenshot" width="300" height="458" /></a></div>
<p>Whew! A few hard months of planning and preparation have come to a culmination with the launch of the new <a title="Texas Tech Today" href="http://today.ttu.edu" target="_blank">Texas Tech Today</a>. TTT is our news and information site that holds all of our news releases, clips, stories, and videos. It all runs on WordPress with the help of some custom plugins and templates. This isn&#8217;t a typical blog site, and the extendability of WordPress allowed me to do some really cool things and use it as a CMS that will fit our needs very well. This is a credit to the developers of wp, and the fact that they have made it such a nice platform to work with.</p>
<p>This new version will make the posting of stories faster and more efficient. That way, our content developers can focus on producing more and more quality content that our audience will find valuable and want to share.</p>
<p>The old way of posting stories to our site was through dreamweaver and was completely file based, with no help from a cms of any sort. This worked ok for a while, but we realized there had to be a better way to manage our content. Since our stories are somewhat &#8220;templatable&#8221;, meaning they can have a standard sidebar and other options, I set out to find a way to make it dead easy to post a story without using dreamweaver. Enter wordpress and the ability to code plugins that do pretty much whatever you can think of, and we were set.</p>
<p>We used to have our stories and videos on one server and clips and news releases on another. The news releases and clips were pushed out with a custom mini-cms I built in CodeIgniter. The new way allows us to have everything in one place and the built-in rss feeds for every category make it easy to send out our feeds for each type of post.</p>
<p>Moving to WordPress will hopefully get us a little better search engine placement and maybe some chatter in the blogosphere. Wp-stats is amazing, but we&#8217;ve also got google analytics running so we can have a comprehensive view of our visitors and their interests in our content to serve them better.</p>
<p>My hope is that this can be a showcase of the power that wordpress has and that we can lead the way for other universities to use this wonderful software.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanpharis.com/2008/07/texas-tech-today-20-is-live/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
