<?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>computeraxe &#187; php</title>
	<atom:link href="http://computeraxe.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://computeraxe.com</link>
	<description>wordpress tips and tricks</description>
	<lastBuildDate>Tue, 31 Jan 2012 07:05:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Enable Caching in Firefox for Faster Web Sites</title>
		<link>http://computeraxe.com/enable-caching-in-firefox-for-faster-web-sites/</link>
		<comments>http://computeraxe.com/enable-caching-in-firefox-for-faster-web-sites/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 08:27:57 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=704</guid>
		<description><![CDATA[Using an .htaccess file to specify that images should be cached is one way to speed up the time it takes for your web pages to appear. Those of us still using older browsers will thank you for using an &#8230; <a href="http://computeraxe.com/enable-caching-in-firefox-for-faster-web-sites/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using an <code>.htaccess</code> file to specify that images should be cached is one way to speed up the time it takes for your web pages to appear. Those of us still using older browsers will thank you for using an <a href="http://computeraxe.com/how-to-download-a-header-image-just-once/" title="htaccess with expire header">Expires Header in <code>.htaccess</code></a> to manage caching.</p>
<p>Yet another good reason to upgrade your browser is to take advantage of newer features. Caching of images and other often-used files can be controlled by your browser.</p>
<p>IE 9 apparently has caching defaulted to ON. Firefox 5 does not. </p>
<p>Here&#8217;s how to enable caching in Firefox.</p>
<ul>
<li>Type &#8220;about:config&#8221; in the address bar and hit enter.</li>
<li>Accept the warning by clicking on the &#8220;I&#8217;ll be careful, I promise!&#8221; button.</li>
<li>Scroll down to &#8216;browser.cache.disk.enable&#8217; and double click. You will see the value in the fourth column toggle from false to true, if caching was not enabled already.</li>
<li>Scroll down to &#8216;browser.cache.memory.enable&#8217; and double click to enable by setting it to true.</li>
</ul>
<p>That&#8217;s it! The performance of your Firefox browser will speed up, noticeably so. After enabling caching, the time to download pages from a client&#8217;s site went from 6-10 seconds to 2-3 seconds!</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/enable-caching-in-firefox-for-faster-web-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Download A Header Image Just Once</title>
		<link>http://computeraxe.com/how-to-download-a-header-image-just-once/</link>
		<comments>http://computeraxe.com/how-to-download-a-header-image-just-once/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 19:27:30 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=699</guid>
		<description><![CDATA[While checking links on a client&#8217;s re-vamped web site, I noticed that the header image would be re-loaded for each page visited on the site. I&#8217;d forgotten to set the .htaccess file with an Expires Header to ensure that the &#8230; <a href="http://computeraxe.com/how-to-download-a-header-image-just-once/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While checking links on a client&#8217;s re-vamped web site, I noticed that the header image would be re-loaded for each page visited on the site. I&#8217;d forgotten to set the <code>.htaccess</code> file with an Expires Header to ensure that the images would be downloaded just one time by a site visitor.</p>
<p>Making the content appear quickly in front of site visitors should be a goal for all site developers. And besides, reducing the load on your server is always a good idea, don&#8217;t you think? </p>
<p>To cache a header image, or other images for that matter, or to make sure that files aren&#8217;t downloaded too often, use an Expires Header in your <code>.htaccess</code> file.</p>
<blockquote><p><code>#Expire Header<br />
&lt;FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$"&gt;<br />
ExpiresDefault "access plus 2 months"<br />
&lt;/FilesMatch&gt;</code></p></blockquote>
<p>Note that all types of image files, as well as stylesheets, javascript, flash and other file types, can be cached with this Expire Header. </p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/how-to-download-a-header-image-just-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paths For Building WordPress Themes or Plugins</title>
		<link>http://computeraxe.com/paths-building-wordpress-themes-plugins/</link>
		<comments>http://computeraxe.com/paths-building-wordpress-themes-plugins/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 15:21:30 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[paths]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=672</guid>
		<description><![CDATA[When tinkering with the code that runs WordPress it&#8217;s very important to get the correct path to a file. Of course it is or else the files can&#8217;t be found and your new functionality won&#8217;t work. According to the Codex &#8230; <a href="http://computeraxe.com/paths-building-wordpress-themes-plugins/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When tinkering with the code that runs WordPress it&#8217;s very important to get the correct path to a file. Of course it is or else the files can&#8217;t be found and your new functionality won&#8217;t work.</p>
<p>According to the Codex -</p>
<blockquote><p>In Version 2.6, users were given the ability to move their /wp-content/ directory to anywhere they want, and many users already keep all WordPress files (like /wp-admin/ and /wp-includes/) in an unusual place.</p></blockquote>
<p>In case you&#8217;ve moved the files for your WP installation, you probably have a good handle on paths and how to traverse them. For those who don&#8217;t, it can be a hair-pulling experience to find the right path. Once the right path is found, work can continue.</p>
<h2>WordPress Paths</h2>
<p>To help avoid those <em>DUH! </em>moments, here are some functions and constants that WordPress has defined regarding paths. Once you&#8217;re familiar with these functions, writing useful and working code should become easier. Optional parameters may be of use in modifying the output for several of the following templates, including $path, $file or $scheme.</p>
<dl>
<dt>plugin_basename()</dt>
<dd>Usage: plugin_basename(__FILE__); Returns: the name of the plugin and file, such as &#8220;myPlugin/myPlugin.php&#8221; </dd>
<dt>get_theme_root()</dt>
<dd>Usage: get_theme_root(); Returns: path to themes directory. <strong>No</strong> trailing slash. </dd>
<dt>get_theme_root_uri()</dt>
<dd>Usage: get_theme_root_uri(); Returns: URI for themes directory. <strong>No</strong> trailing slash. </dd>
<dt>get_theme_roots()</dt>
<dd>Usage: get_theme_roots(); Returns: Themes directory with a <em>leading</em> slash, like &#8220;/themes&#8221;. </dd>
<dt>site_url()</dt>
<dd>Usage: site_url(); Returns: Site directory with <strong>no</strong> trailing slash.<br />
http://www.site.com OR http://www.site.com/wordpress</dd>
<dt>admin_url()</dt>
<dd>Usage: admin_url(); Returns: Admin directory with trailing slash.<br />
http://www.site.com/wp-admin/</dd>
<dt>content_url()</dt>
<dd>Usage: content_url(); Returns: Content directory with trailing slash.<br />
http://www.site.com/wp-content/ </dd>
<dt>plugins_url()</dt>
<dd>Usage: plugins_url(); Returns: Plugins directory with trailing slash.<br />
http://www.site.com/wp-content/plugins/</dd>
<dt>includes_url()</dt>
<dd>Usage: includes_url(); Returns: Includes directory with trailing slash.<br />
http://www.site.com/wp-includes/ </dd>
<dt>home_url()</dt>
<dd>Usage: home_url(); Returns: Home directory with <strong>no</strong> trailing slash.<br />
http://www.site.com</dd>
<dt>ABSPATH (constant)</dt>
<dd>Usage: ABSPATH. Returns: Home directory with <strong>no</strong> trailing slash.</dd>
<dt>TEMPLATEPATH (constant)</dt>
<dd>Usage: TEMPLATEPATH. Returns: Path to current theme with <strong>no</strong> trailing slash.</dd>
</dl>
<p>There are a few more functions for multisite installations and <a title="Directories for older versions of WP" href="http://codex.wordpress.org/Determining_Plugin_and_Content_Directories#Backwards-compatibility_Code">backwards capability</a> specified in the Codex.</p>
<h2>PHP Paths</h2>
<p>Some PHP functions worth noting -</p>
<ul>
<li>__FILE__ returns the filename of the script that is currently being run</li>
<li>dirname() returns parent directory&#8217;s path for a given filename with <strong>no</strong> trailing slash</li>
<li>basename() returns the filename component of path without any parent directories</li>
<li>getcwd() returns current working directory</li>
</ul>
<p>Use the functions or constants indicated to build your paths instead of hard-coding them. You&#8217;ll save yourself a LOT of trouble when it comes time to move your WordPress installation to a new server or directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/paths-building-wordpress-themes-plugins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using PHP Inside Content of WordPress Blogs</title>
		<link>http://computeraxe.com/using-php-inside-content-wordpress-blogs/</link>
		<comments>http://computeraxe.com/using-php-inside-content-wordpress-blogs/#comments</comments>
		<pubDate>Fri, 06 May 2011 14:38:03 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=648</guid>
		<description><![CDATA[Using PHP inside of content on WordPress sites may not produce the expected results. As WordPress is built in PHP, you might think you could just start typing PHP code inside a post to pull some information from a database. &#8230; <a href="http://computeraxe.com/using-php-inside-content-wordpress-blogs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Using PHP inside of content on WordPress sites may not produce the expected results. As WordPress is built in PHP, you might think you could just start typing PHP code inside a post to pull some information from a database. Sorry to say, but it doesn&#8217;t work that way.</p>
<p>WordPress takes your blog content and runs it through some backend shenanigans to create the output that you see on the screen. WP expects to find other content in posts, like text and images, not code.</p>
<p>To run PHP code inside a blog post or Page, you&#8217;ll have to work a little differently than simply filling up the space in the text editor.</p>
<p>There are two ways (at least) of using PHP inside WP blogs to produce the desired output. The first way is to set up a WP template page that points to a pre-written PHP page that is identified in a Page. The second way is to use a plugin that facilitates PHP code execution inside content areas in WordPress. Both ways have their advantages and disadvantages.</p>
<h2>Using WP Template Pages to Execute PHP Code</h2>
<p>A template page is used to identify a pre-written PHP page. By saying &#8220;a pre-written PHP page&#8221; I mean a .php file that you&#8217;ve already written and which has been executed successfully by a server. A template file has at the top of it a PHP comment which identifies the template name followed by an include statement that identifies the .php file. WP template files must follow this format to be properly identified by the WordPress engine as a template file.</p>
<blockquote><p>&lt;?php<br />
/*<br />
Template Name: soccer-roster<br />
*/<br />
include (TEMPLATEPATH . &#8216;/soccer-roster.php&#8217;);<br />
?&gt;</p></blockquote>
<p>The above snippet  is a complete template file which indicates the name of the template as &#8220;soccer-roster&#8221; and the path to the associated PHP file, soccer-roster.php. The template file is best saved with &#8220;template&#8221; in the file name. It must be located in the site&#8217;s theme folder.</p>
<p>After creating the template file and .php file, upload both to the theme folder. Create a blank Page. Do not put anything where you would normally write the content, but go ahead and give it a meaningful title. On the Add New Page page, look for the &#8220;Page Attributes&#8221; widget. Click the down-arrow to expand the list of templates and select your template. Using the example above, you would select the &#8220;soccer-roster&#8221; template. If the template is not stored in the theme folder, it will not appear in this drop-down list. Save the page and preview it. The PHP code, from soccer-roster.php, should be executed just as you would expect.</p>
<p>PROs</p>
<ul>
<li> No interference from WP, code interpreted as stand-alone PHP.</li>
<li>Page renders as expected.</li>
</ul>
<p>CONs</p>
<ul>
<li>Can only be used with Pages, not posts or text widgets.</li>
<li>May have to wrestle with adapting PHP output into style of site.</li>
<li><em><strong>CAUTION:</strong></em> Use a <a title="use a child theme for template safe keeping" href="http://computeraxe.com/twenty-ten-child-theme-mods/">child-theme</a> to safely save site-specific template files.</li>
</ul>
<p>If your site relies heavily on plugins, using template pages may be the best method, see below. If it&#8217;s not a big deal to style the PHP output pages like the rest of your site, creating WP Pages that use templates is a breeze. If you need to put code in a post or text widget, keep reading.</p>
<h2>Using WP Plugins to Execute PHP Code</h2>
<p>Modifying WordPress themes is not for everyone, so using a plugin to execute PHP code may be the easier option. There are more than a handful of plugins available for the task. I chose to use <a title="Exec-PHP Plugin to execute PHP code in posts" href="http://bluesome.net/post/2005/08/18/50/">Exec-PHP plugin for WordPress</a>. It is a very well documented plugin. Thank you, Sören.</p>
<p>Download, unpack, upload and activate the plugin in the usual fashion. Verify these settings to make the plugin do its magic:</p>
<ul>
<li>Disable tag balancing by unchecking ‘WordPress should correct invalidly nested XHTML automatically’ in the Settings/Write menu.</li>
<li>Disable the WYSIWYG editor (visual editor) in the user’s settings through the Users/Your Profile menu.</li>
<li>Assign the ‘unfiltered_html’ capability to the user, if user is not the administrator. Can use role manager plugin to assign this capability to other users.</li>
<li>Assign the ‘exec_php’ capability to the user, if user is not the administrator. Can use role manager plugin to assign this capability to other users.</li>
</ul>
<p>Once I disabled the visual editor, my site was ready to go.</p>
<p>PROs</p>
<ul>
<li> Easy, just change a couple of settings in blog admin. Plugin gives  highly visible warning on Add New Post or Add New Page pages if the settings are not correct.</li>
<li>PHP code can be written in the normal fashion using the &lt;?php ?&gt; tags. It does not need to be marked up in any special way as it might with other plugins.</li>
<li>PHP can be used in text widgets and posts, as well as Pages.</li>
</ul>
<p>CONs</p>
<ul>
<li> Can&#8217;t use plugins that embellish or rely on the WYSIWYG editor.</li>
</ul>
<p>Didn&#8217;t try any other PHP-execution plugins because Exec-PHP worked as soon as the visual editor was disabled.</p>
<p>As mentioned either method will get you there, it&#8217;s just a matter of style. If you need the visual editor to create your posts, use the template method. If you want to put PHP code in posts and text widgets, use the plugin method. Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/using-php-inside-content-wordpress-blogs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Which Versions of PHP and MySql Run Your WordPress Blog?</title>
		<link>http://computeraxe.com/which-versions-of-php-and-mysql-run-your-wordpress-blog/</link>
		<comments>http://computeraxe.com/which-versions-of-php-and-mysql-run-your-wordpress-blog/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 19:12:35 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=644</guid>
		<description><![CDATA[How Healthy is Your WordPress Blog? Do you know what version of PHP or MySQL your server is running? The improvements in WordPress continue. Check the state of your blog&#8217;s health by running the new Health Check plugin. Currently, it &#8230; <a href="http://computeraxe.com/which-versions-of-php-and-mysql-run-your-wordpress-blog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How Healthy is Your WordPress Blog? Do you know what version of PHP or MySQL your server is running?</p>
<p>The improvements in WordPress continue. Check the state of your blog&#8217;s health by running the new <a title="health check plugin" href="http://wordpress.org/extend/plugins/health-check/">Health Check plugin</a>. Currently, it will check for the versions of PHP and MySQL that are running your blog. In order to work with WP 3.2, your server will need to be up-to-date and running —</p>
<ul>
<li> PHP version 5.2 or greater</li>
<li> MySQL version 5.0.15 or greater</li>
</ul>
<p>In an attempt to help others into the 21st century, WordPress will no longer work using PHP 4 or MySQL 4.</p>
<p>WordPress will also drop support for Internet Explorer 6. Yay! There are other improvements coming, so stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/which-versions-of-php-and-mysql-run-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twenty Ten Child Theme Mods</title>
		<link>http://computeraxe.com/twenty-ten-child-theme-mods/</link>
		<comments>http://computeraxe.com/twenty-ten-child-theme-mods/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 13:55:37 +0000</pubDate>
		<dc:creator>axe</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Style Sheets]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[Twenty Ten]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=615</guid>
		<description><![CDATA[Creating WordPress child themes is a slick way to make your own theme. All it takes are a few easy steps. Here&#8217;s an example using the standard Twenty Ten theme as the parent theme: modify the child-stylesheet to make things &#8230; <a href="http://computeraxe.com/twenty-ten-child-theme-mods/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Creating WordPress child themes is a slick way to make your own theme. All it takes are a few easy steps. Here&#8217;s an example using the standard Twenty Ten theme as the parent theme:</p>
<ul>
<li>modify the child-stylesheet to make things look how you want</li>
<li>create child-directory for new child theme</li>
<li>add template files to child-directory, if you wish</li>
<li>upload child-directory to /wp-content/themes/</li>
<li>activate new child theme</li>
</ul>
<p>The child-stylesheet must be saved with the name &#8220;style.css&#8221; in the child-directory. The child-stylesheet header (which has to be at the top of the sheet) must contain a few lines that identify its parent theme, like so:</p><pre class="crayon-plain-tag"><code>/*
Theme Name:     Twenty Ten Child
Description:    Child theme for the Twenty Ten theme
Author:         Your name here
Template:       twentyten
Version:        0.1.0
*/

@import url(&quot;../twentyten/style.css&quot;);

{put new style rules here}</code></pre><p>
You can add a line for the Theme URI: and Author URI:, if you like. Only the Theme Name: and Template: lines are required, the others are optional.</p>
<p>The @import rule indicates the directory of the parent theme and the location of the stylesheet. All you have to do is put in the new css rules below the import line.</p>
<p>That&#8217;s it!</p>
<p>If modifying the stylesheet doesn&#8217;t quite get all the changes you want, realize that you can add any template file to the child-directory and that will <strong>over-ride the parent file with the same name</strong>. For example, say you want to stick in a block for an advertisement right under the header image. Copy header.php and add a new &lt;div&gt; at the bottom of the page just below &lt;div id=&#8221;main&#8221;&gt; and stick the ad code in this division. Upload this new header.php into the child-directory and it will replace the one from the parent template.</p>
<p>Activate your new <a title="wordpress child themes" href="http://codex.wordpress.org/Child_Themes">child theme</a> and see how it looks!</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=508a17ac-d8a3-4edf-a5a8-6527e1596f1d" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/twenty-ten-child-theme-mods/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Mass Delete Spam Comments in WordPress</title>
		<link>http://computeraxe.com/mass-delete-spam-comments-wordpress/</link>
		<comments>http://computeraxe.com/mass-delete-spam-comments-wordpress/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 12:57:04 +0000</pubDate>
		<dc:creator>LizzyFin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[Comment Spam]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=330</guid>
		<description><![CDATA[So, the spam is getting out of control on your WordPress blog? Even if you have activated the Akismet plugin &#8211; and you should &#8211; SPAM may keep filing up the comments. You can just let it ride and those &#8230; <a href="http://computeraxe.com/mass-delete-spam-comments-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, the spam is getting out of control on your WordPress blog? Even if you have activated the Akismet plugin &#8211; <em>and you should</em> &#8211; SPAM may keep filing up the comments.</p>
<p>You can just let it ride and those comments identified by Akismet as spam will silently disappear in a month&#8217;s time. In the meantime your database will be getting bigger and bloated with thousands of lines of useless information. Will this bog down your blog? Perhaps it will.</p>
<p>I found another reason to manually delete all the spam comments on one of my WP blogs. From the WP Dashboard I saw 1000+ spam comments and went to edit the comments. When I clicked on &#8216;spam&#8217;, the anti-virus software on this computer, AVG, detected a threat on the spam comments page and blocked my access to it. Even after shutting down the browser and returning to the edit spam comments page another day, the AVG software wouldn&#8217;t let me in. <em>How could I delete the spam if I can&#8217;t get to the page to do it?</em> Even if I could get to that page it would take a long time to delete so many comments. There must be a better solution to getting rid of spam comments in WordPress.</p>
<p>So, how do you mass delete spam comments in WordPress? Check out this excellent video that provides a solution using phpmyadmin and your WordPress blog database.</p>
<p><object height="385" width="480"><param name="movie" value="http://www.youtube.com/v/QCA4loQi7yM&amp;hl=en_US&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/QCA4loQi7yM&amp;hl=en_US&amp;fs=1&amp;color1=0x2b405b&amp;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="385" width="480"></embed></object></p>
<p>Steps to follow:</p>
<ol>
<li>sign in to CPanel</li>
<li>open up phpmyadmin and select the WP database</li>
<li>click on &#8220;wp_comments&#8221; table and browse to see the comments</li>
<li>backup database by clicking on database name in left column, click on export tab, select all tables under Export, select SQL, check &#8220;save as file&#8221;, click Go to download database backup to your computer</li>
<li>select comments table, by clicking on the table name wp_comments, then click on the SQL tab</li>
<li>use an sql query to mass delete spam comments in WordPress by typing the following in the Run SQL Query box:
<p>DELETE FROM wp_comments WHERE comment_approved = 0</p>
<p>Click Go, click OK.</li>
<li>Comments deleted!</li>
</ol>
<p>If you are using a spam catcher, like Akismet, the value for comment_approved may be set to &#8220;spam&#8221;, so you&#8217;ll need to alter the query as follows:</p>
<p><strong>DELETE FROM wp_comments WHERE comment_approved = &#8216;spam&#8217;</strong></p>
<p>Don&#8217;t forget to use the single quote marks to enclose the word spam.</p>
<p>Verify that the number of records in the comments table has been reduced to the number of approved comments. Hooray!</p>
<p>Optimize the WordPress database by going to the Structure tab, or clicking on the database name in the left column, and at the bottom of the table listing click on &#8220;Check tables having overhead&#8221;. Choose &#8220;optimize table&#8221; from the spin box on the right and all the extra space that those nasty spam comments took up will be released and the database optimized.</p>
<p>Go back to database view and verify that the overhead space has been removed. The size column now represents the space that is actually used by the database.</p>
<p>Refresh your WP blog and the spam comments will be gone. Isn&#8217;t is great to see ZERO spam comments?!</p>
<p>Alternatively, you can catch spam before it lands in your WP blog by modifying the function.php file in your theme using these excellent <a href="http://www.clickonf5.org/wordpress/function-to-avoid-apam-comments-wordpress/6407">directions from Tejaswini</a>.</p>
<p>Also, try <a href="http://maketecheasier.com/5-ways-to-reduce-comment-spam-on-wordpress-blogs/2010/03/17">Soumen Halder&#8217;s list</a> of ways to reduce comment spam on WP blogs.</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/8c433a50-800a-49d3-9f4d-07c5e1fbf4ec/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=8c433a50-800a-49d3-9f4d-07c5e1fbf4ec" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/mass-delete-spam-comments-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Format of Numerical Values Matters to Your MySQL Database</title>
		<link>http://computeraxe.com/format-numerical-values-mysql-database/</link>
		<comments>http://computeraxe.com/format-numerical-values-mysql-database/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 14:55:35 +0000</pubDate>
		<dc:creator>LizzyFin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=253</guid>
		<description><![CDATA[In using databases we tend to move around a lot of data. So much data, in fact, that it&#8217;s impossible to verify every single datum in a manual way. What we can and should do is verify that the beginning, &#8230; <a href="http://computeraxe.com/format-numerical-values-mysql-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In using databases we tend to move around a lot of data. So much data, in fact, that it&#8217;s impossible to verify every single datum in a manual way. What we can and should do is verify that the beginning, middle and ends of the data are intact.</p>
<p>I ran into a solution for a problem that I didn&#8217;t know I had until I checked to see that data I had imported into an existing MySQL table was imported properly. Data at the beginning of the <a href="http://computeraxe.com/how-to-import-data-file-mysql-phpmyadmin/">new table mirrored the CSV nicely</a>, but near the middle of the table I found that certain columns of data were whole numbers, not the decimal figure I was supposed to find.</p>
<p>It&#8217;s important to check the <strong>format of numerical values</strong>. By using the wrong data type when setting up your database you stand to lose precision of your numbers.</p>
<p>For example, when I set up a database I erroneously used the INT data type for a couple of values that needed to show the decimal places. Integers are whole numbers, and therefore, a value like 5.78 in the CSV showed up as 6 in the database table. The software did exactly what I asked it to do, which is a good reason to always verify the data after any manipulations.</p>
<p>The fix was to change the structure of the fields by changing the data &#8216;Type&#8217; from INT to DECIMAL and specifying the &#8216;Length/Values&#8217; in the format of &#8216;N,n&#8217; where N is the total number of digits and n is the number of decimal places. So, for my example of 5.78, I entered &#8220;DECIMAL&#8221; and &#8220;3,2&#8243;.</p>
<p><img src="http://computeraxe.com/images/decimal-int.jpg" alt="Example of DECIMAL and INT numeric formats." /></p>
<p>Then, I imported the data again and ta-da! All the data was there in the proper format.</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/format-numerical-values-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Import a Data File into MySQL via phpMyAdmin</title>
		<link>http://computeraxe.com/how-to-import-data-file-mysql-phpmyadmin/</link>
		<comments>http://computeraxe.com/how-to-import-data-file-mysql-phpmyadmin/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 14:45:15 +0000</pubDate>
		<dc:creator>LizzyFin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=247</guid>
		<description><![CDATA[Sometimes we have a need to read data into an existing database. Knowing how to import a data file into an established table can save you a lot of time. First, we&#8217;ll be working with MySQL and to make things &#8230; <a href="http://computeraxe.com/how-to-import-data-file-mysql-phpmyadmin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes we have a need to read data into an existing database. Knowing how to import a data file into an established table can save you a lot of time.</p>
<p>First, we&#8217;ll be working with MySQL and to make things easier we&#8217;ll use phpMyAdmin to speak to the database.</p>
<p>Second, obtain a delimited text file, which is basically a listing of table columns where each column of data is separated by, or marked off by, or <strong>delimited by </strong>a character. Common delimiting characters are the comma, semi-colon and quote marks, but any character may be used as long as you indicate what the delimiters are.</p>
<p><img src="http://computeraxe.com/images/csv-text.jpg" alt="Example character separated values or CSV file." /></p>
<p>In this example the tilde (~) encloses each field of text and the carat (^) denotes the end of the fields.</p>
<p>In phpMyAdmin select your database and table into which you want to import data and click on the Import tab.</p>
<p><img src="http://computeraxe.com/images/import-tab.jpg" alt="The Import tab of phpMyAdmin." /></p>
<p>Browse to the location of your delimited text file and select the character set of the file if the default is not correct.</p>
<p><img src="http://computeraxe.com/images/import-page.jpg" alt="The Import page in phpMyAdmin." /></p>
<p>Under &#8220;Format of imported file&#8221;, click CSV, which stands for comma separated values file or character separated values file. An options form will open when CSV is chosen, but if SQL is checked the options form remains hidden.</p>
<p><img src="http://computeraxe.com/images/import-csv.jpg" alt="Select the CSV button to open this part of the import page." /></p>
<p>Under &#8220;Options&#8221; you can tick off the boxes for &#8216;Replace table data with file&#8217; and &#8216;Ignore duplicate rows&#8217; if either function is desired.</p>
<p>Enter the characters that are appropriate for your CSV under &#8216;Fields terminated by&#8217; and &#8216;Fields enclosed by&#8217;. In the example file above &#8216;^&#8217; was used for the field termination character and &#8216;~&#8217; for the field enclosure character.</p>
<p>Characters for escaping fields or terminating lines can be input here, too. Also, if you want to add column names enter the names separated by commas in the blank provided. When ready, hit &#8220;Go&#8221;.</p>
<p>If successful, you&#8217;ll get a message that X number of queries were executed, which means that X number of records were imported into your table. If not successful, check the number of columns and the characters that you&#8217;ve input for the CSV and try again.</p>
<p>Your system may limit the size of file that can be imported. If so, check out this <a href="http://computeraxe.com/mysql-load-file-statement-rescues-huge-database-file/">LOAD FILE post</a> for a little help.</p>
<p>As always, verify that the data was read into the database correctly. Check that the data for each column of the table matches up with the source delimited text file.</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/how-to-import-data-file-mysql-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Calendar Pick-A-Date Scripts Reviewed</title>
		<link>http://computeraxe.com/calendar-pick-a-date-scripts-reviewed/</link>
		<comments>http://computeraxe.com/calendar-pick-a-date-scripts-reviewed/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 15:51:41 +0000</pubDate>
		<dc:creator>LizzyFin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://computeraxe.com/?p=220</guid>
		<description><![CDATA[This week I needed to make a form where the user needed to enter two dates in order to produce a report with the selected start and end dates. What were my options? I considered writing my own php script &#8230; <a href="http://computeraxe.com/calendar-pick-a-date-scripts-reviewed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This week I needed to make a form where the user needed to enter two dates in order to produce a report with the selected start and end dates. What were my options?</p>
<p>I considered writing my own php script where I would have separate pull-down boxes for the day, month and year to assure that there was no mistake as to the actual dates. That would take a little extra format massaging to create the date in MySQL format, so I looked for scripts that others had already written. Who wouldn&#8217;t?</p>
<p>Formatting dates can drive a person crazy. Does &#8217;06-08-2000&#8242; mean June 8th or the 6th of August? Writing for the Web should be universal. The month-day format that we tend to use in the U.S. is confusing to everybody else who uses the day-month format, and vice-versa.</p>
<p>Writing by hand I like to use this format &#8217;12-Mar-2000&#8242; so there is no ambiguity, but that format needs to be converted to &#8216;YYYY-MM-DD&#8217; format when sending dates to MySQL.</p>
<p>So, what are my requirements for such a Date-Picker Script?</p>
<ul>
<li>easy, intuitive for the user</li>
<li>easy for me with output in MySQL format (YYYY-MM-DD)</li>
<li>unrestricted license would be nice</li>
</ul>
<p>I tried a few different date picker scripts and decided upon SpiffyCalendar because it&#8217;s the most advanced, yet easily modified to suit my purposes. Also, there is an established support system via a Yahoo! user group. That&#8217;s really nice, and unexpected.</p>
<p>Here&#8217;s the scripts I tried and the pros and cons for each&#8230;most weren&#8217;t as user-friendly as SpiffyCalendar.</p>
<p>&nbsp;</p>
<h3><a href="http://www.phpclasses.org/browse/package/3611/download/zip.html">PHP Calendar</a></h3>
<ul>PROS</p>
<li>I like the look of this calendar, but it&#8217;s difficult to determine how to modify the calendar other than for css of calendar appearance.</li>
<li>Date output is already in MySQL format: YYYY-MM-DD</li>
</ul>
<ul>CONS</p>
<li>Can&#8217;t select year from calendar unless you click back or forward to the actual month.</li>
<li>Ugly and excessively long query strings in links.</li>
</ul>
<h3><a href="http://www.javascriptkit.com/script/script2/timestamp.shtml">DatePick</a></h3>
<ul>PROS</p>
<li>I like the little calendar icon.</li>
</ul>
<ul>CONS</p>
<li>Can&#8217;t select year from calendar unless you click back or forward to the actual month.</li>
<li>Timestamp is included. Don&#8217;t need it.</li>
<li>Relies on javascript and pop-up window to select date.</li>
<li>Calendar doesn&#8217;t update well when moving from month to month. Part of the calendar doesn&#8217;t get loaded in so all days are not selectable. Have to manually widen window to see all days.</li>
<li>Can&#8217;t select year directly, have to click through months to get to next year.</li>
<li>No directions on how to modify output.</li>
</ul>
<h3><a href="http://www.javascriptkit.com/script/script2/tengcalendar.shtml">DateTimePick</a></h3>
<ul>PROS</p>
<li>I like the little calendar icon.</li>
<li>Can modify output via provided directions.</li>
</ul>
<ul>CONS</p>
<li>Can&#8217;t select year from calendar unless you click back or forward to the actual month.</li>
<li>Relies on javascript and pop-up window to select date.</li>
<li>Calendar doesn&#8217;t update well when moving from month to month. Part of the calendar doesn&#8217;t get loaded in so all days are not selectable. Have to manually widen window to see all days.</li>
<li>Can select year directly, but calendar doesn&#8217;t update well.</li>
</ul>
<h3><a href="http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_48.html">SpiffyCalendar</a></h3>
<p><del datetime="2010-08-26T15:28:02+00:00">Sign up to the Yahoo! Group to download the script.</del> <em>Script used to be offered at the now defunct GeoCities. The above link is the first place I found it posted afterwards.</em></p>
<ul>PROS</p>
<li>Calendar pops into page, not a separate window.</li>
<li>Can modify output via provided directions.</li>
<li>Can get help at Yahoo! Groups.</li>
<li>Unrestricted license.</li>
<li>Can refresh page containing calendars as link is not modified after picking a date or two.</li>
<li>Highlights holidays, although will have to remove Dec 1st developer&#8217;s birthday. (OK, modified holiday array in script on lines 86-87.)</li>
</ul>
<ul>CONS</p>
<li>Format of date will have to be modified for MySQL. (OK, Added <code>"cal1.dateFormat="yyyy-MM-dd";</code> after instantiation in header for calendar named &#8216;cal1&#8242;.)</li>
<li>Relies on javascript.</li>
<li>Had to modify the images folder location in the .js file to an absolute address, although things worked fine on my local server with a relative address.</li>
</ul>
<p>I&#8217;m sure there are plenty of these date-picker scripts floating around the Web. Do you have a different one to share with us? Leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://computeraxe.com/calendar-pick-a-date-scripts-reviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

