<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>webdevils.com &#187; PHP</title>
	<atom:link href="http://www.webdevils.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevils.com</link>
	<description>Web New Media notes and ramblings</description>
	<lastBuildDate>Tue, 31 Jan 2012 04:58:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>WordPress: wp_list_pages</title>
		<link>http://www.webdevils.com/2010/10/15/wordpress-list-pages-classes/</link>
		<comments>http://www.webdevils.com/2010/10/15/wordpress-list-pages-classes/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 00:05:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=444</guid>
		<description><![CDATA[Using wp_list_pages This post describes the basics of working with wp_list_pages. wp_list_pages overview The wp_list_pages function generates a list of links to pages in your WordPress site. The list is generated as an li tag with a title and a nested ul containing a list of links. For example, if your site had pages named [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Using wp_list_pages</strong></p>
<p>This post describes the basics of working with wp_list_pages.</p>
<p><span id="more-444"></span></p>
<p><strong>wp_list_pages overview</strong></p>
<p>The wp_list_pages function generates a list of links to pages in your WordPress site. The list is generated as an li tag with a title and a nested ul containing a list of links. For example, if your site had pages named About and Contact wp_list_pages()  would generate:</p>
<pre>
<code >&lt;li&gt;Pages
	&lt;ul&gt;
		&lt;li&gt;&lt;a&gt;About&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;Contact&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/li&gt;</code>
</pre>
<p><strong>Styling the page list heading</strong></p>
<p>By default the wp_list_pages displays &#8220;Pages&#8221; within the li tag. You change the label and or add a tag to it by using the title_li option. For example the following prints Pages as an h3.</p>
<pre>&lt;?php wp_list_pages('title_li=&lt;h3&gt;Pages&lt;/h3&gt;'); ?&gt;</pre>
<p>Or display no title at all:</p>
<pre>&lt;?php wp_list_pages('title_li='); ?&gt;</pre>
<p>Note! In this case the outer li and ul are removed. For example if your pages were About and Contact you would have:</p>
<pre>
<code >	&lt;li&gt;&lt;a&gt;About&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a&gt;Contact&lt;/a&gt;&lt;/li&gt;</code>
</pre>
<p><strong>Styling the page list</strong></p>
<p>Each of the li tags generated by wp_list_pages is assigned the following class names:</p>
<ul>
<li>page_item</li>
<li>page-item-id &#8211; Where id is the id number of the page</li>
</ul>
<p>The class page_item is very useful. Note that it uses the _ rather than the -.</p>
<p>The class page-item-id on the other is less useful. WordPress generates an id number for each page. This number is a little unpredictable. Id numbers really have no rhyme or reason.</p>
<p>When a page is currently displayed the link that matches the page will also have the class:</p>
<ul>
<li>current_page_item</li>
</ul>
<p>This is a very useful property that can be used to assign a style to the current page link.</p>
<p><strong>Sample Selectors</strong></p>
<p>The first step to creating a style for the page links is to define a selector that will target the links. Since all links will end up in li tag within the container element the descendant selector works well. For this example imagine the pages links are contained within an element with the id name nav</p>
<p><code>#nav li {...styles...}</code></p>
<p>To be more specific and target only the page links rather than all of the list items, the class page_item is assigned to all page links. </p>
<p><code>#nav .page_item {...styles...}</code></p>
<p>To style the selected page differently from the other pages links, use the class current_page_item.</p>
<p><code>#nav .current_page_item {...styles...}</code></p>
<p>To target the anchor tag within each of the list items generated by wp_list_pages, use the descendant or child selectors any of the following should work. </p>
<p><code>#nav li a{...styles...}</code><br />
<code>#nav .page_item a{...styles...}</code><br />
<code>#nav .current_page_item a{...styles...}</code></p>
<p><strong>Sample Styles</strong></p>
<p>Here&#8217;s a few ideas on styling the page links. Be sure to use the :link, :visited, :hover and :active styles. </p>
<p><code>#nav li a:link{...styles...}</code><br />
<code>#nav li a:visited{...styles...}</code><br />
<code>#nav li a:hover{...styles...}</code><br />
<code>#nav li a:active{...styles...}</code></p>
<p>Be sure to style the current_page_item after the other links styles.</p>
<p>Here&#8217;s a few more ideas. Make every link appear as a box. Set each anchor tag to display block:</p>
<p><code>.page_item a { display:block;  }</code></p>
<p>Make a horizontal list of links with float. Floating the list may require that you clear the floated elements later in your page. </p>
<p><code>.page_item a {<br />
display:block;<br />
float:left;<br />
}</code></p>
<p>Adding padding on all sides to expand the link boxes. Here&#8217;s an idea use the <a href="http://www.css3.info/preview/rounded-border/">border-radius property</a> to add rounded corners. You could easily create some tabs by rounding only the top corners. </p>
<p><strong>Other options</strong><br />
The wp_list_pages method provides many options. For a full list of options see the <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">WordPress Codex</a>. </p>
<p>Here are a few possibilities. Since pages can be nested, use the depth option to set the number of levels of pages that will be displayed. For example depth=1 displays only the top level pages. </p>
<p>Use the &#038; between properties. For example, the line below creates a list of pages with no title and a depth of 1. </p>
<p><code>&lt;?php wp_list_pages("title_li=&amp;depth=1"); ?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2010/10/15/wordpress-list-pages-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Basics: Functions</title>
		<link>http://www.webdevils.com/2010/10/15/php-basics-functions/</link>
		<comments>http://www.webdevils.com/2010/10/15/php-basics-functions/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 18:51:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=429</guid>
		<description><![CDATA[Functions in PHP PHP allows you to write functions similarly to the way functions are written in other languages. Functions in PHP provide the same advantages that they provide in other languages also. Functions provide a way to encapsulate a block of code so it can be reused as often as needed. This allows you [...]]]></description>
			<content:encoded><![CDATA[<h3>Functions in PHP</h3>
<p>PHP allows you to  write functions similarly to the way functions are written in other  languages. Functions in PHP provide the same advantages that they  provide in other languages also. Functions provide a way to encapsulate a  block of code so it can be reused as often as needed. This allows you  to avoid rewriting the same blocks of code over again. Which makes your  job easier by writing less code. This also keeps your from having to  write similar or the same block of code more than once.</p>
<p><span id="more-429"></span></p>
<p>The basic syntax is  very similar to what you may already be familiar with.</p>
<pre>function  function_name() {
... code ...
}</pre>
<p>Function names must be  unique. The same name may not appear in different documents.</p>
<p>Use a function by  defining it then call it by name. For example:</p>
<pre>&lt;?php
function hello_Wrold() {
echo  "&lt;p&gt;Hello World&lt;/p&gt;";
}

hello_world();
?&gt;</pre>
<p>The code block above  defines a function, named hello, and then calls the function on the line  below. Each time this function is called PHP should print a paragraph  containing the words Hello World. The code block below would print three  paragraphs.</p>
<pre>&lt;?php
function hello_world() {
echo  "&lt;p&gt;Hello World&lt;/p&gt;";
}

hello_world();
hello_world();
hello_world();
?&gt;</pre>
<p>This might not seem  very exciting at this point. Where functions become very useful is when  they are set up to accept parameters. Parameters are variables that hold  values passed along to a function. These values can be used to tell a  function how to do what it does.</p>
<p>For example, the following modifies the  original hello function so that we can tell it how many paragraphs to  print.</p>
<pre>&lt;?php
function hello_world( $n ) {
while( $n &gt; 0 )  {
echo "&lt;p&gt;Hello World&lt;/p&gt;";
$n --;
}
}

hello_world( 3 );
?&gt;</pre>
<p>The example above  calls the hello function and includes the parameter 3: hello(3). This  causes the function to print the paragraph 3 times.</p>
<p>If you have a default  value for a parameter that you use often you can assign that to a  parameter like this:</p>
<pre>&lt;?php
function hello_world( $n = 1 ) {
while( $n &gt; 0 )  {
echo "&lt;p&gt;Hello World&lt;/p&gt;";
$n --;
}
}

hello_world();
?&gt;</pre>
<p>If no parameter is  included the function uses the default value. For example, the following  would print one paragraph: hello(), this would print 5 paragraphs:  hello(5).</p>
<p>Functions can also  return a value. The following rearranges the code above to have the  function return paragraphs.</p>
<pre>&lt;?php
function hello_world( $n = 1 ) {
$str = "";
while( $n &gt; 0 )  {
$str .= "&lt;p&gt;Hello World&lt;/p&gt;";
$n --;
}
return( $str );
}

echo hello_world();
?&gt;</pre>
<p>Here the function  creates a string which is returned and echoed at the point where the  function was called.</p>
<p>Where to place functions<br />
It&#8217;s best to define  all of your functions in the same place. A good strategy is to place  them all in a PHP file and use include or require to make the code  available on any page that might use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2010/10/15/php-basics-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP MySQL and Special Characters</title>
		<link>http://www.webdevils.com/2010/09/29/php-mysql-and-special-characters/</link>
		<comments>http://www.webdevils.com/2010/09/29/php-mysql-and-special-characters/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 17:25:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=402</guid>
		<description><![CDATA[You may find that you have a problem with special characters not displaying or showing up as a small black diamond with a ? in the center. Here&#8217;s a quick fix seems to work well. These would be characters like: &#60;, &#62; and &#38;. It also includes characters like: é,?, ø and the curly quotation [...]]]></description>
			<content:encoded><![CDATA[<p>You may find that you have a problem with special characters not displaying or showing up as a small black diamond with a ? in the center. Here&#8217;s a quick fix seems to work well.</p>
<p>These would be characters like: &lt;, &gt; and &amp;. It also includes characters like: é,?, ø and the curly quotation marks.</p>
<p>At the point you are printing these characters into a page you&#8217;ll want to run them through the php htmlentities function. Here&#8217;s an example:</p>
<pre>htmlentities( $str, ENT_COMPAT, 'Windows-1252' );</pre>
<p>Where $str would be any string you wanted to convert to compatible characters.</p>
<p>For more info: <a href="http://www.php.net/manual/en/function.htmlentities.php" target="_blank">http://www.php.net/manual/en/function.htmlentities.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2010/09/29/php-mysql-and-special-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doodle</title>
		<link>http://www.webdevils.com/2009/10/24/doodle/</link>
		<comments>http://www.webdevils.com/2009/10/24/doodle/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 04:50:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=187</guid>
		<description><![CDATA[Here&#8217;s an app I thought up the Firday. I managed to &#8220;finish&#8221; it up after dinner Friday and and with a few spare hours Saturday. I put finished in quotes, because it&#8217;s not really finished. There&#8217;s a still a lot to do. I did manage to mock up the basic ideas and get them all [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an app I thought up the Firday. I managed to &#8220;finish&#8221; it up after dinner Friday and and with a few spare hours Saturday. I put finished in quotes, because it&#8217;s not really finished. There&#8217;s a still a lot to do. I did manage to mock up the basic ideas and get them all working.</p>
<p><a href="http://newmedia.academyart.edu/~mhudson/doodle/" target="_blank">http://newmedia.academyart.edu/~mhudson/doodle/</a></p>
<p>So what&#8217;s the idea anyway? Anyone can make a user account, login and create a small drawing, and then list all of the drawings that have been created. My idea was to create a sort of Twitter for the visual set. Instead of typing a short message of the moment. You can draw a small picture of the moment, and post it for everyone to view.</p>
<p>The basic functionality works now, but to make this really useful will require more features. At this point you are viewing all of the drawings in the database. The real idea is to show only drawings from people that you feel like seeing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2009/10/24/doodle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A great tutorial on making your own WordPress themes</title>
		<link>http://www.webdevils.com/2007/12/25/a-great-tutorial-on-making-your-own-wordpress-themes/</link>
		<comments>http://www.webdevils.com/2007/12/25/a-great-tutorial-on-making-your-own-wordpress-themes/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 17:16:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=76</guid>
		<description><![CDATA[Here&#8217;s a great tutorial on making your own WordPress themes. Very detailed with a lot of good information. so-you-want-to-create-wordpress-themes-huh]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a great tutorial on making your own WordPress themes. Very detailed with a lot of good information.</p>
<p><a href="http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/">so-you-want-to-create-wordpress-themes-huh</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2007/12/25/a-great-tutorial-on-making-your-own-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kimili Flash Plugin</title>
		<link>http://www.webdevils.com/2007/04/24/kimili-flash-plugin/</link>
		<comments>http://www.webdevils.com/2007/04/24/kimili-flash-plugin/#comments</comments>
		<pubDate>Wed, 25 Apr 2007 03:37:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.webdevils.com/?p=10</guid>
		<description><![CDATA[Testing the Kimili Flash plugin for WordPress. It seems to be working pretty well so far. 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_3D_03_176777660"
			class="flashmovie"
			width="300"
			height="300">
	<param name="movie" value="http://webdevils.com/examples/Make3d/3D_03.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://webdevils.com/examples/Make3d/3D_03.swf"
			name="fm_3D_03_176777660"
			width="300"
			height="300">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Interesting to note that the plugin is supposed to work with Flash anywhere it appears. So you can use KimiliFlash to put Flash into your header or other areas of your site. Another interesting [...]]]></description>
			<content:encoded><![CDATA[<p>Testing the <a href="http://kimili.com/plugins/kml_flashembed/wp">Kimili Flash plugin for WordPress</a>. It seems to be working pretty well so far.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_3D_03_1847310288"
			class="flashmovie"
			width="300"
			height="300">
	<param name="movie" value="http://webdevils.com/examples/Make3d/3D_03.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://webdevils.com/examples/Make3d/3D_03.swf"
			name="fm_3D_03_1847310288"
			width="300"
			height="300">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Interesting to note that the plugin is supposed to work with Flash anywhere it appears. So you can use KimiliFlash to put Flash into your header or other areas of your site.</p>
<p>Another interesting item is that the Kimili plugin uses <a href="http://blog.deconcept.com/swfobject/">SWFObject: Javascript Flash Player detection and embed script</a> which is XHTML valid. The default Flash HTML code written by Flash and Dreamweaver will not validate.</p>
<p>There is an article about this on <a href="http://www.alistapart.com/articles/flashsatay/">A List Apart</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevils.com/2007/04/24/kimili-flash-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

