<?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/"
	>

<channel>
	<title>Query7</title>
	<atom:link href="http://query7.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://query7.com</link>
	<description>jQuery Programming &#124; Flex Development &#124; Zend Coding &#124; AIR Development &#124; PHP Development</description>
	<pubDate>Wed, 24 Jun 2009 04:30:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Regular expresssion URL Router</title>
		<link>http://query7.com/php-regular-expresssion-url-router/</link>
		<comments>http://query7.com/php-regular-expresssion-url-router/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 04:30:30 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=495</guid>
		<description><![CDATA[<p>In this tutorial we will create a PHP URL router. The developer using the router will be able to define these routes with regular expressions, these will then map to a file, class and method which will be called - very similar to Django&#8217;s routing. By using regular expressions to define our URLs we get maximum customizability. <em>/class/method/</em> based URL routing&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we will create a PHP URL router. The developer using the router will be able to define these routes with regular expressions, these will then map to a file, class and method which will be called - very similar to Django&#8217;s routing. By using regular expressions to define our URLs we get maximum customizability. <em>/class/method/</em> based URL routing is too restrictive sometimes. We will assume the user is using an apache or similar web server with <em>mod_rewite</em> enabled. You can adapt this router and use it in your web application or framework.</p>
<p>Quick Note: This is taken straight out of one of my applications. I have a singleton registry object called $core which you&#8217;ll see referenced many times. I suggest you make your own or use <em>global</em> variables.</p>
<h3>.htaccess</h3>
<p>First of all we need to create a <em>.htaccess</em> file in the root directory of your project. We turn the RewriteEngine on, and then declare a rule to route everything except images/js/css through our <em>index.php</em> file. So even if the person goes to www.yoursite.com/directory/file.php , rather than executing that file it will execute our <em>index.php</em> instead.</p>
<pre>RewriteEngine on
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php</pre>
<p>If your building a framework or application you&#8217;ll probably have some ini/bootstrapping code that you want to run here. The router itself is procedural so include it at the bottom of index.php.</p>
<h3>Declaring the Routes</h3>
<p>We define our routes in an array called <strong>$urls</strong> (naming matters). You can declare these anywhere before the router is included. In the array key we declare our regular expression. I&#8217;ve listed a couple as examples below. The first matches to the root - as if someone went to www.yoursite.com. This gets mapped to <em>application/views/blog.php</em> , then the <em>index()</em> method in the <em>blog</em> class is executed. The second is slightly more complex and captures a value called slug. This value is then passed as a parameter in the <em>individual_post()</em> method when it is executed.</p>
<pre>$urls = array(
			// "Regex to match" =&gt; "path_to_file.php___className___functionName",

			"(^[/]$)" =&gt; "application/views/blog.php___blog___index", // No captured values
			"(/post/(?P &lt;slug&gt;\w.*)$)" => "application/views/blog.php___blog___individual_post",

			);</pre>
<h3>The Router Itself</h3>
<p>The operation of the router itself is pretty simple:</p>
<ul>
<li>Figure out the URI the user requested</li>
<li>Try and match one of the defined regular expressions to that URI</li>
<li>If it does match, see if there are any captured matches (eg. our slug name above)</li>
<li>If there are matches, call the appropriate method and pass them as a parameter</li>
</ul>
<p>First we need to figure out the URI. For example if they went to www.yoursite.com/blog/first-post/ , we would just want to capture the /blog/first-post/ so it matches our regular expressions. The code below does that with a series of <em>str_replace()</em>s.</p>
<pre>
$already_there = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);

$slightly = str_replace($_SERVER['SCRIPT_NAME'], "", $_SERVER['REQUEST_URI']);

$uri = '/' . str_replace($already_there, '', $slightly);
</pre>
<p>We will then iterate through our defined URL routes/regular expressions and try to get a match.</p>
<pre>foreach($urls as $regex => $mapper)
{

	if (preg_match($regex, $uri, $matches))
	{
</pre>
<p><em>$matches</em> is an array that is populated when a URL pattern is matched. If we are capturing a value (eg. slug in the above example) then there will be a key called &#8217;slug&#8217; and the value it captured in the array. If there is only one item in the <em>$matches</em> array, then there the user didn&#8217;t try to capture any values in their regular expression so we don&#8217;t need to pass any arguments in the method that we call. We simply explode the $val variable to get the filename, class name and method name, then call it.<br />
If however we iterate across a key that isn&#8217;t numeric, then we know there is a value that is getting captured. We simply get that and pass it as an argument when we call the method.</p>
<pre>
		foreach($matches as $key => $val)
		{

			if(count($matches) == 1)
			{

				$foo = explode("___", $mapper);

				//Include the view they specified
				include($core->settings->application_path . $foo[0]);

				//Instantiate a new class they specified
				$bar = new $foo[1]();

				//Call the function they specified
				$bar->$foo[2]();

			}

			//Make sure the key is not numeric - some extra garbage preg_match() gives us.
			if(!is_numeric($key))
			{

				//Split the value they defined up into sections
				$foo = explode("___", $mapper);

				//Include the view they specified
				include($core->settings->application_path . $foo[0]);

				//Instantiate a new class they specified
				$bar = new $foo[1]();

				//Call the function they specified
				$bar->$foo[2]($val);

				//echo $key . ' -> ' . $val . '';
			}
		}
	break;
</pre>
<p>Theres also a place to indicate to the user that there we no matches - it&#8217;s up to you if you want to give a custom error page, 404, whatever.</p>
<pre>
	}
	else
	{
	    //echo "A match was not found.";
	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-regular-expresssion-url-router/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Autoload</title>
		<link>http://query7.com/php-autoload/</link>
		<comments>http://query7.com/php-autoload/#comments</comments>
		<pubDate>Sat, 30 May 2009 20:33:59 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Web Development]]></category>

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

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

		<guid isPermaLink="false">http://query7.com/?p=482</guid>
		<description><![CDATA[<p>In large PHP applications you typically see a &#8220;classes&#8221; directory that only contains classes which are used throughout the application (database, session management, forms etc..). A problem quickly appears: Everytime you wanted to use one of the classes, you would be forced to <em>include()</em> it at the top of the page. <em>__autoload()</em> solves this by automatically including the definition file when a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In large PHP applications you typically see a &#8220;classes&#8221; directory that only contains classes which are used throughout the application (database, session management, forms etc..). A problem quickly appears: Everytime you wanted to use one of the classes, you would be forced to <em>include()</em> it at the top of the page. <em>__autoload()</em> solves this by automatically including the definition file when a class is called.</p>
<h3>Example</h3>
<p>We have a simple application with the index.php file in the root directory and a directory called classes that contains numerous classes.<br />
<strong>classes/time.class.php</strong></p>
<pre lang="php">class time
{
	function fn1()
	{
		echo 'hello world';
	}
}</pre>
<p>The code below shows what we&#8217;d need to do if we didn&#8217;t have autoload. While that code doesn&#8217;t seem so bad, imagine writing includes on each of your 30-40 files. It would get messy and very hard to maintain. Another option would be to have a single file that all of your classes are included in, there include that one file in each of your functional scripts but you could expect a performance loss as every one of your classes would be included on the page - even if it wasn&#8217;t needed.</p>
<p><strong>index.php</strong></p>
<pre lang="php">include('classes/time.class.php');

$time = new time();

$time-&gt;fn1();

//Returns hello world</pre>
<p>The<em> __autoload()</em> function accepts one parameter - the name of the class that is being instantiated. We pass this so we know what file to include.</p>
<p><strong>index.php revised</strong></p>
<pre lang="php">function __autoload($class_name)
{
	include('classes/' . $class_name . '.class.php');
}

$time = new time();

$time-&gt;fn1();

//Returns hello world</pre>
<h3>A More Complex Example</h3>
<p>Large projects and frameworks often have classes split up into groups - extensions, modules and core components. When instantiating a new class, we don&#8217;t want to have to declare what group it belongs to. We can build this right into our autoload function, and also check if the file/class exists.</p>
<pre lang="php">function __autoload($class)
{

	if(file_exists('core/' . $class . '.class.php'))
	{
		include('core/' . $class . '.class.php');
	}

	if(file_exists('extensions/' . $class . '.class.php'))
	{
		include('extensions/' . $class . '.class.php');
	}

	if(file_exists('modules/' . $class . '.class.php'))
	{
		include('modules/' . $class . '.class.php');
	}

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-autoload/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Development Tools on Linux</title>
		<link>http://query7.com/web-development-tools-on-linux/</link>
		<comments>http://query7.com/web-development-tools-on-linux/#comments</comments>
		<pubDate>Sun, 03 May 2009 07:31:57 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://query7.com/?p=443</guid>
		<description><![CDATA[<p>While there are numerous posts and tutorials detailing web development tools for Windows and Mac operating systems scattered throughout the internet, there are very little for Linux. I&#8217;ll show and describe the tools I use to code PHP, Python, Javascript, HTML and CSS on a Linux platform (Ubuntu 8.10). None of these tools are distro specific.</p>
<h3>Netbeans</h3>
<p>Netbeans is a full featured&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>While there are numerous posts and tutorials detailing web development tools for Windows and Mac operating systems scattered throughout the internet, there are very little for Linux. I&#8217;ll show and describe the tools I use to code PHP, Python, Javascript, HTML and CSS on a Linux platform (Ubuntu 8.10). None of these tools are distro specific.</p>
<h3>Netbeans</h3>
<p>Netbeans is a full featured IDE written in Java by Sun. Some people prefer Eclipse and Eclipse based IDEs (Aptana) but I find them slow and laggy on my system. The current Netbeans version in the Ubuntu repositories is 6.1, whlie this is good for Java and C++ developement, PHP support wasn&#8217;t included until 6.5.X. You can download the PHP package <a href="http://www.netbeans.org/downloads/index.html">here</a> - 26mb. Netbeans comes with standard project support, code completion, syntax highlighting and searching. What sets Netbeans apart from the rest is that it has on the fly PHP debugging (that works!). It also has version control support out of the box and in general it&#8217;s very quick.</p>
<p><img class="alignnone size-full wp-image-451" title="screenshot_0011" src="http://query7.com/wp-content/uploads/2009/04/screenshot_0011.png" alt="screenshot_0011" width="647" height="398" /></p>
<h3>Gedit</h3>
<p>Gedit is the default text editor for GNOME, if you use GNOME, chances are it is already installed. If not you can find it by the package name gedit in your distro&#8217;s repository. The KDE equivalent is Kate. By itself it is just a text editor, but with a few plugins you can turn it into a mini IDE. You can view all of the available plugins <a href="http://live.gnome.org/Gedit/Plugins">here</a> they range from version control to a lorem ipsum generator. I recommend you install the following:</p>
<ul>
<li><a href="http://my.opera.com/area42/blog/gedit-browser-preview-plugin">Browser preview</a> - Firefox, Opera, Internet Explorer (done through ies4linux)</li>
<li><a href="http://live.gnome.org/Gedit/Plugins/BetterPythonConsole">Python Console</a> - Supports PyGTK, PyQT and Tkinter. Think of an in-editor IDLE</li>
<li>File Browser - Gives a pane to view files. Comes with Gedit out of the box.</li>
<li>Code Snippets - Allows you to type a few characters and expand them to full code snippets. Comes with Gedit out of the box.</li>
</ul>
<p><img class="alignnone size-full wp-image-453" title="gedit" src="http://query7.com/wp-content/uploads/2009/04/gedit.png" alt="gedit" width="650" height="479" /></p>
<h3>Heidi SQL</h3>
<p>The choice of SQL editor largely depends upon the person as there are many with similar features. I prefer HeidiSQL. Although there are no native builds of HeidiSQL for Linux, it runs perfectly under WINE. I find it easier to use than phpmyadmin as content loads seamlessly and you can be connected to several different servers simultaneously.</p>
<p><img class="alignnone size-full wp-image-457" title="screenshot_0021" src="http://query7.com/wp-content/uploads/2009/04/screenshot_0021.png" alt="screenshot_0021" width="600" height="570" /></p>
<h3>Firefox</h3>
<p>Although Firefox is primarily a web browser, there have been many creative addons released that add extra functionality to it. I won&#8217;t cover Firebug as there are many articles and tutorials out there but I will bring your attention to  <a href="http://www.evolus.vn/Pencil/">Pencil</a>. Pencil allows you to prototype user interfaces. It includes Microsoft Windows and GTK+ widgets that you can drag and drop onto a palette. Although it doesn&#8217;t actually generate an XML file like the Glade Interface Designer does, it allows for rapid prototyping for both desktop and web. As it&#8217;s a firefox addon it&#8217;s cross platform, so you can share interfaces you make with colleagues.</p>
<p><img class="alignnone size-full wp-image-460" title="screenshot_003" src="http://query7.com/wp-content/uploads/2009/04/screenshot_003.png" alt="screenshot_003" width="600" height="456" /></p>
<h3>Filezilla</h3>
<p><a href="http://filezilla-project.org/">Filezilla</a> is an open source cross-platform FTP client. It has an easy to use five pane interface. Two for local directories and files, two for remote directories and files and one for the status of transferring files. Filezilla can also connect through proxies or sFTP. One of my favourite features of Filezilla is that you can edit remote files on the fly. Just right click on the file and choose the <em>edit</em> option and it will download the contents and open it in your specified editor. When you save the file it will automatically re-upload itself to the server.</p>
<p><img class="alignnone size-full wp-image-467" title="screenshot_008" src="http://query7.com/wp-content/uploads/2009/05/screenshot_008.png" alt="screenshot_008" width="600" height="438" /></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/web-development-tools-on-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building a Todo List using Code Igniter</title>
		<link>http://query7.com/building-a-todo-list-using-code-igniter/</link>
		<comments>http://query7.com/building-a-todo-list-using-code-igniter/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 10:06:59 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Code Igniter]]></category>

		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=422</guid>
		<description><![CDATA[<p>A Query7 reader <a href="http://query7.com/getting-started-with-code-igniter/#comments">requested</a> this tutorial to be written. It&#8217;s aimed to be a general guide to build &#8217;something&#8217; using Code Igniter. It uses Models, Views, Controllers, Helpers and Libraries and will give you a good idea how Code Igniter works as a whole. I will be posting more advanced Code Igniter tutorials in the future.</p>
<h2>Setup</h2>
<p>Install and do some basic configuration&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A Query7 reader <a href="http://query7.com/getting-started-with-code-igniter/#comments">requested</a> this tutorial to be written. It&#8217;s aimed to be a general guide to build &#8217;something&#8217; using Code Igniter. It uses Models, Views, Controllers, Helpers and Libraries and will give you a good idea how Code Igniter works as a whole. I will be posting more advanced Code Igniter tutorials in the future.</p>
<h2>Setup</h2>
<p>Install and do some basic configuration (URL, database settings) of Code Igniter. If you don&#8217;t know how to do this, read <a href="http://query7.com/getting-started-with-code-igniter/">here</a>. Autoload the <em>database</em> library and <em>url</em> helper as we will be using them.</p>
<p>The user will be able to post new items and delete current items and the app itself will be made up of:</p>
<ul>
<li>One Controller - todo.php</li>
<li>One Model - todo_model.php</li>
<li>One View - todo_index.php</li>
</ul>
<h2>PHP4 Compatibility</h2>
<p>Because Code Igniter supports both PHP4 and PHP5, you are forced to use PHP4 style OOP. Your constructor must be the same name as the class, and it needs to contain <em>parent::Controller();</em> or <em> parent::Model();</em><br />
The naming conventions for controllers and models are very strict. The name of both class and constructor must be the same as the file name, but capitalized. In our case of our controller, the file name is <em>todo.php</em> and the name of the class and constructor is called <em>Todo</em>.</p>
<h2>Model</h2>
<p>The model in Code Igniter is a place where you write your application&#8217;s SQL queries (It doesn&#8217;t map your schema like in Django/RoR). In our application we specify 3 methods, which can then be called upon in the controller. You will notice we are using the Code Igniter database class but not Code Igniter&#8217;s full ORM. This is just personal preference. In get_all_todo_items() we call <em>$q-&gt;result_array()</em> . Think of it as an equivalent to<em> mysql_fetch_array()</em>.</p>
<pre lang="php">class Todo_model extends Model {

    function Todo_model()

    {

        parent::Model();

    }

	function new_todo($content)

	{
		$date = date('l jS \of F Y h:i:s A');

		$q = $this-&gt;db-&gt;query("INSERT INTO items (date,content) VALUES ('$date','$content')");

	}

	function get_all_todo_items()
	{
		$q = $this-&gt;db-&gt;query("SELECT id,date,content FROM items");
		return $q-&gt;result_array();
	}

	function delete_todo_item($id)
	{
		$q = $this-&gt;db-&gt;query("DELETE FROM items WHERE id = '$id'");
	}

}</pre>
<h2>Controller</h2>
<blockquote><p>/system/application/controllers/todo.php</p></blockquote>
<p>You can also see in the Controller that we are loading the <em>form</em> helper and <em>todo_model</em> model. Notice there are no file extensions being used. In Code Igniter URLs are structured like: <em>www.foo.com/ci/index.php/controller/method/</em>. If no method is specified then Code Igniter will automatically run the <em>index()</em> method.</p>
<p><strong>index_page()</strong><br />
We assign the results of <em>get_all_todo_items()</em> to <em>$info['item']</em> . We then pass the $info array (which contains all of our todo items) to our view which we&#8217;ll create soon.<br />
<strong>add_item()</strong><br />
Rather than using <em>$_POST['content']</em> to access a property, you should use <em>$this-&gt;input-&gt;post(&#8217;content&#8217;)</em>. This utilises Code Igniter&#8217;s input class which automatically filters out SQL injections and XSS attacks (<em>line 266 /application/config/config.php</em>)<br />
We then pass the result from that to our new_todo() method in our model and redirect the user back to the index page.<br />
<strong>delete_item()</strong><br />
We can use the <em>segment()</em> method in the <em>uri</em> class to grab bits of information from the URL. Because our URI will be <em>/todo/delete_item/id/</em>, by grabbing the 3rd segment we get the id. We can then feed that do our <em>delete_todo_item()</em> method we defined in the model and redirect the user to the main page.</p>
<pre lang="php">class Todo extends Controller {

	function Todo()
	{
		parent::Controller();
                $this-&gt;load-&gt;helper('url');
		$this-&gt;load-&gt;helper('form');
		$this-&gt;load-&gt;model('todo_model');
	}

	function index()
	{
		$this-&gt;index_page();
	}

	function index_page()
	{
		$info['item'] = $this-&gt;todo_model-&gt;get_all_todo_items();
		$this-&gt;load-&gt;view('todo_index.php', $info);
	}

	function add_item()
	{
		$content = $this-&gt;input-&gt;post('content');
		$this-&gt;todo_model-&gt;new_todo($content);

		redirect('');
	}

	function delete_item()
	{
		$this-&gt;todo_model-&gt;delete_todo_item($this-&gt;uri-&gt;segment(3));

		redirect('');
	}
}</pre>
<p>Finally we need to write our view.</p>
<blockquote><p>/system/application/views/todo_index.php</p></blockquote>
<p>On line 5 you can see the form_open() function being used. This creates our opening form tag. The <em>action</em> attribute is specified by the parameter that we passed. Code Igniter automatically prepends your site URL to this parameter it ends up as <em>action=&#8221;http://path_to_site.com/URI_passed&#8221;</em>. This is useful because if we move the site to another domain name, the form will continue to post to the correct URL. Between lines 12 and 17 we are iterating through the todo items posted.</p>
<pre>&lt;h1&gt;Todo List&lt;/h1&gt;

&lt;hr /&gt;

&lt;?php echo form_open('todo/add_item'); ?&gt;

	&lt;textarea cols="40" rows="10" name="content"&gt;&lt;/textarea&gt;
	&lt;input type="submit" value="Add new item" /&gt;
&lt;/form&gt;

&lt;ul&gt;
&lt;?php
for($i = 0; $i &lt; sizeof($item); ++$i)
{
    echo '&lt;li&gt;' . $item[$i]['content'] . ' - &lt;i&gt;' . $item[$i]['date'] . '&lt;/i&gt; - &lt;a href="' . site_url() . '/todo/delete_item/' . $item[$i]['id'] . '"&gt;Delete&lt;/a&gt;&lt;/li&gt;';
}
?&gt;
&lt;/ul&gt;

&lt;hr /&gt;
&lt;p&gt;Created by &lt;a href="http://www.query7.com"&gt;Query7&lt;/a&gt;&lt;/p&gt;</pre>
<p>Feel free to post any questions or comments you have.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/building-a-todo-list-using-code-igniter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting started with Code Igniter</title>
		<link>http://query7.com/getting-started-with-code-igniter/</link>
		<comments>http://query7.com/getting-started-with-code-igniter/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 05:05:13 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Code Igniter]]></category>

		<category><![CDATA[Web Development]]></category>

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

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

		<guid isPermaLink="false">http://query7.com/?p=394</guid>
		<description><![CDATA[<h2>What is Code Igniter?</h2>
<p>Code Igniter is a PHP web framework which assists in creating complex websites. Unlike other web frameworks, Code Igniter doesn&#8217;t force you to use all of it&#8217;s components. You select and load them as you require. The only feature you have to use is the URL structuring (<em>/controller/method/</em>) which is very helpful anyway.</p>
<p>Code Igniter follows the Model,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<h2>What is Code Igniter?</h2>
<p>Code Igniter is a PHP web framework which assists in creating complex websites. Unlike other web frameworks, Code Igniter doesn&#8217;t force you to use all of it&#8217;s components. You select and load them as you require. The only feature you have to use is the URL structuring (<em>/controller/method/</em>) which is very helpful anyway.</p>
<p>Code Igniter follows the Model, View, Controller (MVC) principle. All of your database queries are stored in models, HTML/XML output in Views and the logic code in Controllers. You aren&#8217;t forced to do this, however it does keep your code organized and reusable.</p>
<h2>Helpers and Libraries</h2>
<p>Like most frameworks, Code Igniter comes with many classes that help assist development. They are split into <em>Libraries</em> (AKA <em>Classes</em>) and <em>Helpers</em>. Libraries contain code that you could use on every page of your application - Database ORM, Image Manipulation, Pagination and Benchmarking. Helpers are things like Relative URLs, Forms and Email.</p>
<p>Using helpers and libraries is very easy. If you want it included throughout the site see below (autoloads). If you want it included for every method in a Controller, then you can add it to that Controller&#8217;s constructor. If you just want it included in one method, add the code inside the method.</p>
<pre>$this-&gt;load-&gt;helper('helper_name');
$this-&gt;load-&gt;library('library_name');</pre>
<h2>Installation</h2>
<p>Installing Code Igniter is alot easier than installing other PHP web frameworks. There is no need for command line access, nor the need to write your database schema in XML. You only need to edit a few configuration files.</p>
<p>Download and Install the latest version off the Code Igniter <a href="http://codeigniter.com/downloads/">download page</a>. Extract it and upload it to your web server. You may notice the directory <em>/user_guide/</em> . This only contains documentation so it can be deleted safely. Up to date documentation can always be found at <a href="http://www.codeigniter.com/user_guide/">www.codeigniter.com/user_guide/</a>.</p>
<p>Now that Code Igniter has been &#8216;installed&#8217; we need to configure our settings. Open..</p>
<blockquote><p><em>/system/application/config/config.php</em></p></blockquote>
<p>On line 14 we need to set the path to our website. Make sure it has a trailing slash.</p>
<pre>$config['base_url']	= "http://www.website.com/path/to/codeigniter/";</pre>
<p>I also put global XSS filtering on. By default it is not active. Replace line 267 with..</p>
<pre>$config['global_xss_filtering'] = TRUE;</pre>
<p>If your application uses a database, now is a good time to set it up. Open..</p>
<blockquote><p><em>/system/application/config/database.php</em></p></blockquote>
<pre>$db['default']['hostname'] = "localhost"; //usually localhost
$db['default']['username'] = "usernamet";  //database username
$db['default']['password'] = "password";  //password to user set above
$db['default']['database'] = "database";  //database name
$db['default']['dbdriver'] = "mysql";  //database driver - mysql/postgre/sqlite etc..
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";</pre>
<p>When you call the database class, Code Igniter will connect to the database with the information you set in <em>$db['default']</em> array. </p>
<pre>$this-&gt;load-&gt;database();</pre>
<p>You can then interact with the database through</p>
<pre>$this-&gt;db-&gt;method();</pre>
<p>If your application uses more than one database, you can set another array in the same <em>database.php</em> file but call it a seperate name. eg <em>$db['remote']</em> (copy and paste the <em>$db['default']</em> array and change where necessary). You can then connect that database with..</p>
<pre>$remote_db = $this-&gt;load-&gt;database('remote', TRUE);</pre>
<p>And execute database methods through..</p>
<pre>$remote_db-&gt;method();</pre>
<p>I also recommend you set up autoloads..</p>
<blockquote><p><em>/system/application/config/autoload.php</em></p></blockquote>
<p>Here you can specify classes and helpers that will be available in every file throughout your project. This is useful because you won&#8217;t need to call them every time you make a new controller. I recommend <em>autoload</em>ing the database class and the URL helper. You will find the URL helper very useful in your Views, being able to use relative URLs instead of hard coding full <em>http://www.website.com/path/to/codeigniter/</em> URLs is very useful. You just need to add the name of the library/helper in the appropriate array..</p>
<pre>$autoload['libraries'] = array('database');
$autoload['helper'] = array('url');</pre>
<p>Thats it.. Feel free to ask any questions.<br />
In the next couple of weeks I&#8217;ll be writing a tutorial showing how to get a fully featured authentication system up and running with Code Igniter.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/getting-started-with-code-igniter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Working with Google&#8217;s Language API</title>
		<link>http://query7.com/working-with-googles-language-apis/</link>
		<comments>http://query7.com/working-with-googles-language-apis/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 19:28:42 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=378</guid>
		<description><![CDATA[<p>Google translate is used by millions of people every day. Combine this with the easy reporting of language errors/mistakes makes it one of the most comprehensive and accurate online translators. Google provides an easy to use API to access their large language database, we&#8217;ll be using that today.</p>
<p>It will consist of two textareas, two dropdowns and one button. It will&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Google translate is used by millions of people every day. Combine this with the easy reporting of language errors/mistakes makes it one of the most comprehensive and accurate online translators. Google provides an easy to use API to access their large language database, we&#8217;ll be using that today.</p>
<p>It will consist of two textareas, two dropdowns and one button. It will look something like this:</p>
<p><a href="http://query7.com/wp-content/uploads/2009/02/preview.gif"><img class="alignnone size-medium wp-image-379" src="http://query7.com/wp-content/uploads/2009/02/preview-300x273.gif" alt="" width="300" height="273" /></a></p>
<h2>HTML</h2>
<p>The HTML code is fairly straight foward. Notice the dropdown menus have <em>value</em>s. These are essential as this is the language code, it&#8217;s sent to Google.</p>
<pre>&lt;body&gt;
&lt;div class="he"&gt;
&lt;h2&gt;Translate&lt;/h2&gt;
From:
&lt;select id="from"&gt;
&lt;option value=sq&gt;Albanian&lt;/option&gt;&lt;option value=ar&gt;Arabic&lt;/option&gt;&lt;option value=bg&gt;Bulgarian&lt;/option&gt;&lt;option value=ca&gt;Catalan&lt;/option&gt;&lt;option value=zh-CN&gt;Chinese (Simplified)&lt;/option&gt;&lt;option value=zh-TW&gt;Chinese (Traditional)&lt;/option&gt;&lt;option value=hr&gt;Croatian&lt;/option&gt;&lt;option value=cs&gt;Czech&lt;/option&gt;&lt;option value=da&gt;Danish&lt;/option&gt;&lt;option value=nl&gt;Dutch&lt;/option&gt;&lt;option value=en selected&gt;English&lt;/option&gt;&lt;option value=et&gt;Estonian&lt;/option&gt;&lt;option value=tl&gt;Filipino&lt;/option&gt;&lt;option value=fi&gt;Finnish&lt;/option&gt;&lt;option value=fr&gt;French&lt;/option&gt;&lt;option value=gl&gt;Galician&lt;/option&gt;&lt;option value=de&gt;German&lt;/option&gt;&lt;option value=el&gt;Greek&lt;/option&gt;&lt;option value=iw&gt;Hebrew&lt;/option&gt;&lt;option value=hi&gt;Hindi&lt;/option&gt;&lt;option value=hu&gt;Hungarian&lt;/option&gt;&lt;option value=id&gt;Indonesian&lt;/option&gt;&lt;option value=it&gt;Italian&lt;/option&gt;&lt;option value=ja&gt;Japanese&lt;/option&gt;&lt;option value=ko&gt;Korean&lt;/option&gt;&lt;option value=lv&gt;Latvian&lt;/option&gt;&lt;option value=lt&gt;Lithuanian&lt;/option&gt;&lt;option value=mt&gt;Maltese&lt;/option&gt;&lt;option value=no&gt;Norwegian&lt;/option&gt;&lt;option value=pl&gt;Polish&lt;/option&gt;&lt;option value=pt&gt;Portuguese&lt;/option&gt;&lt;option value=ro&gt;Romanian&lt;/option&gt;&lt;option value=ru&gt;Russian&lt;/option&gt;&lt;option value=sr&gt;Serbian&lt;/option&gt;&lt;option value=sk&gt;Slovak&lt;/option&gt;&lt;option value=sl&gt;Slovenian&lt;/option&gt;&lt;option value=es&gt;Spanish&lt;/option&gt;&lt;option value=sv&gt;Swedish&lt;/option&gt;&lt;option value=th&gt;Thai&lt;/option&gt;&lt;option value=tr&gt;Turkish&lt;/option&gt;&lt;option value=uk&gt;Ukrainian&lt;/option&gt;&lt;option value=vi&gt;Vietnamese&lt;/option&gt;
&lt;/select&gt;

To:
&lt;select id="to"&gt;
&lt;option value=sq&gt;Albanian&lt;/option&gt;&lt;option value=ar&gt;Arabic&lt;/option&gt;&lt;option value=bg&gt;Bulgarian&lt;/option&gt;&lt;option value=ca&gt;Catalan&lt;/option&gt;&lt;option value=zh-CN&gt;Chinese (Simplified)&lt;/option&gt;&lt;option value=zh-TW&gt;Chinese (Traditional)&lt;/option&gt;&lt;option value=hr&gt;Croatian&lt;/option&gt;&lt;option value=cs&gt;Czech&lt;/option&gt;&lt;option value=da&gt;Danish&lt;/option&gt;&lt;option value=nl&gt;Dutch&lt;/option&gt;&lt;option value=en selected&gt;English&lt;/option&gt;&lt;option value=et&gt;Estonian&lt;/option&gt;&lt;option value=tl&gt;Filipino&lt;/option&gt;&lt;option value=fi&gt;Finnish&lt;/option&gt;&lt;option value=fr&gt;French&lt;/option&gt;&lt;option value=gl&gt;Galician&lt;/option&gt;&lt;option value=de&gt;German&lt;/option&gt;&lt;option value=el&gt;Greek&lt;/option&gt;&lt;option value=iw&gt;Hebrew&lt;/option&gt;&lt;option value=hi&gt;Hindi&lt;/option&gt;&lt;option value=hu&gt;Hungarian&lt;/option&gt;&lt;option value=id&gt;Indonesian&lt;/option&gt;&lt;option value=it&gt;Italian&lt;/option&gt;&lt;option value=ja&gt;Japanese&lt;/option&gt;&lt;option value=ko&gt;Korean&lt;/option&gt;&lt;option value=lv&gt;Latvian&lt;/option&gt;&lt;option value=lt&gt;Lithuanian&lt;/option&gt;&lt;option value=mt&gt;Maltese&lt;/option&gt;&lt;option value=no&gt;Norwegian&lt;/option&gt;&lt;option value=pl&gt;Polish&lt;/option&gt;&lt;option value=pt&gt;Portuguese&lt;/option&gt;&lt;option value=ro&gt;Romanian&lt;/option&gt;&lt;option value=ru&gt;Russian&lt;/option&gt;&lt;option value=sr&gt;Serbian&lt;/option&gt;&lt;option value=sk&gt;Slovak&lt;/option&gt;&lt;option value=sl&gt;Slovenian&lt;/option&gt;&lt;option value=es&gt;Spanish&lt;/option&gt;&lt;option value=sv&gt;Swedish&lt;/option&gt;&lt;option value=th&gt;Thai&lt;/option&gt;&lt;option value=tr&gt;Turkish&lt;/option&gt;&lt;option value=uk&gt;Ukrainian&lt;/option&gt;&lt;option value=vi&gt;Vietnamese&lt;/option&gt;

&lt;/select&gt;
&lt;/div&gt;

&lt;div class="tebg"&gt;
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;&lt;textarea rows="10" cols="60" id="or" class="te"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;textarea rows="10" cols="60" id="tr" class="te"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;input type="submit" id="translate" value="Translate" /&gt;
&lt;div id="translation"&gt;&lt;/div&gt;
&lt;/body&gt;</pre>
<p>We&#8217;ll start by including Google&#8217;s Language API and jQuery. We can&#8217;t link directly to a language.js file, instead we need to use Google&#8217;s own <em>load</em> function. jQuery will also be included this way.</p>
<pre>

google.load("language", "1");
google.load("jquery", "1.3.2");
</pre>
<p>We need to use jQuery to get 3 values. The textarea containing the words they want translated, the language it is currently in and the language they want it translated into. We only want to capture these when the user clicks the translate button so we wrap it in the <em>click</em> event.</p>
<pre>
    $(document).ready(function(){

		    $("#translate").click(function(){

		        var from = $("#from").val();
			var to = $("#to").val();

			var orig = $("#or").val();

			    });

	});
</pre>
<p>Now we need to use Google&#8217;s translate function. It takes several parameters - the text we want translated (<em>orig</em>), the language the text was in (<em>from</em>) and the language we want it translated to (<em>to</em>). We capture the information google sends back to is in <em>result</em>. If there are no errors then we set the textarea to the translated text.</p>
<pre>
google.language.translate(orig, from, to, function(result) {

	if(!result.error)
	{

		$("#tr").val(result.translation);

	}

	});
</pre>
<p>If you have any questions or comments feel free to post them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/working-with-googles-language-apis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Git for Source Control</title>
		<link>http://query7.com/git-for-source-control/</link>
		<comments>http://query7.com/git-for-source-control/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 05:23:35 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Git]]></category>

		<category><![CDATA[Web Development]]></category>

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

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

		<guid isPermaLink="false">http://query7.com/?p=366</guid>
		<description><![CDATA[<p>Source Control is an essential part of the development system that any and every programmer needs to utilize. Simply put it is a repository of source code that keeps track of revisions and is a system that allows multiple programmers to work on one copy of code without issues. There are numerous version control systems (VCS) out there including Subversion,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Source Control is an essential part of the development system that any and every programmer needs to utilize. Simply put it is a repository of source code that keeps track of revisions and is a system that allows multiple programmers to work on one copy of code without issues. There are numerous version control systems (VCS) out there including Subversion, Mercurial and Bazaar. Everyone has their preference, today we will be focusing on git, a VCS that has become more popular in the latest months.</p>
<h2>Git</h2>
<p>A typical programmer&#8217;s workflow would be to:</p>
<ol>
<li><strong>pull</strong> (download) the latest copy of code from the git respository.</li>
<li>Make neccessary changes, modify code etc.</li>
<li><strong>commit</strong> the changed files</li>
<li><strong>push</strong> (upload) the files back to the git repository.</li>
</ol>
<p>If multiple programmers were working on the same project they would all use the same git repository. It&#8217;s good practice to always <strong>pull</strong> the latest copy before you <strong>push</strong> any of your changes to make sure your using the most update-to-date copy of the code (Someone may have <strong>push</strong>ed another change while you were editing your code). You can also branch (fork) a git repository. For example two programmers might be working on the same code but both are implementing different features. Their work flow would be something like:</p>
<ol>
<li>Each of them fork the master (main) copy of code</li>
<li>Make appropriate changes to their branches/forks of code</li>
<li>Merge both forks back into master (Git does this for you)</li>
</ol>
<h2>Installing Git</h2>
<p>Git is very easy to install and use on *nix type operating systems (Linux, Mac, BSD). Using Macports or your package management system, install the package <em>git-core</em>. It&#8217;s a little more complicated on Windows. I use <a href="http://code.google.com/p/msysgit/">msysgit</a>. Download and install that. On Windows git is not integrated into the windows command prompt, instead it has it&#8217;s own *nix like terminal (cygwin?). You use *nix commands rather than windows commands -  <em>ls</em> instead of <em>dir</em>. Fire up the shortcut to &#8216;git bash&#8217; (The git command prompt), you should be able to <em>cd</em> around, viewing your directories, and when you type <em>git</em> it should bring you up a list of available commands.</p>
<h2>Git Basics</h2>
<p>To use Git you must have a repository. You can host one yourself or use one of the numerous Git Hosts out there. I use <a href="http://www.github.com">Github</a>, it allows unlimited repositories for open source projects, and also offers paid plans for private repositories. For the rest of this tutorial I&#8217;ll assume your using github. The first thing you need to do is set your username and email. (In the git shell)</p>
<pre>git config --global user.name "Username Here"</pre>
<pre>git config --global user.email "email@email.here"</pre>
<p>Note that we use <em>&#8211;global</em>, this tells git that we want these details to be applied to all of our projects, you can can override these settings when in the local project directory by calling the command again without the <em>&#8211;global</em> flag.</p>
<p>Now we need to generate an SSH key. Git requires it as it&#8217;s an extra step of authentication. There are numerous ways to generate the key and they are different on all platforms so I advise you read <a href="http://github.com/guides/providing-your-ssh-key">this</a> (github.com) tutorial on setting it up.</p>
<p>The final step is to create the git project itself. On Github, login to an account (that you have created) then head over to the <a href="http://github.com/repositories/new">create a repository page</a>. Enter the information and hit Ok.</p>
<p>Now we can make that project on our local system. Change into the project&#8217;s directory then</p>
<pre>git init</pre>
<p>This generates the .git directory and git will now start &#8216;watching&#8217; deletes, alterations and the like. Now we need to add the files that we want to commit. You can name them individually or to select all we simply use the decimal point.</p>
<pre>git add .</pre>
<p>That will add the entire directory&#8217;s contents and all sub directories. We can then commit our changes/additions. We also provide a commit message, explaining to ourselves/others/repository readers what changes you made in that commit - eg new features in the code.</p>
<pre>git commit -m 'This is our first commit'</pre>
<p>Now we need to attach our project to the repository, then push the changes we made. Again, this is fairly simple.</p>
<pre>git remote add origin git@github.com:GITHUBUSERNAME/REPOSITORYNAME.git</pre>
<pre>git push origin master</pre>
<p>You can view your project&#8217;s page on github now and you will see that the files have been added. From now on it&#8217;s just a matter of <strong>git add</strong>-ing altered files, <strong>git commit</strong>-ing then finally <strong>git push</strong>-ing to upload the changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/git-for-source-control/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Easy RSS Consumption with Simple Pie in PHP</title>
		<link>http://query7.com/easy-rss-consumption-with-simple-pie-in-php/</link>
		<comments>http://query7.com/easy-rss-consumption-with-simple-pie-in-php/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 14:16:06 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=350</guid>
		<description><![CDATA[<h2>Introduction</h2>
<p>RSS Feed consumption has always been a stick point in PHP. Simple Pie is a library that works with both PHP4 and PHP5 that enables you to easily parse and save RSS feeds. Today I&#8217;ll show you some common uses of Simple Pie and explain how it runs.</p>
<p>Simple Pie requires:</p>
<ul>
<li>PHP 4.3.0 or higher</li>
<li><a href="http://nz.php.net/curl">cURL</a> Enabled.</li>
<li><a href="http://nz.php.net/zlib">zLib</a> (Caching?)</li>
</ul>
<p>As well as a few other PHP modules&#8230;</p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>RSS Feed consumption has always been a stick point in PHP. Simple Pie is a library that works with both PHP4 and PHP5 that enables you to easily parse and save RSS feeds. Today I&#8217;ll show you some common uses of Simple Pie and explain how it runs.</p>
<p>Simple Pie requires:</p>
<ul>
<li>PHP 4.3.0 or higher</li>
<li><a href="http://nz.php.net/curl">cURL</a> Enabled.</li>
<li><a href="http://nz.php.net/zlib">zLib</a> (Caching?)</li>
</ul>
<p>As well as a few other PHP modules that will be enabled in a vanilla PHP install. To run the compatibility test, upload the un-compressed archive to your server and navigate to www.yourname.com/pathtosimplepie/compatibility_test/sp_compatibility_test.php .</p>
<h2>Finding the RSS Feed</h2>
<p>The first thing we need to do is include SimplePie and then make a new SimplePie feed.</p>
<pre>include('path/to/simplepie.inc');</pre>
<pre>$feed = new SimplePie('lastkarrde.com');</pre>
<p>Simple Pie has a very useful &#8216;auto feed discovery&#8217; feature. If you give it a plain URL, such as Query7.com, it will automatically find the RSS feed. Of course you can specify the path to the .xml file or Feed Burner page if you wanted to. Although the feed has been pulled we need to do call on another function, handle_content_type, to ensure that the feed has the correct mime type and encoding.</p>
<pre>$feed-&gt;handle_content_type();</pre>
<h2>Parsing the RSS Feed</h2>
<p>Now that all of the configuration/setup is done (all 3 lines of it) we can parse the feed on our page. We use a <em>foreach</em> loop to iterate through all of the items. Simple Pie&#8217;s functions make everything easy! As you can see below we simply echo the date, content and title of each item in the RSS feed.</p>
<pre>foreach($feed-&gt;get_items() as $item){

echo '&lt;h3&gt;&lt;a href="' . $item-&gt;get_permalink() . '"&gt;' . $item-&gt;get_title() . '&lt;/a&gt;&lt;/h3&gt;';
echo '&lt;p&gt;' . $item-&gt;get_date() . '&lt;/p&gt;';
echo '&lt;p&gt;' . $item-&gt;get_content() . '&lt;/p&gt;';

}</pre>
<p><a href="http://query7.com/wp-content/uploads/2009/01/preview1.gif"><img class="alignnone size-full wp-image-354" src="http://query7.com/wp-content/uploads/2009/01/preview1.gif" alt="" width="500" height="190" /></a></p>
<h2>Extra Data from the Feed</h2>
<p>In the above example we only got the permalink, title, date and content from each feed item. Simple Pie provides alot of other functions that are used in the same way. Some of the more useful ones are.</p>
<ul>
<li><strong>get_author(s)</strong> - Get the author(s) of the post item (if set).</li>
<li><strong>get_description</strong> - Gets a summary of the post content, rather than the whole post like get_content() does.</li>
<li><strong>get_source </strong>- Returns the source site of the feed. This is particularly useful if you are parsing multiple feeds and displaying them on one page.</li>
<li><strong>get_title</strong> - Returns the title of the entire RSS feed, wouldn&#8217;t be called in the loop.</li>
</ul>
<h2>Parsing Multiple Feeds onto one Page</h2>
<p>With Simple Pie, this is painfully easy. When declaring a new instance of the Simple Pie class, we pass an array of websites rather than a string. Instead of..</p>
<pre>$feed = new SimplePie('lastkarrde.com');</pre>
<p>We would use</p>
<pre>$sites = array('query7.com', 'digg.com', slashdot.org');
$feed = new SimplePie($sites);</pre>
<h2>Caching</h2>
<p>Simple Pie comes with an easy to use and very effective caching system. By default it caches each feed for 60 minutes, then it automatically discards it and pulls a new copy of the feed. This is great for a &#8216;typical user&#8217; who just wants to use Simple Pie for a few things but for someone who knows the feed they are monitoring updates every 2 hours.. or every 20 minutes you need to change the length of caching time. This is done with the <em>set_cache_duration()</em> function. You specify it after you have pulled the feed, but before you display any information onto the page. You can also change the location of where the feed is cached with the <em>set_cache_location()</em> function. Both are demonstrated below.</p>
<pre>$feed = new SimplePie('query7.com');
$feed-&gt;set_cache_duration(1800); //Value in seconds, 1800s = 30 minutes
$feed-&gt;set_cache_duration('/home/user/simplepie/customcache'); //Full path to cache

//Continue with display code here.</pre>
<p>As you can see Simple Pie makes parsing RSS feeds really easy. You don&#8217;t have to parse them directly onto the page, you can just as easily put database INSERTs into the loop rather than echos and display them from the database at a later date. Simple Pie is an open source project so you don&#8217;t need to worry about any fees or license agreements.</p>
<p>If you have any questions about Simple Pie, feel free to post them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/easy-rss-consumption-with-simple-pie-in-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tutorial: Automated Site Backup with PHP and FTP</title>
		<link>http://query7.com/tutorial-automated-site-backup-with-php-ftp/</link>
		<comments>http://query7.com/tutorial-automated-site-backup-with-php-ftp/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 19:24:31 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=339</guid>
		<description><![CDATA[<p>In this tutorial we are going to make a PHP script that archives your website into a .tar file, then automatically moves it to an external FTP server for safe keeping. We can then setup a cron for this script which will execute it automatically every day/week/month , however frequent you want it. This will only work on Linux servers&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we are going to make a PHP script that archives your website into a .tar file, then automatically moves it to an external FTP server for safe keeping. We can then setup a cron for this script which will execute it automatically every day/week/month , however frequent you want it. This will only work on Linux servers however that shouldn&#8217;t be a problem as most hosts run Linux.</p>
<p>First we&#8217;ll setup some variables to allow for easy editing.</p>
<pre>$dir = '/path/to/file'; // Directory to backup.
$filename = 'backups/backup' . date("MdY") . '.tar'; //path to where the file will be saved.

$ftp_server = 'urlToFTPServer.Com'; //External FTP server
$ftp_user_name = 'ftpUsername'; //External FTP server username
$ftp_password = 'ftpPassword'; //External FTP server password</pre>
<p>Now we need to archive the site. We&#8217;re going to wrap an if statement around it so if for some reason it doesn&#8217;t archive, the FTP part of the script won&#8217;t try and copy it over to another server. The <em>system</em> function executes a system command, here we are calling <em>tar cvf</em> which will archive our <em>$dir</em> (directory) and save it to the path specified in <em>$filename</em>.</p>
<pre>if(system("tar cvf $filename $dir")){</pre>
<p>We&#8217;ll then connect to the FTP server itself. Because we set variables, if we need to change servers, it&#8217;s very easy to implement.</p>
<pre>$conn_id = ftp_connect($ftp_server); 

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_password);</pre>
<p>If it connects to the server, then we can move our backup across. We give it the same name as the archive on our own server and store it in a /backups directory.</p>
<pre>if (($conn_id) || ($login_result)) { 

$upload = ftp_put($conn_id, 'backups/' . date("MdY") . '.tar', $filename, FTP_BINARY);      

    }</pre>
<p>Once that is done, we can close the FTP stream as we don&#8217;t need to use it anymore.</p>
<pre>ftp_close($conn_id);
} //Initial if statement</pre>
<p>All thats needed to do is automate this script. For this we use something built into the Linux Operating System called a Cron Tab. Crons will automatically run a script at a time you specify. We can set it up to run every time at the same day so you have a daily backup. You can make this more frequent or less frequent depending on how often the data of your site changes. Making a <a href="http://www.upstartblogger.com/how-to-create-a-cron-job-in-cpanel">cronjob in cPanel</a> is alot easier than if you <a href="https://help.ubuntu.com/community/CronHowto">didn&#8217;t have cPanel</a>. But both are fairly straight foward.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/tutorial-automated-site-backup-with-php-ftp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Other jQuery Uses</title>
		<link>http://query7.com/other-jquery-uses/</link>
		<comments>http://query7.com/other-jquery-uses/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:32:48 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=332</guid>
		<description><![CDATA[<p>We traditionally think that jQuery&#8217;s selector engine can only select elements/information off of the document that we are working on. And AJAX&#8217;s only use is to process web forms without the page needing to reload. While both of these are common uses, they are not the only uses. In this tutorial I&#8217;m going to show you a not-so-mainstream use of&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>We traditionally think that jQuery&#8217;s selector engine can only select elements/information off of the document that we are working on. And AJAX&#8217;s only use is to process web forms without the page needing to reload. While both of these are common uses, they are not the only uses. In this tutorial I&#8217;m going to show you a not-so-mainstream use of jQuery, but a very useful one all the same.</p>
<p>Take this standard web page. It pulls the latest news items from a database and displays them like so. That is the basic DOM of the page.</p>
<pre>&lt;head&gt;
&lt;title&gt;Latest News&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

# More Header, sidebar code here #

&lt;p class="latest"&gt;Employees at the Karate Bank are getting the chop&lt;/p&gt;
&lt;p class="latest"&gt;NASA shares have sky-rocketed&lt;/p&gt;
&lt;p class="latest"&gt;Investors at the Sushi Bank feel they are getting a raw deal&lt;/p&gt;

# More content, footer code here #

&lt;/body&gt;

&lt;/html&gt;
&lt;/pre&gt;</pre>
<p>If we wanted to highlight all of the news items on this page we can use jQuery&#8217;s each method to iterate through them and modify their CSS.</p>
<pre>$("p.latest").each(function(){

	$(this).css({"background-color" : "yellow"});

});</pre>
<p>But what if we wanted to pull that information from another page? Due to some restrictions in the software the website is using, mayby they can&#8217;t display the latest posts on every page that they want to. To get this information we would need to do 2 things. The first is to pull the latest news page itselfand the second is to parse that page and only show the latest news (not the header, sidebar etc.)</p>
<h3>Ajax</h3>
<p>First of all we want to pull the page using AJAX and save it in a variable. To do this we use jQuery&#8217;s $.get method. We specify the page and since we are not sending any data (like information from a form) we don&#8217;t need to specify anything else. We then save the contents of latestnews.html into the variable content. This is important.</p>
<pre>$.get('http://urlto.com/latestnews.html' ,function(content) {

});</pre>
<h3>Narrowing Our Search</h3>
<p>At this stage we cannot simply document.write(content) as it contains all of the header, footer, sidebar and text in there. We need to select the latest news paragraphs that we want. For this we use jQuery&#8217;s standard selector. We don&#8217;t need to use a special plugin or write our own function. The only thing we need to change is to pass an extra parameter into the selector. This parameter tells jQuery&#8217;s selector engine where it look for the pattern/rule. If it isn&#8217;t specified (it usually isn&#8217;t in standard codes) then jQuery assumes you mean the current page&#8217;s source (DOM) however by specifying this we can narrow our search. In the code below we pass the content variable (which contains the entire source of latestnews.html) into the selector. jQuery will then look for all paragraphs with a class of latest inside the content variable.</p>
<pre>$.get('http://urlto.com/latestnews.html' ,function(content) {

$("p.latest", content).each(function(){

});

});</pre>
<h3>Displaying the data</h3>
<p>Since we have matched the URLs, we can display the content as we please.<br />
If we wanted to highlight the latest news paragraphs on that page then we would:</p>
<pre>$.get('http://urlto.com/latestnews.html' ,function(content) {

$("p.latest", content).each(function(){

$(this).appendTo("#latest");

});

});</pre>
<h3>More</h3>
<p>Using the information you&#8217;ve learnt, you can apply this to other situations. For example you can parse RSS feeds and reflect live updates of the RSS feed on the website straight away. These techniques are especially useful in remotely hosted software systems where you have no control over the source code. Or if PHP coding isn&#8217;t your strong point, but you know a little bit of jQuery, you can easily modify some of your website content this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/other-jquery-uses/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Increase Development Speed With jQuery</title>
		<link>http://query7.com/increase-development-speed-with-jquery/</link>
		<comments>http://query7.com/increase-development-speed-with-jquery/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 14:23:40 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

		<guid isPermaLink="false">http://query7.com/?p=299</guid>
		<description><![CDATA[<p>As we all know jQuery is a very small language. Not only is the file size of the jQuery library small, but the amount of code you need to write to achieve something is also very small. Because of this it is sometimes more efficient to write and test jQuery code in the browser than in a local file. To&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>As we all know jQuery is a very small language. Not only is the file size of the jQuery library small, but the amount of code you need to write to achieve something is also very small. Because of this it is sometimes more efficient to write and test jQuery code in the browser than in a local file. To do this we need a couple of things.</p>
<ol>
<li>The Firebug Extension for Firefox</li>
<li>Greasemonkey</li>
</ol>
<p>If the page that we are going to manipulate doesn&#8217;t already include jQuery on it, then we can include it with this small Greasemonkey script. If jQuery is already included on the page, there is no use for this script.</p>
<pre><code>// Add jQuery
    var GM_JQ = document.createElement('script');
    GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
    GM_JQ.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(GM_JQ);

// Check if jQuery's loaded
    function GM_wait() {
        if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
    else { $ = unsafeWindow.jQuery; letsJQuery(); }
    }
    GM_wait();

// All your GM code must be inside this function
    function letsJQuery() {
        alert($); // check if the dollar (jquery) function works

    }
</code></pre>
<p><a href="http://joanpiedra.com/jquery/greasemonkey/">Source</a><br />
With the jQuery library on the page we can now go ahead and start entering commands. For this example we&#8217;ll take jQuery.com, we can enter a basic jQuery Selector and see what happens.</p>
<p>before.png (http://img228.imageshack.us/img228/1918/beforeus0.png) Download, rehost, embed this image here.</p>
<p>after.png (http://img218.imageshack.us/img218/5812/aftercd6.png) Download, rehost, embed this image here.</p>
<p>As you can see it&#8217;s very easy to manipulate pages. You can use this to manipulate scripts that your working on. For example, if you were trying to nail down a certain selector, or find a 4th parent of something, its going to be alot easier and faster to do it in the Firebug terminal than editing, saving and refreshing the page while your trying to perfect it. With jQuery&#8217;s CSS capabilities, you can also test your CSS out live, without needing to switch back and forth between your editor and firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/increase-development-speed-with-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP/jQuery Todo List Part 2</title>
		<link>http://query7.com/php-jquery-todo-list-part-2/</link>
		<comments>http://query7.com/php-jquery-todo-list-part-2/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:24:00 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=280</guid>
		<description><![CDATA[<p>This is part 2 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery&#8217;s AJAX</p>
<p>In part 1 of the tutorial, we covered the PHP and MySQL side of things. In this part we will be enhancing it with jQuery&#8217;s AJAX and manipulation functionality. The to-do list will degrade fine - if the user&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This is part 2 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery&#8217;s AJAX</p>
<p>In part 1 of the tutorial, we covered the PHP and MySQL side of things. In this part we will be enhancing it with jQuery&#8217;s AJAX and manipulation functionality. The to-do list will degrade fine - if the user has Javascript disabled, the application will still work. All changes occur in the <strong>index.php</strong> file.</p>
<p>There are two parts to the script. One handles the posting of new posts, while the other handles posts being deleted. We&#8217;ll start with adding new posts.</p>
<pre>//When the button with an id of submit is clicked (the submit button)
$("#submit").click(function(){

//Retrieve the contents of the textarea (the content)
var formvalue = $("#content").val();

//Build the URL that we will send
var url = 'submit=1&amp;content=' + formvalue;

//Use jQuery's ajax function to send it
 $.ajax({
   type: "POST",
   url: "process.php",
   data: url,
   success: function(){

//If successful , notify the user that it was added
   $("ul").before("&lt;p class='new'&gt;You just added: &lt;i&gt;" + formvalue + "&lt;/i&gt;&lt;/p&gt;");

   }
 });

//We return false so when the button is clicked, it doesn't follow the action
return false;

});</pre>
<p>The <em>url</em> part confuses some people. What we are doing is sending a request to the process page, we need to include some data with that request. In process.php there was the line</p>
<pre>if($_POST['submit']){</pre>
<p>It checks to see if $_POST['submit'] isn&#8217;t null (has a value). If it is null (has no value), then it means that the form hadn&#8217;t been submitted, by sending any value, in our case <em>submit=1</em>, we are telling process.php that the button had been clicked so it should run the rest of the PHP script. The rest of the PHP script calls for the content, which we also send in the url (<em>content= &#8216; + formvalue</em>). Instead of sending anything, we only want to send the value of the form (The stuff inside the textarea - that the user wants to submit). By returning false at the end, it prevents the submit button from carrying through with its <em>action=&#8221;process.php&#8221;</em>. If it did, it means the page would refresh when the information was sent which is exactly what we don&#8217;t want.</p>
<p>The code that handles the deletion of posts is similar.</p>
<pre>//Check to see if an anchor link was clicked (The delete link)
$("a").click(function(){

//Save the link in a variable called element
var element = $(this);

//Find the id of the link that was clicked
var noteid = element.attr("id");

//Built a url to send
var info = 'id=' + noteid;

 $.ajax({
   type: "GET",
   url: "delete.php",
   data: info,
   success: function(){
   element.parent().eq(0).fadeOut("slow");
   }
 });

//We return false so the browser doesn't actually follow the link
return false;

});</pre>
<p>When we were displaying the posts in <strong>process.php</strong> we echo&#8217;d the id of the post in the anchor tag. We are then getting this id <em>element.attr(&#8221;id&#8221;)</em> and building the URL. So when the AJAX call is sent, it will be something like <em>delete.php?id=POSTID. </em>If the AJAX call is successful, then we need to hide the list item.</p>
<pre>element.parent().eq(0).fadeOut("slow");</pre>
<p>In that bit of code, we select the element (anchor tag) that was clicked. We then find it&#8217;s parents and take the first one using <em>eq(0)</em>. It&#8217;s &#8216;first&#8217; parent is the list item its in (&lt;li&gt;&lt;a href&gt;&lt;/a&gt;&lt;/li&gt;) and we fade that out slowly.</p>
<p>Demo: <a href="http://lastkarrde.com/q7todo/">http://lastkarrde.com/q7todo/</a></p>
<p>Download: <a href="http://lastkarrde.com/files/q7todo.zip">http://lastkarrde.com/files/q7todo.zip</a></p>
<p>You can read the first part of the series at <a href="http://query7.com/php-jquery-todo-list-part-1/">PHP + jQuery Todo List Part 1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-jquery-todo-list-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP + jQuery Todo List Part 1</title>
		<link>http://query7.com/php-jquery-todo-list-part-1/</link>
		<comments>http://query7.com/php-jquery-todo-list-part-1/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 23:54:33 +0000</pubDate>
		<dc:creator>sourcebits staff</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=270</guid>
		<description><![CDATA[<p>This is part 1 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery&#8217;s AJAX</p>
<p>In this two part series I&#8217;m going to show you how to make a simple to-do list in PHP, and then enhance it using jQuery&#8217;s AJAX and manipulation capabilities. This won&#8217;t follow any proper coding principles, but will give&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This is part 1 of a 2 part series on making a Todo List with PHP and enhancing it with jQuery&#8217;s AJAX</p>
<p>In this two part series I&#8217;m going to show you how to make a simple to-do list in PHP, and then enhance it using jQuery&#8217;s AJAX and manipulation capabilities. This won&#8217;t follow any proper coding principles, but will give you the skills to adapt the code to fit your own situations. A todo list isn&#8217;t that far away from a simple threaded forum.</p>
<p>It will consist of a few files.</p>
<ul>
<li>delete.php - delete the note.</li>
<li>process.php - create the note, display the notes.</li>
<li>index.html - form, javascript</li>
</ul>
<p>We will be storing the list items in a MySQL database. The query:</p>
<pre>CREATE TABLE `notes`
(
`id` INT PRIMARY KEY AUTO INCREMENT NOT NULL,
`content` VARCHAR(500) NOT NULL
)</pre>
<p><strong>index.php</strong> will only contain the form (for now). It&#8217;s a fairly basic form, it contains a textarea (where the user enters their note) and a button they hit to submit it. The information is sent to a file called process.php through the post method.</p>
<pre>&lt;form id="form" action="process.php" method="post"&gt;
&lt;textarea name="content" id="content" cols="50" rows="3"&gt;&lt;/textarea&gt;
&lt;input type="submit" id="submit" name="submit" value="Post it" /&gt;
&lt;/form&gt;</pre>
<p><strong>process.php</strong> then handles the information that was sent from the form. We only need to insert the content into the database because the <em>id</em> field auto_increments itself. We display the to-do list in a nice and tidy list. We also provide a link after the post to delete it.</p>
<pre>&lt;?php
//Connect to the database
$connection = mysql_connect('host (usually localhost)', 'mysql_username' , 'mysql_password');
$selection = mysql_select_db('mysql_database', $connection);

//Was the form submitted?
if($_POST['submit']){

//Map the content that was sent by the form a variable. Not necessary but it keeps things tidy.
$content = $_POST['content'];

//Insert the content into database
$ins = mysql_query("INSERT INTO `notes` (content) VALUES ('$content')");

//Redirect the user back to the index page
header("Location:index.php");
}

/*Doesn't matter if the form has been posted or not, show the latest posts*/

//Find all the notes in the database and order them in a descending order (latest post first).
$find = mysql_query("SELECT * FROM `notes` ORDER BY id DESC");

//Setup the un-ordered list
echo '&lt;ul&gt;';

//Continue looping through all of them
while($row = mysql_fetch_array($find)){

//For each one, echo a list item giving a link to the delete page with it's id.
echo '&lt;li&gt;' . $row['content'] . ' &lt;a id="' . $row['id'] . '" href="delete.php?id=' . $row['id'] . '"&gt;&lt;img src="cancel.png" alt="Delete?" /&gt;&lt;/a&gt;&lt;/li&gt;';

}

//End the un-ordered list
echo '&lt;/ul&gt;';

?&gt;</pre>
<p><strong>delete.php</strong> does nothing more than delete the post. It uses the id parameter its provided to find the post entry in the database. Once it&#8217;s found, it&#8217;s deleted.</p>
<pre>&lt;?php

//Connect to the database
$connection = mysql_connect('host (usually localhost)', 'mysql_username' , 'mysql_password');
$selection = mysql_select_db('mysql_database', $connection);

//delete.php?id=IdOfPost
if($_GET['id']){

$id = $_GET['id'];

//Delete the record of the post
$delete = mysql_query("DELETE FROM `notes` WHERE `id` = '$id'");

//Redirect the user
header("Location:index.php");

}

?&gt;</pre>
<p>All of this produces a tidy to-do system. The source, stylesheet and images will be provided in a .zip file at the end of Part 2 of this tutorial.</p>
<p>You can read the second part of the series at <a href="http://query7.com/php-jquery-todo-list-part-2/">PHP/jQuery Todo List Part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-jquery-todo-list-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Top 5 PHP Resource Websites</title>
		<link>http://query7.com/top-5-php-resource-websites/</link>
		<comments>http://query7.com/top-5-php-resource-websites/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 08:46:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

		<category><![CDATA[php-gtk]]></category>

		<category><![CDATA[Top PHP]]></category>

		<guid isPermaLink="false">http://query7.com/?p=255</guid>
		<description><![CDATA[<p></p>
<p class="MsoNormal">PHP is a very vast language. It’s hard to say that you’ve mastered it. For example, do you know how to crop an image using GD and process web requests with XML-RPC off the top of your head? You may know one of them, but probably not both. That being said, there are a lot of resources out there that&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><!--StartFragment--></p>
<p class="MsoNormal">PHP is a very vast language. It’s hard to say that you’ve mastered it. For example, do you know how to crop an image using GD and process web requests with XML-RPC off the top of your head? You may know one of them, but probably not both. That being said, there are a lot of resources out there that help you learn the basics of PHP – Processing forms, security, database interactions and array manipulation. I’ve compiled a list of 5 websites that I think will help you learn the ‘basics’ of PHP as well as taking them a step further.</p>
<p><strong><span style="text-decoration: none;"><a href="http://www.killerphp.com/videos/">KillerPHP.com’s Video Tutorials</a></span></strong><br />
I used these when I was initially learning PHP and are still a great resource today. These screencasts are typically 10 minutes long and cover the absolute basics – getting your development enviroment up and running to variables and includes.</p>
<ul type="disc">
<li class="MsoNormal">Local      server setup</li>
<li class="MsoNormal">Variables</li>
<li class="MsoNormal">Arrays</li>
<li class="MsoNormal">Includes</li>
<li class="MsoNormal">Loops</li>
<li class="MsoNormal">Form      Processing</li>
<li class="MsoNormal">Functions</li>
<li class="MsoNormal">Sessions</li>
<li class="MsoNormal">OOP</li>
</ul>
<p><strong><span style="text-decoration: none;"><a href="http://www.pixel2life.com/tutorials/php_coding/">Pixel2Life’s Tutorial Index</a></span></strong><br />
Pixel2Life is a tutorial index where bloggers can submit their tutorials and articles. The result of hundreds of people doing this is a very large library of ‘specialised’ links. For example, at the time of writing this, the frontpage contains tutorials about Twitter, Code Igniter, Gravatars and Converting Excel to CSV with PHP. There are also numerous tutorials and articles on PHP frameworks (Code Igniter, CakePHP etc) that aren’t on the framework’s website. Be aware that there are excellent tutorials back 6 or 7 pages, so have a dig around for them.</p>
<p><strong><span style="text-decoration: none;"><a href="http://nettuts.com/category/tutorials/php/">NetTut’s PHP Tutorials</span></a></span></strong><br />
Nettuts is well known for it’s high quality tutorials. They have recently done a 3 part series on making your own PHP framework – something you don’t see on an everyday blog. Although there aren’t many PHP tutorials now, new authors are writing more tutorials on them. Often the tutorials are not only PHP, a recent one showed how to make a twitter clone in PHP which used mootools for the AJAX and effects. Lately the editor, Jeff Way, has been doing some screencasts.</p>
<p><strong><span style="text-decoration: none;"><a href="http://www.php.net/quickref.php">PHP.net Quickref</span></a></span></strong><br />
Sorry, I had to put it in. If you don’t know what a certain function does, do a quick search on the quickref page and find it in seconds. The documentation provided by PHP isn’t the only good part, read peoples comments on real application usage of function. For example the sleep function (<a href="http://www.php.net/manual/en/function.sleep.php">http://www.php.net/manual/en/function.sleep.php</a>) , it not only shows usage of it, but mini hacks people have used to get it working better, or an alternative way to do it.</p>
<p><strong><span style="text-decoration: none;"><a href="http://www.phpbuilder.com/">PHP Builder</span></a></span></strong><br />
PHP Builder is a portal for everything PHP. It has PHP job lisitings, original articles, a snippet library, forum and a mailing list. Some of the articles on there are really interesting, using PHP as a shell language (<a href="http://www.phpbuilder.com/columns/darrell20000319.php3?page=1">http://www.phpbuilder.com/columns/darrell20000319.php3?page=1</a>) not only covers the basic ‘hello world’ tutorial, but using arguments and reading input from the console. The forum (<a href="http://phpbuilder.com/board/">http://phpbuilder.com/board/</a>) is incredibly useful. There are fully certified Zend Engineers that help you think up<span>  </span></p>
<p class="MsoNormal"> </p>
<p><!--EndFragment--></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/top-5-php-resource-websites/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery In Action</title>
		<link>http://query7.com/jquery-in-action/</link>
		<comments>http://query7.com/jquery-in-action/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:30:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=129</guid>
		<description><![CDATA[<p>In an attempt to sharpen up my jQuery, i purchased the book <a href="http://www.amazon.com/gp/product/1933988355?ie=UTF8&#38;tag=query7com-20&#38;linkCode=as2&#38;camp=1789&#38;creative=9325&#38;creativeASIN=1933988355">jQuery in Action</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=query7com-20&#38;l=as2&#38;o=1&#38;a=1933988355" border="0" alt="" width="1" height="1" /> by Bear Bibeault and Yehuda Katz. Reading through the book, i could see that the first few chapters were obviously aimed at beginners. They covered selectors (If you know CSS already your fine) and events. You can easily get this information off the jQuery doc site,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In an attempt to sharpen up my jQuery, i purchased the book <a href="http://www.amazon.com/gp/product/1933988355?ie=UTF8&amp;tag=query7com-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1933988355">jQuery in Action</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=query7com-20&amp;l=as2&amp;o=1&amp;a=1933988355" border="0" alt="" width="1" height="1" /> by Bear Bibeault and Yehuda Katz. Reading through the book, i could see that the first few chapters were obviously aimed at beginners. They covered selectors (If you know CSS already your fine) and events. You can easily get this information off the jQuery doc site, nothing spectacular there. Chapter 5 covers the effects, slides and fades but goes into depth abit more on the animate function. Something (in my opinion) which is under documented on the jQuery doc site. It shows off a few different examples.</p>
<p>Chapter 7 is another excellent chapter - showing you how to write your own plugins. It goes into alot of detail, from extending the wrapper to proper naming conventions to looping through each element effected. This chapter is a must read for anyone considering writing their own jQuery plugins. Again, the authors have written 3 example plugins providing alot of reference material.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-in-action/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fedora 9 Package Management</title>
		<link>http://query7.com/fedora-9-package-management/</link>
		<comments>http://query7.com/fedora-9-package-management/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:28:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[fedora]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=62</guid>
		<description><![CDATA[<p>Fedora 9 includes the new package manager called Package Kit. It aims to be the package manager for your system, as it can install apts, slackware packages,rpms and many other file formats. I booted into it and noticed 2 things.</p>
<ul>
<li> The first, its incredibly slow - It took along time to download the updates i needed (Slower than downloading a normal&#8230;</li></ul>]]></description>
			<content:encoded><![CDATA[<p>Fedora 9 includes the new package manager called Package Kit. It aims to be the package manager for your system, as it can install apts, slackware packages,rpms and many other file formats. I booted into it and noticed 2 things.</p>
<ul>
<li> The first, its incredibly slow - It took along time to download the updates i needed (Slower than downloading a normal file that size from the server) and it took along time to generate the meta data of plugins list.</li>
<li>The second is that (in my opnion) the User Interface is horrible. Its hard to navigate to select the packages you want, When you select a package it takes a few more clicks to even see the dependencies it requires, whereas adept and synaptic show you right away.</li>
</ul>
<p>I tried it, i can honestly say i gave it a good go, but its not for me. Since im new to the rpm system, i searched around for alternatives, i found one called Yum Extender (Yumex).  Its easy to install, just <em>yum install yumex</em> or download it from the websit.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/fedora-9-package-management/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Layout and UI Designer</title>
		<link>http://query7.com/layout-and-ui-designer/</link>
		<comments>http://query7.com/layout-and-ui-designer/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:28:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=73</guid>
		<description><![CDATA[<p>A stumbled across an amazing online app, meant to be like a CAD im guessing but then i realised the different things it could be used for. <a onclick="pageTracker._trackPageview('/outgoing/draw.labs.autodesk.com/ADDraw/draw.html?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');pageTracker._trackPageview('/outgoing/draw.labs.autodesk.com/ADDraw/draw.html?referer=http://www.query7.com/wp-admin/post-new.php');" href="http://draw.labs.autodesk.com/ADDraw/draw.html">Project Draw</a> gives you a grid to start off with, you can then place various shapes onto the grid and resize them. Further more you can add colours, text, gradients, alignments and borders which&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>A stumbled across an amazing online app, meant to be like a CAD im guessing but then i realised the different things it could be used for. <a onclick="pageTracker._trackPageview('/outgoing/draw.labs.autodesk.com/ADDraw/draw.html?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');pageTracker._trackPageview('/outgoing/draw.labs.autodesk.com/ADDraw/draw.html?referer=http://www.query7.com/wp-admin/post-new.php');" href="http://draw.labs.autodesk.com/ADDraw/draw.html">Project Draw</a> gives you a grid to start off with, you can then place various shapes onto the grid and resize them. Further more you can add colours, text, gradients, alignments and borders which makes it a really good tool to design layouts.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/layout-and-ui-designer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More jQuery Effects</title>
		<link>http://query7.com/more-jquery-effects/</link>
		<comments>http://query7.com/more-jquery-effects/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:27:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=58</guid>
		<description><![CDATA[<p>With the arrival of jQuery UI 1.5 i was browsing its&#8217; wiki pages and learning all of the API. I came across the jQuery UI wiki page, its essentially more jQuery effects except these ones are alot more dynamic! You can explode, puff, slide, highlight and alot more. I was a amazed that i hadn&#8217;t seen this page or been&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>With the arrival of jQuery UI 1.5 i was browsing its&#8217; wiki pages and learning all of the API. I came across the jQuery UI wiki page, its essentially more jQuery effects except these ones are alot more dynamic! You can explode, puff, slide, highlight and alot more. I was a amazed that i hadn&#8217;t seen this page or been linked to it before, its something the jQuery UI team should be proud of.</p>
<p><a href="http://docs.jquery.com/UI/Effects">Check it out</a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/more-jquery-effects/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery UI</title>
		<link>http://query7.com/jquery-ui/</link>
		<comments>http://query7.com/jquery-ui/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:26:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jquery]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=55</guid>
		<description><![CDATA[<p>For those of you with no jQuery background what-so-ever, jQuery UI is a series of user interface (UI) enhancements made in Javascript. These range from tabs (which also support ajax loading), to dialog boxes which you can drag, drop and resize. All cross browser! Although its currently still under development the finish line is in sight for the 1.5 release.&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>For those of you with no jQuery background what-so-ever, jQuery UI is a series of user interface (UI) enhancements made in Javascript. These range from tabs (which also support ajax loading), to dialog boxes which you can drag, drop and resize. All cross browser! Although its currently still under development the finish line is in sight for the 1.5 release. I encourage everyone to check it out, it can add some really professional effects to your website for minimal lines of code.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-ui/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Menu Roundup</title>
		<link>http://query7.com/jquery-menu-roundup/</link>
		<comments>http://query7.com/jquery-menu-roundup/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:27:07 +0000</pubDate>
		<dc:creator>sourcebits</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

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

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

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

		<guid isPermaLink="false">http://query7.com/?p=225</guid>
		<description><![CDATA[<p><span>“Whats a good jQuery menu?” is a question I hear quite frequently on blogs and forums. As jQuery is such a simple language to learn, most people code their own for their own sites. I’ve compiled a list of 3 menu plugins, and and 5 ‘custom’ solutions that people have setup.</span></p>
<p><span style="font-size: 11pt;"><a href="http://p.sohei.org/jquery-plugins/menu/">http://p.sohei.org/jquery-plugins/menu/</a></span><br />
<span>Latest release: Jan 07</span></p>
<p><a href="http://query7.com/wp-content/uploads/2008/11/psoheiorg.jpg"><img class="size-medium wp-image-226 alignright" title="menu1" src="http://query7.com/wp-content/uploads/2008/11/psoheiorg-300x138.jpg" alt="" width="300" height="138" /></a></p>
<p><span>This plugin was constructed to emulate a&#8230;</span></p>]]></description>
			<content:encoded><![CDATA[<p><span>“Whats a good jQuery menu?” is a question I hear quite frequently on blogs and forums. As jQuery is such a simple language to learn, most people code their own for their own sites. I’ve compiled a list of 3 menu plugins, and and 5 ‘custom’ solutions that people have setup.</span></p>
<p><span style="font-size: 11pt;"><a href="http://p.sohei.org/jquery-plugins/menu/">http://p.sohei.org/jquery-plugins/menu/</a></span><br />
<span>Latest release: Jan 07</span></p>
<p><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"  o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"  stroked="f"> <v:stroke joinstyle="miter" /> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0" /> <v:f eqn="sum @0 1 0" /> <v:f eqn="sum 0 0 @1" /> <v:f eqn="prod @2 1 2" /> <v:f eqn="prod @3 21600 pixelWidth" /> <v:f eqn="prod @3 21600 pixelHeight" /> <v:f eqn="sum @0 0 1" /> <v:f eqn="prod @6 1 2" /> <v:f eqn="prod @7 21600 pixelWidth" /> <v:f eqn="sum @8 21600 0" /> <v:f eqn="prod @7 21600 pixelHeight" /> <v:f eqn="sum @10 21600 0" /> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /> <o:lock v:ext="edit" aspectratio="t" /> </v:shapetype><v:shape id="_x0000_s1026" type="#_x0000_t75" style='position:absolute;  margin-left:171pt;margin-top:5.1pt;width:255.75pt;height:118.5pt;z-index:251656704'> <v:imagedata src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg" mce_src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg"   o:title="p" /> <w:wrap type="square" /> </v:shape><![endif]--><!--[if !vml]--><a href="http://query7.com/wp-content/uploads/2008/11/psoheiorg.jpg"><img class="size-medium wp-image-226 alignright" title="menu1" src="http://query7.com/wp-content/uploads/2008/11/psoheiorg-300x138.jpg" alt="" width="300" height="138" /></a><!--[endif]--></p>
<p><span>This plugin was constructed to emulate a desk top apps menu. They don’t close until clicked off and are activated by clicking them (rather than hovering). It requires the jQuery dimensions plugin to perform ‘smart calculations’.</span></p>
<p><span>Example Usage: <a href="http://p.sohei.org/stuff/jquery/menu/demo/demo.html">http://p.sohei.org/stuff/jquery/menu/demo/demo.html</a></span><br />
<span>Download: <strong><a href="http://p.sohei.org/jquery-plugins/menu/">http://p.sohei.org/jquery-plugins/menu/</a></strong></span></p>
<p><span style="font-size: 11pt;"><a href="http://jdsharp.us/jQuery/plugins/jdMenu/">http://jdsharp.us/jQuery/plugins/jdMenu/</a></span><br />
<span>Latest release: April 08</span></p>
<p><!--[if gte vml 1]><v:shape id="_x0000_s1027" type="#_x0000_t75"  style='position:absolute;margin-left:207pt;margin-top:8.95pt;width:3in;  height:64.5pt;z-index:251657728'> <v:imagedata src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image003.jpg" mce_src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image003.jpg"   o:title="jdmenu" /> <w:wrap type="square" /> </v:shape><![endif]--><!--[if !vml]--><!--[endif]--></p>
<p><a href="http://query7.com/wp-content/uploads/2008/11/jdmenu.jpg"><img class="size-medium wp-image-227 alignright" title="jdmenu" src="http://query7.com/wp-content/uploads/2008/11/jdmenu-300x89.jpg" alt="" width="300" height="89" /></a><span lang="EN-US">Although the jdMenu plugin is only 3kb itself, it depends on or looks a hell of a lot better with the plugins dimension, positionBy and bgiframe. jdMenu boasts keyboard access and can be easily made into a verticle menu by changing an option.</span><br />
<span>Example Usage &amp; Download: <a href="http://jdsharp.us/jQuery/plugins/jdMenu/">http://jdsharp.us/jQuery/plugins/jdMenu/</a></span><br />
<span style="font-size: 11pt;"><a href="http://users.tpg.com.au/j_birch/plugins/superfish/"></a></span></p>
<p><span style="font-size: 11pt;"><a href="http://users.tpg.com.au/j_birch/plugins/superfish/">http://users.tpg.com.au/j_birch/plugins/superfish/</a></span><br />
<span>Latest release: Sometime in 08</span></p>
<p><!--[if gte vml 1]><v:shape id="_x0000_s1028" type="#_x0000_t75"  style='position:absolute;margin-left:261pt;margin-top:12.8pt;width:168.75pt;  height:135.6pt;z-index:251658752'> <v:imagedata src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image005.jpg" mce_src="file:///C:\Users\Raghu\AppData\Local\Temp\msohtmlclip1\01\clip_image005.jpg"   o:title="superfish" /> <w:wrap type="square" /> </v:shape><![endif]--><!--[if !vml]--><!--[endif]--></p>
<p><a href="http://query7.com/wp-content/uploads/2008/11/superfish.jpg"><img class="size-medium wp-image-228 alignright" title="superfish" src="http://query7.com/wp-content/uploads/2008/11/superfish-300x240.jpg" alt="" width="300" height="240" /></a><span lang="EN-US">Superfish takes a CSS based dropdown then enhances it with jQuery so if the user has Javascript disabled, it degrades perfectly well. Since the menu is mainly CSS based, I’d imagine it’s a fair bit faster than the other options.</span></p>
<p><span>Example Usage: <a href="http://users.tpg.com.au/j_birch/plugins/superfish/#examples">http://users.tpg.com.au/j_birch/plugins/superfish/#examples</a></span><br />
<span>Download: <a href="http://users.tpg.com.au/j_birch/plugins/superfish/#download">http://users.tpg.com.au/j_birch/plugins/superfish/#download</a></span></p>
<p><span>More menus</span></p>
<ul style="type=">
<li><span><a href="http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery">http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery</a></span></li>
<li><span><a href="http://javascript-array.com/scripts/jquery_simple_drop_down_menu/">http://javascript-array.com/scripts/jquery_simple_drop_down_menu/</a> </span></li>
<li><span><a href="http://designreviver.com/tutorials/jquery-css-example-dropdown-menu/">http://designreviver.com/tutorials/jquery-css-example-dropdown-menu/</a></span></li>
<li><span><a href="http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/">http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/</a></span></li>
</ul>
<p style="margin-left: 11pt;"><span>Plugins are useful, but a lot of the time you don’t need their full functionality. If your confident of modifying a few scripts, then taking something like <a href="http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery">http://www.kriesi.at/archives/create-a-multilevel-dropdown-menu-with-css-and-improve-it-via-jquery</a> and changing it to meet your needs would be the best way to go. That being said, the plugins have dropshadows and funky multi level code that some of the ‘smaller menus’ do not.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-menu-roundup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Coding Standards</title>
		<link>http://query7.com/php-coding-standards/</link>
		<comments>http://query7.com/php-coding-standards/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 04:27:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=137</guid>
		<description><![CDATA[<p>Coding standards is a very important thing in web development. Code must be formatted in such a way that everyone can read it. Although you start a project on your own and don&#8217;t imagine anyone else seeing the source, there may come a time where you sell the site and a new developer will need to work on it. Or&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Coding standards is a very important thing in web development. Code must be formatted in such a way that everyone can read it. Although you start a project on your own and don&#8217;t imagine anyone else seeing the source, there may come a time where you sell the site and a new developer will need to work on it. Or you have to hire a developer to work on the site. It is best if you stick to one clear format. I personally follow the zend coding standard. In this post I am going to explain a bit about how to format your code in such a way as you follow the Zend Standards. This will make your code clean and easy to use for any developer reading your code and make it easy for yourself to read.</p>
<h3>General Rules</h3>
<p>Number 1: You don&#8217;t use &#8220;?&gt;&#8221;. PHP does not require it. Do not end your files with ?&gt; just leave it blank. It should not change anything at all in your code. It also prevents accidental whitespace injection into your files. The exception is when the file is both php and html. Although that is also bad practice. PHP shouldn&#8217;t really have HTML and PHP in the same file.</p>
<p>Number 2: Short tags are never allowed. Short tags are when you use  instead of the full value which is .</p>
<p>Number 3: Indentation should be 4 spaces. Tabs aren&#8217;t allowed. Some IDE&#8217;s such as Dreamweaver allow you to set your tabs at 4 spaces. Number 4: You should aim to have a maximum of 80 characters per line. However Zend allows up to 120. This can also be set in your IDE. These should all be followed strictly.</p>
<h3>Naming</h3>
<p>The naming of files is important, files should be named appropriately and end in .php. There is no general rule but I like to have classes named as &#8220;ClassName.class.php&#8221;. It helps seperate classes from general php. It&#8217;s also easy for anyone looking at the code to find what they need. &#8220;MySQL.class.php&#8221; means they would know it&#8217;s a MySQL class. All characters in the name have to be alpha numberic. So either numbers or letters. Functions and methods are named starting with a lowercase then each new word starts with an uppercase. Underscores are not permitted. A function should be named along the lines of this. &#8220;phpIsAwesome( );&#8221;. Variable names can never contain underscores. Only alpha numberic characters. The same method as functions should be used when naming. This is the &#8220;$lowerUpper&#8221; variable naming. The one thing that does however need underscores are Constants. Constants should be underscored at each new word however all letters must be uppercase. &#8220;WE_LOVE_CONSTANTS&#8221;.</p>
<h3>If and Else</h3>
<p>If&#8217;s must have a single space before any conditions and a single space before an opening bracket. All code inside it should be properly indented with 4 spaces. This is one of the most vital rules as most people hate code without indentation. It is almost impossible to read. An example of good, clean and indented code is this:</p>
<pre>
if ( $a &gt; $b ) {
	// Some Code
} else {
	// Some more code here
}
</pre>
<p>This is what you should aim for. Rather than a block of code with no indentation such as this:</p>
<pre>
if($a &gt; $b){
//code and stuff
}else{
//other code
} </pre>
<p>Code like that is the pet hate of almost all developers.<br />
Documentation<br />
All documentation blocks must be documented using phpDocumentor format. This looks somewhat like this:</p>
<pre>/**
 * Short description for file / class
 *
 * Long description for file / class (if any)...
 *
 * LICENSE: Some license information
 *
 * @copyright  2008 Your Company
 * @license    http://license.yoursite.com
 * @link       http://www.yourfile.com
 * @since      File available since Release 1.5.0
*/ </pre>
<p>Try and document alot of your code. It&#8217;s important so other developers know whats going on with your work. Remember that not everyone codes like you, everyone will have different ways of doing things. So explain what your doing but don&#8217;t go over the top.<br />
The End<br />
That&#8217;s all for this article on coding standards. I hope you learned somethings from this article and put them into practice. For a full list on zend coding standards read the Zend Coding Standards Manual. You do not have to adhere exactly to these, adding your own twists to the style.</p>
<p>Mark Cole.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-coding-standards/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting Up an Adobe Air Development Enviroment (Video Tutorial)</title>
		<link>http://query7.com/setting-up-an-adobe-air-development-enviroment-video-tutorial/</link>
		<comments>http://query7.com/setting-up-an-adobe-air-development-enviroment-video-tutorial/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 03:59:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=131</guid>
		<description><![CDATA[<p>Adobe Air has been out for around a year, i&#8217;ve only just started playing with it. I recorded a video tutorial showing you how to setup a development (using Aptana) and make a very simple application. This method will work for all Operating Systems.</p>
<p></p>
]]></description>
			<content:encoded><![CDATA[<p>Adobe Air has been out for around a year, i&#8217;ve only just started playing with it. I recorded a video tutorial showing you how to setup a development (using Aptana) and make a very simple application. This method will work for all Operating Systems.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/OW1jjuMj5Ss&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/OW1jjuMj5Ss&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/setting-up-an-adobe-air-development-enviroment-video-tutorial/feed/</wfw:commentRss>
<enclosure url="http://query7.com/vids/airinstall.avi" length="24066652" type="video/x-msvideo" />
		</item>
		<item>
		<title>Writing better jQuery Code</title>
		<link>http://query7.com/writing-better-jquery-code/</link>
		<comments>http://query7.com/writing-better-jquery-code/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 23:02:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[code]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=98</guid>
		<description><![CDATA[<p>We all know that jQuery is great, that you can do things in 2-3 lines in jQuery that you can in 20 lines of Javascript, but is your jQuery code starting to get a bit bulky?  Could you do things better?. I&#8217;m going to show you how to reduce a 20-25 line jQuery script into 3 lines by making the&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>We all know that jQuery is great, that you can do things in 2-3 lines in jQuery that you can in 20 lines of Javascript, but is your jQuery code starting to get a bit bulky?  Could you do things better?. I&#8217;m going to show you how to reduce a 20-25 line jQuery script into 3 lines by making the script dynamic, and give a few tips on improvement of your code.</p>
<p>What we want: When the user clicks a list item, it will show the corresponding <em>div</em></p>
<pre lang="html">
<ul id="langs">
<li id="php">PHP</li>
<li id="asp">ASP</li>
<li id="ruby">Ruby</li>
<li id="python">Python</li>
<li id="air">AIR</li>
</ul>
<div id="container">
<div id="d_php">http://www.php.net</div>
<div id="d_asp">http://www.asp.net</div>
<div id="d_ruby">http://www.ruby-lang.org</div>
<div id="d_python">http://www.python.org</div>
<div id="d_air">http://www.adobe.com/products/air/</div>
</div>
</pre>
<p>If i were a beginner and i was asked to write the script, i&#8217;d most likely code sections for each <em>id/div</em> such as below.. Once the specified link is clicked it&#8217;ll hide all the <em>div</em>s shown(the other content panels) and then it&#8217;ll fade in the relevant content panel.</p>
<pre lang="javascript">$("ul#langs li#php").click(function(){

	$("div#container div").hide();
	$("div#container div#d_php").fadeIn("slow");

	});

	$("ul#langs li#asp").click(function(){

	$("div#container div").hide();
	$("div#container div#d_asp").fadeIn("slow");

	});</pre>
<p>This is alright.. it does the job but for each id/div you need around 3 lines of code, your also listening for alot of events (all of those clicks) which may use more memory and slow the script down in general.</p>
<p>Instead of listening for unique clicks(php, asp, ruby etc..), why don&#8217;t we just listen for any click (on the list) and after its clicked, find out which item it was by getting the id (via attributes), save it as a variable, and then use that variable in the selector for the <em>div</em>.</p>
<pre lang="javascript">$("ul#langs li").click(function(){

	var elid = $(this).attr('id');
	$("div#container div").hide();

	$("div#container div#d_" + elid + "").fadeIn("slow");

	});</pre>
<p>This code is alot smaller, its scalable and its not going to get any bigger. You can use this method in other applications such as calling for ajax.</p>
<p>Questions/Comments?</p>
<p>**The Next Day**<br />
Thanks for all your thanks/comments/&#8221;gtfo noob why are you programming&#8221;-ings. Matt August, <a href="http://www.staga.net/">Bryan Migliorisi</a> and <a href="http://charlieslatte.blogspot.com/">Karol Kowalski</a> pointed out that you can&#8217;t have more than 1 element with the same <em>id</em>, I completely overlooked this and I&#8217;ve fixed the code up.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/writing-better-jquery-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XAMPP(Webserver) On Linux</title>
		<link>http://query7.com/xampp-webserver-on-linux/</link>
		<comments>http://query7.com/xampp-webserver-on-linux/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 08:07:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[linux]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=102</guid>
		<description><![CDATA[<p>I recently erased Fedora 9 from my hard drive, and installed Linux Mint. Im enjoying it so far but it didn&#8217;t come with a webserver. Heres a little tutorial on how to install XAMPP and get it up and running.</p>
<p>First of all, <a href="http://sourceforge.net/project/showfiles.php?group_id=61776&#38;package_id=60248">download XAMPP</a> from sourceforge. As of writing this, the latest version is 1.6.7 so ill be referencing to that&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I recently erased Fedora 9 from my hard drive, and installed Linux Mint. Im enjoying it so far but it didn&#8217;t come with a webserver. Heres a little tutorial on how to install XAMPP and get it up and running.</p>
<p>First of all, <a href="http://sourceforge.net/project/showfiles.php?group_id=61776&amp;package_id=60248">download XAMPP</a> from sourceforge. As of writing this, the latest version is 1.6.7 so ill be referencing to that in the tutorial. Save it to your <em>/home/$USER/</em> directory.</p>
<p>Extract the archive to your /opt/ directory.</p>
<blockquote><p><em>sudo tar xvfz xampp-linux-1.6.7.tar.gz -C /opt</em></p></blockquote>
<p>Now its installed <img src='http://query7.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
To start it:</p>
<blockquote><p>sudo /opt/lampp/lampp start</p></blockquote>
<p>To stop it:</p>
<blockquote><p>sudo /opt/lampp/lampp start</p></blockquote>
<p>To launch the panel/manager:</p>
<blockquote><p>sudo /opt/lampp/lampp panel</p></blockquote>
<p>You can test if its on by going to <em>http://localhost</em></p>
<p>To add files to the server, you would need to put them in <em>/opt/lampp/htdocs/</em> but since that directory is owned by root, your user doesn&#8217;t have neccesary privilages. The easiest way to &#8220;get around&#8221; this is to set up a symlink folder in your home directory. You may be familiar with public_html or www directories on your webhosting, we are basically setting the same thing up here.</p>
<p>First we want to set up the directory we are going to link to in htdocs. So..</p>
<blockquote><p><em>sudo mkdir /opt/lampp/htdocs/homefiles/</em></p></blockquote>
<p>Then make the equivilant directory in our home directory.</p>
<blockquote><p><em>mkdir ~/public_html/</em></p></blockquote>
<p>And finally link them together.</p>
<blockquote><p><em>sudo ln -S ~/public_html/ /opt/lampp/htdocs/homefiles/</em></p></blockquote>
<p>So now we can put PHP files/whatnot into our ~/public_html/ folder and they will show up in <em>localhost/homefiles/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/xampp-webserver-on-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Format your Twitter Stream with jQuery</title>
		<link>http://query7.com/format-your-twitter-stream-with-jquery/</link>
		<comments>http://query7.com/format-your-twitter-stream-with-jquery/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 20:54:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jquery]]></category>

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

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=96</guid>
		<description><![CDATA[<p>Woo! Another screencast. In this one i show you how to include your twitter stream into your blog or website, and then format it using jQuery so your tweets have an alternating background colour.</p>
<p></p>
]]></description>
			<content:encoded><![CDATA[<p>Woo! Another screencast. In this one i show you how to include your twitter stream into your blog or website, and then format it using jQuery so your tweets have an alternating background colour.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/ULGG4KeTb5k&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/ULGG4KeTb5k&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/format-your-twitter-stream-with-jquery/feed/</wfw:commentRss>
<enclosure url="http://query7.com/vids/jquerytwitterfeed.avi" length="17438138" type="video/x-msvideo" />
		</item>
		<item>
		<title>Learning PHP-GTK2</title>
		<link>http://query7.com/learning-php-gtk2/</link>
		<comments>http://query7.com/learning-php-gtk2/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 21:13:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php-gtk]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=90</guid>
		<description><![CDATA[<p>As PHP-GTK2 is fairly new on the scene, there aren&#8217;t many resources for learning it. Those that are, are scattered throughout the web. Ive compiled a list below, hopefully they can help you develop PHP-GTK2 applications.</p>
<ul>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/sample-codes/">kksou - Sample Codes</a>, Hundreds of code examples with explanations.</li>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/blog/">kksou - Blog</a>, Some nice advanced info, updated frequently.</li>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/Forum/">kksou - Forums</a>, Can ask for help on&#8230;</li></ul>]]></description>
			<content:encoded><![CDATA[<p>As PHP-GTK2 is fairly new on the scene, there aren&#8217;t many resources for learning it. Those that are, are scattered throughout the web. Ive compiled a list below, hopefully they can help you develop PHP-GTK2 applications.</p>
<ul>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/sample-codes/">kksou - Sample Codes</a>, Hundreds of code examples with explanations.</li>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/blog/">kksou - Blog</a>, Some nice advanced info, updated frequently.</li>
<li><a rel="nofollow" href="http://www.kksou.com/php-gtk2/Forum/">kksou - Forums</a>, Can ask for help on your codes.</li>
<li><a rel="nofollow" href="http://www.gnope.org/">Gnope</a>, Installation of PHP-GTK2.</li>
<li><a rel="nofollow" href="http://cweiske.de/phpgtk.htm">cweiske</a>, Some PHP-GTK1 resources, you may/may not find it useful for PHP-GTK2 development.</li>
<li><a rel="nofollow" href="http://gtk.php.net/">gtk.php.net</a>, Official PHP-GTK2 homepage, numerous links, source code.</li>
<li><a rel="nofollow" href="http://gtk.php.net/docs.php">gtk.php.net docs</a>, Official PHP-GTK2 documentation.</li>
<li><a rel="nofollow" href="http://gtk.php.net/faq.php">gtk.php.net FAQ</a>, Frequently Asked Questions.</li>
<li><a rel="nofollow" href="http://gtk.php.net/resources.php">gtk.php.net Resources</a>, PHP-GTK2 mailing list, more resources.</li>
<li><a rel="nofollow" href="http://php-gtk.eu/">php-gtk.eu</a>, Great support forum, samples,news.</li>
<li><a rel="nofollow" href="http://phpgtk.activeventure.com/">activenture</a>, Docs, Refs, Tutorials. Very good.</li>
<li><a rel="nofollow" href="http://php-gtk.eu/apps">php-gtk.eu apps</a>, Largest list (that i could find) of PHP-GTK2 apps.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/learning-php-gtk2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgraded To Wordpress 2.6</title>
		<link>http://query7.com/upgraded-to-wordpress-26/</link>
		<comments>http://query7.com/upgraded-to-wordpress-26/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 22:15:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[news]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=75</guid>
		<description><![CDATA[<p>We have now upgraded to wordpress 2.6.</p>
<p>Remember, you can subscribe to our <a href="http://feeds.feedburner.com/query7">RSS Feed</a> to get the latest updates and tutorials and <a href="http://www.query7.com/request-a-tutorial/">request tutorials and screencasts</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p>We have now upgraded to wordpress 2.6.</p>
<p>Remember, you can subscribe to our <a href="http://feeds.feedburner.com/query7">RSS Feed</a> to get the latest updates and tutorials and <a href="http://www.query7.com/request-a-tutorial/">request tutorials and screencasts</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/upgraded-to-wordpress-26/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dropbox Linux Client (Video)</title>
		<link>http://query7.com/dropbox-linux-client-video/</link>
		<comments>http://query7.com/dropbox-linux-client-video/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 09:38:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[dropbox]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=71</guid>
		<description><![CDATA[<p>A little screencast i made just showing the linux dropbox client off.</p>
<p></p>
]]></description>
			<content:encoded><![CDATA[<p>A little screencast i made just showing the linux dropbox client off.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/xk6aClhKhFE&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/xk6aClhKhFE&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/dropbox-linux-client-video/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Screencasting In Linux</title>
		<link>http://query7.com/screencasting-in-linux/</link>
		<comments>http://query7.com/screencasting-in-linux/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 09:07:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[fedora]]></category>

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

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=67</guid>
		<description><![CDATA[<p>Ive recorded another video tutorial, this time on Fedora 9, showing how you can make your own screencasts/video tutorials on linux. I tell you how to (sorta) get your microphone working and use the <a href="http://recordmydesktop.sourceforge.net/about.php">recordmydesktop</a> program.</p>
<p></p>
]]></description>
			<content:encoded><![CDATA[<p>Ive recorded another video tutorial, this time on Fedora 9, showing how you can make your own screencasts/video tutorials on linux. I tell you how to (sorta) get your microphone working and use the <a href="http://recordmydesktop.sourceforge.net/about.php">recordmydesktop</a> program.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/hbNEUEkj66I&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/hbNEUEkj66I&amp;hl=en&amp;fs=1" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/screencasting-in-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dropbox on Fedora. Believe it</title>
		<link>http://query7.com/dropbox-on-fedora-believe-it/</link>
		<comments>http://query7.com/dropbox-on-fedora-believe-it/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 22:05:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[dropbox]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=64</guid>
		<description><![CDATA[<p>I was lucky enough to get chosen to be one of the 25 alpha testers for the linux dropbox client. We were given the choice to download a precomiled .deb, or the source code. Since i use Fedora, i opted for the source code. I attempted to compile it and then i came across some dependency issues.There were 2-3 packages&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I was lucky enough to get chosen to be one of the 25 alpha testers for the linux dropbox client. We were given the choice to download a precomiled .deb, or the source code. Since i use Fedora, i opted for the source code. I attempted to compile it and then i came across some dependency issues.There were 2-3 packages that i needed to find work arounds for, they weren&#8217;t in the default repositories and for one (i think) there wasn&#8217;t a package for it so i needed to compile it.</p>
<p>I eventually was able to compile it without any errors. It did need a system restart to take effect, but low and behold.</p>
<p><img class="alignnone" src="http://Dropbox on Fedora" alt="" /><a href="http://www.query7.com/wp-content/uploads/2008/07/dropboxfedora9nautilus.png"><img class="alignnone size-medium wp-image-65" title="dropboxfedora9nautilus" src="http://www.query7.com/wp-content/uploads/2008/07/dropboxfedora9nautilus-300x234.png" alt="" width="595" height="464" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/dropbox-on-fedora-believe-it/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fedora 9 , First thoughts</title>
		<link>http://query7.com/fedora-9-first-thoughts/</link>
		<comments>http://query7.com/fedora-9-first-thoughts/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 20:28:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[fedora]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=60</guid>
		<description><![CDATA[<p>I was getting some problems with the latest Ubuntu release (ext3 didn&#8217;t agree with ubuntu) so i decided to try another distro. Ive always been an <em>apt-get</em> man so i wanted to try something different. I downoloaded the Fedora 9 DVD and popped it in the drive.</p>
<p>I couldn&#8217;t use the GUI installer as there was some conflict with my monitor, so&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I was getting some problems with the latest Ubuntu release (ext3 didn&#8217;t agree with ubuntu) so i decided to try another distro. Ive always been an <em>apt-get</em> man so i wanted to try something different. I downoloaded the Fedora 9 DVD and popped it in the drive.</p>
<p>I couldn&#8217;t use the GUI installer as there was some conflict with my monitor, so i need to use the text based installer. Its no big hassle for me, ive used the text base installer on slackware and other distros. The anaconda installer is great, i selected the programs i wanted to install and install. All up the install only took around 20-25 minutes - very speedy considering i installed gnome, xfce, servers, dev tools and a number of other things. Once the installation had finished i rebooted.</p>
<p>Straight away i noticed that i didn&#8217;t have an X server. When you run Fedora for the first time, im pretty sure theres a little dialog that lets you make accounts etc.. unfortunately there was no text option for me and i got left with a command prompt. I was forced to login as root. I tried <em>startx</em> and it worked! I was in the GNOME desktop, i quickly made myself a normal user account and restarted the computer. Unfortunately the Desktop Manager/GUI Login screen didn&#8217;t start so i was at the command prompt again, however i could still <em>startx</em> .</p>
<p><a href="http://www.query7.com/wp-content/uploads/2008/06/desktop.png"><img class="alignnone size-medium wp-image-61" title="fedora9desktop" src="http://www.query7.com/wp-content/uploads/2008/06/desktop-300x240.png" alt="" width="300" height="240" /></a></p>
<p>UPDATE: I decided to reinstall Fedora (2 Hours after i initially installed it. I got Anaconda to run graphically, i added the boot parameter <em>resolution=1024&#215;768</em> and it worked! The installation went smoothly, the boot screen was working and i added my user the proper way. X works straight off now, im very pleased <img src='http://query7.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/fedora-9-first-thoughts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery UI 1.5</title>
		<link>http://query7.com/jquery-ui-15/</link>
		<comments>http://query7.com/jquery-ui-15/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 04:03:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jquery]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=56</guid>
		<description><![CDATA[<p>The jQuery team are approaching the UI 1.5 release, the library of demos is steadily building up and i personally cannot wait until its fully released <img src='http://query7.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . One of the &#8220;weaker&#8221; points of other Javascript User Interfaces and previous releases were the themes for the window borders etc. This has been solved in <a onclick="pageTracker._trackPageview('/outgoing/ui.jquery.com?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');pageTracker._trackPageview('/outgoing/ui.jquery.com?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://ui.jquery.com">jQuery UI 1.5</a> with the theme roller. Its&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The jQuery team are approaching the UI 1.5 release, the library of demos is steadily building up and i personally cannot wait until its fully released <img src='http://query7.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . One of the &#8220;weaker&#8221; points of other Javascript User Interfaces and previous releases were the themes for the window borders etc. This has been solved in <a onclick="pageTracker._trackPageview('/outgoing/ui.jquery.com?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');pageTracker._trackPageview('/outgoing/ui.jquery.com?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://ui.jquery.com">jQuery UI 1.5</a> with the theme roller. Its a well polished <a onclick="pageTracker._trackPageview('/outgoing/ui.jquery.com/themeroller/?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');pageTracker._trackPageview('/outgoing/ui.jquery.com/themeroller/?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://ui.jquery.com/themeroller/">theme roller</a> with features like the jQuery colour picker in it, you set the necessary classes and you can see a live demo of what it will look like on dialogs, sliders and tabs below, very nice.</p>
<p>Heres a video by the <a onclick="pageTracker._trackPageview('/outgoing/www.filamentgroup.com/lab/introducing_themeroller_design_download_custom_themes_for_jquery_ui/?referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://www.filamentgroup.com/lab/introducing_themeroller_design_download_custom_themes_for_jquery_ui/">Filament group</a>, who made the theme roller.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="353" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.vimeo.com/moogaloop.swf?clip_id=1113981&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="353" src="http://www.vimeo.com/moogaloop.swf?clip_id=1113981&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a onclick="pageTracker._trackPageview('/outgoing/www.vimeo.com/1113981?pg=embed_amp_sec=1113981&amp;referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://www.vimeo.com/1113981?pg=embed&amp;sec=1113981">ThemeRoller for jQuery UI Screencast v4</a> from <a onclick="pageTracker._trackPageview('/outgoing/www.vimeo.com/user516403?pg=embed_amp_sec=1113981&amp;referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://www.vimeo.com/user516403?pg=embed&amp;sec=1113981">filamentgroup</a> on <a onclick="pageTracker._trackPageview('/outgoing/vimeo.com?pg=embed_amp_sec=1113981&amp;referer=http://www.query7.com/wp-admin/edit.php?post_status=draft');" href="http://vimeo.com?pg=embed&amp;sec=1113981">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-ui-15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Feed Fixed</title>
		<link>http://query7.com/feed-fixed/</link>
		<comments>http://query7.com/feed-fixed/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 04:25:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[news]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=54</guid>
		<description><![CDATA[<p>The RSS feed has been fixed and the theme is just about done! Its a very simple theme (as CSS/graphics have never been my strong point) but it will look good. More jQuery, PHP and Linux content coming soon!</p>
]]></description>
			<content:encoded><![CDATA[<p>The RSS feed has been fixed and the theme is just about done! Its a very simple theme (as CSS/graphics have never been my strong point) but it will look good. More jQuery, PHP and Linux content coming soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/feed-fixed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Whats Happening?</title>
		<link>http://query7.com/whats-happening/</link>
		<comments>http://query7.com/whats-happening/#comments</comments>
		<pubDate>Tue, 27 May 2008 21:49:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[news]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=53</guid>
		<description><![CDATA[<p>Im in the process of making/designing a custom wordpress theme for the site. Alot of things went wrong in the upgrade from 2.5 to 2.5.1 so once the new theme is finished, im doing a fresh install of wordpress so it (hopefully) irons out the RSS and posting bugs. Im backing up the database (and ill restore it) so all&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Im in the process of making/designing a custom wordpress theme for the site. Alot of things went wrong in the upgrade from 2.5 to 2.5.1 so once the new theme is finished, im doing a fresh install of wordpress so it (hopefully) irons out the RSS and posting bugs. Im backing up the database (and ill restore it) so all of the posts will still be where they were.</p>
<p>More posts are coming, ive been working on a couple of video tutorials lately so i can post them with the launch of the new site/theme.</p>
<p>Just letting everyone know.</p>
<p>~Panzer</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/whats-happening/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery AJAX Tutorial Pt2</title>
		<link>http://query7.com/jquery-ajax-tutorial-pt2/</link>
		<comments>http://query7.com/jquery-ajax-tutorial-pt2/#comments</comments>
		<pubDate>Tue, 13 May 2008 08:35:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=50</guid>
		<description><![CDATA[<p>Heres Part 2 of the jQuery AJAX login tutorial. If you haven&#8217;t already, i suggest you read part 1 located <a href="http://www.query7.com/jquery-ajax-login-series-pt1/">here</a>.</p>
<p>We are going to start writing the PHP code to process the form. This is fairly basic stuff, using <em>$_POST</em> to get the values from the form, then checking them against pre-assigned values, if they match, then echo approved, if they&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Heres Part 2 of the jQuery AJAX login tutorial. If you haven&#8217;t already, i suggest you read part 1 located <a href="http://www.query7.com/jquery-ajax-login-series-pt1/">here</a>.</p>
<p>We are going to start writing the PHP code to process the form. This is fairly basic stuff, using <em>$_POST</em> to get the values from the form, then checking them against pre-assigned values, if they match, then echo approved, if they don&#8217;t then echo denied.</p>
<pre lang="php"><?php

if($_POST['submit']){

$username = $_POST['username'];
$password = $_POST['password'];

// Here you would put your validation, checking existing database records.

if($username == panzer &#038;&#038; $password == query7){

echo 'Logged in';

//Insert your cookie setting code here

} else {

echo 'Denied';

}

} else {

echo "Form not submitted";

}
?></pre>
<p>So at the end of this stage, you will have an HTML form set up and this PHP file. You can enter the username Panzer and the password of query7 into the form and it will return Logged in.</p>
<p>Next tutorial, the fun part, the AJAX!</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-ajax-tutorial-pt2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery AJAX Login Series Pt1</title>
		<link>http://query7.com/jquery-ajax-login-series-pt1/</link>
		<comments>http://query7.com/jquery-ajax-login-series-pt1/#comments</comments>
		<pubDate>Sat, 10 May 2008 18:10:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ajax]]></category>

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

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=49</guid>
		<description><![CDATA[<p>Heyo. This is going to be the first of 4 tutorials on making a jQuery powered AJAX login system with a PHP backend. The series of tutorials will go like so.</p>
<ol>
<li> Plan, code the form (This tutorial)</li>
<li>Code the PHP backend, make it work</li>
<li>Code the AJAX, implement it.</li>
<li>Tidy it up, make it look snazzy</li>
</ol>
<p>Ok then. So we will have a forum with&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Heyo. This is going to be the first of 4 tutorials on making a jQuery powered AJAX login system with a PHP backend. The series of tutorials will go like so.</p>
<ol>
<li> Plan, code the form (This tutorial)</li>
<li>Code the PHP backend, make it work</li>
<li>Code the AJAX, implement it.</li>
<li>Tidy it up, make it look snazzy</li>
</ol>
<p>Ok then. So we will have a forum with 2 inputs; username and password. The user will enter the details and we&#8217;ll use PHP to authenticate them. If its true, we can set a cookie or echo some text. We will then implement jQuery&#8217;s AJAX and make the whole thing seemless. Some nice little fades will be added at the end.</p>
<p>So, the form. Its a plain and simple HTML form. Nothing special about it.</p>
<pre lang="html">
<form method="post">

<b>Username:</b>
<input type="text" name="username">
<b>Password:</b>
<input type="password" name="password">
<input type="submit" name="login" value="Login">
</form>
</pre>
<p>Thats all for now. Next lesson we will code the PHP and &#8220;<em>make it work</em>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/jquery-ajax-login-series-pt1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX Series Coming Soon!</title>
		<link>http://query7.com/ajax-series-coming-soon/</link>
		<comments>http://query7.com/ajax-series-coming-soon/#comments</comments>
		<pubDate>Fri, 09 May 2008 07:50:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[query7]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=48</guid>
		<description><![CDATA[<p>Hey guys, just thought i&#8217;d post a little interim post (as such). Im in the process of making a 4 part tutorial series on using jQuery&#8217;s AJAX. Its a &#8220;case study&#8221; where i/we will make a basic login form with a PHP backend and then use jQuery to make the login seemless. Eg. you put your username/password in the form&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Hey guys, just thought i&#8217;d post a little interim post (as such). Im in the process of making a 4 part tutorial series on using jQuery&#8217;s AJAX. Its a &#8220;case study&#8221; where i/we will make a basic login form with a PHP backend and then use jQuery to make the login seemless. Eg. you put your username/password in the form and click the login button the page doesn&#8217;t reload but it will tell you whether its the correct user/pass , in which case a cookie is set, or if its bad info.</p>
<p>It might take a little while to finish up so i might not be posting much over the next week (sorry) but it will be worth it in the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/ajax-series-coming-soon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Revising the jQuery Drop Down</title>
		<link>http://query7.com/revising-the-jquery-drop-down/</link>
		<comments>http://query7.com/revising-the-jquery-drop-down/#comments</comments>
		<pubDate>Sat, 03 May 2008 04:19:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[code]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=45</guid>
		<description><![CDATA[<p>This post is in reference to the <a href="http://www.query7.com/making-a-slide-in-menu-using-jquery-video-tutorial/">jquery drop down menu tutorial</a> .</p>
<p>Someone emailed me asking if the menu could truely slide in , vertically, not how it is now with the slide on a slight angle ( using jquery&#8217;s <em>show</em> / <em>hide</em> ). Its very easy to alter the existing code to make it truely slide.</p>
<p>Instead of using jQuery&#8217;s <em>show</em> and <em>hide</em> functions, we&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This post is in reference to the <a href="http://www.query7.com/making-a-slide-in-menu-using-jquery-video-tutorial/">jquery drop down menu tutorial</a> .</p>
<p>Someone emailed me asking if the menu could truely slide in , vertically, not how it is now with the slide on a slight angle ( using jquery&#8217;s <em>show</em> / <em>hide</em> ). Its very easy to alter the existing code to make it truely slide.</p>
<p>Instead of using jQuery&#8217;s <em>show</em> and <em>hide</em> functions, we just use <em>slideDown</em> and <em>slideUp</em> in replace of them. So the jQuery looks like this..</p>
<pre lang="javascript">$(document).ready(function(){

$("#drop_down").hide();
$("#drop_down").animate({

opacity:0.5

});

$("a:contains('Google')").click(function() {
$("#drop_down").slideDown("slow");

});

$("#drop_down").mouseout(function(){
$(this).slideUp("slow");

});
});</pre>
<p><a href="http://www.query7.com/demos/jquerymenurevisedslide.html#"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/revising-the-jquery-drop-down/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Making a Slide in Menu using jQuery (Video tutorial)</title>
		<link>http://query7.com/making-a-slide-in-menu-using-jquery-video-tutorial/</link>
		<comments>http://query7.com/making-a-slide-in-menu-using-jquery-video-tutorial/#comments</comments>
		<pubDate>Thu, 01 May 2008 19:12:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[code]]></category>

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

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

		<category><![CDATA[video tutorial]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=44</guid>
		<description><![CDATA[<p>This video tutorial shows how to make a basic slide in/drop down menu using jQuery. The menu itself stylishly slides in and has transparencies so you can view data behind it.</p>
<p></p>
<p>Sorry for the low sound, i was trying something different with my microphone.</p>
]]></description>
			<content:encoded><![CDATA[<p>This video tutorial shows how to make a basic slide in/drop down menu using jQuery. The menu itself stylishly slides in and has transparencies so you can view data behind it.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/VBTKjfAN1cc&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/VBTKjfAN1cc&amp;hl=en" wmode="transparent"></embed></object></p>
<p>Sorry for the low sound, i was trying something different with my microphone.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/making-a-slide-in-menu-using-jquery-video-tutorial/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Invision Power Board 3.0 Announced</title>
		<link>http://query7.com/invision-power-board-30-announced/</link>
		<comments>http://query7.com/invision-power-board-30-announced/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 19:58:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[news]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=43</guid>
		<description><![CDATA[<p>Invision Power Services have announced the development of <a onclick="pageTracker._trackPageview('/outgoing/forums.invisionpower.com/index.php?autocom=blog_amp_blogid=1174_amp_showentry=2332&#38;referer=http://www.query7.com/wp-admin/post-new.php');" href="http://forums.invisionpower.com/index.php?autocom=blog&#38;blogid=1174&#38;showentry=2332">Invision Power Board 3.0</a>. They promise a new</p>
<p>Features Include</p>
<ul>
<li>Template engine</li>
<li>Search engine friendly URLS (I presume<em> /forumname/topicname</em> rather than <em>?fid=493&#38;tid=98</em> )</li>
<li>New BB Code system</li>
<li>More Administrator controls (Picky options i&#8217;d image - turning signatures off in specific forums etc..)</li>
<li>Reputation System (Finally catching up with vBulletin <img src='http://query7.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
<li>Enhanced permission and moderator systems.</li>
</ul>
<p>They say they are adding more integration tools, so&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Invision Power Services have announced the development of <a onclick="pageTracker._trackPageview('/outgoing/forums.invisionpower.com/index.php?autocom=blog_amp_blogid=1174_amp_showentry=2332&amp;referer=http://www.query7.com/wp-admin/post-new.php');" href="http://forums.invisionpower.com/index.php?autocom=blog&amp;blogid=1174&amp;showentry=2332">Invision Power Board 3.0</a>. They promise a new</p>
<p>Features Include</p>
<ul>
<li>Template engine</li>
<li>Search engine friendly URLS (I presume<em> /forumname/topicname</em> rather than <em>?fid=493&amp;tid=98</em> )</li>
<li>New BB Code system</li>
<li>More Administrator controls (Picky options i&#8217;d image - turning signatures off in specific forums etc..)</li>
<li>Reputation System (Finally catching up with vBulletin <img src='http://query7.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</li>
<li>Enhanced permission and moderator systems.</li>
</ul>
<p>They say they are adding more integration tools, so you can integrate it with your existing website, or adleast provide some easier integration tools; it will also have tighter integration with other IPS products such as the blog, gallery.</p>
<p>Its interesting to see that they are dropping support for Oracle. They boast about having so many big business clients, i&#8217;d presume they all run Oracle, and yet are dropping support for it. Mayby they are turning back into a community board rather than a business board?</p>
<p>I&#8217;d be interested to hear your thoughts on that.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/invision-power-board-30-announced/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP-GTK 2</title>
		<link>http://query7.com/php-gtk-2/</link>
		<comments>http://query7.com/php-gtk-2/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 19:29:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[php-gtk]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=40</guid>
		<description><![CDATA[<p>Im a big Fan of PHP and one day i wanted to make a desktop application that could pull down posts and private messages from one of my forums. I didn&#8217;t want to learn a whole new language, just code the small application so i dismissed C, and looked at Python. I saw there was PyGTK, saw i wondered if&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Im a big Fan of PHP and one day i wanted to make a desktop application that could pull down posts and private messages from one of my forums. I didn&#8217;t want to learn a whole new language, just code the small application so i dismissed C, and looked at Python. I saw there was PyGTK, saw i wondered if there were PHP-GTK, which indeed there is.</p>
<p>I bought Scott Mattock&#8217;s PHP-GTK 2 book (Only to learn later that it was based on one of the early alphas) and dove straight in. Installation wasn&#8217;t hard, and i could get started straight away. I learned the hello world example first, and here it is..</p>
<pre lang="php"><?php

$wnd = new GtkWindow();
$wnd->set_title('Hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));

$lblHello = new GtkLabel("Just wanted to say\r\n'Hello world!'");
$wnd->add($lblHello);

$wnd->show_all();
Gtk::main();
?></pre>
<p>As you can see, the syntax is OOP. If you&#8217;ve coded GTK, or PyGTK before things will look very similar. We start off by declaring a new <em>GtkWindow() </em> and assign it to the class/variable <em>$wnd</em>. We then set a title using <em>set_title</em>. The next line makes sure the window shuts correctly (destroys) it when you close the window, it will also stop the gtk main loop. Then we declare a new <em>GtkLabel</em> and give it some text, and then add it to the window, again fairly self explanitory. We then tell the window to show and declare the Gtk Main loop (which keeps the window open).</p>
<p>Finished Product:<br />
<a href="http://www.query7.com/wp-content/uploads/2008/04/phpgtkhelloworld.jpg"><img class="alignnone size-thumbnail wp-image-42" title="phpgtkhelloworld" src="http://www.query7.com/wp-content/uploads/2008/04/phpgtkhelloworld-150x150.jpg" alt="" width="150" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/php-gtk-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Manipulation in jQuery</title>
		<link>http://query7.com/manipulation-in-jquery/</link>
		<comments>http://query7.com/manipulation-in-jquery/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 18:23:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jquery]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=34</guid>
		<description><![CDATA[<p>So far you should have read/watched:</p>
<ul>
<li><a href="http://www.query7.com/basics-slides-in-jquery-video-tutorial/">Basics of jQuery and Slides</a></li>
<li><a href="http://www.query7.com/selectors-in-jquery/">Using Selectors to Select HTML Elements in jQuery</a></li>
</ul>
<p>So you know the very basics of jQuery, and multiple ways to select the HTML element that you want to manipulate. In this tutorial i&#8217;ll show you how to manipulate that element after you have selected it; changing the contents, changing the HTML and&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>So far you should have read/watched:</p>
<ul>
<li><a href="http://www.query7.com/basics-slides-in-jquery-video-tutorial/">Basics of jQuery and Slides</a></li>
<li><a href="http://www.query7.com/selectors-in-jquery/">Using Selectors to Select HTML Elements in jQuery</a></li>
</ul>
<p>So you know the very basics of jQuery, and multiple ways to select the HTML element that you want to manipulate. In this tutorial i&#8217;ll show you how to manipulate that element after you have selected it; changing the contents, changing the HTML and getting values. I won&#8217;t be showing you slides/effects  , that&#8217;ll be in a tutorial coming up.</p>
<p>I will be using the HTML example from the selectors tutorial, and ill only be calling on cells by using their id - im focusing on the manipulation rather than the selecting. Anywho, lets get into it. First the HTML code we&#8217;ll be manipulating.</p>
<pre lang="html">
<table class="holder" border="1">
<tbody>
<tr>
<td id="1">One</td>
<td id="2">Two</td>
<td id="3">Three</td>
<td id="4">Four</td>
<td id="5">Five</td>
</tr>
</tbody>
</table>
</pre>
<p>Ok, say we want to change the text value of a column. We can do this using <em>text()</em> . Take note that text <strong>does not</strong> parse HTML, it keeps it as plain text.</p>
<pre lang="javascript">$("#3").text("wowow");</pre>
<p>This changes the value of the <em>#3 td </em>to <em>wowow</em></p>
<p>What if we wanted to put some HTML in their, mayby make some text bold? We use the <em>html</em> function, very much alike the <em>text</em> function except that it parses the HTML. So the text <em>&#8220;cool this is bold&#8221;</em> is bolded.</p>
<pre lang="javascript">$("#2").html("<strong>cool this is bold</strong>");</pre>
<p>Lets say we wanted to get rid of it completely, so no one could see it. For that we would use the <em>remove</em> function. It does what it says.. it just removes it.</p>
<pre lang="javascript">$("#3").remove();</pre>
<p>What if you wanted to keep the current text or HTML code in and element but simply add some text at the beginning or end. We would use <em>append</em> or <em>prepend .</em>These keep the contents of what ever is inside the element but will add a small bit of text at either the start or end of the element. <em>append</em> adds it at the start, <em>prepend</em> adds it onto the end.</p>
<pre lang="javascript">$("#4").append("hoola hoops");</pre>
<p>So the output of that would be <em>Four Hoola Hoops</em></p>
<pre lang="javascript">$("#4").prepend("hoola hoops");</pre>
<p>The output of that would be <em>hoola hoops Four</em>.</p>
<p>Another very nice function jQuery has to offer is the <em>clone</em> function. It lets you take an element and make an exact copy of it. Thanks to jQuery&#8217;s chainability its very easy to add that clone where ever you want. So, we want to make a copy of <em>#4</em>, and add its contents to <em>#2</em>.</p>
<pre lang="javascript">$("#4").clone().prependTo("#2");</pre>
<p>So, thats about it for this tutorial on manipulation. I&#8217;d love some comments, what sorts of things you&#8217;d like to see next or feedback on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/manipulation-in-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rick Rolling</title>
		<link>http://query7.com/rick-rolling/</link>
		<comments>http://query7.com/rick-rolling/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 01:00:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

		<category><![CDATA[rick astley]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=28</guid>
		<description><![CDATA[<p>Every been linked to one of <strong>those</strong> pages? You know, the ones you can&#8217;t escape.. Javascript boxes start popping out of nowhere and then you hear him.. Rick Astley.. telling you how he&#8217;s feeling about you.. You&#8217;ve been <em>Rick Rolled.</em></p>
<p>Rick Rolling has taken off as late and links are popping up all over forums, websites and IRC. What links? You say.&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Every been linked to one of <strong>those</strong> pages? You know, the ones you can&#8217;t escape.. Javascript boxes start popping out of nowhere and then you hear him.. Rick Astley.. telling you how he&#8217;s feeling about you.. You&#8217;ve been <em>Rick Rolled.</em></p>
<p>Rick Rolling has taken off as late and links are popping up all over forums, websites and IRC. What links? You say. <a href="http://members.tele2.nl/class-pc/">These links</a>.  <img src='http://query7.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . On top of tricking your friends.. or blog viewers .. to click this link there have been some &#8220;live rick rollings&#8221;.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/BJkxilXekyI&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/BJkxilXekyI&amp;hl=en" wmode="transparent"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/EeuEMeg8eQE&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/EeuEMeg8eQE&amp;hl=en" wmode="transparent"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/Jkjv9WbrxHQ&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/Jkjv9WbrxHQ&amp;hl=en" wmode="transparent"></embed></object></p>
<p>Ever been rickrolled yourself? Or got a really good one on somebody? Share it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/rick-rolling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dropbox Invites!</title>
		<link>http://query7.com/dropbox-invites/</link>
		<comments>http://query7.com/dropbox-invites/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 20:38:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=27</guid>
		<description><![CDATA[<p>Dropbox is the next big thing. Its an application that lets you sync multiple computers. For example if you have a laptop and a Desktop and want to keep some files across the two machines synchronized then this is the tool for you. The great thing is that its multiple Operating System compatible. There are currently clients for Windows and&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Dropbox is the next big thing. Its an application that lets you sync multiple computers. For example if you have a laptop and a Desktop and want to keep some files across the two machines synchronized then this is the tool for you. The great thing is that its multiple Operating System compatible. There are currently clients for Windows and Mac and a linux client is in Alpha (They promise to release it). Ill leave the rest of the explaining to the video below&#8230;</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/a_Y0AKUM3-4&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/a_Y0AKUM3-4&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>When they do a full release there will be two types of accounts, premium and free. The free accounts will get 1gb of space each, premium is as of yet undecided. At the moment they are beta testing. Beta accounts get 2gb of space and will be kept free forever.</p>
<p>You can sign up on the getdropbox.com website to try and get a beta account but they take along time and sometimes you aren&#8217;t accepted. Im offering dropbox invites.. for free. Once i sent the invite email your account will get activated straight away! Thats a 2gb account for ever!</p>
<p>*Beta accounts used to be 5gb, but are now 2gb. If your 2gb is getting full you ask the dropbox staff and they will upgrade you to a 5gb*</p>
<p>To get an invite.. simply comment here asking for one and ill send via email.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/dropbox-invites/feed/</wfw:commentRss>
		</item>
		<item>
		<title>phpbb2 being pulled</title>
		<link>http://query7.com/phpbb2-being-pulled/</link>
		<comments>http://query7.com/phpbb2-being-pulled/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 05:42:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=32</guid>
		<description><![CDATA[<p><a href="http://www.query7.com/wp-content/uploads/2008/04/phpbb.jpg"><img class="alignnone size-medium wp-image-33" title="phpbb" src="http://www.query7.com/wp-content/uploads/2008/04/phpbb-300x118.jpg" alt="" width="414" height="118" /></a></p>
<p>The popular discussion board phpbb2 is being pulled/development dropped. Security patches and support will be given until January 2009 and you will be able to download the software from the website until the 1st of Ocbober 2008 . phpBB2 has been plagued by a large number of vulnerabilities, a significant number of them were through user submitted modifications.</p>
<p>phpBB 3 started&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.query7.com/wp-content/uploads/2008/04/phpbb.jpg"><img class="alignnone size-medium wp-image-33" title="phpbb" src="http://www.query7.com/wp-content/uploads/2008/04/phpbb-300x118.jpg" alt="" width="414" height="118" /></a></p>
<p>The popular discussion board phpbb2 is being pulled/development dropped. Security patches and support will be given until January 2009 and you will be able to download the software from the website until the 1st of Ocbober 2008 . phpBB2 has been plagued by a large number of vulnerabilities, a significant number of them were through user submitted modifications.</p>
<p>phpBB 3 started strong and is continuing to do so. With more database types being support, and a massive new set of administrator controls, it&#8217;s set up to compete with the likes of MyBB and Simple Machine Forums. People often look back at <a href="http://forums.devshed.com/php-development-5/help-me-test-4914.html">this</a> thread, posted when phpBB 1 was undergoing testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/phpbb2-being-pulled/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Selectors in jQuery</title>
		<link>http://query7.com/selectors-in-jquery/</link>
		<comments>http://query7.com/selectors-in-jquery/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 10:05:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=24</guid>
		<description><![CDATA[<p>In this tutorial i&#8217;ll go over some of the frequently used Selectors and show you how to use them. Most of jQuery&#8217;s manipulations revolve around selectors, so it&#8217;s a vital skill to know.</p>
<pre lang="html">
<table class="holder" border="1">
<tbody>
<tr>
<td id="1">One</td>
<td id="2">Two</td>
<td id="3">Three</td>
<td id="4">Four</td>
<td id="5">Five</td>
</tr>
</tbody>
</table>
</pre>
<p>So.. we want to select the first <em>td</em>. We do this by first selecting all the <em>td</em> tags and then use <em>:first</em> to select the first <em>td</em>. Using jQuery&#8217;s great&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial i&#8217;ll go over some of the frequently used Selectors and show you how to use them. Most of jQuery&#8217;s manipulations revolve around selectors, so it&#8217;s a vital skill to know.</p>
<pre lang="html">
<table class="holder" border="1">
<tbody>
<tr>
<td id="1">One</td>
<td id="2">Two</td>
<td id="3">Three</td>
<td id="4">Four</td>
<td id="5">Five</td>
</tr>
</tbody>
</table>
</pre>
<p>So.. we want to select the first <em>td</em>. We do this by first selecting all the <em>td</em> tags and then use <em>:first</em> to select the first <em>td</em>. Using jQuery&#8217;s great chaining ability, we change the text.</p>
<pre lang="javascript">  $("td:first").text("This is the altered first box");</pre>
<p>jQuery also has <em>:odd</em> and <em>:even</em> selectors. This will select the odd or even id&#8217;s. In this next example. We are selecting all of the odd <em>td</em>&#8217;s , and then select the first one of them. Again , we use jQuery&#8217;s chainability.</p>
<pre lang="javascript"> $("td:odd:first").text("We changed this using odd and first");</pre>
<p><span style="color: #ff0000;">You need to be aware that selecting the odds/evens does not use the element ids. It just counts them. It starts from 0 and starts counting, not from 1. This is why it changes the second cell using the method above.</span></p>
<p>Now, lets match the next one by specific text. We can do this using the <em>:contains</em> selector. We look in all <em>td</em> elements, then in them we look for the word <em>Three</em> , if we find it we replace the text.</p>
<pre lang="javascript">$("td:contains('Three')").text("we matched the text, then changed it.");</pre>
<p>We can use the element <em>id</em> to edit select what we want. jQuery&#8217;s element selector is the hash symbol (#).</p>
<pre lang="javascript">$("#4").text("We found this using the id");</pre>
<p>The last one! How are we going to select it? We are going to use the <em>gt</em> selector. We can specify a tag, and jQuery counts how many there are. In this case we select <em>td</em> and it counts them (remember it starts at 0, not 1). It will select all the td that are higher than the number we specify. So we have 5 <em>td</em> , 0,1,2,3,4 . Se specify number 3, so only number 4 is effected. Thats our last <em>td</em>.</p>
<pre lang="javascript">$("td:gt(3)").text("The Last One!");</pre>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/selectors-in-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu 8.04 LTS Released</title>
		<link>http://query7.com/ubuntu-804-lts-released/</link>
		<comments>http://query7.com/ubuntu-804-lts-released/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 03:58:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.query7.com/?p=25</guid>
		<description><![CDATA[<p><a href="http://www.query7.com/wp-content/uploads/2008/04/ubuntusign.jpg"><img class="alignnone size-medium wp-image-26" title="ubuntusign" src="http://www.query7.com/wp-content/uploads/2008/04/ubuntusign-300x225.jpg" alt="" width="346" height="225" /></a></p>
<p>The 8th version of Ubuntu has now been released! Notable inclusions are..</p>
<ul>
<li>Linux Kernel 2.6.24</li>
<li>Xorg 7.3 (Latest)</li>
<li>GNOME 2.22</li>
<li>Firefox 3 Beta 5</li>
</ul>
<p>Its interesting to see that they&#8217;ve given some</p>
<p>of their older applications an overhaul. It now includes the <em>Brasero </em>CD burning utility which replaces <em>Serpentine</em>. They&#8217;ve also included the GTK front-end bit-torrent client <em>Transmission</em> and added a new VNC viewer called <em>Vinagre</em>. If&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.query7.com/wp-content/uploads/2008/04/ubuntusign.jpg"><img class="alignnone size-medium wp-image-26" title="ubuntusign" src="http://www.query7.com/wp-content/uploads/2008/04/ubuntusign-300x225.jpg" alt="" width="346" height="225" /></a></p>
<p>The 8th version of Ubuntu has now been released! Notable inclusions are..</p>
<ul>
<li>Linux Kernel 2.6.24</li>
<li>Xorg 7.3 (Latest)</li>
<li>GNOME 2.22</li>
<li>Firefox 3 Beta 5</li>
</ul>
<p>Its interesting to see that they&#8217;ve given some</p>
<p>of their older applications an overhaul. It now includes the <em>Brasero </em>CD burning utility which replaces <em>Serpentine</em>. They&#8217;ve also included the GTK front-end bit-torrent client <em>Transmission</em> and added a new VNC viewer called <em>Vinagre</em>. If you put the burnt ISO disk into a Windows machine, you can install Ubuntu via Windows! I thought this was a cool little feature.</p>
<p>Ive been following Ubuntu for a few years now, i started Using Hoary right through to Fiesty. After that Ubuntu wasn&#8217;t right for me. It felt pretty bloated, trying to do things for you, and now im happily running Zenwalk 5.0 which is based off Slackware. I&#8217;m interested to here what you think, of Ubuntu and the new release.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/ubuntu-804-lts-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tune Into Shoutcasts With VLC</title>
		<link>http://query7.com/tune-into-shoutcasts-with-vlc/</link>
		<comments>http://query7.com/tune-into-shoutcasts-with-vlc/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:50:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=21</guid>
		<description><![CDATA[<p>Heres a quick tutorial on how to stream internet radio, in particular shoutcast, through VLC media player. Most people stream through Windows Media Player or Winamp, but if you like Open Source applications like me, heres how you do it.</p>
<p>File -> Open Network Stream<br />
<img title="step1-VLCshoutcast" src="http://www.query7.com/wp-content/uploads/2008/04/step1-300x185.gif" alt="" width="300" height="185" /></p>
<p>Select the <em>HTTP/HTTPS/FTP/MMS</em> box and in the form, enter the URL of the shoutcast server, with the port. In&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Heres a quick tutorial on how to stream internet radio, in particular shoutcast, through VLC media player. Most people stream through Windows Media Player or Winamp, but if you like Open Source applications like me, heres how you do it.</p>
<p>File -> Open Network Stream<br />
<img title="step1-VLCshoutcast" src="http://www.query7.com/wp-content/uploads/2008/04/step1-300x185.gif" alt="" width="300" height="185" /></p>
<p>Select the <em>HTTP/HTTPS/FTP/MMS</em> box and in the form, enter the URL of the shoutcast server, with the port. In my case its <em>enaxi.com:8000</em> . Then click OK.</p>
<p><a href='http://www.query7.com/wp-content/uploads/2008/04/step2.gif'><img src="http://www.query7.com/wp-content/uploads/2008/04/step2-300x218.gif" alt="" title="step2" width="300" height="218" class="alignnone size-medium wp-image-22" /></a></p>
<p>And tadah.. It works!</p>
<p><a href='http://www.query7.com/wp-content/uploads/2008/04/step3.gif'><img src="http://www.query7.com/wp-content/uploads/2008/04/step3-300x87.gif" alt="" title="step3" width="300" height="87" class="alignnone size-medium wp-image-23" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/tune-into-shoutcasts-with-vlc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Securing User Input in PHP</title>
		<link>http://query7.com/securing-user-input-in-php/</link>
		<comments>http://query7.com/securing-user-input-in-php/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 18:57:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=19</guid>
		<description><![CDATA[<p>In nearly all of my PHP tutorials you&#8217;ll see me using the secure function to sanitise incoming user data from things like forms, and <em>$_GET</em>s . Its a small function, which no doubt alot of you already have, but here it is anyway.</p>
<pre lang="php">function secure($string) {
		$string = strip_tags($string);
		$string = htmlspecialchars($string);
		$string = trim($string);
		$string = stripslashes($string);
		$string = mysql_real_escape_string($string);&#8230;</pre>]]></description>
			<content:encoded><![CDATA[<p>In nearly all of my PHP tutorials you&#8217;ll see me using the secure function to sanitise incoming user data from things like forms, and <em>$_GET</em>s . Its a small function, which no doubt alot of you already have, but here it is anyway.</p>
<pre lang="php">function secure($string) {
		$string = strip_tags($string);
		$string = htmlspecialchars($string);
		$string = trim($string);
		$string = stripslashes($string);
		$string = mysql_real_escape_string($string);
	return $string;

	}</pre>
<p>As you can see, it basically sanitises the heck out of everything. Some people say its an overkill but you can use it in almost every situation when user data is incoming.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/securing-user-input-in-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Remotely Hosted? No Problem</title>
		<link>http://query7.com/lets-code-some-jquery/</link>
		<comments>http://query7.com/lets-code-some-jquery/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 10:14:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=17</guid>
		<description><![CDATA[<p>There are alot of remotely hosted systems out nowadays, Zetaboards, SMF for Free and the series of IPB 1.3.1s. If you want to edit the looks of your board you need to use Javascript since you can&#8217;t access the source PHP files. You can work your way around using <em>getElementById </em>and the likes, or you can use jQuery. Here are&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>There are alot of remotely hosted systems out nowadays, Zetaboards, SMF for Free and the series of IPB 1.3.1s. If you want to edit the looks of your board you need to use Javascript since you can&#8217;t access the source PHP files. You can work your way around using <em>getElementById </em>and the likes, or you can use jQuery. Here are some hints on how to use it.</p>
<p>Say you have a menu and you want to add some extra items to it. The menu code is something like..</p>
<pre lang="html">
<div id="navcontainer">
<ul id="navlist">
<li><a id="menu" href="#">Item two</a></li>
<li><a id="menu" href="#">Item three</a></li>
<li><a id="menu" href="#">Item four</a></li>
<li><a id="menu" href="#">Item five</a></li>
</ul>
</div>
</pre>
<p>We want to add another</p>
<pre lang="html">
<li><a id="menu" href="#">Item Six</a></li>
</pre>
<p>beneath the element</p>
<pre lang="html"></pre>
<p>So, in normal javascript you would need to find the unordered list with an id of navlist, then add innerHTML or a childnode of the ordered list. However in jQuery we can do this with one easy line.</p>
<pre lang="javascript"> $("#navlist").append("
<li><a id="menu" href="#">A Custom item</a></li>

");</pre>
<p>That would add it to the start of the list, if we wanted it at the end we would use the prepend function.</p>
<pre lang="javascript"> $("#navlist").prepend("
<li><a id="menu" href="#">A Custom item</a></li>

");</pre>
<p>What if there were a menu item we didn&#8217;t like? Say Item Four. Lets get ride of it! We could need to match the text inside the list, then hide it. With this next snippet, we are using the selector <em>contains</em> and are looking for the word <em>four</em> in every single ordered list ( <em>li </em>)</p>
<pre lang="javascript"> $("li:contains('four')").hide();</pre>
<p>For some strange reason, if you wanted to make the list items fade out instead of just being hidden, its not hard to change it (Because of jQuery&#8217;s chainability). Instead of hide() -ing. Just fade out like so.</p>
<pre lang="javascript"> $("li:contains('four')").fadeOut("slow");</pre>
<p>If theres something you want to do with your remotely hosted system, but don&#8217;t know how. Feel free to ask!</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/lets-code-some-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Debian Package Management Using apt-get</title>
		<link>http://query7.com/debian-package-management-using-apt-get/</link>
		<comments>http://query7.com/debian-package-management-using-apt-get/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 04:34:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[apt-get]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=16</guid>
		<description><![CDATA[<p>Heres a tutorial on how to use the apt-get package management system in Debian and its derivitives such as Ubuntu and Knoppix. I will cover command line use of apt-get, the aptitude program and the Synaptic Package Manager. I wrote all of this myself, feel free to link to here but do not copy and paste it.</p>
<p>Debian uses apt-get package&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Heres a tutorial on how to use the apt-get package management system in Debian and its derivitives such as Ubuntu and Knoppix. I will cover command line use of apt-get, the aptitude program and the Synaptic Package Manager. I wrote all of this myself, feel free to link to here but do not copy and paste it.</p>
<p>Debian uses apt-get package management. It looks at a series of defined repositories (servers) for the package(s) you want and will download them if they are there. The repositories are defined in the file</p>
<p><em>/etc/apt/sources.list</em></p>
<p>You can edit that file directly (make sure you have root) or use frontends like the Synaptic Package Manager or Software Sources (Menu item) in the distro.</p>
<p><strong>Command Line Usage</strong></p>
<p>To install a package you need to use the apt-get install command. For example to install the IRC program XChat you would type into the console.</p>
<p><em>sudo apt-get  install xchat</em></p>
<p>It would prompt you for your root password and then list information about the package and would double check you still want to download and install it.</p>
<p>To remove a package you would use the apt-get remove command. This will remove the package files but will keep the configuration files incase you install the same application at a later date. If you wanted to remove XChat you would type into the console.</p>
<p><em>sudo apt-get remove xchat</em></p>
<p>To completely remove a package and leave no trace of it you would use the apt-get &#8211;purge remove command. If you wanted to completely remove XChat you would type into the console.</p>
<p><em>sudo apt-get &#8211;purge remove xchat</em></p>
<p>To upgrade packages on your system you would use the apt-get -u upgrade command. This would update all your packages but before updating them, would list them for you to see. If you wanted to update packages on your system you would type into the console.</p>
<p><em>sudo apt-get -u </em></p>
<p>To do a complete distro upgrade (Eg upgrade from Ubuntu Fiesty Fawn to Ubuntu Gutsy Gibbon then you would use the apt-get -u dist-upgrade command. Its considered to be good practice in reinstalling your system when a new release comes out or only dist-upgrade once or twice. It can lead to breaks in the OS and sluggishness. If you wanted to dist-upgrade your system you would type into the console.</p>
<p><em>sudo apt-get -u dist-upgrade</em></p>
<p>Again, it would show you what packages you would be upgrading before actually starting.</p>
<p><strong>Aptitude</strong></p>
<p>aptitude is a Command Line/Basic GUI tool for installing packages using apt-get. If your still not comfortable with full command line usage but the Synaptic Package Manager takes up too much system resources on your system then aptitude might be right for you. You can start it with the command</p>
<p><em>sudo aptitude</em></p>
<p>It launches a basic GUI in the console in which you can browse packages by category and search for them.</p>
<p>Once you have found the package you want to install, you can confirm it and it will download and install it.</p>
<p><strong>Synaptic Package Manager</strong></p>
<p>The Synaptic Package Manager is one of the most widely used applications in Debian based systems. Its got a friendly and easy to navigate GUI. Like aptitude its really just an apt-get frontend but new users seem to like it.</p>
<p>Although it may seem basic, it provides updating, installing, removing, purging, searching and an editor for /etc/apt/sources.list all in one.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/debian-package-management-using-apt-get/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Keeping Your Website Secure</title>
		<link>http://query7.com/keeping-your-website-secure/</link>
		<comments>http://query7.com/keeping-your-website-secure/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 08:45:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

		<guid isPermaLink="false">http://www.query7.com/?p=12</guid>
		<description><![CDATA[<p>This isn&#8217;t Yet Another PHP Security blog post, like you see on all the other websites. This is aimed at people who run existing software such as SMF, Joomla and Wordpress.</p>
<p>Some people using pre-made software think they are immune to hacking attempts. 4 days ago, there was a vulnerability found in the latest version of the Coppermine Gallery software, after&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t Yet Another PHP Security blog post, like you see on all the other websites. This is aimed at people who run existing software such as SMF, Joomla and Wordpress.</p>
<p>Some people using pre-made software think they are immune to hacking attempts. 4 days ago, there was a vulnerability found in the latest version of the Coppermine Gallery software, after the vulnerability was made public, hundreds of people got hit, and their galleries essentially destroyed. Infact there were 2 SQL injection vulnerabilities found within 5 days of each other. For something that has been in development since September 7th 2003, thats pretty scary.</p>
<p>Now, if you owned a Coppermine Gallery what measures could you take to make sure that your installation was safe, even if you couldn&#8217;t patch it yourself, you could take it offline until one is released. The website securityfocus.com is a security and vulnerability website. People post the latest vulnerabilities there in software, for example one of the coppermine vulns , http://www.securityfocus.com/bid/28767 . If you do a daily run of your blogs/forums, you could also go there and type in the version and software that your using to do a quick check. Social news websites such as digg, stumbleupon and del.icio.us are also good for checking for a vulnerability. Again, just type in your software name and version number and some results might come up!</p>
<p>There is no proper way to prevent your website from being hacked, all of these new exploits are 0 days. Its a race between you shutting down or patching your website, and the hacker getting to it first.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/keeping-your-website-secure/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Basics, Slides in jQuery - Video Tutorial</title>
		<link>http://query7.com/basics-slides-in-jquery-video-tutorial/</link>
		<comments>http://query7.com/basics-slides-in-jquery-video-tutorial/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 04:27:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[code]]></category>

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

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

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

		<guid isPermaLink="false">http://www.query7.com/?p=10</guid>
		<description><![CDATA[<p>Heres a quick video tutorial i made, you&#8217;ll learn the basics of jQuery such as selecting elements as well as usage of the slide effect. Feel free to ask any questions</p>
<p></p>
]]></description>
			<content:encoded><![CDATA[<p>Heres a quick video tutorial i made, you&#8217;ll learn the basics of jQuery such as selecting elements as well as usage of the slide effect. Feel free to ask any questions</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/Jl8ELG1OlLM&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/Jl8ELG1OlLM&amp;hl=en" wmode="transparent"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/basics-slides-in-jquery-video-tutorial/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
