<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Apache Web Hosting Php - Php4, Php5 Programming Blog</title>
	<link>http://apache.armadillowebhosting.com</link>
	<description>Fine weblog about PHP and MySQL programming skills</description>
	<pubDate>Tue, 29 Jan 2008 07:19:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>WRITE YOUR OWN BLOG ENGINE Post and comment  (Post office web site)</title>
		<link>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-post-and-comment-post-office-web-site/</link>
		<comments>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-post-and-comment-post-office-web-site/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 07:19:48 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-post-and-comment-post-office-web-site/</guid>
		<description><![CDATA[WRITE YOUR OWN BLOG ENGINE   Post and comment previews   You can provide a preview of a post in your Administration site. To do this, add a Preview  button next to Add post or Update post. Use logic, such as case switching, so your script  can detect which button has [...]]]></description>
			<content:encoded><![CDATA[<p>WRITE YOUR OWN BLOG ENGINE   Post and comment previews   You can provide a preview of a post in your Administration site. To do this, add a Preview  button next to Add post or Update post. Use logic, such as case switching, so your script  can detect which button has been pressed and then know whether to update the database  or display a preview of the form submission on the page.   Adding previews for comments is another good idea because it gives your readers a  chance to ensure that their comment will look like they expect. If you force readers to  preview their post first by showing the Post button only in preview mode, this can help  fend off comment spam (in itself, having your own blog engine goes a long way toward  preventing comment spam).   Advanced formatting of posts   As it stands, your posts are only automatically formatted with paragraph and line break  tags; any other formatting you require needs to be added as HTML within the post. Luckily,  there are some free alternatives available to help speed up your post writing and format  your blog more beautifully.   Textile is used within TextPattern (see Chapter 5) and is also available as a separate function from www.textism.com/tools/textile/license.html. You can use it to replace the  format function in the functions.php include file. Textile automatically adds paragraphs  and line breaks, automatically links URLs, and has its own simple language for formatting for example, *this* would place <strong> tags around the word this.   Markdown, which is similar to Textile, is available as a PHP function from www.michelf.com/  projects/php-markdown/. Markdown has some differences from Textile because it  converts e-mail style language into HTML. For more information on Markdown, see  daringfireball.net/projects/markdown/.   Categorizing your posts   A slightly more advanced addition is to add a categorization system for your blog posts,  which would involve creating a categories table with the names of your categories and a  category_id for each. Then, in the same way in which you included a post_id field in the  comments table so that you knew which post each comment referred to, so you could add  a category_id field to the posts table so you know which category each post is in. You  would probably also want to add a Categories section to your CMS to help add and edit  categories, as well as a post archive page for each category.   Happy blogging   You should now have a fully functioning content management system and blogging  engine, complete with comments, search engine, and a whole bunch of ideas for new features. But what your blog really needs is some content, so pick a subject, get writing, and  enjoy yourself!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-post-and-comment-post-office-web-site/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>BLOG DESIGN SOLUTIONS Migrating your files Next it s  (Hosting your own web site)</title>
		<link>http://apache.armadillowebhosting.com/apache/blog-design-solutions-migrating-your-files-next-it-s-hosting-your-own-web-site/</link>
		<comments>http://apache.armadillowebhosting.com/apache/blog-design-solutions-migrating-your-files-next-it-s-hosting-your-own-web-site/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 16:02:50 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/blog-design-solutions-migrating-your-files-next-it-s-hosting-your-own-web-site/</guid>
		<description><![CDATA[BLOG DESIGN SOLUTIONS   Migrating your files   Next it s time to copy your files across. Edit db_connect.php so it has the correct username  and password for your live database. Now open up your FTP software, connect to your  web server, and copy the rest of your files and folders [...]]]></description>
			<content:encoded><![CDATA[<p>BLOG DESIGN SOLUTIONS   Migrating your files   Next it s time to copy your files across. Edit db_connect.php so it has the correct username  and password for your live database. Now open up your FTP software, connect to your  web server, and copy the rest of your files and folders into the public_html folder. Check  that your index.xml RSS file is read-writeable, as explained earlier.   Finally, you need to password-protect your cms folder. This process will vary from ISP to ISP,  but you will usually be provided with an Apache web control panel, which enables you to  password-protect directories as well as a whole host of other operations (see Figure 7-26).    Figure 7-26. Adding password protection using the Apache console   And that s it: you exported and uploaded your entire MySQL blog database, transferred all  your files to your public-facing website, and password-protected your CMS. Your blog is  now live and awaiting posts and readers.   The future   The great thing about having your own blog engine is that you can keep improving it as  you discover more techniques and cool stuff to add. I ll now discuss a few additions you  could make to your blog by using the knowledge you have already gained.   Flickr   Flickr (www.flickr.com) is a fantastic photo-sharing site in which you can upload and  share photographs, and what s more basic registration is free. Flickr provides a number  of ways to display your photos on sites other than Flickr, and what better place to show  them than your blog? The quickest and easiest way is to use the Flickr badge JavaScript or  Flash code. Once you are signed up, you can go to www.flickr.com/badge.gne, follow the  instructions, and cut and paste the code into your blog the ideal place is the sidebar of  your homepage.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/blog-design-solutions-migrating-your-files-next-it-s-hosting-your-own-web-site/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Submit web site - WRITE YOUR OWN BLOG ENGINE Now you re ready</title>
		<link>http://apache.armadillowebhosting.com/apache/submit-web-site-write-your-own-blog-engine-now-you-re-ready/</link>
		<comments>http://apache.armadillowebhosting.com/apache/submit-web-site-write-your-own-blog-engine-now-you-re-ready/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 22:23:56 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/submit-web-site-write-your-own-blog-engine-now-you-re-ready/</guid>
		<description><![CDATA[WRITE YOUR OWN BLOG ENGINE   Now you re ready to copy your database to your live server. Open up your local installation  of phpMyAdmin in your browser and select the blog database. Click the Export tab. Now  click the Select All link in the Export box so that the posts and [...]]]></description>
			<content:encoded><![CDATA[<p>WRITE YOUR OWN BLOG ENGINE   Now you re ready to copy your database to your live server. Open up your local installation  of phpMyAdmin in your browser and select the blog database. Click the Export tab. Now  click the Select All link in the Export box so that the posts and comments tables are both  selected. Finally select the Save as file option and click Go (see Figure 7-25). A file called  blog.sql should be saved to your default download folder (usually your desktop).    Figure 7-25. Exporting your database in phpMyAdmin   Now you have a complete copy of your database: table structure, indexes, and data. To  import this onto your live server, open up the remote installation of phpMyAdmin and create a database called blog. Now click the SQL tab and browse to select your blog.sql file  in the Location of the textfile section. Click Go, and your database will be uploaded. Easy  as that!   335
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/submit-web-site-write-your-own-blog-engine-now-you-re-ready/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>BLOG DESIGN SOLUTIONS Mon, 28 Mar 2005 22:15:00  (Web site design and hosting)</title>
		<link>http://apache.armadillowebhosting.com/apache/blog-design-solutions-mon-28-mar-2005-221500-web-site-design-and-hosting/</link>
		<comments>http://apache.armadillowebhosting.com/apache/blog-design-solutions-mon-28-mar-2005-221500-web-site-design-and-hosting/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 06:24:48 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/blog-design-solutions-mon-28-mar-2005-221500-web-site-design-and-hosting/</guid>
		<description><![CDATA[BLOG DESIGN SOLUTIONS     
Mon, 28 Mar 2005 22:15:00 GMT
http://your-domain-name.com/post.php?post_id=4  Paying my debts and thence to .   Covent Garden and an Italian puppet play.
]]&#62; .     
Sat, 01 May 2004 23:10:00 GMT
http://your-domain-name.com/post.php?post_id=3  My arme not being well, .   I staid within all the [...]]]></description>
			<content:encoded><![CDATA[<p>BLOG DESIGN SOLUTIONS   </description> </item> <item><br />
<pubDate>Mon, 28 Mar 2005 22:15:00 GMT</pubDate>
<link>http://your-domain-name.com/post.php?post_id=4</link>  <description><![CDATA[
<p>Paying my debts and thence to .   Covent Garden and an Italian puppet play.</p>
<p>]]&gt; .   </description> </item> <item><br />
<pubDate>Sat, 01 May 2004 23:10:00 GMT</pubDate>
<link>http://your-domain-name.com/post.php?post_id=3</link>  <description><![CDATA[
<p>My arme not being well, .   I staid within all the morning.</p>
<p>]]&gt;</description>  </item>  </channel>  </rss>   Finally, you need to tell the world that you have an RSS feed. Many indexers will automatically look for an index.xml file, but you should also add this line just after the <title> in  your blog homepage to make sure:<br />
<link rel="alternate" type="application/rss+xml" .   title="RSS 2.0 feed" . href="http://your-domain-name.com/index.xml" />   Once your RSS feed is up and running on your live site, I recommend submitting it to  pingomatic.com, which will automatically notify all the web-based RSS news readers that  your RSS feed exists.   Making it live   And so your blog engine is complete. You now have an administration site to add and edit  blog posts and a blog site with a homepage listing your latest entries, a page for each post  allowing comments, an archive of all past entries, search functionality, and an RSS feed. All  that remains is to move the whole lot onto a live web server.   Migrating your database   I assume that your Internet Service Provider has provided you with FTP access, PHP, and  MySQL. If so, it probably provided you with phpMyAdmin as well. If phpMyAdmin is not  installed, you can use FTP software to copy your phpMyAdmin files to your live server. In  this case, you will probably have to edit the username and password in the  config.inc.php file, as explained in Chapter 2.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/blog-design-solutions-mon-28-mar-2005-221500-web-site-design-and-hosting/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web space - WRITE YOUR OWN BLOG ENGINE $message = &#8220;RSS</title>
		<link>http://apache.armadillowebhosting.com/apache/web-space-write-your-own-blog-engine-message-rss/</link>
		<comments>http://apache.armadillowebhosting.com/apache/web-space-write-your-own-blog-engine-message-rss/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 13:08:45 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/web-space-write-your-own-blog-engine-message-rss/</guid>
		<description><![CDATA[WRITE YOUR OWN BLOG ENGINE   $message = &#8220;RSS file updated.&#8221;; }   // close file fclose($fh);   The script uses the fwrite function to write the contents of $rssfile to the $fh file  handler created at the beginning of the script. As with fopen, fwrite returns false if the  [...]]]></description>
			<content:encoded><![CDATA[<p>WRITE YOUR OWN BLOG ENGINE   $message = &#8220;RSS file updated.&#8221;; }   // close file fclose($fh);   The script uses the fwrite function to write the contents of $rssfile to the $fh file  handler created at the beginning of the script. As with fopen, fwrite returns false if the  writing process fails. Finally, the fclose function is used to release the index.xml file, and  your RSS feed has been updated.   But all you have at the moment is a function that can update your RSS feed. That function  is not actually called from anywhere. Your RSS feed will need updating on three occasions:  when you add a new blog post, when you update a post, and when you delete a post. The  first two instances happen in the addpost.php file. So open that file. Just after the opening  <?php delimiter, add this code to bring in the functions.php:   include($_SERVER["DOCUMENT_ROOT"] . "/functions.php");   Now find the line that says the following:   $message = "Successfully inserted post '$title'.";   Following that line, add this call to the makerssfeed function:   $message .= "<br />&#8221; . makerssfeed();   Now find this line:   $message = &#8220;Successfully update post &#8216;$title&#8217;.&#8221;;   After that line, add the same call to makerssfeed. The delete blog function is on the  index.php page in your CMS, so add the functions.php include to that file in the same  way and add the same call to makerssfeed after this line:   $message = &#8220;Post $delete deleted.&#8221;;   Now try making a change to one of your blog posts using your CMS, which will force the  RSS file to be created. Once you have received the message RSS file updated in your CMS,  open up index.xml in your text editor and you should see something like this:   <rss version="2.0">   <channel><br />
<link>http://your-domain-name.com</link> <description>A blog by Samuel Pepys</description> <language>en-gb</language> <item><br />
<pubDate>Sun, 03 Apr 2005 15:30:00 GMT</pubDate>
<link>http://your-domain-name.com/post.php?post_id=2</link>  <description><![CDATA[
<p>News of the fleet and an .   afternoon with Mrs. Turner to see a dreadful play.</p>
<p>]]&gt; .   333
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/web-space-write-your-own-blog-engine-message-rss/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>BLOG DESIGN SOLUTIONS blog). More information on the  (Kids web site)</title>
		<link>http://apache.armadillowebhosting.com/apache/blog-design-solutions-blog-more-information-on-the-kids-web-site/</link>
		<comments>http://apache.armadillowebhosting.com/apache/blog-design-solutions-blog-more-information-on-the-kids-web-site/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 22:23:46 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/blog-design-solutions-blog-more-information-on-the-kids-web-site/</guid>
		<description><![CDATA[BLOG DESIGN SOLUTIONS   blog). More information on the RSS 2.0 syntax can be found at feedvalidator.  org/docs/rss2.html.   // pull blogs from database   $sql = &#8220;SELECT post_id, title, summary, .  DATE_FORMAT(postdate, &#8216;%a, %d %b %Y %T GMT&#8217;) as pubdate .  FROM posts ORDER BY postdate DESC LIMIT [...]]]></description>
			<content:encoded><![CDATA[<p>BLOG DESIGN SOLUTIONS   blog). More information on the RSS 2.0 syntax can be found at feedvalidator.  org/docs/rss2.html.   // pull blogs from database   $sql = &#8220;SELECT post_id, title, summary, .  DATE_FORMAT(postdate, &#8216;%a, %d %b %Y %T GMT&#8217;) as pubdate .  FROM posts ORDER BY postdate DESC LIMIT 10&#8243;;   $result = mysql_query($sql);   The script now performs the familiar SELECT query in which it grabs the latest ten blog  post titles and summaries. The postdate is formatted in a special way for RSS feeds and  includes the time zone (in this case, GMT), which you may have to change according to  where your live website is hosted.   if ($mypost = mysql_fetch_array($result)) {   do { $post_id = $mypost[&#8221;post_id&#8221;]; $pubdate = $mypost[&#8221;pubdate&#8221;]; $summary = format($mypost[&#8221;summary&#8221;]); $title = $mypost[&#8221;title&#8221;]; $title = strip_tags($title); $title = htmlentities($title);   $rssfile .= &#8221; <item>\n&#8221;; $rssfile .= &#8221;<br />
<pubDate>$pubdate</pubDate>\n&#8221;; $rssfile .= &#8221; \n&#8221;; $rssfile .= &#8221;<br />
<link>http://your-domain-name.com/ .   post.php?post_id=$post_id</link>\n&#8221;;  $rssfile .= &#8221; <description><![CDATA[$summary]]&gt; .  </description>\n&#8221;;  $rssfile .= &#8221; </item>\n&#8221;;  } while ($mypost = mysql_fetch_array($result));  }   This code should again look familiar as the script loops through the posts and writes them  to the $rssfile variable. Because you are writing RSS instead of HTML, the mark-up will  look different, but it is still structured in a similar manner.   $rssfile .=&#8221; </channel> </rss>&#8220;;   Here, the final closing tags are added to the RSS feed. It is now ready for writing to your  index.xml file.   // write to file $fw = @fwrite($fh, $rssfile); if (!$fw) {   $message = &#8220;Could not write to the file $filename&#8221;;  } else {
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/blog-design-solutions-blog-more-information-on-the-kids-web-site/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web server on xp - WRITE YOUR OWN BLOG ENGINE if (!$fw) {</title>
		<link>http://apache.armadillowebhosting.com/apache/web-server-on-xp-write-your-own-blog-engine-if-fw/</link>
		<comments>http://apache.armadillowebhosting.com/apache/web-server-on-xp-write-your-own-blog-engine-if-fw/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 06:07:22 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/web-server-on-xp-write-your-own-blog-engine-if-fw/</guid>
		<description><![CDATA[WRITE YOUR OWN BLOG ENGINE   if (!$fw) {  $message = &#8220;Could not write to the file $filename&#8221;;  } else {  $message = &#8220;RSS file updated.&#8221;;  }   // close file   fclose($fh);   } else {   $message = &#8220;Could not open file $filename&#8221;;  [...]]]></description>
			<content:encoded><![CDATA[<p>WRITE YOUR OWN BLOG ENGINE   if (!$fw) {  $message = &#8220;Could not write to the file $filename&#8221;;  } else {  $message = &#8220;RSS file updated.&#8221;;  }   // close file   fclose($fh);   } else {   $message = &#8220;Could not open file $filename&#8221;;   }   return $message;   }   Your code will be calling the function from more than one place, so the ideal place to add  it is in the functions.php include you made earlier. Make sure that the makerssfeed function is placed before the closing ?> delimiter.   I will now step through the function. It is really just a simplified version of your blog home- page: It grabs the ten most recent blog entries from the database and writes them to a file.  The main differences will be the RSS file syntax (which is similar to but different from  HTML) and some new functions for file handling, which is what we kick off with:   function makerssfeed() {   // set file to write   $filename = $_SERVER[&#8221;DOCUMENT_ROOT&#8221;] . &#8220;/index.xml&#8221;;   // open file   $fh = @fopen($filename, &#8220;w&#8221;);   if($fh) {   Here, the full server path of the RSS file is written to the $filename variable. Next, the  fopen function is used to open the file for writing (that s what the w means). As mentioned  earlier in the chapter, the @ before the function call prevents any ugly errors being written  to the screen. I m writing the fopen function to the $fh variable. If the fopen function  failed (perhaps the index.xml file doesn t exist or it is read-only), the value of $fh is false,  and there s no point continuing with the function.   $rssfile = &#8220;<rss version=\"2.0\">   <channel><br />
<link>http://your-domain-name.com</link>   <description>A blog by Samuel Pepys</description>   <language>en-gb</language>&#8220;;   The script has verified that your RSS file has been opened for writing, so it now starts to  piece together the contents of the file. The script will compile the entire file in a variable  called $rssfile and then write it to index.xml. Here the script has begun with the opening elements required by RSS (make sure that you change these details to match your   331
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/web-server-on-xp-write-your-own-blog-engine-if-fw/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>BLOG DESIGN SOLUTIONS Here is  (Free web hosting with ftp) the function that</title>
		<link>http://apache.armadillowebhosting.com/apache/blog-design-solutions-here-is-free-web-hosting-with-ftp-the-function-that/</link>
		<comments>http://apache.armadillowebhosting.com/apache/blog-design-solutions-here-is-free-web-hosting-with-ftp-the-function-that/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 15:22:00 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/blog-design-solutions-here-is-free-web-hosting-with-ftp-the-function-that/</guid>
		<description><![CDATA[BLOG DESIGN SOLUTIONS   Here is the function that will write your RSS file:   function makerssfeed() {  // set file to write  $filename = $_SERVER[&#8221;DOCUMENT_ROOT&#8221;] . &#8220;/index.xml&#8221;;   // open file $fh = @fopen($filename, &#8220;w&#8221;);   if($fh) { $rssfile = &#8220;   
http://your-domain-name.com A blog by Samuel [...]]]></description>
			<content:encoded><![CDATA[<p>BLOG DESIGN SOLUTIONS   Here is the function that will write your RSS file:   function makerssfeed() {  // set file to write  $filename = $_SERVER[&#8221;DOCUMENT_ROOT&#8221;] . &#8220;/index.xml&#8221;;   // open file $fh = @fopen($filename, &#8220;w&#8221;);   if($fh) { $rssfile = &#8220;<rss version=\"2.0\">   <channel><br />
<link>http://your-domain-name.com</link> <description>A blog by Samuel Pepys</description> <language>en-gb</language>&#8220;;   // pull blogs from database   $sql = &#8220;SELECT post_id, title, summary, .  DATE_FORMAT(postdate, &#8216;%a, %d %b %Y %T GMT&#8217;) as pubdate .  FROM posts ORDER BY postdate DESC LIMIT 10&#8243;;   $result = mysql_query($sql);   if ($mypost = mysql_fetch_array($result)) {   do {  $post_id = $mypost[&#8221;post_id&#8221;];  $pubdate = $mypost[&#8221;pubdate&#8221;];  $summary = format($mypost[&#8221;summary&#8221;]);  $title = $mypost[&#8221;title&#8221;];  $title = strip_tags($title);  $title = htmlentities($title);   $rssfile .= &#8221; <item>\n&#8221;; $rssfile .= &#8221;<br />
<pubDate>$pubdate</pubDate>\n&#8221;; $rssfile .= &#8221; \n&#8221;; $rssfile .= &#8221;<br />
<link>http://your-domain-name.com/ .   post.php?post_id=$post_id</link>\n&#8221;;  $rssfile .= &#8221; <description><![CDATA[$summary]]&gt; .  </description>\n&#8221;;  $rssfile .= &#8221; </item>\n&#8221;;  } while ($mypost = mysql_fetch_array($result));  }   $rssfile .=&#8221; </channel> </rss>&#8220;;   // write to file $fw = @fwrite($fh, $rssfile);
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/blog-design-solutions-here-is-free-web-hosting-with-ftp-the-function-that/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>WRITE YOUR OWN BLOG ENGINE  (My web site) Figure 7-23. Adding</title>
		<link>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-my-web-site-figure-7-23-adding/</link>
		<comments>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-my-web-site-figure-7-23-adding/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 00:13:41 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-my-web-site-figure-7-23-adding/</guid>
		<description><![CDATA[WRITE YOUR OWN BLOG ENGINE   Figure 7-23. Adding an index to the postdate field in phpMyAdmin   Now do the same for the post_id field in the comments table, and your blog database will be fully optimized.    Creating an RSS feed   The final thing every blog should [...]]]></description>
			<content:encoded><![CDATA[<p>WRITE YOUR OWN BLOG ENGINE   Figure 7-23. Adding an index to the postdate field in phpMyAdmin   Now do the same for the post_id field in the comments table, and your blog database will be fully optimized.    Creating an RSS feed   The final thing every blog should have is an RSS feed, which is a web content syndication format. (RSS stands for Really Simple Syndication.) An RSS feed is an XML file that tells the outside world when you have updated your blog so your readers don t have to keep com ing back to your website to find out whether you made any changes. RSS feeds can be read online, through websites such as Bloglines (www.bloglines.com), or by using news reader software. There are many different news readers available for all operating systems. Your RSS feed might well end up being the most frequently downloaded file on your website. Many robots, indexers, and software will come and grab it so they can keep their users up to date with when your blog has been updated. Assuming that you want your blog to be read (and who doesn t), this is a good thing. However, it also means that your database server could end up fairly stressed if a database query were required every time the RSS file is requested. For this reason, I will show you how to create a static file that is updated only when you make a change to your blog. Because, by definition, static files do not require a database connection, your site will be more easily able to handle lots of nosy RSS software.    Traditionally, the main RSS feed for a site is named index.xml. The first step is to create an empty index.xml file just create a new document in your text editor and save it to your root directory as index.xml. Because your code will eventually be rewriting this document, it needs to have read-write privileges. On Windows machines that should already be the case, but on Mac OS X machines you need to change the file properties. To do so, locate your index.xml file in Finder and select File . Get Info. Open the Details area of Ownership &#038; Permissions and Figure 7-24. Changing file permissions  select Read &#038; Write access for Owner, Group, and Others; then close of index.xml on Mac OS X  the Info window (see Figure 7-24).    329
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/write-your-own-blog-engine-my-web-site-figure-7-23-adding/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web page design - BLOG DESIGN SOLUTIONS The code should be somewhat</title>
		<link>http://apache.armadillowebhosting.com/apache/web-page-design-blog-design-solutions-the-code-should-be-somewhat/</link>
		<comments>http://apache.armadillowebhosting.com/apache/web-page-design-blog-design-solutions-the-code-should-be-somewhat/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 08:21:02 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Apache</category>
		<guid isPermaLink="false">http://apache.armadillowebhosting.com/apache/web-page-design-blog-design-solutions-the-code-should-be-somewhat/</guid>
		<description><![CDATA[BLOG DESIGN SOLUTIONS
  
    
       The code should be somewhat familiar by now, with a database query first, followed by a  do-while loop in the body of your page. However the SELECT statement in the database  query warrants further investigation:   SELECT [...]]]></description>
			<content:encoded><![CDATA[<p>BLOG DESIGN SOLUTIONS<br />
<div id="sidebar"> <?php include("searchform.php"); ?> </div>
<p> <!-- sidebar ends -->   </div>
<p> <!-- maincontent ends --> <?php include("footer.php"); ?> </body> </html>   The code should be somewhat familiar by now, with a database query first, followed by a  do-while loop in the body of your page. However the SELECT statement in the database  query warrants further investigation:   SELECT post_id, title, summary, DATE_FORMAT(postdate, &#8216;%e %b %Y .   at %H:%i&#8217;) .   AS dateattime FROM posts WHERE .   MATCH (title,summary,post) AGAINST (&#8217;$q&#8217;) LIMIT 50   MySQL text searching is performed by combing the MATCH and AGAINST functions. The  arguments passed to the MATCH function should be a comma-separated list of the columns  you used to create the fulltext index, and the argument to the AGAINST function should be  the search term. MySQL automatically returns the results in order of relevance.   Because you have only a few posts in your database, the fulltext searching can produce  some unexpected results, particularly if you search for a word you know to be repeated in  all your posts. In this instance, MySQL will deem the word as  common,  and you might  receive no results for the search. However, as you write more and more, the search results  become increasingly accurate.   Indexing your blog database   MySQL fulltext searching is extremely quick because it uses an index. If you were trying to  find a topic in a reference book, you would most likely look at the index first, rather than  leafing through the book page by page. In essence, this is how database indexes work, too.   Every time you have a WHERE clause in a SELECT query you should ensure that you have an  index on each field mentioned in the clause, which can increase speed by an order of magnitude or more (especially for tables with large amounts of data).   When you created the posts table, you set the Primary Key option. When this was done, an  index was automatically created for the post_id field. However, some queries are being  performed on fields that are not indexed: archive.php also queries the postdate field, and  post.php queries the post_id field in the comments table.   To add indexes to these fields, open up phpMyAdmin in your browser, select the blog  database, and click the posts link in the left frame. In the Indexes box, type 1 in the Create  an index on n columns box and click Go. Now name the index as idx_postdate, select  Index as the Index type (it is probably already selected) and select postdate as the Fields,  then press Save (see Figure 7-23).
</p>
]]></content:encoded>
			<wfw:commentRSS>http://apache.armadillowebhosting.com/apache/web-page-design-blog-design-solutions-the-code-should-be-somewhat/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
