<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Techrangers</title>
	
	<link>http://techrangers.cdl.ucf.edu</link>
	<description />
	<lastBuildDate>Tue, 24 Jan 2012 22:29:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/techrangersucf" /><feedburner:info uri="techrangersucf" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Matthew Emond</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/wAEVhNP4FNM/</link>
		<comments>http://techrangers.cdl.ucf.edu/biographies/matthew-emond/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 17:33:24 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
		
		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?page_id=1348</guid>
		<description><![CDATA[Birthday: May 25th, 1993 Degree: Computer Science Expertise: (X)HTML CSS C Photoshop Learning: PHP MySQL JavaScript Biography: Hi, I&#8217;m Matt Emond and I&#8217;m the newest addition to the Techranger Team! I am currently a first-year student at UCF majoring in Computer Science and am also an active member of the UCF Robotics Club. Currently I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Birthday:</strong></p>
<p>May 25th, 1993</p>
<p><strong>Degree:</strong></p>
<p>Computer Science</p>
<p><strong>Expertise:</strong></p>
<ul>
<li>(X)HTML</li>
<li>CSS</li>
<li>C</li>
<li>Photoshop</li>
</ul>
<p>
<strong>Learning:</strong></p>
<ul>
<li>PHP</li>
<li>MySQL</li>
<li>JavaScript</li>
</ul>
<p>
<strong>Biography:</strong></p>
<p>Hi, I&#8217;m Matt Emond and I&#8217;m the newest addition to the Techranger Team! I am currently a first-year student at UCF majoring in Computer Science and am also an active member of the UCF Robotics Club. Currently I am most familiar with (X)HTML and CSS, and a fair bit of C from my programming classes. I am also an Adobe Certified Associate in Photoshop CS4 &amp; CS5, Dreamweaver CS4 &amp; CS5, and Flash CS4. My focus for the coming years is putting to use my current skills, and learning new ones! Specifically, I am interested in learning about PHP, MySQL, and JavaScript.</p>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/wAEVhNP4FNM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/biographies/matthew-emond/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/biographies/matthew-emond/</feedburner:origLink></item>
		<item>
		<title>Sevena Skeels</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/-cZ_LchTQM0/</link>
		<comments>http://techrangers.cdl.ucf.edu/biographies/sevena-skeels/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 13:09:08 +0000</pubDate>
		<dc:creator>sskeels</dc:creator>
		
		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?page_id=1256</guid>
		<description><![CDATA[Birthday: 05/30/1992 Degree: Computer Science Expertise: HTML CSS Photoshop Also comfortable with Java Learning: Javascript PHP Biography: I am a UCF undergrad working towards a Computer Science degree. My ultimate goal is to become a &#8220;Beast Programmer&#8221;. I love both designing and coding as they equally offer intriguing challenges and creative outlets. I began making [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Birthday:</strong></p>
<p>05/30/1992</p>
<p><strong>Degree:</strong></p>
<p>Computer Science</p>
<p><strong>Expertise:</strong></p>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>Photoshop</li>
<li>Also comfortable with Java</li>
</ul>
<p><strong>Learning:</strong></p>
<ul>
<li>Javascript</li>
<li>PHP</li>
</ul>
<div><strong>Biography:</strong></div>
<p></p>
<div>I am a UCF undergrad working towards a Computer Science degree. My ultimate goal is to become a &#8220;Beast Programmer&#8221;. I love both designing and coding as they equally offer intriguing challenges and creative outlets. I began making websites as a hobby in middle school and have continued to hone my skills throughout the years with freelance work and personal projects. After I graduate, I plan to live in Japan for a while.</div>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/-cZ_LchTQM0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/biographies/sevena-skeels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/biographies/sevena-skeels/</feedburner:origLink></item>
		<item>
		<title>Fuel Crash Course – Part 1: Creating a Messaging System</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/GZYG3Og65bI/</link>
		<comments>http://techrangers.cdl.ucf.edu/fuel-crash-course/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 21:19:28 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?p=1190</guid>
		<description><![CDATA[An introduction to the Fuel PHP framework Table of contents: Part 1 – Creating a Messaging System Part 2 – Adding Comments Part 3 – Adding a Login System Part 1 &#8211; Creating a Messaging System This tutorial is designed to introduce you to the Fuel PHP framework by walking you through the creation of [...]]]></description>
			<content:encoded><![CDATA[<p class="sub_title">An introduction to the Fuel PHP framework</p>
<div class="fuel-table-of-contents">
<p>Table of contents:</p>
<ol>
<li><a href="/fuel-crash-course/">Part 1 – Creating a Messaging System</a></li>
<li><a href="/fuel-crash-course-part-2/">Part 2 – Adding Comments</a></li>
<li><a href="/fuel-crash-course-part-3/">Part 3 – Adding a Login System</a></li>
</ol>
</div>
<h3>Part 1 &#8211; Creating a Messaging System</h3>
<p>This tutorial is designed to introduce you to the Fuel PHP framework by walking you through the creation of a simple messaging app.</p>
<h4 id="Requirements">Requirements</h4>
<p>First and foremost, here&#8217;s what you&#8217;re going to need:</p>
<ol>
<li><a href="http://fuelphp.com">Fuel PHP framework</a> (we&#8217;re using v1.01)</li>
<li><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> (if you&#8217;re having trouble installing this, <a href="http://keito.me/tutorials/xampp">go here for a tutorial</a>)</li>
<li><a href="http://wamp.corephp.co.uk/step_06.php">PHP Environment Variables Configured in Windows</a> (for command line executions)</li>
<li>phpMyAdmin (it comes with XAMPP)</li>
<li>A basic understanding of the <a href="http://php-html.net/tutorials/model-view-controller-in-php/">Model-View-Controller (MVC) pattern</a>.</li>
</ol>
<h4>Before You Get Started</h4>
<p>Keep in mind that the completed source code for this tutorial is available from the <a href="https://github.com/UCF/fuelphp-crash-course">Fuel Crash Course GitHub repository</a>.</p>
<h4 id="Getting_Configged_Up">Getting Configged Up</h4>
<p>Put the Fuel files into a folder called &#8220;fuel_intro&#8221; in the htdocs folder of xampp.</p>
<p>Go to <a href="http://localhost/fuel_intro/public">http://localhost/fuel_intro/public</a> and you should see the &#8220;Successful install&#8221; page from Fuel</p>
<p><img src="/files/2011/10/gettin_configged_up_01.jpg" alt="Screenshot showing successful Fuel PHP install." /></p>
<p>For this tutorial we&#8217;re going to be using an <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">orm package</a>, included in your install of fuel. To enable packages, you have to add the package name it to the packages array in the config file. Mosey on over to <code>/fuel/app/config/config.php</code> and uncomment the &#8216;orm&#8217; package to the package array.</p>
<pre class="brush: php; first-line: 196; title: ; notranslate">
		'packages'	=&gt; array(
			'orm',
		),
</pre>
<p>After doing that, go to phpmyadmin (<a href="http://localhost/phpmyadmin">http://localhost/phpmyadmin</a>) and create a database called &#8220;fuel_intro&#8221;. Leave this database blank for now, because we&#8217;re going to eventually unleash fuel on its emptiness.</p>
<p><img src="/files/2011/10/gettin_configged_up_02.jpg" alt="Screenshot showing the creation of a database from phpmyadmin." /></p>
<p>Go into the <code>/fuel/app/config/db.php</code> file and fill out the following (this is assuming that you have a fresh install of XAMPP and you have not created or modified the default MySQL configuration):</p>
<pre class="brush: php; first-line: 13; title: ; notranslate">
return array(
	'active' =&gt; Config::get('environment'),
	Fuel::DEVELOPMENT =&gt; array(
		'type'			=&gt; 'mysql',
		'connection'	=&gt; array(
			'hostname'   =&gt; 'localhost',
			'database'   =&gt; 'fuel_dev',
			'username'   =&gt; 'root',
			'password'   =&gt; '',
			'persistent' =&gt; false,
		),
		'table_prefix' =&gt; '',
		'charset'      =&gt; 'utf8',
		'caching'      =&gt; false,
		'profiling'    =&gt; false,
	),
</pre>
<p>We renamed the database to &#8220;fuel_intro&#8221;, but left all the rest of the stuff as it was since the defaults will work fine for what we&#8217;re doing. Notice we&#8217;re only editing the Fuel::DEVELOPMENT environment and not touching Fuel::PRODUCTION.</p>
<h4 id="Oil_Slick">Oil Slick</h4>
<p>Fuel has a cool command line utility called Oil that lets you set up a lot of your controllers and tables automatically.</p>
<p>Bring up Command Prompt, type in the file path of your Fuel installation, and then run &#8220;php oil&#8221;. You should see a bit of oil usage documentation.</p>
<p><img src="/files/2011/10/oil_slick_02.jpg" alt="Running php oil." /></p>
<p>Seeing this means that Oil is successfully installed and working! Now let&#8217;s get to business.</p>
<h5 id="Every_Building_Needs_A_Scaffold">Every Building Needs A Scaffold</h5>
<p>Scaffolding in fuel allows you to quickly create a related controller, model (using ORM), and view for manipulating information.</p>
<p>What we want to end up with after creating the scaffold is a table with the following fields:</p>
<p><img src="/files/2011/10/every_building_needs_a_scaffold_01.jpg" alt="Screenshot of field names." /></p>
<p>The &#8216;ID&#8217;, &#8216;created on&#8217;, and &#8216;updated on&#8217; columns are made automatically, so all we have to tell oil to do is make the name and messages fields.</p>
<p><img src="/files/2011/10/every_building_needs_a_scaffold_02.jpg" alt="Running php scaffold for messages: php oil generate scaffold message name:string message:text." /></p>
<p>The only two weird things about this are the name of the scaffold has to be singular, and the &#8220;string&#8221; type for the name is a shortcut that is really var_char(255).</p>
<p>If you look at your document tree, you can see that the a controller, model, and view were created and populated with default content.</p>
<p>If you look at your database, you&#8217;ll notice that no table has been created, that&#8217;s because we need to migrate the database.</p>
<h6 id="Migra-wha">Migra-wha?</h6>
<p>A migration is like a version control scheme for your database. If you open up the file <code>/fuel/app/migrations/001_create_messages.php</code> you can see what is going to be generated when the migration runs. Checking the file before you run the migration is a good idea, at least to check for typos.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
namespace Fuel\Migrations;
class Create_messages {
	public function up()
	{
		\DBUtil::create_table('messages', array(
			'id' =&gt; array('constraint' =&gt; 11, 'type' =&gt; 'int', 'auto_increment' =&gt; true),
			'name' =&gt; array('constraint' =&gt; 255, 'type' =&gt; 'varchar'),
			'message' =&gt; array('type' =&gt; 'text'),
			'created_at' =&gt; array('constraint' =&gt; 11, 'type' =&gt; 'int'),
			'updated_at' =&gt; array('constraint' =&gt; 11, 'type' =&gt; 'int'),
		), array('id'));
	}
	public function down()
	{
		\DBUtil::drop_table('messages');
	}
}
</pre>
<p>Now that we know what the migration is going to create, go ahead and run it.</p>
<p><img src="/files/2011/10/Migra_wha_01.jpg" alt="Running php migrate for scaffold: php oil refine migrate." /></p>
<p>Now the table has been created, and you can add messages to it! Take a look at your database, you should see something like <a href="#screenshot_fuel_intro_database">the screenshot from before</a>.</p>
<h4 id="Prettying_Up_The_Code">Prettying Up The Code</h4>
<p>Navigate to &#8220;<a href="http://localhost/fuel_intro/public/messages">http://localhost/fuel_intro/public/messages</a>&#8221; and add a message.</p>
<p>If you look at the message, you&#8217;ll notice that all the layout is done using a table, so take a minute and make the code <a href="http://en.wikipedia.org/wiki/Semantic_HTML">semantic</a>.</p>
<p>Go into <code>/fuel/app/views/messages/index.php</code> and do the following:</p>
<p><strong>Before:</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;h2 class=&quot;first&quot;&gt;Listing Messages&lt;/h2&gt;
&lt;table cellspacing=&quot;0&quot;&gt;
	&lt;tr&gt;
		&lt;th&gt;Name&lt;/th&gt;
		&lt;th&gt;Message&lt;/th&gt;
		&lt;th&gt;&lt;/th&gt;
	&lt;/tr&gt;
	&lt;?php foreach ($messages as $message): ?&gt;	&lt;tr&gt;
		&lt;td&gt;&lt;?php echo $message-&gt;name; ?&gt;&lt;/td&gt;
		&lt;td&gt;&lt;?php echo $message-&gt;message; ?&gt;&lt;/td&gt;
		&lt;td&gt;
			&lt;?php echo Html::anchor('messages/view/'.$message-&gt;id, 'View'); ?&gt; |
			&lt;?php echo Html::anchor('messages/edit/'.$message-&gt;id, 'Edit'); ?&gt; |
			&lt;?php echo Html::anchor('messages/delete/'.$message-&gt;id, 'Delete', array('onclick' =&gt; &quot;return confirm('Are you sure?')&quot;)); ?&gt;		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;?php endforeach; ?&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;?php echo Html::anchor('messages/create', 'Add new Message'); ?&gt;
</pre>
<p><strong>After:</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;h2 class=&quot;first&quot;&gt;Listing Messages&lt;/h2&gt;
	&lt;ul&gt;
	&lt;?php foreach ($messages as $message): ?&gt;
		&lt;li&gt;&lt;?php echo $message-&gt;name; ?&gt;
			&lt;ul&gt;
				&lt;li&gt;&lt;?php echo $message-&gt;message; ?&gt;&lt;/li&gt;
				&lt;li&gt;&lt;?php echo Html::anchor('messages/view/'.$message-&gt;id, 'View'); ?&gt;&lt;/li&gt;
				&lt;li&gt;&lt;?php echo Html::anchor('messages/edit/'.$message-&gt;id, 'Edit'); ?&gt;&lt;/li&gt;
				&lt;li&gt;&lt;?php echo Html::anchor('messages/delete/'.$message-&gt;id, 'Delete', array('onclick' =&gt; &quot;return confirm('Are you sure?')&quot;)); ?&gt;&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/li&gt;
	&lt;?php endforeach; ?&gt;
	&lt;/ul&gt;
&lt;br /&gt;
&lt;?php echo Html::anchor('messages/create', 'Add new Message'); ?&gt;
</pre>
<p>Now your code is more semantic, if not more understandable (If you don&#8217;t like the bullets or the list view, <a href="http://css.maxdesign.com.au/listutorial/horizontal_introduction.htm">you can take them away using CSS</a>).</p>
<h5 id="New_Landing_Page">New Landing Page</h5>
<p>Remember the successful install page you visited immediately after installing fuel? What you were seeing on that page comes from a view as well. Through routing, fuel can redirect the browser to display views outside of the default structure. These routing directions are stored in <code>/fuel/app/config/routes.php</code>.</p>
<p>By default there are two routes: the landing page and the 404 page.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
return array(
	'_root_'  =&gt; 'welcome/index',  // The default route
	'_404_'   =&gt; 'welcome/404',    // The main 404 route
	/**
	 * This is an example of a BASIC named route (used in reverse routing).
	 * The translated route MUST come first, and the 'name' element must come
	 * after it.
	 */
	// 'foo/bar' =&gt; array('welcome/foo', 'name' =&gt; 'foo'),
);
</pre>
<p>What you need to do is have fuel redirect the browser to the messages view when going to <a href="http://localhost/fuel_intro/public">http://localhost/fuel_intro/public</a> instead of the successful install page. To do that, simply edit the value for the _root_ key like so:</p>
<pre class="brush: php; first-line: 2; title: ; notranslate">
return array(
	'_root_'  =&gt; 'messages/index',  // The default route
</pre>
<p>In the next section we will deal with creating comments for the messages.</p>
<ul class="page_navlinks">
<li><a href="/fuel-crash-course-part-2/">Continue to Part 2 &raquo;</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/GZYG3Og65bI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/fuel-crash-course/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/fuel-crash-course/</feedburner:origLink></item>
		<item>
		<title>Fuel Crash Course – Part 2: Adding Comments</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/5ROzrk9pCFk/</link>
		<comments>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-2/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 21:19:21 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?p=1186</guid>
		<description><![CDATA[An introduction to the Fuel PHP framework Table of contents: Part 1 – Creating a Messaging System Part 2 – Adding Comments Part 3 – Adding a Login System Part 2 &#8211; Adding Comments New Comments Now that we have pretty semantic messages, we need to add a way for users to add comments to [...]]]></description>
			<content:encoded><![CDATA[<p class="sub_title">An introduction to the Fuel PHP framework</p>
<div class="fuel-table-of-contents">
<p>Table of contents:</p>
<ol>
<li><a href="/fuel-crash-course/">Part 1 – Creating a Messaging System</a></li>
<li><a href="/fuel-crash-course-part-2/">Part 2 – Adding Comments</a></li>
<li><a href="/fuel-crash-course-part-3/">Part 3 – Adding a Login System</a></li>
</ol>
</div>
<h3>Part 2 &#8211; Adding Comments</h3>
<h4 id="New_Comments">New Comments</h4>
<p>Now that we have pretty semantic messages, we need to add a way for users to add comments to those messages.</p>
<p>The first step is to create our controllers and views for the comments. We will be using oil&#8217;s generate command again to do this. Let&#8217;s watch:</p>
<p><img src="/files/2011/10/new_comments_01.jpg" alt="Running php generate for comments: php oil generate controller comments edit create." /></p>
<p>As you can see, a controller was generated called &#8220;comments&#8221; with the actions create and edit. Two views were also created, both associated with the comments controller (edit.php and create.php).</p>
<p>Open the controller and see what was made.</p>
<h5 id="Controlling_the_Power">Controlling the Power</h5>
<p>The comments controller should look like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Controller_Comments extends Controller_Template {
	public function action_edit()
	{
		$this-&gt;template-&gt;title = 'Comments &amp;raquo; Edit';
		$this-&gt;template-&gt;content = View::factory('comments/edit');
	}
	public function action_create()
	{
		$this-&gt;template-&gt;title = &quot;Comments &amp;raquo; Create&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
}
/* End of file comments.php */
</pre>
<h6 id="Defaults">Defaults</h6>
<p>The default class name for the controller is Controller_NAME, and the default actions are action_NAME. So if you&#8217;re making your own actions or controllers, you should follow the conventions that are set forth in this file. </p>
<p>Let&#8217;s go ahead and make a new action to illustrate this.</p>
<p>We want to create a controller that&#8217;s not associated with any view in order to handle deleting a comment. So, we would write the deletion function under the current actions:</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
		public function action_create()
		{
			$this-&gt;template-&gt;title = &quot;Comments &amp;raquo; Create&quot;;
			$this-&gt;template-&gt;content = View::factory('comments/create');
		}
		public function action_delete()
		{
		}
</pre>
<p>This controller isn&#8217;t going to have any code in it yet, we can save that for later.</p>
<h6 id="Form_Templates">Form Templates</h6>
<p>If you look at the Messages views, you will see a file called &#8220;_form.php&#8221;. This is a form template that all of the views in messages can share by calling <code></code> and is something that should be recreated for the comments views as well.</p>
<p>Go ahead and create <code>/fuel/app/views/comments/_form.php</code>.</p>
<p>First and foremost, you&#8217;re going to need to open a new form, and rather than using straight HTML, Fuel has classes for HTML elements. To open a new form you write:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
</pre>
<p>This is analogous to writing &#8220;<code>&lt;form action="http://localhost/fuel_intro/public/index.php/comments/create" accept-charset="utf-8" method="post"&gt;</code>&#8221; so it&#8217;s a good idea to use these HTML elements when possible.</p>
<p>Next, create a name field for the comment:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Name', 'name'); ?&gt;
		&lt;?php echo Form::input('name', Input::post('name', isset($comment) ? $comment-&gt;name : '')); ?&gt;
	&lt;/p&gt;
</pre>
<ul>
<li><code>Form::label()</code> takes (in order) the text that will be displayed to the user, and the id which should match the name attribute of the input field.</li>
<li><code>Form::input()</code> takes (in order) the name attribute of the form and the default value of that form element.</li>
</ul>
<p>You can repeat this code for the comment text as well. The only difference is that instead of <code>Form::input</code>, you&#8217;ll need to use <code>Form::textarea()</code>. Which takes in the same parameters.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Name', 'name'); ?&gt;
		&lt;?php echo Form::input('name', Input::post('name', isset($comment) ? $comment-&gt;name : '')); ?&gt;
	&lt;/p&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Comment', 'comment'); ?&gt;
		&lt;?php echo Form::textarea('comment', Input::post('comment', isset($comment) ? $comment-&gt;comment : ''), array('cols' =&gt; 60, 'rows' =&gt; 8)); ?&gt;
	&lt;/p&gt;
</pre>
<p>Did you notice the extra bit at the end? The last parameter for the label, input, or textarea tags is an array of attributes. So when we write &#8220;<code>array('cols' =&gt; 60, 'rows' =&gt; 8));</code>&#8221; at the end of the textarea function,  it&#8217;s the same as saying &#8220;<code>&lt;textarea cols="60" rows="8"&gt;&lt;/textarea&gt;</code>&#8220;</p>
<p>Next we just need to add the submit button and close the form:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Name', 'name'); ?&gt;
		&lt;?php echo Form::input('name', Input::post('name', isset($comment) ? $comment-&gt;name : '')); ?&gt;
	&lt;/p&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Comment', 'comment'); ?&gt;
		&lt;?php echo Form::textarea('comment', Input::post('comment', isset($comment) ? $comment-&gt;comment : ''), array('cols' =&gt; 60, 'rows' =&gt; 8)); ?&gt;
	&lt;/p&gt;
	&lt;?php echo Form::hidden('mid', Input::post('mid', isset($message) ? $message : '')); ?&gt;
	&lt;div class=&quot;actions&quot;&gt;
		&lt;?php echo Form::submit(); ?&gt;	&lt;/div&gt;
&lt;?php echo Form::close(); ?&gt;
</pre>
<p>Now open up <code>fuel/app/views/comments/create.php</code>, write the following:</p>
<pre class="brush: php; title: ; notranslate">
&lt;h2 class=&quot;first&quot;&gt;New Comment&lt;/h2&gt;
&lt;?php echo render('comments/_form'); ?&gt;
&lt;p&gt;&lt;?php echo Html::anchor('comments', 'Back'); ?&gt;&lt;/p&gt;
</pre>
<p>Go to <a href="http://localhost/fuel_intro/public/comments/create/">http://localhost/fuel_intro/public/comments/create/</a> and take a look at the form. You should see this:</p>
<p><img src="/files/2011/10/controlling_the_power_01.jpg" alt="A Google Chrome window displaying the create page." /></p>
<h5 id="Modeling">Modeling</h5>
<p>This is the easy part of the tutorial. All you need to do is run the following into command line for oil to use (make sure the model name is singular!):</p>
<p><img src="/files/2011/10/modeling_01.jpg" alt="Running php oil generate model comment name:string comment:text mid:int" /></p>
<p>This created comment.php in the <code>fuel/app/classes/model</code> folder. If you open up the file you should see something like this (it should be exactly like this, actually):</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Model_Comment extends Orm\Model {
	protected static $_observers = array(
		'Orm\Observer_CreatedAt' =&gt; array('before_insert'),
		'Orm\Observer_UpdatedAt' =&gt; array('before_save'),
	);
}
/* End of file comment.php */
</pre>
<h5 id="Why_Its_So_Small">Why It&#8217;s So Small</h5>
<p>Notice that there&#8217;s not much code there? That&#8217;s because the comment model extends a class called ORM, or the Object-relational mapper. You can take a look at <a href="http://fuelphp.com/docs/packages/orm/creating_models.html">some of the more complicated things ORM can do</a>, but for now we&#8217;re just going to stick to the defaults.</p>
<p>Since we made another model, we&#8217;re going to have to migrate to the newest version:</p>
<p><img src="/files/2011/10/migra_wha_02.jpg" alt="Running php oil refine migrate" /></p>
<p class="note">Quick Note: If an error is encountered when migrating, you can fix any typos in your migration file by going to <code>/fuel/app/migrations/###_create_NAME.php</code> and editing the file.</p>
<h5 id="Adding_to_the_Database">Adding to the Database</h5>
<p>We can now edit the controller for comments to actually add our comments to the database. So go ahead and open the <cite>/fuel/app/classes/controller/comments.php</cite> file.</p>
<p>First and foremost, an <code>$id</code> variable is going to be taken in, so we need to add that as an attribute to the action_create function:</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p>Notice that we are setting the <code>$id</code> to null by default. Now we need to check to make sure that they&#8217;ve completed the form, so we add an if statement:</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p>This is using Fuel&#8217;s Input class, but we could have just as easily used <code>"if($_POST) {</code>&#8221; as well.</p>
<p>But what about going to the form before submitting?</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
		}
		else
		{
			$this-&gt;template-&gt;set_global('message', $id, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p>This means if they didn&#8217;t post anything, take the <code>$id</code> and turn it into a variable called $message that the view can use.</p>
<p>Now we need to build what we need to from the Comment Model.</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
			$comment = Model_Comment::factory(array(
				'name' =&gt; Input::post('name'),
				'comment' =&gt; Input::post('comment'),
				'mid' =&gt; Input::post('mid'),
			));
		}
		else
		{
			$this-&gt;template-&gt;set_global('message', $id, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p><cite>$comment</cite> is now an object that has the comment information in it, so we need to try and save the comment:</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
			$comment = Model_Comment::factory(array(
				'name' =&gt; Input::post('name'),
				'comment' =&gt; Input::post('comment'),
				'mid' =&gt; Input::post('mid'),
			));
			if ($comment and $comment-&gt;save())
			{
			}
		}
		else
		{
			$this-&gt;template-&gt;set_global('message', $id, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p>&#8216;And&#8217; is used here instead of &#8216;&amp;&#8217; because it&#8217;s part of the <a href="http://fuelphp.com/docs/general/coding_standards.html#comparison_logical">Fuel coding standards</a>.</p>
<p>If the if statement is successful, it will save the comment to the database, so we should now set a flash to show that to the user. <a href="http://fuelphp.com/docs/classes/session/usage.html#method_set_flash">Session Flashes</a> are for information with a limited lifespan, such as presenting success or failure information.</p>
<p>So we can set our flash and redirect them back to the message they were viewing:</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
			$comment = Model_Comment::factory(array(
				'name' =&gt; Input::post('name'),
				'comment' =&gt; Input::post('comment'),
				'mid' =&gt; Input::post('mid'),
			));
			if ($comment and $comment-&gt;save())
			{
				Session::set_flash('notice', 'Added comment #' . $comment-&gt;id . '.');
				Response::redirect('messages/view/'.$id);
			}
		}
		else
		{
			$this-&gt;template-&gt;set_global('message', $id, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<p>or else we set the flash to say that the comment couldn&#8217;t be saved</p>
<pre class="brush: php; first-line: 11; title: ; notranslate">
	public function action_create($id = null)
	{
		if (Input::method() == 'POST')
		{
			$comment = Model_Comment::factory(array(
				'name' =&gt; Input::post('name'),
				'comment' =&gt; Input::post('comment'),
				'mid' =&gt; Input::post('mid'),
			));
			if ($comment and $comment-&gt;save())
			{
				Session::set_flash('notice', 'Added comment #' . $comment-&gt;id . '.');
				Response::redirect('messages/view/'.$id);
			}
			else
			{
				Session::set_flash('notice', 'Could not save comment.');
			}
		}
		else
		{
			$this-&gt;template-&gt;set_global('message', $id, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/create');
	}
</pre>
<h5 id="Creating_A_Comment_from_A_Message">Creating A Comment from A Message</h5>
<p>Now we&#8217;re going to add a link to the <code>view.php</code> file in the messages view, so you can add a comment to that message.</p>
<p>Go to <code>/fuel/app/views/messages/view.php</code> and add:</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;
	&lt;strong&gt;Name:&lt;/strong&gt;
	&lt;?php echo $message-&gt;name; ?&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Message:&lt;/strong&gt;
	&lt;?php echo $message-&gt;message; ?&gt;&lt;/p&gt;
&lt;p&gt;&lt;?php echo Html::anchor('comments/create/'.$message-&gt;id, 'Add new Comment'); ?&gt;&lt;/p&gt;
&lt;?php echo Html::anchor('messages/edit/'.$message-&gt;id, 'Edit'); ?&gt; |
&lt;?php echo Html::anchor('messages', 'Back'); ?&gt;
</pre>
<p>Go ahead and add a comment so we can pull it up from the messages.</p>
<h5 id="Now_that_we_have_a_Comment...">Now that we have a Comment&#8230;</h5>
<p>Since there is a comment in the database now, we can add functions to the controller to manipulate that comment. First off, we need a way to be able to edit that comment in <code>/fuel/app/classes/controller/comments.php</code>.</p>
<p>The edit function will take in two parameters instead of just the one. It will take in the comment id and the message id. </p>
<pre class="brush: php; first-line: 5; title: ; notranslate">
	public function action_edit($id, $mid)
	{
		$this-&gt;template-&gt;title = 'Comments &amp;raquo; Edit';
		$this-&gt;template-&gt;content = View::factory('comments/edit');
	}
</pre>
<p>Now we use the comment model to find the comment, based on it&#8217;s id</p>
<pre class="brush: php; first-line: 5; title: ; notranslate">
	public function action_edit($id, $mid)
	{
		$comment = Model_Comment::find($id);
		$this-&gt;template-&gt;title = 'Comments &amp;raquo; Edit';
		$this-&gt;template-&gt;content = View::factory('comments/edit');
	}
</pre>
<p>The rest of the code is pretty much the same as creating a comment with a few minor tweaks, here it is in bulk:</p>
<pre class="brush: php; first-line: 5; title: ; notranslate">
	public function action_edit($id = null, $mid = null)
	{
		$comment = Model_Comment::find($id);
		if (Input::method() == 'POST')
		{
			$comment-&gt;name = Input::post('name');
			$comment-&gt;comment = Input::post('comment');
			$comment-&gt;mid = $mid;
			if ($comment-&gt;save())
			{
				Session::set_flash('notice', 'Updated comment #' . $id);
				Response::redirect('messages/view/'.$comment-&gt;mid);
			}
			else
			{
				Session::set_flash('notice', 'Could not update comment #' . $id);
			}
		}
		else
		{
			$this-&gt;template-&gt;set_global('comment', $comment, false);
		}
		$this-&gt;template-&gt;title = &quot;Comments&quot;;
		$this-&gt;template-&gt;content = View::factory('comments/edit');
	}
</pre>
<p>The action <code>$comment-&gt;save()</code> will update the comment if it already exists in the database, or adds it if it doesn&#8217;t.</p>
<h6 id="Deletion">Deletion</h6>
<p>Deleting the comment is just as easy as saving it, all you need to do is call <code>$comment-&gt;delete()</code> instead of <code>$comment-&gt;save()</code></p>
<pre class="brush: php; first-line: 44; title: ; notranslate">
	public function action_delete($id, $mid)
	{
		if ($comment = Model_Comment::find($id))
		{
			$comment-&gt;delete();
			Session::set_flash('notice', 'Deleted comment #' . $id);
		}
		else
		{
			Session::set_flash('notice', 'Could not delete comment #' . $id);
		}
		Response::redirect('messages/view/'.$mid);
	}
</pre>
<p>For the next section we can accomplish two things, showing the number of comments that a message has, and showing the comments in a list when we view the message.</p>
<h5 id="Number_of_Comments">Number of Comments</h5>
<p>Open up the messages controller (at this point you should probably be pretty good at navigating the file tree, so I&#8217;m going to stop giving you the path names to things we&#8217;ve already visited) and take a look at the index:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$data['messages'] = Model_Message::find('all');
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index', $data);
	}
</pre>
<p>There&#8217;s not too much there except a command to find all the messages, which needs to be changed to $messages instead of <code>$data['messages']</code>. </p>
<p>Go to the top of the function and add this:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$view = View::factory('messages/index');
		$messages = Model_Message::find('all');
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index', $data);
	}
</pre>
<p>That way we have an object for the view that we can set variables for, which will come later.</p>
<p>Just under the messages object we&#8217;re going to declare an array called $comments, and then loop through the messages object:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$view = View::factory('messages/index');
$messages = Model_Message::find('all');
		$comments = array();
		foreach ($messages as $message)
		{
		}
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index', $data);
	}
</pre>
<p>We need to do a database call to get all of the comments associated with a particular message, so we call on the Comment_Model:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$view = View::factory('messages/index');
		$messages = Model_Message::find('all');
		$comments = array();
		foreach ($messages as $message)
		{
			$query = Model_Comment::find()-&gt;where(&quot;mid&quot;, $message['id']);
		}
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index');
	}
</pre>
<p>This is analogous to &#8220;<code>SELECT * FROM 'comments' WHERE mid = $message[id]</code>&#8220;, but it&#8217;s an easier way to read it and it uses fuels built in classes.</p>
<p>Now we just need to count the number of results and add that number to the $comments array. For ease of parsing, we&#8217;re going to make the comment array key match the message id:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$view = View::factory('messages/index');
		$messages = Model_Message::find('all');
		$comments = array();
		foreach ($messages as $message)
		{
			$query = Model_Comment::find()-&gt;where(&quot;mid&quot;, $message['id']);
			$comments[$message['id']] = $query-&gt;count();
		}
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index');
	}
</pre>
<p>The next bit is really for syntax purposes. If there is one comment display &#8217;1 Comment&#8217;, no comments displays &#8216;View&#8217;, and more than one comment displays &#8216;# Comments&#8217;:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
	public function action_index()
	{
		$view = View::factory('messages/index');
		$messages = Model_Message::find('all');
		$comments = array();
		foreach ($messages as $message)
		{
			$query = Model_Comment::find()-&gt;where(&quot;mid&quot;, $message['id']);
			$comments[$message['id']] = $query-&gt;count();
			if ($comments[$message['id']] == 1) {
				$comments[$message['id']] .= &quot; Comment&quot;;
			}
			else if($comments[$message['id']] == 0)
			{
				$comments[$message['id']] = &quot;View&quot;;
			}
			else {
				$comments[$message['id']] .= &quot; Comments&quot;;
			}
		}
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/index');
	}
</pre>
<p>Now we just need to set the variables to the view (which is why we declared the view at the top of the function, and change the content to be the view object:</p>
<pre class="brush: php; first-line: 4; title: ; notranslate">
public function action_index()
	{
		$view = View::factory('messages/index');
		$messages = Model_Message::find('all');
		$comments = array();
		foreach ($messages as $message)
		{
			$query = Model_Comment::find()-&gt;where(&quot;mid&quot;, $message['id']);
			$comments[$message['id']] = $query-&gt;count();
			if ($comments[$message['id']] == 1) {
				$comments[$message['id']] .= &quot; Comment&quot;;
			}
			else if($comments[$message['id']] == 0)
			{
				$comments[$message['id']] = &quot;View&quot;;
			}
			else {
				$comments[$message['id']] .= &quot; Comments&quot;;
			}
		}
		$view-&gt;set('comments', $comments);
		$view-&gt;set('messages', $messages);
		$this-&gt;template-&gt;title = &quot;Messages&quot;;
		$this-&gt;template-&gt;content = $view;
	}
</pre>
<p>Now that we are passing the number of comments to the messages view, we need to modify the html to display it.</p>
<p>What we did was modify the &#8220;View&#8221; message link to include the number of comments, if any are present. At the moment, there shouldn&#8217;t be any.
</p>
<p>Now if you go to <a href="http://localhost/fuel_intro/public/index.php/messages/">http://localhost/fuel_intro/public/index.php/messages/</a> you should see the number of comments each message has.</p>
<h6 id="Showing_the_Comments">Showing the Comments</h6>
<p>To actually show the comments for each view, you need to get all the comments associated with a message in the messages controller:</p>
<pre class="brush: php; first-line: 32; title: ; notranslate">
public function action_view($id = NULL)
	{
		$data['message'] = Model_Message::find($id);
		$comments = Model_Comment::find()-&gt;where('mid', $id)-&gt;get();
		$data['comments'] = $comments;
		$this-&gt;template-&gt;title = &quot;Message&quot;;
		$this-&gt;template-&gt;content = View::factory('messages/view', $data);
	}
</pre>
<p>The <code>-&gt;get()</code> command returns the comments associated with the message as an object, which is passed to the view when added to the $data array.</p>
<p>Now all we need to do is show it on the view.php page of the message views:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;strong&gt;Message:&lt;/strong&gt;
	&lt;?php echo $message-&gt;message; ?&gt;&lt;/p&gt;
&lt;h3&gt;Comments&lt;/h3&gt;
&lt;ul&gt;
&lt;?php
foreach ($comments as $comment) {  ?&gt;
	&lt;li&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;strong&gt;Name:&lt;/strong&gt; &lt;?php echo $comment-&gt;name; ?&gt;&lt;/li&gt;
			&lt;li&gt;&lt;strong&gt;Comment:&lt;/strong&gt;&lt;br /&gt;&lt;?php echo $comment-&gt;comment; ?&gt;&lt;/li&gt;
			&lt;li&gt;&lt;p&gt;&lt;?php echo Html::anchor('comments/edit/'.$comment-&gt;id.'/'.$message-&gt;id, 'Edit'); ?&gt;|
	&lt;?php echo Html::anchor('comments/delete/'.$comment-&gt;id.'/'.$message-&gt;id, 'Delete', array('onclick' =&gt; &quot;return confirm('Are you sure?')&quot;)); ?&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
&lt;?php } ?&gt;
&lt;/ul&gt;
</pre>
<p>The final section will deal with Logging and and creating users.</p>
<ul class="page_navlinks">
<li><a href="/fuel-crash-course/">&laquo; Back to Part 1</a></li>
<li><a href="/fuel-crash-course-part-3/">Continue to Part 3 &raquo;</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/5ROzrk9pCFk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-2/</feedburner:origLink></item>
		<item>
		<title>Fuel Crash Course – Part 3: Adding a Login System</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/7Z3QD25JCAo/</link>
		<comments>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-3/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 20:45:59 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?p=1183</guid>
		<description><![CDATA[An introduction to the Fuel PHP framework Table of contents: Part 1 – Creating a Messaging System Part 2 – Adding Comments Part 3 – Adding a Login System Part 3 &#8211; Adding a Login System Creating Users and Login Now that we&#8217;ve done messages and comments, we don&#8217;t want just anyone to be able [...]]]></description>
			<content:encoded><![CDATA[<p class="sub_title">An introduction to the Fuel PHP framework</p>
<div class="fuel-table-of-contents">
<p>Table of contents:</p>
<ol>
<li><a href="/fuel-crash-course/">Part 1 – Creating a Messaging System</a></li>
<li><a href="/fuel-crash-course-part-2/">Part 2 – Adding Comments</a></li>
<li><a href="/fuel-crash-course-part-3/">Part 3 – Adding a Login System</a></li>
</ol>
</div>
<h3>Part 3 &#8211; Adding a Login System</h3>
<h4 id="Login_Page_and_User_Creation">Creating Users and Login</h4>
<p>Now that we&#8217;ve done messages and comments, we don&#8217;t want just anyone to be able to edit/delete messages, and it would be nice if messages were associated with some kind of username, so we&#8217;re going to make a simple and generic user system for our messages.</p>
<p>First add the &#8216;auth&#8217; package to the package list in the config file</p>
<pre class="brush: php; first-line: 196; title: ; notranslate">
		'packages'	=&gt; array(
			'orm',
			'auth',
		),
</pre>
<p>Then we need to create a controller for our login:</p>
<p><img src="/files/2011/10/login_page_and_user_creation_01.jpg" alt="Running php oil controller users login logout register in the command line." /></p>
<p>Notice that we used &#8216;g&#8217; instead of &#8216;generate&#8217;, Oil has a lot of short tags that we can now use because you&#8217;re familiar with the long way to do it.</p>
<p>Now we need to build the models:</p>
<p><img src="/files/2011/10/login_page_and_user_creation_021.jpg" alt="Running php oil g model user username:string password:string group:int email:string last_login:string login_hash:string in the command line." /></p>
<p>The only thing that should be explained on this line is groups. Here&#8217;s the default group number definitions:</p>
<dl>
<dt>
  -1  =</dt>
<dd>Banned</dd>
<dt>0 =</dt>
<dd>Guests</dd>
<dt>1 =</dt>
<dd>Users</dd>
<dt>50 =</dt>
<dd>Moderators</dd>
<dt>100 =</dt>
<dd>Administrators </dd>
</dl>
<p>This way you can check a users access in bulk, like people below this number can&#8217;t access something.</p>
<p>Finally, migrate to the new version (using the short tag &#8220;r&#8221; instead of &#8220;refine&#8221;).</p>
<p><img src="/files/2011/10/login_page_and_user_creation_03.jpg" alt="php oil r migrate" /></p>
<h5 id="Changing_the_Defualt_Table">Changing the Defualt Table</h5>
<p>The auth package is expecting a table called &#8220;simpleusers&#8221; created to base it&#8217;s database controls on, but we named ours &#8220;users&#8221;. So, we&#8217;re going to change their default rather than change our table.</p>
<p><code>/fuel/packages/auth/config/simpleauth.php</code>:</p>
<pre class="brush: php; first-line: 24; title: ; notranslate">
	/**
	 * DB table name for the user table
	 */
	'table_name' =&gt; 'users', // Old: 'table_name' =&gt; 'simpleusers',
</pre>
<h5 id="Registration">Registration</h5>
<p>Now that we have a model, controller, and views, we need to add a link to the registration so people can actually sign up! Since this should be on the top of all the pages, we need to edit the template page for the entire site. So go to <code>/fuel/app/views/template.php</code> and add the following:</p>
<pre class="brush: php; first-line: 30; title: ; notranslate">
&lt;body&gt;
	&lt;div id=&quot;wrapper&quot;&gt;
		&lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;/h1&gt;
		&lt;?php
			if(isset($user_info))
			{
				echo $user_info;
			}
			else
			{
				$link = array(Html::anchor('users/login', 'Login'), Html::anchor('users/register', 'Register'));
				echo Html::ul($link);
			}
			echo $content;
		?&gt;
</pre>
<p>This checks to see if a user is logged in (we&#8217;ll call the object with the user&#8217;s info in it <code>$user_info</code>), if they&#8217;re not logged in, then it builds an unordered list that links to a registration page.</p>
<h5 id="Registration_Model">Registration Model</h5>
<p>We&#8217;re going to create the registration form using the model and passing it with the controller. Create a function at the bottom of the users model. It&#8217;s going to have and empty form passed into it, and this form will be a Fieldset, which is kind of like a form that has validation attached to it:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Model_User extends Orm\Model {
	protected static $_observers = array(
		'Orm\Observer_CreatedAt' =&gt; array('before_insert'),
		'Orm\Observer_UpdatedAt' =&gt; array('before_save'),
	);
	public static function register(Fieldset $form)
	{
	}
}
</pre>
<p>Now we need to attach fields to this form, and send it back to the controller.</p>
<pre class="brush: php; first-line: 8; title: ; notranslate">
	public static function register(Fieldset $form)
	{
		$form-&gt;add('username', 'Username:')-&gt;add_rule('required');
		$form-&gt;add('password', 'Choose Password:', array('type'=&gt;'password'))-&gt;add_rule('required');
		$form-&gt;add('password2', 'Re-type Password:', array('type' =&gt; 'password'));
		$form-&gt;add('email', 'Email:')-&gt;add_rule('required')-&gt;add_rule('valid_email');
		$form-&gt;add('submit', ' ', array('type'=&gt;'submit', 'value' =&gt; 'Register'));
		return $form;
	}
</pre>
<p>The <code>add()</code> function adds a certain field with the field&#8217;s name, label, and attributes in that order. The <code>add_rule()</code> function adds a validation rule to the field. All the rules available by default can be found here: <a href="http://fuelphp.com/docs/classes/validation/validation.html#rules_table">http://fuelphp.com/docs/classes/validation/validation.html#rules_table</a>.</p>
<h5 id="User_Controller_Registration_Function">User Controller Registration Function</h5>
<p>Now we&#8217;re going to go to the action_register function within the user controller.</p>
<p>We are going to change it from this:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
public function action_register()
{
	$this-&gt;template-&gt;title = 'Users &amp;raquo; Register';
	$this-&gt;template-&gt;content = View::factory('users/register');
}
</pre>
<p>To this:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
	public function action_register() {
		$auth = Auth::instance();
		$view = View::factory(&#039;users/register&#039;);
		$form = Fieldset::factory(&#039;register&#039;);
		Model_User::register($form);
	}
</pre>
<p><code>$auth</code> is going to be our way of Authenticating users, <code>$view</code> is the view that will be passed to the user, <code>$form</code> is the fieldset that we&#8217;re sending to the model. <code>Model_User::register($form)</code> just populates the form with the fields.</p>
<p>If we build the form in the view, we can see how this will work:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
	public function action_register()
	{
		$auth = Auth::instance();
		$view = View::factory('users/register');
		$form = Fieldset::factory('register');
		Model_User::register($form);
		$view-&gt;set('reg', $form-&gt;build(), false);
		$this-&gt;template-&gt;title = 'User &amp;raquo; Register';
		$this-&gt;template-&gt;content = $view;
	}
</pre>
<p>Then go to the register view and add:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo $reg; ?&gt;
</pre>
<p>Once you do this, you should see the registration form if you go to <a href="http://localhost/fuel_intro/public/index.php/users/register">http://localhost/fuel_intro/public/index.php/users/register</a>.</p>
<h5 id="Validating_the_Registration">Validating the Registration</h5>
<p><!-- This section needs cleanup and more clarity --></p>
<p>Now what happens when someone actually fills out the form? We need to have their registration validated. So we need to repopulate the form field with the values that the user typed in, and then send the whole form and authentication to a validation controller:</p>
<pre class="brush: php; first-line: 23; title: ; notranslate">
		Model_User::register($form);
		if($_POST)
		{
			$form-&gt;repopulate();
			$result = Model_User::validate_registration($form, $auth);
		}
		$view-&gt;set('reg', $form-&gt;build(), false);
		$this-&gt;template-&gt;title = 'User &amp;raquo; Register';
		$this-&gt;template-&gt;content = $view;
	}
</pre>
<p>On the model side it needs to take in the form and authentication:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
	public function validate_registration(Fieldset $form, $auth)
	{
	}
}
/* End of file user.php */
</pre>
<p>Then we need to add a rule to the password field that it must match what the user has typed in for the password2 field:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
public function validate_registration(Fieldset $form, $auth)
{
	$form-&gt;field('password')-&gt;add_rule('match_value', $form-&gt;field('password2')-&gt;get_attribute('value'));
}
</pre>
<p>And now we need to create a validation object and set messages to display what we want if the user enters in something incorrectly:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
public function validate_registration(Fieldset $form, $auth)
{
$form-&gt;field('password')-&gt;add_rule('match_value', $form-&gt;field('password2')-&gt;get_attribute('value'));
	$val = $form-&gt;validation();
	$val-&gt;set_message('required', 'The field :field is required');
	$val-&gt;set_message('valid_email', 'The field :field must be an email address');
	$val-&gt;set_message('match_value', 'The passwords must match');
</pre>
<p>For a full explanation of the set message feature, look at <a href="http://fuelphp.com/docs/classes/validation/validation.html#errors">Fuel&#8217;s documentation on error messages</a>.</p>
<p>Next, we try to run the validation to see if it passes or fails</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
public function validate_registration(Fieldset $form, $auth)
{
$form-&gt;field('password')-&gt;add_rule('match_value', $form-&gt;field('password2')-&gt;get_attribute('value'));
	$val = $form-&gt;validation();
	$val-&gt;set_message('required', 'The field :field is required');
	$val-&gt;set_message('valid_email', 'The field :field must be an email address');
	$val-&gt;set_message('match_value', 'The passwords must match');
	if($val-&gt;run())
	{
	}
	else
	{
		$errors = $val-&gt;show_errors();
		return array('e_found' =&gt; true, 'errors' =&gt; $errors);
	}
</pre>
<p>So, if the validation doesn&#8217;t pass, the show_errors() function turns the errors into an HTML list, and we return that and a Boolean saying that errors were found.</p>
<h6 id="What_if_they_Pass">What if they Pass?</h6>
<p>If the user passes validation, then we get their username, password, and email from the form:</p>
<pre class="brush: php; first-line: 24; title: ; notranslate">
if($val-&gt;run())
{
	$username = $form-&gt;field('username')-&gt;get_attribute('value');
	$password = $form-&gt;field('password')-&gt;get_attribute('value');
	$email = $form-&gt;field('email')-&gt;get_attribute('value');
}
</pre>
<p>Try to create the user in the database:</p>
<pre class="brush: php; first-line: 24; title: ; notranslate">
if($val-&gt;run())
{
	$username = $form-&gt;field('username')-&gt;get_attribute('value');
	$password = $form-&gt;field('password')-&gt;get_attribute('value');
	$email = $form-&gt;field('email')-&gt;get_attribute('value');
	try
	{
		$user = $auth-&gt;create_user($username, $password, $email);
	}
</pre>
<p>And catch an errors if we find them:</p>
<pre class="brush: php; first-line: 24; title: ; notranslate">
if($val-&gt;run())
{
	$username = $form-&gt;field('username')-&gt;get_attribute('value');
	$password = $form-&gt;field('password')-&gt;get_attribute('value');
	$email = $form-&gt;field('email')-&gt;get_attribute('value');
	try
	{
		$user = $auth-&gt;create_user($username, $password, $email);
	}
	catch (Exception $e)
	{
		$error = $e-&gt;getMessage();
	}
</pre>
<p>We&#8217;re going to be nice here and log the user in once they register, so if they <code>$user</code> object is present, we can use the <code>$auth</code> object we passed in to log the person in:</p>
<pre class="brush: php; first-line: 24; title: ; notranslate">
if($val-&gt;run())
{
	$username = $form-&gt;field('username')-&gt;get_attribute('value');
	$password = $form-&gt;field('password')-&gt;get_attribute('value');
	$email = $form-&gt;field('email')-&gt;get_attribute('value');
	try
	{
		$user = $auth-&gt;create_user($username, $password, $email);
	}
	catch (Exception $e)
	{
		$error = $e-&gt;getMessage();
	}
	if(isset($user))
	{
		$auth-&gt;login($username, $password);
	}
</pre>
<p>And if the login didn&#8217;t work, then we can create an unordered list and return both that and the error&#8217;s found array:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
public function validate_registration(Fieldset $form, $auth)
{
$form-&gt;field('password')-&gt;add_rule('match_value', $form-&gt;field('password2')-&gt;get_attribute('value'));
	$val = $form-&gt;validation();
	$val-&gt;set_message('required', 'The field :field is required');
	$val-&gt;set_message('valid_email', 'The field :field must be an email address');
	$val-&gt;set_message('match_value', 'The passwords must match');
if($val-&gt;run())
{
	$username = $form-&gt;field('username')-&gt;get_attribute('value');
	$password = $form-&gt;field('password')-&gt;get_attribute('value');
	$email = $form-&gt;field('email')-&gt;get_attribute('value');
	try
	{
		$user = $auth-&gt;create_user($username, $password, $email);
	}
	catch (Exception $e)
	{
		$error = $e-&gt;getMessage();
	}
	if(isset($user))
	{
		$auth-&gt;login($username, $password);
	}
	else
	{
		if(isset($error))
		{
			$li = $error;
		}
		else {
			$li = 'Something went wrong with creating the user!';
		}
		$errors = Html::ul(array($li));
		return array('e_found' =&gt; true, 'errors' =&gt; $errors);
	}
}
else
{
	$errors = $val-&gt;show_errors();
	return array('e_found' =&gt; true, 'errors' =&gt; $errors);
}
}
</pre>
<p>Two more things to do. First, go to <code>action_register()</code> on the users controller and and add a check for errors, if there are no errors found, log the user in and redirect to the homepage:</p>
<pre class="brush: php; first-line: 25; title: ; notranslate">
if($_POST)
	{
		$form-&gt;repopulate();
		$result = Model_User::validate_registration($form, $auth);
		if($result['e_found'])
		{
			$view-&gt;set('errors', $result['errors'], false);
		}
		else
		{
			Session::set_flash('notice', 'User created.');
			Response::redirect('./');
		}
	}
</pre>
<p>Second, go to the register view and check for errors:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;?php if(isset($errors)){echo $errors;}?&gt;
	&lt;?php echo $reg; ?&gt;
</pre>
<p>There, now you should be able to register and be logged in automatically.</p>
<h6 id="Regular_Logging_In_and_Out">Regular Logging In and Out</h6>
<p>Based on what we&#8217;ve done so far, I should be able to just give you the code for this and you can understand it:</p>
<p>Users Controller:</p>
<pre class="brush: php; first-line: 5; title: ; notranslate">
	public function action_login()
	{
		$view = View::factory('users/login');
		$form = Form::factory('login');
		$auth = Auth::instance();
		$form-&gt;add('username', 'Username:');
		$form-&gt;add('password', 'Password:', array('type' =&gt; 'password'));
		$form-&gt;add('submit', ' ', array('type' =&gt; 'submit', 'value' =&gt; 'Login'));
		if($_POST)
		{
			if($auth-&gt;login(Input::post('username'), Input::post('password')))
			{
				Session::set_flash('notice', 'Successfully logged in! Welcome '.$auth-&gt;get_screen_name());
				Response::redirect('messages/');
			}
			else
			{
				Session::set_flash('notice', 'Username or password incorrect.');
			}
		}
		$view-&gt;set('form', $form, false);
		$this-&gt;template-&gt;title = 'User &amp;raquo; Login';
		$this-&gt;template-&gt;content = $view;
	}
	public function action_logout()
	{
		$auth = Auth::instance();
		$auth-&gt;logout();
		Session::set_flash('notice', 'Logged out.');
		Response::redirect('messages/');
	}
</pre>
<p>Don&#8217;t forget to echo the form in the login view!</p>
<h5 id="Finishing_Touches">Finishing Touches</h5>
<p>Now we just need to add the name of the person making the message (instead of letting them type it in themselves), and give them editing rights to their own posts.</p>
<p>Go to the _form.php files in both the comments and the messages and replace the name input field with the user&#8217;s name:</p>
<p>From this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Name', 'name'); ?&gt;
&lt;?php echo Form::input('name', Input::post('name', isset($message) ? $message-&gt;name : '')); ?&gt;
	&lt;/p&gt;
</pre>
<p>To this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo 'Name: '.Auth::instance()-&gt;get_screen_name(); ?&gt;
	&lt;/p&gt;
</pre>
<p>And this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo Form::label('Name', 'name'); ?&gt;
		&lt;?php echo Form::input('name', Input::post('name', isset($comment) ? $comment-&gt;name : '')); ?&gt;
	&lt;/p&gt;
</pre>
<p>To this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo Form::open(); ?&gt;
	&lt;p&gt;
		&lt;?php echo 'Name: '.Auth::instance()-&gt;get_screen_name(); ?&gt;
	&lt;/p&gt;
</pre>
<p>And on the message &amp; comment controllers replace the posted name with the user name:</p>
<pre class="brush: php; first-line: 42; title: ; notranslate">
	'name' =&gt; Auth::instance()-&gt;get_screen_name(), //Old: 'name' =&gt; Input::post('name'),
</pre>
<p>Now, go the the message view and check to see if the person looking at the post is the person who created it, and give them editing/deletion right:</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;
	&lt;strong&gt;Name:&lt;/strong&gt;
	&lt;?php echo $message-&gt;name; ?&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Message:&lt;/strong&gt;
	&lt;?php echo $message-&gt;message; ?&gt;&lt;/p&gt;
&lt;?php if($message-&gt;name == Auth::instance()-&gt;get_screen_name()) {?&gt;
	&lt;p&gt;&lt;?php echo Html::anchor('messages/edit/'.$message-&gt;id, 'Edit'); ?&gt; |
		&lt;?php echo Html::anchor('messages/delete/'.$message-&gt;id, 'Delete', array('onclick' =&gt; &quot;return confirm('Are you sure?')&quot;)); ?&gt;
	&lt;/p&gt;
&lt;?php } ?&gt;
&lt;?php echo Html::anchor('messages', 'Back'); ?&gt;
&lt;p&gt;&lt;?php echo Html::anchor('comments/create/'.$message-&gt;id, 'Add new Comment'); ?&gt;&lt;/p&gt;
</pre>
<p>And then in the list under the comment:</p>
<pre class="brush: php; first-line: 17; title: ; notranslate">
	&lt;?php if($comment-&gt;name == Auth::instance()-&gt;get_screen_name()) {?&gt;
	&lt;li&gt;&lt;p&gt;&lt;?php echo Html::anchor('comments/edit/'.$comment-&gt;id.'/'.$message-&gt;id, 'Edit'); ?&gt;|
&lt;?php echo Html::anchor('comments/delete/'.$comment-&gt;id.'/'.$message-&gt;id, 'Delete', array('onclick' =&gt; &quot;return confirm('Are you sure?')&quot;)); ?&gt;&lt;/li&gt;
	&lt;?php } ?&gt;
</pre>
<h6 id="This_is_the_Last_Thing_I_promise">This is the Last Thing, I promise</h6>
<p>The very last thing we&#8217;re going to do is to check if they user is logged in. If they are, allow them to make a message or comment.</p>
<p>Near the bottom of the message view that we were last on:</p>
<pre class="brush: php; first-line: 32; title: ; notranslate">
&lt;?php if(Auth::instance()-&gt;check()) { ?&gt;
&lt;p&gt;&lt;?php echo Html::anchor('comments/create/'.$message-&gt;id, 'Add new Comment'); ?&gt;&lt;/p&gt;
&lt;?php } ?&gt;
</pre>
<p>At the bottom of the message&#8217;s index view:</p>
<pre class="brush: php; first-line: 15; title: ; notranslate">
&lt;?php if(Auth::instance()-&gt;check()) {
 echo Html::anchor('messages/create', 'Add new Message');
}?&gt;
</pre>
<h4 id="Finished">Finished!</h4>
<p>Congratulations! You now have a working understanding of Fuel and have this neat little messaging system!</p>
<ul class="page_navlinks">
<li><a href="/fuel-crash-course-part-2/">&laquo; Back to Part 2</a></li>
<li><a href="/tutorials/">Back to Tutorials</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/7Z3QD25JCAo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/fuel-crash-course-part-3/</feedburner:origLink></item>
		<item>
		<title>Jacob Bates</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/0NxybtQyDDY/</link>
		<comments>http://techrangers.cdl.ucf.edu/biographies/jacob-bates/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 16:01:23 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
		
		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?page_id=1105</guid>
		<description><![CDATA[Birthday: October 13th Degree: Computer Engineering B.S. Expertise: XHTML PHP MySQL Flash/Actionscript 2 Audio/Video Editing Not exactly an expert with: jQuery/Javascript Python/Django CSS Photoshop Biography: I started my career with CDL&#8217;s own New Media team developing custom Flash pieces and PHP-based web applications. After graduating in 2006, I spent a few years in private industry [...]]]></description>
			<content:encoded><![CDATA[<h4>Birthday:</h4>
<p>October 13th</p>
<h4>Degree:</h4>
<p>Computer Engineering B.S.</p>
<h4>Expertise:</h4>
<ul>
<li>XHTML</li>
<li>PHP</li>
<li>MySQL</li>
<li>Flash/Actionscript 2</li>
<li>Audio/Video Editing</li>
</ul>
<h4>Not exactly an expert with:</h4>
<ul>
<li>jQuery/Javascript</li>
<li>Python/Django</li>
<li>CSS</li>
<li>Photoshop</li>
</ul>
<h4>Biography:</h4>
<p>I started my career with CDL&#8217;s own New Media team developing custom Flash pieces and PHP-based web applications.  After graduating in 2006, I spent a few years in private industry doing web development, marketing, and multimedia development.  I have returned to UCF to become the Techrangers Team Lead.  I enjoy photography, marksmanship, playing video games, and being a know-it-all.</p>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/0NxybtQyDDY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/biographies/jacob-bates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/biographies/jacob-bates/</feedburner:origLink></item>
		<item>
		<title>Jesse Slavens</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/_cGFDRLZLmI/</link>
		<comments>http://techrangers.cdl.ucf.edu/biographies/jesse-slavens/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 19:40:42 +0000</pubDate>
		<dc:creator>jslavens</dc:creator>
		
		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?page_id=1109</guid>
		<description><![CDATA[Birthday: January 8th Degree: Digital Media Expertise: XHTML CSS Learning: JavaScript PHP Flash Biography: I&#8217;m a UCF senior seeking a degree in Digital Media.  When I&#8217;m not working, I like to play and listen to music, bike, play videogames, and hang out with my friends.]]></description>
			<content:encoded><![CDATA[<p><strong>Birthday:</strong></p>
<ul>
<li>January 8th</li>
</ul>
<p><strong>Degree:</strong></p>
<ul>
<li>Digital Media</li>
</ul>
<p><strong>Expertise:</strong></p>
<ul>
<li>XHTML</li>
<li>CSS</li>
</ul>
<p><strong>Learning:</strong></p>
<ul>
<li>JavaScript</li>
<li>PHP</li>
<li>Flash</li>
</ul>
<p><strong>Biography:</strong> <strong></strong>I&#8217;m a UCF senior seeking a degree in Digital Media.  When I&#8217;m not working, I like to play and listen to music, bike, play videogames, and hang out with my friends.</p>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/_cGFDRLZLmI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/biographies/jesse-slavens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/biographies/jesse-slavens/</feedburner:origLink></item>
		<item>
		<title>Accessibility in the Web</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/qEB9FeJYOiQ/</link>
		<comments>http://techrangers.cdl.ucf.edu/accessibility-in-the-web/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 12:41:53 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
				<category><![CDATA[Tech Time]]></category>

		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?p=1027</guid>
		<description><![CDATA[<h3>UCF Staff/Faculty Only</h3>
This workshop held by the Center for Distributed Learning Techrangers focused on accessibility and how content creators can ensure their online material is accessible to all users, including those with disabilities.

Section 508 requires that Federal agencies’ electronic and information technology is accessible to people with disabilities (<a href="http://www.section508.gov">See: Section508.gov</a>).  The Techrangers will walk UCF staff and faculty through analyzing and applying Section 508 compliance to online documents.  There are a lot of simple principles you can apply to make your content as accessible as possible.]]></description>
			<content:encoded><![CDATA[<h3>UCF Staff/Faculty Only</h3>
<p>This workshop held by the Center for Distributed Learning Techrangers focused on accessibility and how content creators can ensure their online material is accessible to all users, including those with disabilities.</p>
<p>Section 508 requires that Federal agencies’ electronic and information technology is accessible to people with disabilities (<a href="http://www.section508.gov">See: Section508.gov</a>).  The Techrangers will walk UCF staff and faculty through analyzing and applying Section 508 compliance to online documents.  There are a lot of simple principles you can apply to make your content as accessible as possible.</p>
<p><a href="http://techrangers.cdl.ucf.edu/files/2011/03/techtime_flyer_3_30_2011.pdf">FLYER</a></p>
<p><span id="more-1027"></span></p>
<p><strong>This is a workshop for UCF staff and faculty only, we hope to open this up to the rest of the UCF community at a later time. </strong></p>
<p><strong>Participants will need to know basic HTML to fully participate in this workshop. Bring your laptop, if possible!<br />
</strong></p>
<p><img src="http://techrangers.cdl.ucf.edu/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<div id="extra">
<div id="event-description">
<dl>
<dt>When:</dt>
<dd>Wednesday, March 30, 2011 </dd>
<dd>2:30pm – 3:30pm</dd>
</dl>
</div>
<p><strong>The location on campus will be emailed to participants closer to the date.</strong></p>
<h3 id="resources">Accessibility Tech Time: Additional Resources</h3>
<h4>Presentation Video</h4>
<p>You can find the video recording of our presentation on YouTube.</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=ggKvbbQN3bo">Part One</a></li>
<li><a href="http://www.youtube.com/watch?v=nCCqVrGrE2g">Part Two</a></li>
<li><a href="http://www.youtube.com/watch?v=CBxCGBYBnfI">Part Three</a></li>
</ul>
<h4>Presentation Resources</h4>
<ul>
<li><a href="http://techrangers.ucf.devel/files/2011/03/Accessibility-Techtime-Handout1.pdf">Additional Resources Handout (PDF Copy)</a></li>
<li><a href="http://techrangers.ucf.devel/files/2011/03/accessibility_techtime1.pptx">Powerpoint Presentation</a></li>
</ul>
<h4>Presentation Activities</h4>
<p>For both activities download and correct the source code so that it is Section 508/accessible to those with disabilities.  The zip files contain the corrected source code as well.</p>
<ul>
<li><a href="http://teach.ucf.edu/wp-content/themes/techrangers/techtime_resources/2011-03-30_techtime_activity1.zip">Activity 1</a></li>
<li><a href="http://teach.ucf.edu/wp-content/themes/techrangers/techtime_resources/2011-03-30_techtime_activity2.zip">Activity 2</a></li>
</ul>
</div>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/qEB9FeJYOiQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/accessibility-in-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/accessibility-in-the-web/</feedburner:origLink></item>
		<item>
		<title>User Interface Moderator Training</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/69OvxT6bbX0/</link>
		<comments>http://techrangers.cdl.ucf.edu/user-interface-moderator-training/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 19:51:05 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?p=954</guid>
		<description><![CDATA[In this tutorial you will learn tips on how to be an effective moderator for usability testing. Usability testing is a technique used to evaluate a product by testing it with representative users. In the test, these users will try to complete typical tasks while observers watch, listen and takes notes. Your goal is to identify any usability problems, collect quantitative data on participants' performance (e.g., time on task, error rates), and determine participant's satisfaction with the product (From Usability.gov).



]]></description>
			<content:encoded><![CDATA[<h3>Powerpoint Presentation</h3>
<p>In the PowerPoint presentation (linked below), there are techniques, tips, and resources available on how to be the most effective moderator.</p>
<p><a href="http://techrangers.cdl.ucf.edu/files/2011/03/Web-Usability-Training.pptx">Web Usability Training Power Point</a>.</p>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/69OvxT6bbX0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/user-interface-moderator-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/user-interface-moderator-training/</feedburner:origLink></item>
		<item>
		<title>Accessibility Standards</title>
		<link>http://feedproxy.google.com/~r/techrangersucf/~3/tEYYvtanPs8/</link>
		<comments>http://techrangers.cdl.ucf.edu/techtime/accessibility-standards-033011/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 22:14:03 +0000</pubDate>
		<dc:creator>jbates</dc:creator>
		
		<guid isPermaLink="false">http://techrangers.cdl.ucf.edu/?page_id=943</guid>
		<description><![CDATA[UCF Staff/Faculty Only This workshop held by the Center for Distributed Learning Techrangers will focus on accessibility and how content creators can ensure their online material is accessible to all users, including those with disabilities. Section 508 requires that Federal agencies’ electronic and information technology is accessible to people with disabilities (See: Section508.gov).  The Techrangers [...]]]></description>
			<content:encoded><![CDATA[<h3>UCF Staff/Faculty Only</h3>
<p>This workshop held by the Center for Distributed Learning Techrangers will focus on accessibility and how content creators can ensure their online material is accessible to all users, including those with disabilities.</p>
<p>Section 508 requires that Federal agencies’ electronic and information technology is accessible to people with disabilities (<a href="http://www.section508.gov">See: Section508.gov</a>).  The Techrangers will walk UCF staff and faculty through analyzing and applying Section 508 compliance to online documents.  There are a lot of simple principles you can apply to make your content as accessible as possible.</p>
<p><a href="http://techrangers.cdl.ucf.edu/files/2011/03/techtime_flyer_3_30_2011.pdf">FLYER</a></p>
<p><span id="more-943"></span></p>
<p><strong>This is a workshop for UCF staff and faculty only, we hope to open this up to the rest of the UCF community at a later time. </strong></p>
<p><strong>Participants will need to know basic HTML to fully participate in this workshop. Bring your laptop, if possible!<br />
</strong></p>
<p><img src="http://techrangers.cdl.ucf.edu/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<div id="extra">
<div id="event-description">
<dl>
<dt>When:</dt>
<dd>Wednesday, March 30, 2011 </dd>
<dd>2:30pm – 3:30pm</dd>
</dl>
</div>
<h3 id="resources">Accessibility Tech Time: Additional Resources</h3>
<h4>Presentation Video</h4>
<p>You can find the video recording of our presentation on YouTube.</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=ggKvbbQN3bo">Part One</a></li>
<li><a href="http://www.youtube.com/watch?v=nCCqVrGrE2g">Part Two</a></li>
<li><a href="http://www.youtube.com/watch?v=CBxCGBYBnfI">Part Three</a></li>
</ul>
<h4>Presentation Resources</h4>
<ul>
<li><a href='http://techrangers.cdl.ucf.edu/files/2011/03/2011-03-30-Accessibility-Techtime-Handout-digital.pdf'>Additional Resources Handout (PDF Copy)</a></li>
<li><a href='http://techrangers.cdl.ucf.edu/files/2011/03/2011-03-30-accessibility_techtime.pptx'>Powerpoint Presentation</a></li>
</ul>
<h4>Presentation Activities</h4>
<p>For both activities download and correct the source code so that it is Section 508/accessible to those with disabilities.  The zip files contain the corrected source code as well.</p>
<ul>
<li><a href="http://teach.ucf.edu/wp-content/themes/techrangers/techtime_resources/2011-03-30_techtime_activity1.zip">Activity 1</a></li>
<li><a href="http://teach.ucf.edu/wp-content/themes/techrangers/techtime_resources/2011-03-30_techtime_activity2.zip">Activity 2</a></li>
</ul>
<h4>Links and Information</h4>
<ul>
<li><a href="http://www.webaim.org">WebAIM</a>
<ul>
<li>This is a great resource for all things accessibility. It gives the specifics of section 508 requirements in easy to understand terms, helpful practices, hints, and tips to making accessible web content without hindering the design process.</li>
</ul>
</li>
<li><a href="http://wave.webaim.org">WAVE Validator</a>
<ul>
<li>The WAVE validator is like an HTML validator,  but instead it checks the accessibility of your site based on a 12 point checklist. This is a great place to start for improving your page.</li>
</ul>
</li>
<li><a href="http://webanywhere.cs.washington.edu/">WebAnywhere</a>
<ul>
<li>This is a free web-based screen reader. It&#8217;s a little less advanced, but it&#8217;s a great place to start for making your page screen reader accessible.</li>
</ul>
</li>
<li><a href="http://www.accesskeys.org/tools/color-contrast.html">Access Color</a>
<ul>
<li>This site functions as a &#8220;color validator&#8221; that will give you in-depth data on the contrast levels of the content on your site. It will give errors or warnings if certain colors don&#8217;t contrast well enough to be accessible.</li>
</ul>
<li><a href="http://colorschemedesigner.com">Color Scheme Designer</a>
<ul>
<li>This is a great color accessibility reference  tool that lets you see what your color scheme would look like with various  types of color blindness.</li>
</ul>
</li>
</ul>
</div>
<img src="http://feeds.feedburner.com/~r/techrangersucf/~4/tEYYvtanPs8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://techrangers.cdl.ucf.edu/techtime/accessibility-standards-033011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://techrangers.cdl.ucf.edu/techtime/accessibility-standards-033011/</feedburner:origLink></item>
	</channel>
</rss>

