<?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>CQ-CSER &#187; WORDPRESS</title>
	<atom:link href="http://cq-cser.cn/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://cq-cser.cn</link>
	<description>计算机爱好者</description>
	<lastBuildDate>Wed, 02 May 2012 10:01:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>19-WordPress-SQL</title>
		<link>http://cq-cser.cn/2010/05/19-wordpress-sql/</link>
		<comments>http://cq-cser.cn/2010/05/19-wordpress-sql/#comments</comments>
		<pubDate>Fri, 14 May 2010 07:37:25 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=1190</guid>
		<description><![CDATA[原文：http://paranimage.com/19-wordpress-sql-hacks/ 高度注意： 在每次执行SQL语句前，请勿必备份你的WordPress数据库。 1. 删除所有未使用的标签 DELETE a,b,c FROM wp_terms AS a LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'post_tag' AND c.count = 0 2. 删除所有文章修订版本(Revisions)以及它们的Meta数据 DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/02/wordpress%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5/' rel='bookmark' title='Permanent Link: wordpress备份数据导入'>wordpress备份数据导入</a></li>
<li><a href='http://cq-cser.cn/2010/02/evalfunctionpackerefunctionc/' rel='bookmark' title='Permanent Link: eval(function(p,a,c,k,e,r){e=function(c)'>eval(function(p,a,c,k,e,r){e=function(c)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>原文：<a href="http://paranimage.com/19-wordpress-sql-hacks/">http://paranimage.com/19-wordpress-sql-hacks/</a></strong></p>
<p><strong>高度注意：</strong></p>
<p>在每次执行SQL语句前，请<strong>勿必备份你的WordPress数据库</strong>。</p>
<h3>1. 删除所有未使用的标签<span id="more-1190"></span></h3>
<pre><code>DELETE a,b,c
FROM wp_terms AS a
LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id
LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id
WHERE c.taxonomy = 'post_tag' AND c.count = 0</code></pre>
<h3>2. 删除所有文章修订版本(Revisions)以及它们的Meta数据</h3>
<pre><code>DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'</code></pre>
<h3>3. 更改WordPress地址和首页地址</h3>
<pre><code>UPDATE wp_options
SET option_value = replace(option_value, 'http://www.旧网址.com', 'http://www.新网址.com')
WHERE option_name = 'home' OR option_name = 'siteurl'</code></pre>
<h3>4. 更改文章的GUID</h3>
<pre><code>UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.旧网址.com', 'http://www.新网址.com')</code></pre>
<p><span id="more-11644"> </span></p>
<h3>5. 更改正文中的链接地址</h3>
<pre><code>UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://www.旧网址.com', 'http://www.新网址.com')</code></pre>
<h3>6. 更新文章的Meta值</h3>
<pre><code>UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://www.旧网址.com', 'http://www.新网址.com'</code></pre>
<h3>7. 重设Admin密码</h3>
<pre><code>UPDATE wp_users
SET user_pass = MD5( 'new_password' )
WHERE user_login = 'admin'</code></pre>
<h3>8. 重设admin的用户名</h3>
<pre><code>UPDATE wp_users
SET user_login = 'newname'
WHERE user_login = 'admin'</code></pre>
<h3>9. 将作者a的文章全部转移到作者b</h3>
<pre><code>UPDATE wp_posts
SET post_author = 'b'
WHERE post_author = 'a'</code></pre>
<h3>10. 删除文章的meta标签</h3>
<pre><code>DELETE FROM wp_postmeta
WHERE meta_key = 'your-meta-key'
</code></pre>
<h3>11. 导出所有评论中的邮件地址</h3>
<pre><code>SELECT DISTINCT comment_author_email
FROM wp_comments</code></pre>
<h3>12. 删除所有的Pingback</h3>
<pre><code>DELETE FROM wp_comments
WHERE comment_type = 'pingback'</code></pre>
<h3>13. 删除所有的垃圾评论</h3>
<pre><code>DELETE FROM wp_comments
WHERE comment_approved = 'spam'</code></pre>
<h3>14. 禁用所有激活的插件</h3>
<pre><code>UPDATE wp_options
SET option_value = ''
WHERE option_name = 'active_plugins'</code></pre>
<h3>15. 罗列所有未使用的Meta标签</h3>
<pre><code>SELECT *
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE  wp.ID IS NULL</code></pre>
<h3>16. 关闭旧文章的留言</h3>
<pre><code>UPDATE wp_posts
SET comment_status = 'closed'
WHERE post_date &lt; '2009-01-01' AND post_status = 'publish'</code></pre>
<h3>17. 更新留言者的网址</h3>
<pre><code>UPDATE wp_comments
SET comment_author_url = REPLACE( comment_author_url, 'http://旧网址.com', 'http://新网址.com' )</code></pre>
<h3>18. 更新正文内所有的’target=”_blank”‘为’rel=”nofollow”‘</h3>
<pre><code>UPDATE wp_posts
SET post_content = REPLACE (post_content, 'target="_blank',  'rel="nofollow')</code></pre>
<h3><del datetime="2010-05-12T07:47:16+00:00">19. 删除所有含链接的留言(勿用)</del></h3>
<pre><code><del datetime="2010-05-12T07:47:16+00:00">DELETE FROM wp_comments
WHERE comment_content LIKE "%&lt;a href=%" AND comment_type = ''</del></code></pre>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/02/wordpress%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5/' rel='bookmark' title='Permanent Link: wordpress备份数据导入'>wordpress备份数据导入</a></li>
<li><a href='http://cq-cser.cn/2010/02/evalfunctionpackerefunctionc/' rel='bookmark' title='Permanent Link: eval(function(p,a,c,k,e,r){e=function(c)'>eval(function(p,a,c,k,e,r){e=function(c)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/05/19-wordpress-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>7 Must Have WordPress Plugins For Every Blog</title>
		<link>http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/</link>
		<comments>http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 09:31:02 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=939</guid>
		<description><![CDATA[I’m sure you have seen lots of articles named something like “best 30 plugins for WordPress” or “The coolest 60 plugins for WordPress” etc. In my post today I’m not going to make another collection of links but rather list just a few plugins that I’m using in my own blog. Of course, I haven’t [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2009/12/%e9%98%b2spam%e6%8f%92%e4%bb%b6/' rel='bookmark' title='Permanent Link: 防SPAM插件'>防SPAM插件</a></li>
<li><a href='http://cq-cser.cn/2009/12/the-best-jquery-plugins-of-2009/' rel='bookmark' title='Permanent Link: The Best jQuery Plugins of 2009'>The Best jQuery Plugins of 2009</a></li>
<li><a href='http://cq-cser.cn/2009/11/how-to-display-any-rss-feed-on-your-wordpress-blog%e3%80%90z%e3%80%91/' rel='bookmark' title='Permanent Link: How to: Display any rss feed on your WordPress blog【Z】'>How to: Display any rss feed on your WordPress blog【Z】</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://1stwebdesigner.com/wordpress/basic-wordpress-plugins-every-blog" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/wordpress-plugin.jpg" alt="" width="150" height="150" /></a>I’m sure you have seen lots of articles named something like “best 30 plugins for WordPress” or “The coolest 60 plugins for WordPress” etc. In my post today I’m not going to make another collection of links but rather list just a few plugins that I’m using in my own blog. Of course, I haven’t added all of them from the very beginning. Depending on the task set before me I had to make some studies followed by experiments and make tests, tests and tests. I will explain why I find these plugins extremely useful as well as speak about some widgets that are worth using.</p>
<h2>1. <a href="http://akismet.com/download/" target="_blank">Akismet</a><span id="more-939"></span></h2>
<p><a href="http://akismet.com/download/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/akismet.png" alt="" width="198" height="98" /></a> Akismet is a perfect spam catcher. Not sure how they do this, but 99% of spam comments will get under I’ve had the problem with Akismet only once actually shortly after installation. For some reason it was recognizing uberVU – social comments (the post mentions on twitter) as spam but once I approved it, the Akismet learned the algorithm and now it’s saving me from hundreds of funky comments. There’s also a cool option to “Automatically discard spam comments on posts older than a month” which means that spam comments for the early posts won’t even be added to the Spam” section of blog comments, they will be deleted automatically.</p>
<h2>2. <a href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/" target="_blank">Google Analytics for WordPress</a></h2>
<p><a href="http://wordpress.org/extend/plugins/google-analytics-for-wordpress/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/wordpress-analytics.jpg" alt="" width="570" height="348" /></a></p>
<p>A simple plugin allowing to add Google Analytics to your blog pages and enjoy a variety of tracking options available at Google Analytics account. Once you upload and activate the plugin go to the Settings section in the main menu and look for Google Analytics. Here’s the place where you can make a Google Analytics WordPress Configuration. All you have to do is enter your Analytics Account ID and click on save. Now you can go to your Google Analytics account and track visitors, traffic sources, search keywords and most popular articles.</p>
<h2>3. <a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/" target="_blank">Yet Another Related Posts Plugin</a></h2>
<p><a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/yarpp.png" alt="" width="569" height="290" /></a></p>
<p>As a blogger and project manager I know that it’s highly important to keep blog visitors on the website as long as possible, especially if you are selling ads and are going to earn something from them. This is where Yet Another Related Posts Plugin comes on arena. It allows to show links to related posts at the end of the article, and you can set this relatedness by a number of options, such as keywords in the text, titles, tags, categories etc. You can define the number of links to show and the period of time to check on related articles from your previous posts. You will find related posts section under the main Sections menu of the blog admin area.</p>
<h2>4. <a href="http://wordpress.org/extend/plugins/sociofluid/" target="_blank">SocioFluid</a></h2>
<p><a href="http://wordpress.org/extend/plugins/sociofluid/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/sociofluid.jpg" alt="" width="570" height="372" /></a></p>
<p>Seeking blog promotion and popularity I had to look for a nice plugin that would allow submission of the article to social networks on the fly. I might have tested around 10 plugins before I found and fall in love with Sociofluid. This plugin adds keen social network icons below the post that get bigger on roll-over. SocioFluid settings can be found under the main Sections menu of the blog admin area. There are 20 bookmarking site you can choose from (including my favorite Twitter, Digg, Facebook and Stumble) and you can also choose from the several icons sizes. You can define whether to display SocioFluid Bar for posts in home page or browse pages, to show it on the top of the page or after the article, whether the icons should open in the new window or not.</p>
<h2>5. <a href="http://wordpress.org/extend/plugins/permalinks-migration-plugin-for-wordpress/" target="_blank">Dean’s </a><a href="http://wordpress.org/extend/plugins/permalinks-migration-plugin-for-wordpress/" target="_blank">Permalinks</a><a href="http://wordpress.org/extend/plugins/permalinks-migration-plugin-for-wordpress/" target="_blank"> Migration</a></h2>
<p><a href="http://wordpress.org/extend/plugins/permalinks-migration-plugin-for-wordpress/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/permalinks-migration.jpg" alt="" width="570" height="143" /></a></p>
<p>Dean’s Permalinks Migration plugin helped me to stay on board once I decided to update the URLs structure of the links on my blog to more friendly ones. I’m sure all of us do this from time to time having read some cool articles about SEO friendliness or deciding to test this or that option and to test the results. When your articles have been indexed by search engines and there are other websites linking to you, it’s vital not to lose this audience. What Permalinks Migration plugin does is it changes your permalink structure without breaking the old links to your website. The settings are quite simple and understandable. Once you have updated the permalinks structure in the General settings section just enter the old permalink structure and the plugin will be automatically sending visitors from the old urls to the new ones.</p>
<h2>6. <a href="http://wordpress.org/extend/plugins/wp-banner/" target="_blank">Banner Plugin</a></h2>
<p><a href="http://wordpress.org/extend/plugins/wp-banner/" target="_blank"><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/banner.jpg" alt="" width="570" height="281" /></a></p>
<p>The reason why I needed the banner plugin is that I wanted to convert traffic from the blog into product purchases from the main website. I wanted to add the product pics, have them in rotation and link all of them to according product pages. If compared to the other multiple banner plugins I have tested, Banner Plugin doesn’t have many options like conversion and visitors tracking, multiple campaigns with multiple banners, deducting the cost per click from the deposit etc. But it’s extremely easy to work with, you don’t have to go to the blog code to update a single thing and it’s widgets supported. That means that having uploaded and activated the plugins you just add the pics and the links, save the settings and then simply drag and drop the banner widget into the sidebar. A perfect solution if the simple banner is enough for your needs.</p>
<h2>7. <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">All in One SEO Pack</a></h2>
<p><img src="http://www.1stwebdesigner.com/wp-content/uploads/2010/02/seo-pack-copy.jpg" alt="" width="570" height="348" /></p>
<p>All in one SEO Pack plugin is meant for advanced blog owners and allows to enhance your blog in terms of search engines friendliness. You may skip this one if you’re not into SEO yet as this one requires some basic SEO knowledge. One of the things that I like is that there’s a direct link to options configuration panel right from the plugins section and you don’t have to dive into the settings and check where they could have been added. All in One SEO Pack allows to set the titles structure of blog pages, use noindex attributes for the sections you’d like to close from the search engines and set meta title and meta description for the blog main page without going into the blog code.</p>
<p>Summing this up, I’d like to say that this is definitely not a full list of nice plugins and that I might need more in the future depending on the goals I set. But the factor that plays the most important role for me and makes me test tens of plugins is the simplicity. Since I’m not a programmer I always look for simple solutions that won’t require much of my time and where I wouldn’t have to go into the blog source code and perform significant changes. I hope this article will be useful even for those bloggers who have been working with WordPress for some time by now and will save you some time.</p>
<p>Good luck!</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2009/12/%e9%98%b2spam%e6%8f%92%e4%bb%b6/' rel='bookmark' title='Permanent Link: 防SPAM插件'>防SPAM插件</a></li>
<li><a href='http://cq-cser.cn/2009/12/the-best-jquery-plugins-of-2009/' rel='bookmark' title='Permanent Link: The Best jQuery Plugins of 2009'>The Best jQuery Plugins of 2009</a></li>
<li><a href='http://cq-cser.cn/2009/11/how-to-display-any-rss-feed-on-your-wordpress-blog%e3%80%90z%e3%80%91/' rel='bookmark' title='Permanent Link: How to: Display any rss feed on your WordPress blog【Z】'>How to: Display any rss feed on your WordPress blog【Z】</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress备份数据导入</title>
		<link>http://cq-cser.cn/2010/02/wordpress%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5/</link>
		<comments>http://cq-cser.cn/2010/02/wordpress%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 06:38:25 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[备份]]></category>
		<category><![CDATA[导入]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=888</guid>
		<description><![CDATA[将wordpress的备份数据导入的步骤如下： 1.安装一个wordpress在本地机器上，创建数据库:test，表前缀:ts; 2.打开phpmyadmin找到数据库test,导入备份出来的解压包，如果你的表前缀跟开始建的表前缀一样的话，会覆盖以前的表，尽量不要这样做，因为*_options 这个表中，有数据是安装时生成的，如果覆盖的话页面又会回到安装以前的状态，不会被识别的 3.找到新导入的表中的*_options 字段_transient_random_seed跟siteurl,把它们改成ts_options的这两个字段的内容，运行刷新即可!(OPTION2———&#62;SITEURL，option39&#8212;&#62;home也改下吧，应该是头部href的url) 4.内容已经全部导入，然后把你下载的模板跟插件都放到相应目录，就跟你网站上面的一模一样啦！ 顺便几个函数。某人写的： 用的是./wp-includes/pluggable.php&#8217;下的wp_hash_password函数，从registration.php到class-phpass.php到pluggable.php，有兴趣的同学自己看 &#60; ?php require_once(&#8216;./wp-config.php&#8217;); //载入wp的函数库和基本配置 require_once(&#8216;./wp-includes/pluggable.php&#8217;); $password = &#8220;000123&#8243;; $user = &#8220;tty1&#8243;; $hash = wp_hash_password($password); //这个就是新版的加密函数了 $wpdb-&#62;query( “UPDATE wp_users SET user_pass = ‘$hash’ WHERE user_login = ‘$user’ “); ?&#62; &#60;?php /********************************************* #@filename: change-wp-pass.php #@version: $0.1$ #@date: 2008/06/19 #@author: U{ kldoo http://mifunny.info } #@license: LGPL #@see: 关于加密函数具体内容请看 http://www.openwall.com/phpass/ [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/jquery%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b04/' rel='bookmark' title='Permanent Link: jquery学习笔记4'>jquery学习笔记4</a></li>
<li><a href='http://cq-cser.cn/2009/11/rss-feed%e5%9c%b0%e5%9d%80/' rel='bookmark' title='Permanent Link: RSS Feed地址'>RSS Feed地址</a></li>
<li><a href='http://cq-cser.cn/2009/12/create-an-options-page-for-your-wordpress-theme/' rel='bookmark' title='Permanent Link: create-an-options-page-for-your-WordPress-theme'>create-an-options-page-for-your-WordPress-theme</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>将wordpress的备份数据导入的步骤如下：<br />
1.安装一个wordpress在本地机器上，创建数据库:test，表前缀:ts;<br />
2.打开phpmyadmin找到数据库test,导入备份出来的解压包，如果你的表前缀跟开始建的表前缀一样的话，会覆盖以前的表，尽量不要这样做，因为*_options 这个表中，有数据是安装时生成的，如果覆盖的话页面又会回到安装以前的状态，不会被识别的<span id="more-888"></span><br />
3.找到新导入的表中的*_options 字段_transient_random_seed跟siteurl,把它们改成ts_options的这两个字段的内容，运行刷新即可!(OPTION2———&gt;SITEURL，option39&#8212;&gt;home也改下吧，应该是头部href的url)<br />
4.内容已经全部导入，然后把你下载的模板跟插件都放到相应目录，就跟你网站上面的一模一样啦！</p>
<p>顺便几个函数。某人写的：</p>
<p>用的是./wp-includes/pluggable.php&#8217;下的wp_hash_password函数，从registration.php到class-phpass.php到pluggable.php，有兴趣的同学自己看</p>
<p>&lt; ?php<br />
require_once(&#8216;./wp-config.php&#8217;); //载入wp的函数库和基本配置<br />
require_once(&#8216;./wp-includes/pluggable.php&#8217;);<br />
$password = &#8220;000123&#8243;;<br />
$user = &#8220;tty1&#8243;;<br />
$hash = wp_hash_password($password); //这个就是新版的加密函数了<br />
$wpdb-&gt;query( “UPDATE wp_users SET user_pass = ‘$hash’ WHERE user_login = ‘$user’ “);<br />
?&gt;</p>
<p>&lt;?php<br />
/*********************************************<br />
<a href="mailto:#@filename">#@filename</a>: change-wp-pass.php<br />
<a href="mailto:#@version">#@version</a>: $0.1$<br />
<a href="mailto:#@date">#@date</a>: 2008/06/19<br />
<a href="mailto:#@author">#@author</a>: U{ kldoo <a href="http://mifunny.info">http://mifunny.info</a> }<br />
<a href="mailto:#@license">#@license</a>: LGPL<br />
<a href="mailto:#@see">#@see</a>: 关于加密函数具体内容请看 <a href="http://www.openwall.com/phpass/">http://www.openwall.com/phpass/</a><br />
<a href="mailto:#@note">#@note</a>: 修改 WordPress 2.5 版本的用户密码<br />
*********************************************/<br />
 $user = $_POST['user'];  //用户名<br />
 $password = $_POST['password'];  //新密码<br />
?&gt;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.1//EN&#8221; &#8220;<a href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</a>&#8220;&gt;<br />
&lt;html xmlns=&#8221;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>&#8221; xml:lang=&#8221;zh&#8221;&gt;<br />
&lt;head profile=&#8221;<a href="http://gmpg.org/xfn/11">http://gmpg.org/xfn/11</a>&#8220;&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=UTF-8&#8243; /&gt;<br />
&lt;title&gt;修改WP密码 for wp2.5~~~&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h2 align=&#8221;center&#8221; style=&#8221;font-size:25px; &#8220;&gt; 修改WP2.5~~~密码 &lt;/h2&gt;<br />
 &lt;br /&gt;<br />
 <br />
 &lt;table align=&#8221;center&#8221; border=&#8221;0&#8243; &gt;<br />
 &lt;tbody&gt;&lt;tr&gt;&lt;td&gt; <br />
 &lt;form action=&#8221;change-wp-pass.php&#8221; method=&#8221;post&#8221; &gt;<br />
  &lt;div&gt;&lt;label for=&#8221;text&#8221;&gt;输入需修改的用户登录名：&lt;/label&gt;<br />
  &lt;?php<br />
   if(empty($user)) {<br />
    echo &#8216;&lt;div&gt;&lt;input type=&#8221;text&#8221; name=&#8221;user&#8221; size=&#8221;32&#8243; maxlength=&#8221;36&#8243; value=&#8221;your login name&#8221;/ &gt;&#8217;;<br />
   }<br />
   else<br />
    echo &#8216;&lt;div&gt;&lt;input type=&#8221;text&#8221; name=&#8221;user&#8221; size=&#8221;32&#8243; maxlength=&#8221;36&#8243; value=&#8221;&#8216;.$user.&#8217;&#8221;/ &gt;&#8217;;<br />
  ?&gt;<br />
  &lt;/div&gt;<br />
  &lt;div&gt;&lt;label for=&#8221;text&#8221;&gt;接下来是输入你的新密码：&lt;/label&gt;<br />
  &lt;/div&gt;<br />
  &lt;?php<br />
   if(empty($password)) {<br />
    echo &#8216;&lt;div&gt;&lt;input type=&#8221;text&#8221; name=&#8221;password&#8221; size=&#8221;32&#8243; maxlength=&#8221;36&#8243; value=&#8221;your new password&#8221;/ &gt;&#8217;;<br />
   }<br />
   else<br />
    echo &#8216;&lt;div&gt;&lt;input type=&#8221;text&#8221; name=&#8221;password&#8221; size=&#8221;32&#8243; maxlength=&#8221;36&#8243; value=&#8221;&#8216;.$password.&#8217;&#8221;/ &gt;&#8217;;<br />
  ?&gt;<br />
  &lt;div&gt; &lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;修改密码&#8221; /&gt;<br />
   &lt;input type=&#8221;reset&#8221; name=&#8221;reset&#8221; value=&#8221;重置&#8221; /&gt;<br />
  &lt;/div&gt;<br />
 &lt;/form&gt;<br />
 &lt;/td&gt;&lt;tr&gt;&lt;/tbody&gt;</p>
<p> &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;<br />
 &lt;?php  <br />
   if( !empty($user) and !empty($password) ) {<br />
    require_once(&#8216;./wp-config.php&#8217;);<br />
    require_once(&#8216;./wp-includes/pluggable.php&#8217;);<br />
    // 找到用户ID<br />
    $id_results =  $wpdb-&gt;get_results(&#8220;SELECT ID FROM $wpdb-&gt;users WHERE user_login = &#8216;$user&#8217; &#8220;);<br />
     if ( $id_results )<br />
      foreach ($id_results as $id_result) {<br />
      $id = $id_result-&gt;ID;<br />
      wp_set_password( $password , $id ); //修改密码<br />
      echo &#8220;新密码修改成功了，这回可要记住哦^0^ &#8220;;<br />
     } // END foreach<br />
    else<br />
     echo &#8220;没 &#8220;.$user.&#8221; 这么个用户！ 注意：是登录名。&#8221;;<br />
   } // END if(!empty<br />
 ?&gt;<br />
 &lt;/td&gt;&lt;tr&gt;&lt;/tbody&gt; <br />
 &lt;/table&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/jquery%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b04/' rel='bookmark' title='Permanent Link: jquery学习笔记4'>jquery学习笔记4</a></li>
<li><a href='http://cq-cser.cn/2009/11/rss-feed%e5%9c%b0%e5%9d%80/' rel='bookmark' title='Permanent Link: RSS Feed地址'>RSS Feed地址</a></li>
<li><a href='http://cq-cser.cn/2009/12/create-an-options-page-for-your-wordpress-theme/' rel='bookmark' title='Permanent Link: create-an-options-page-for-your-WordPress-theme'>create-an-options-page-for-your-WordPress-theme</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/wordpress%e5%a4%87%e4%bb%bd%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各大站点美化引用插件</title>
		<link>http://cq-cser.cn/2010/02/%e5%90%84%e5%a4%a7%e7%ab%99%e7%82%b9%e7%be%8e%e5%8c%96%e5%bc%95%e7%94%a8%e6%8f%92%e4%bb%b6/</link>
		<comments>http://cq-cser.cn/2010/02/%e5%90%84%e5%a4%a7%e7%ab%99%e7%82%b9%e7%be%8e%e5%8c%96%e5%bc%95%e7%94%a8%e6%8f%92%e4%bb%b6/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 10:51:23 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[各大]]></category>
		<category><![CDATA[引用]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[站点]]></category>
		<category><![CDATA[美化]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=811</guid>
		<description><![CDATA[豆瓣秀 http://www.douban.com/service/badgemaker http://www.clicki.cn http://data.xiami.com/widget http://mediaplayer.yahoo.com/ http://wibiya.com/Login.php cnzz,51啦，零点统计，naq专业博客统计 twitter，fackbook的就不说了 Related posts:[转]博客底部工具栏 Wibiya 使用介绍


Related posts:<ol><li><a href='http://cq-cser.cn/2009/11/%e8%bd%ac%e5%8d%9a%e5%ae%a2%e5%ba%95%e9%83%a8%e5%b7%a5%e5%85%b7%e6%a0%8f-wibiya-%e4%bd%bf%e7%94%a8%e4%bb%8b%e7%bb%8d/' rel='bookmark' title='Permanent Link: [转]博客底部工具栏 Wibiya 使用介绍'>[转]博客底部工具栏 Wibiya 使用介绍</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>豆瓣秀</p>
<p><a href="http://www.douban.com/service/badgemaker">http://www.douban.com/service/badgemaker</a></p>
<p><a href="http://www.clicki.cn">http://www.clicki.cn</a></p>
<p><a href="http://data.xiami.com/widget">http://data.xiami.com/widget</a></p>
<p><a href="http://mediaplayer.yahoo.com/">http://mediaplayer.yahoo.com/</a></p>
<p><a href="http://wibiya.com/Login.php">http://wibiya.com/Login.php</a></p>
<p>cnzz,51啦，零点统计，naq专业博客统计</p>
<p>twitter，fackbook的就不说了</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2009/11/%e8%bd%ac%e5%8d%9a%e5%ae%a2%e5%ba%95%e9%83%a8%e5%b7%a5%e5%85%b7%e6%a0%8f-wibiya-%e4%bd%bf%e7%94%a8%e4%bb%8b%e7%bb%8d/' rel='bookmark' title='Permanent Link: [转]博客底部工具栏 Wibiya 使用介绍'>[转]博客底部工具栏 Wibiya 使用介绍</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/%e5%90%84%e5%a4%a7%e7%ab%99%e7%82%b9%e7%be%8e%e5%8c%96%e5%bc%95%e7%94%a8%e6%8f%92%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change Font/-size</title>
		<link>http://cq-cser.cn/2010/02/change-font-size/</link>
		<comments>http://cq-cser.cn/2010/02/change-font-size/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 06:10:57 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[字体大小]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=777</guid>
		<description><![CDATA[Change the size and style of fonts via Link. Please visit the official website for further details and the latest information on this plugin. 作者为 Frank Bueltge. Installation Unpack the download-package Upload all files to the /wp-content/plugins/ directory, with folder Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress Edit content or template of your [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2009/12/%e9%98%b2spam%e6%8f%92%e4%bb%b6/' rel='bookmark' title='Permanent Link: 防SPAM插件'>防SPAM插件</a></li>
<li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/05/google-font-directory-google-font-api/' rel='bookmark' title='Permanent Link: Google Font Directory-Google Font API'>Google Font Directory-Google Font API</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Change the size and style of fonts via Link.<br />
Please visit the official website for further details and the latest information on this plugin. 作者为 <a href="http://bueltge.de/">Frank Bueltge</a>.</p>
<p>Installation</p>
<ol>
<li>Unpack the download-package</li>
<li>Upload all files to the <code>/wp-content/plugins/</code> directory, with folder</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress</li>
<li>Edit content or template of your theme<span id="more-777"></span></li>
</ol>
<p><em>Code:</em></p>
<pre><code>&lt;a href="http://wordpress.org/extend/plugins/change-font-size/javascript:fname('style','id');" &gt;fontstyle&lt;/a&gt;
&lt;a href="http://wordpress.org/extend/plugins/change-font-size/javascript:fsize('size','unit','id');" &gt;fontsize&lt;/a&gt;
</code></pre>
<p><em>Example:</em></p>
<pre><code>&lt;a href="http://wordpress.org/extend/plugins/change-font-size/javascript:fname('serif','content');" &gt;fontstyle serif on ID content&lt;/a&gt;
&lt;a href="http://wordpress.org/extend/plugins/change-font-size/javascript:fsize('1.2','em','content');" &gt;fontsize 1.2em on ID content&lt;/a&gt;
</code></pre>
<p>See on <a title="Change Font/-size" href="http://bueltge.de/wp-schift-veraendern-fontsize-und-font-plugin/140/" target="_blank">the official website</a>.</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2009/12/%e9%98%b2spam%e6%8f%92%e4%bb%b6/' rel='bookmark' title='Permanent Link: 防SPAM插件'>防SPAM插件</a></li>
<li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/05/google-font-directory-google-font-api/' rel='bookmark' title='Permanent Link: Google Font Directory-Google Font API'>Google Font Directory-Google Font API</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/change-font-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jGrowl</title>
		<link>http://cq-cser.cn/2010/02/jgrowl/</link>
		<comments>http://cq-cser.cn/2010/02/jgrowl/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:46:33 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[jGrowl]]></category>
		<category><![CDATA[JQUERY]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=774</guid>
		<description><![CDATA[jGrowl is a jQuery 插件,工作在浏览器的右上角, 渐出渐入等,就像 the way that OS X&#8217;s Growl Framework works. jGrowl 资源: Download jGrowl 1.2.4 jGrowl&#8217;s jQuery Plugin Page Checkout the source code with Mercurial on BitBucket Updates on Development via Stan Lemon&#8217;s blog. Example Usage and Samples Explanation of jGrowl Options Version Change Log Example Usage and Samples: // Sample 1 [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2010/03/prototype-and-jquery/' rel='bookmark' title='Permanent Link: Prototype And jquery'>Prototype And jquery</a></li>
<li><a href='http://cq-cser.cn/2009/12/quickbox/' rel='bookmark' title='Permanent Link: QuickBox'>QuickBox</a></li>
<li><a href='http://cq-cser.cn/2010/02/jquery%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b04/' rel='bookmark' title='Permanent Link: jquery学习笔记4'>jquery学习笔记4</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://growl.info/img/growlicon.png" alt="Growl" align="right" /></p>
<p>jGrowl is a jQuery 插件,工作在浏览器的右上角, 渐出渐入等,就像 the way that OS X&#8217;s <a href="http://growl.info/">Growl Framework</a> works.</p>
<h3>jGrowl 资源:</h3>
<ul>
<li><a href="http://plugins.jquery.com/files/jGrowl-1.2.4.zip">Download jGrowl 1.2.4</a></li>
<li><a href="http://plugins.jquery.com/project/jgrowl">jGrowl&#8217;s jQuery Plugin Page</a></li>
<li><a href="http://bitbucket.org/stanlemon/jgrowl/">Checkout the source code with Mercurial on BitBucket</a></li>
<li><a href="http://stanlemon.net/index.jgrowl.html">Updates on Development via Stan Lemon&#8217;s blog.</a></li>
<li><a href="http://cq-cser.cn/wp-admin/#samples">Example Usage and Samples</a></li>
<li><a href="http://cq-cser.cn/wp-admin/#options">Explanation of jGrowl Options</a></li>
<li><a href="http://cq-cser.cn/wp-admin/#changes">Version Change Log</a><span id="more-774"></span></li>
</ul>
<h3>Example Usage and Samples:</h3>
<pre>// Sample 1
$.jGrowl("Hello world!");
// Sample 2
$.jGrowl("Stick this!", { sticky: true });
// Sample 3
$.jGrowl("A message with a header", { header: 'Important' });
// Sample 4
$.jGrowl("A message that will live a little longer.", { life: 10000 });
// Sample 5
$.jGrowl("A message with a beforeOpen callback and a different opening animation.", {
    beforeClose: function(e,m) {
        alert('About to close this notification!');
    },
    animateOpen: {
        height: 'show'
    }
});</pre>
<pre>下面是我的：
&lt;SCRIPT type=text/javascript src="/test/jquery-1.3.2.js"&gt;&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript src="/test/jquery.jgrowl.js"&gt;&lt;/SCRIPT&gt;
&lt;LINK rel=stylesheet type=text/css href="/test/jquery.jgrowl.css"&gt;
&lt;SCRIPT type=text/javascript&gt;
&lt;!--
var id_info ="还没好好的感受,雪花绽放的气候,我们一起颤抖,会更明白什么是温柔,还没跟你牵着手,走过荒芜的沙丘,可能从此以后学会珍惜,天长和地久....";
PopupjGrowlBoxtime(id_info,16000);
--&gt;
&lt;/SCRIPT&gt;</pre>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2010/03/prototype-and-jquery/' rel='bookmark' title='Permanent Link: Prototype And jquery'>Prototype And jquery</a></li>
<li><a href='http://cq-cser.cn/2009/12/quickbox/' rel='bookmark' title='Permanent Link: QuickBox'>QuickBox</a></li>
<li><a href='http://cq-cser.cn/2010/02/jquery%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b04/' rel='bookmark' title='Permanent Link: jquery学习笔记4'>jquery学习笔记4</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/jgrowl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP FollowMe</title>
		<link>http://cq-cser.cn/2010/02/wp-followme/</link>
		<comments>http://cq-cser.cn/2010/02/wp-followme/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:16:56 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=770</guid>
		<description><![CDATA[WP FollowMe is a wordpress plugin that allows you to add a twitter “Follow me” badge on your wordpress blog. Get what version you like more : v 0.1.3 – No flash, followme message displayed sideways, using images to display the folowme message v 0.1.4 – Flash used only for the icon, text displayed vertically [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/change-font-size/' rel='bookmark' title='Permanent Link: Change Font/-size'>Change Font/-size</a></li>
<li><a href='http://cq-cser.cn/2010/02/jgrowl/' rel='bookmark' title='Permanent Link: jGrowl'>jGrowl</a></li>
<li><a href='http://cq-cser.cn/2010/04/twitter%e5%bc%80%e6%94%beapi%e6%96%87%e6%a1%a3/' rel='bookmark' title='Permanent Link: Twitter开放API文档'>Twitter开放API文档</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>WP FollowMe is a wordpress plugin that allows you to add a twitter “Follow me” badge on your wordpress blog.</p>
<p><strong>Get what version you like more :</strong></p>
<ul>
<li><a href="http://downloads.wordpress.org/plugin/wp-followme.0.1.3.zip">v 0.1.3 – No flash, followme message displayed sideways, using images to display the folowme message</a></li>
<li><a href="http://downloads.wordpress.org/plugin/wp-followme.0.1.4.zip">v 0.1.4 – Flash used only for the icon, text displayed vertically</a></li>
<li><a href="http://downloads.wordpress.org/plugin/wp-followme.2.0.3.zip">v 2.0.3 – The badge is completly in flash, text displayed sideways (some users reported problems in chrome browser)</a></li>
<li><a href="http://downloads.wordpress.org/plugin/wp-followme.2.0.4.zip">v2.0.4 – Same as 2.0.3 but with some minor bugs fixed.</a><span id="more-770"></span></li>
</ul>
<h3><strong><strong><strong><strong>Update v2.0.4 :</strong></strong></strong></strong></h3>
<ul>
<li>404 not found error for css file fixed</li>
<li>minor bugs fixed</li>
</ul>
<h3><strong><strong>Update v2.0.3 :</strong></strong></h3>
<ul>
<li>The badge is completly in flash.</li>
<li>The text is displayed sideways.</li>
<li>Added border color option.</li>
<li>“I love it ” icon and question mark removed</li>
</ul>
<h3><strong>Update v2.0 :<br />
</strong></h3>
<ul>
<li>Choose from 16 twitter icons or use your own.</li>
<li>Edit the icon background color.</li>
<li>Edit the “Follow Me” text.</li>
<li>Change text color.</li>
<li>Change font size.</li>
<li>Change font family.</li>
</ul>
<p>If you found a bug or if you have a twitter icon that you want to share with all other users of this plugin let me know on comments section.</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/change-font-size/' rel='bookmark' title='Permanent Link: Change Font/-size'>Change Font/-size</a></li>
<li><a href='http://cq-cser.cn/2010/02/jgrowl/' rel='bookmark' title='Permanent Link: jGrowl'>jGrowl</a></li>
<li><a href='http://cq-cser.cn/2010/04/twitter%e5%bc%80%e6%94%beapi%e6%96%87%e6%a1%a3/' rel='bookmark' title='Permanent Link: Twitter开放API文档'>Twitter开放API文档</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/wp-followme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SimpleViewer</title>
		<link>http://cq-cser.cn/2010/02/simpleviewer/</link>
		<comments>http://cq-cser.cn/2010/02/simpleviewer/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:07:38 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[SimpleViewer]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=767</guid>
		<description><![CDATA[SimpleViewer SimpleViewer is a free, customizable Flash image gallery. It allows you to display your images on any web page in a professional, intuitive and simple way. Controls Mouse: Click thumbnails or the main image to navigate. Keyboard: Use Cursor keys, Home, End, Page Up/Down to navigate. Press &#8216;F&#8217; to toggle Fullscreen mode. Right-Click Menu: [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/flash%e7%9b%b8%e5%86%8c%e7%a8%8b%e5%ba%8f/' rel='bookmark' title='Permanent Link: flash相册程序'>flash相册程序</a></li>
<li><a href='http://cq-cser.cn/2009/12/quickbox/' rel='bookmark' title='Permanent Link: QuickBox'>QuickBox</a></li>
<li><a href='http://cq-cser.cn/2010/04/26jquery-skills/' rel='bookmark' title='Permanent Link: 26JQUERY-SKILLS'>26JQUERY-SKILLS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2>SimpleViewer</h2>
<p>SimpleViewer is a free, customizable Flash image gallery. It allows you to display your images on any web page in a professional, intuitive and simple way.</p>
<h3>Controls</h3>
<ul>
<li><strong>Mouse:</strong> Click thumbnails or the main image to navigate.</li>
<li><strong>Keyboard</strong>: Use Cursor keys, Home, End, Page Up/Down to navigate. Press &#8216;F&#8217; to toggle Fullscreen mode.</li>
<li><strong>Right-Click Menu</strong>: Open Image in New Window, Toggle Fullscreen Mode.</li>
</ul>
<h3>Examples:</h3>
<ul>
<li><a href="http://www.simpleviewer.net/examples/modern">Modern</a> &#8211; Full browser, loading images from XML.</li>
<li><a href="http://www.simpleviewer.net/examples/compact">Compact</a> &#8211; Loading from Flickr&#8217;s most interesting images.</li>
<li><a href="http://www.simpleviewer.net/examples/classic">Classic</a> &#8211; SimpleViewer classic style. Loading a Flickr photostream.</li>
</ul>
<h3>Download:</h3>
<p><a href="http://www.simpleviewer.net/downloads/simpleviewer.zip"><img style="PADDING-BOTTOM: 15px; PADDING-TOP: 12px" src="http://www.simpleviewer.net/global/dl.png" alt="Download" width="153" height="44" /></a></p>
<p><a href="http://www.simpleviewer.net/downloads/simpleviewer.zip">Download SimpleViewer </a>to use on your site.<br />
FREE download for Windows, Mac and Linux.</p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2010/02/flash%e7%9b%b8%e5%86%8c%e7%a8%8b%e5%ba%8f/' rel='bookmark' title='Permanent Link: flash相册程序'>flash相册程序</a></li>
<li><a href='http://cq-cser.cn/2009/12/quickbox/' rel='bookmark' title='Permanent Link: QuickBox'>QuickBox</a></li>
<li><a href='http://cq-cser.cn/2010/04/26jquery-skills/' rel='bookmark' title='Permanent Link: 26JQUERY-SKILLS'>26JQUERY-SKILLS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/simpleviewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xampp</title>
		<link>http://cq-cser.cn/2010/02/xampp/</link>
		<comments>http://cq-cser.cn/2010/02/xampp/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 03:44:29 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=757</guid>
		<description><![CDATA[Installing Xampp and WordPress Why ?? One reason is that you can do a lot of developing (playing around) much quicker as there is no need to use ftp. An added bonus is that no-one can see when you make some strange mistakes. You can also install plugins, upgrade to the latest nightly and virtually [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2011/01/xampp-mysql-1067/' rel='bookmark' title='Permanent Link: xampp-mysql-1067'>xampp-mysql-1067</a></li>
<li><a href='http://cq-cser.cn/2010/04/silverlight-mime-types-in-iis6-and-apache/' rel='bookmark' title='Permanent Link: Silverlight Mime types in IIS6 and Apache'>Silverlight Mime types in IIS6 and Apache</a></li>
<li><a href='http://cq-cser.cn/2009/11/how-to-create-and-use-wordpress-page-templates/' rel='bookmark' title='Permanent Link: How to: Create and use WordPress page templates'>How to: Create and use WordPress page templates</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Installing Xampp and WordPress</p>
<div>Why ??<br />
One reason is that you can do a lot of developing (playing around) much quicker as there is no need to use ftp. An added bonus is that no-one can see when you make some strange mistakes.<br />
You can also install plugins, upgrade to the latest nightly and virtually anything else confident in the knowledge that if it goes wrong, there is no impact on your actual site.</div>
<p>It is also very very easy.</p>
<p> </p>
<div>This is written for Windows XP Home. It works for XP Pro, but only if you stop IIS.</div>
<p> </p>
<div>First go and download XAMPP Lite from <a href="http://www.apachefriends.org/en/xampp.html">http://www.apachefriends.org/en/xampp.html</a>. You can choose a larger package if you need, but for WordPress, the Lite package is fine.<br />
You can choose one of two download packages &#8211; the ZIP or the EXE. If you are unsure, choose the EXE as this will install itself. (The EXE is also smaller).<br />
Move the downloaded EXE file to the root of the drive. In my case, this is C:\<span id="more-757"></span></div>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp1.jpg" alt="" /></p>
<p>Double-click the file and the extract dialog will appear:</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp2.jpg" alt="" /></p>
<p>Click extract &#8211; and wait a few moments while it does it&#8217;s job.<br />
You will then have the xampplite directory at root:</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp3.jpg" alt="" /></p>
<p> </p>
<div>Now you need to start Xampp.<br />
Open the xampplite folder.<br />
You should be seeing a screen with these files (among others) on:</div>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp1.png" alt="" /></p>
<p>Click &#8220;setup_xampp.bat&#8221;</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp5.jpg" alt="" /></p>
<p>Once you have the success message, you can click &#8220;xampp-control.exe&#8221;</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp6.jpg" alt="" /></p>
<p>Now click both indicated buttons to get xampp working in the way we need</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp7.jpg" alt="" /></p>
<p>You&#8217;ll know it&#8217;s working when you see this</p>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp8.jpg" alt="" /></p>
<p> </p>
<div>Now you need to see it all properly.<br />
In your browser, enter the address <em>http://localhost/xampp/splash.php</em></div>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp2.png" alt="" /></p>
<p> </p>
<div>After you have clicked your language and entered the program, click phpMyAdmin.</div>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp3.png" alt="" /></p>
<p> </p>
<div>Copy exactly what is in this image and press Create.</div>
<p align="center"><img src="http://www.tamba2.org.uk/wordpress/xampp/xampp4.png" alt="" /></p>
<p>That is xampp completely sorted out for now.</p>
<p> </p>
<div>Download and unzip WordPress.<br />
Open the file <em>wp-config-sample.php</em><br />
These are the exact details you need for Xampp to work because the default user in phpmyadmin is called &#8216;root&#8217; and there is no password.</div>
<blockquote><p>define(&#8216;DB_NAME&#8217;, &#8216;wordpress&#8217;); // The name of the database<br />
define(&#8216;DB_USER&#8217;, &#8216;root&#8217;); // Your MySQL username<br />
define(&#8216;DB_PASSWORD&#8217;, &#8221;); // &#8230;and password<br />
define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;); // 99% chance you won&#8217;t need to change this value</p></blockquote>
<p>Copy those details into your wp-config file, and save it as <em>wp-config.php</em></p>
<p> </p>
<div>Now you need to copy the files to the right place.<br />
Click the Start button, followed by My Computer &gt; Main drive &gt; Xampplite &gt; htdocs<br />
Copy the whole WordPress folder into this directory.</div>
<p> </p>
<div>In your browser, go to <em>http://localhost/wordpress/wp-admin/install.php</em> and everything from there should run smoothly !</div>
<p> </p>
<div><strong>NOTES:</strong></div>
<ul>
<li>You do not need to use the inbuilt editor to change any WP files. Just open them directly in your text editor, make your changes and then save. As there is no uploading to do, it makes things much much faster &#8211; and you can do this without an internet connection too.</li>
<li>If you want to use permalinks, you will need to make a change inside another file:<br />
Click the Start button, followed by My Computer &gt; Main drive &gt; Xampplite &gt; apache &gt; Conf and find the file <em>httpd.conf</em>. Open that in a text editor. Use the search facility in the editor to find &#8220;rewrite&#8221;. The line you need looks like this:</p>
<blockquote><p>#LoadModule rewrite_module modules/mod_rewrite.so</p></blockquote>
<p>You need to take away the hash sign so it looks like this</p>
<blockquote><p>LoadModule rewrite_module modules/mod_rewrite.so</p></blockquote>
<p>Now just save the file.</li>
</ul>
<p> </p>
<div id="clearer"> </div>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2011/01/xampp-mysql-1067/' rel='bookmark' title='Permanent Link: xampp-mysql-1067'>xampp-mysql-1067</a></li>
<li><a href='http://cq-cser.cn/2010/04/silverlight-mime-types-in-iis6-and-apache/' rel='bookmark' title='Permanent Link: Silverlight Mime types in IIS6 and Apache'>Silverlight Mime types in IIS6 and Apache</a></li>
<li><a href='http://cq-cser.cn/2009/11/how-to-create-and-use-wordpress-page-templates/' rel='bookmark' title='Permanent Link: How to: Create and use WordPress page templates'>How to: Create and use WordPress page templates</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2010/02/xampp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>create-an-options-page-for-your-WordPress-theme</title>
		<link>http://cq-cser.cn/2009/12/create-an-options-page-for-your-wordpress-theme/</link>
		<comments>http://cq-cser.cn/2009/12/create-an-options-page-for-your-wordpress-theme/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 14:50:33 +0000</pubDate>
		<dc:creator>cq</dc:creator>
				<category><![CDATA[WORDPRESS]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://cq-cser.cn/?p=379</guid>
		<description><![CDATA[Including a Theme Options page for your theme is one of the best ways to increase ease-of-use for managing a complex theme. However, a few quick Google searches later and most people give up. Such a great inclusion for theme design appears to have such little documentation, that it appears to be one of those [...]


Related posts:<ol><li><a href='http://cq-cser.cn/2009/11/how-to-create-and-use-wordpress-page-templates/' rel='bookmark' title='Permanent Link: How to: Create and use WordPress page templates'>How to: Create and use WordPress page templates</a></li>
<li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/02/jquery%e8%87%aa%e5%ad%a6%e7%ac%94%e8%ae%b01/' rel='bookmark' title='Permanent Link: jquery自学笔记1'>jquery自学笔记1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Including a Theme Options page for your theme is one of the best ways to increase ease-of-use for managing a complex theme. However, a few quick Google searches later and most people give up. Such a great inclusion for theme design appears to have such little documentation, that it appears to be one of those heavily guarded secrets which only the <em>crème de la crème </em>of designers hold the key to.<span id="more-379"></span></p>
<p>In this article we will be incorporating an options panel for the ‘WordPress Classic’ theme. The methods you learn will allow you to very easily integrate it into an existing theme you’re working on.</p>
<p><span id="more-175"> </span></p>
<p>Firstly, I’d like to give heaps of credit to <a href="http://theundersigned.net/2006/06/wordpress-how-to-theme-options/">this post at The Undersigned</a>. A lot of the code used in this tutorial is from their post. I’m simply building on the foundation they provided – Thanks!</p>
<p>What we’ll be making is a section at the top of the ‘Classic’ WordPress theme to display a welcome message. This message will be customizable from an options page in the Dashboard:</p>
<div><img src="http://blog.themeforest.net/wp-content/uploads/2008/09/options.gif" alt="Options Preview" /></div>
<p>Normally, the options page will look a mess and unstyled. However I’m sharing with you the code I use in my projects to give your page a very user-friendly look which also fits in well with the WordPress Dashboard.</p>
<h3>The Back-End</h3>
<p>Start of by opening the <em>functions.php</em> file in the <em>/wp-content/themes/classic/</em> folder. The first two lines should be:</p>
<pre>&lt;?php if ( function_exists('register_sidebar') )</pre>
<p>Above this, insert the following code to get started:</p>
<pre>&lt;?php
$themename = "WordPress Classic";
$shortname = "wpc";
$options = array (</pre>
<p>You can set $themename and $shortname to whatever you like. The last line starts an array for all our options to go in.</p>
<pre>array(    "name" =&gt; "Welcome Message",
        "type" =&gt; "title"),

array(    "type" =&gt; "open"),

array(    "name" =&gt; "Title",
        "desc" =&gt; "Enter a title to display for your welcome message.",
        "id" =&gt; $shortname."_welcome_title",
        "std" =&gt; "",
        "type" =&gt; "text"),

array(    "name" =&gt; "Message",
        "desc" =&gt; "Text to display as welcome message.",
        "id" =&gt; $shortname."_welcome_message",
        "type" =&gt; "textarea"),

array(  "name" =&gt; "Disable Welcome Message?",
        "desc" =&gt; "Check this box if you would like to DISABLE the welcome message.",
        "id" =&gt; $shortname."_welcome_disable",
        "type" =&gt; "checkbox",
        "std" =&gt; "false"),

array(    "type" =&gt; "close")

);</pre>
<p>This is where we create the options to display. We are storing each option in an array so that we can insert them into a form later in the code. This saves on a lot of duplicated code. In each array, we use the following:</p>
<p><strong>name</strong> – This is the title which will be displayed for this option.</p>
<p><strong>desc </strong>- A description for the option.</p>
<p><strong>id</strong> – This is very important. We will be using these to retrieve the option. $shortname gets replaced with whatever you set the shortname to (in our case <em>wpc</em>).</p>
<p><strong>std</strong> – This is the ‘default’ setting for the option. For example on checkboxes we can use <em>true </em>or <em>false</em> to determine whether the box is pre-ticked or not.</p>
<p><strong>type – </strong>This defines what type of option it is. For example, <em>text</em>, <em>textarea</em>, <em>checkbox</em> etc.</p>
<p>As you can see, we start with the title option. Then <em>‘open’ </em>which is used for purely presentational purposes. It is used to simply open the table for our options (yeah, we’re using tables – so be sure to repent your sins!)</p>
<p>We next have a textbox for the title of our Welcome Message, followed by an textarea for the message itself. We then have a checkbox for <em>disabling</em> the welcome message, followed by <em>‘Close’ </em>which simply closes any tags created by <em>‘open’.</em></p>
<p>And now for the rest of the code. Most of which is a bunch of WordPress functions to tell it this is an options page, so we wont go over most of it:</p>
<pre>function mytheme_add_admin() {

    global $themename, $shortname, $options;

    if ( $_GET['page'] == basename(__FILE__) ) {

        if ( 'save' == $_REQUEST['action'] ) {

                foreach ($options as $value) {
                    update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }

                foreach ($options as $value) {
                    if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }

                header("Location: themes.php?page=functions.php&amp;saved=true");
                die;

        } else if( 'reset' == $_REQUEST['action'] ) {

            foreach ($options as $value) {
                delete_option( $value['id'] ); }

            header("Location: themes.php?page=functions.php&amp;reset=true");
            die;

        }
    }

    add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');

}

function mytheme_admin() {

    global $themename, $shortname, $options;

    if ( $_REQUEST['saved'] ) echo '&lt;div id="message"&gt;&lt;p&gt;&lt;strong&gt;'.$themename.' settings saved.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
    if ( $_REQUEST['reset'] ) echo '&lt;div id="message"&gt;&lt;p&gt;&lt;strong&gt;'.$themename.' settings reset.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';

?&gt;
&lt;div&gt;
&lt;h2&gt;&lt;?php echo $themename; ?&gt; settings&lt;/h2&gt;

&lt;form method="post"&gt;

&lt;?php foreach ($options as $value) {</pre>
<p>Next is the code which tells WordPress how to display the <em>‘type’ </em>of option used (title, open, close, text, textarea, checkbox etc.)</p>
<pre>switch ( $value['type'] ) {

case "open":
?&gt;
&lt;table width="100%" border="0" style="background-color:#eef5fb; padding:10px;"&gt;

&lt;?php break;

case "close":
?&gt;

&lt;/table&gt;&lt;br /&gt;

&lt;?php break;

case "title":
?&gt;
&lt;table width="100%" border="0" style="background-color:#dceefc; padding:5px 10px;"&gt;&lt;tr&gt;
    &lt;td colspan="2"&gt;&lt;h3 style="font-family:Georgia,'Times New Roman',Times,serif;"&gt;&lt;?php echo $value['name']; ?&gt;&lt;/h3&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;?php break;

case 'text':
?&gt;

&lt;tr&gt;
    &lt;td width="20%" rowspan="2" valign="middle"&gt;&lt;strong&gt;&lt;?php echo $value['name']; ?&gt;&lt;/strong&gt;&lt;/td&gt;
    &lt;td width="80%"&gt;&lt;input style="width:400px;" name="&lt;?php echo $value['id']; ?&gt;" id="&lt;?php echo $value['id']; ?&gt;" type="&lt;?php echo $value['type']; ?&gt;" value="&lt;?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?&gt;" /&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;&lt;small&gt;&lt;?php echo $value['desc']; ?&gt;&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;

&lt;?php
break;

case 'textarea':
?&gt;

&lt;tr&gt;
    &lt;td width="20%" rowspan="2" valign="middle"&gt;&lt;strong&gt;&lt;?php echo $value['name']; ?&gt;&lt;/strong&gt;&lt;/td&gt;
    &lt;td width="80%"&gt;&lt;textarea name="&lt;?php echo $value['id']; ?&gt;" style="width:400px; height:200px;" type="&lt;?php echo $value['type']; ?&gt;" cols="" rows=""&gt;&lt;?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?&gt;&lt;/textarea&gt;&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;&lt;small&gt;&lt;?php echo $value['desc']; ?&gt;&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;

&lt;?php
break;

case 'select':
?&gt;
&lt;tr&gt;
    &lt;td width="20%" rowspan="2" valign="middle"&gt;&lt;strong&gt;&lt;?php echo $value['name']; ?&gt;&lt;/strong&gt;&lt;/td&gt;
    &lt;td width="80%"&gt;&lt;select style="width:240px;" name="&lt;?php echo $value['id']; ?&gt;" id="&lt;?php echo $value['id']; ?&gt;"&gt;&lt;?php foreach ($value['options'] as $option) { ?&gt;&lt;option&lt;?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?&gt;&gt;&lt;?php echo $option; ?&gt;&lt;/option&gt;&lt;?php } ?&gt;&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;&lt;small&gt;&lt;?php echo $value['desc']; ?&gt;&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;

&lt;?php
break;

case "checkbox":
?&gt;
    &lt;tr&gt;
    &lt;td width="20%" rowspan="2" valign="middle"&gt;&lt;strong&gt;&lt;?php echo $value['name']; ?&gt;&lt;/strong&gt;&lt;/td&gt;
        &lt;td width="80%"&gt;&lt;? if(get_settings($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?&gt;
                &lt;input type="checkbox" name="&lt;?php echo $value['id']; ?&gt;" id="&lt;?php echo $value['id']; ?&gt;" value="true" &lt;?php echo $checked; ?&gt; /&gt;
                &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
        &lt;td&gt;&lt;small&gt;&lt;?php echo $value['desc']; ?&gt;&lt;/small&gt;&lt;/td&gt;
   &lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;

&lt;?php         break;

}
}
?&gt;</pre>
<p>Basically, if the <em>‘type’</em> is text, we display a textbox with the title and desc tags next to it. The same goes for each of the others.</p>
<p>Note that we are using tables <em>and</em> inline-styling. Seriously, repent your sins <img src="http://blog.themeforest.net/wp-includes/images/smilies/icon_wink.gif" alt=";)" /></p>
<p>Next is the final piece of code for the options page. It displays ‘Submit’ and ‘Reset’ buttons. At the end is the final code to tell WordPress to add this as a page in the Admin Dashboard.</p>
<pre>&lt;p&gt;
&lt;input name="save" type="submit" value="Save changes" /&gt;
&lt;input type="hidden" name="action" value="save" /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;form method="post"&gt;
&lt;p&gt;
&lt;input name="reset" type="submit" value="Reset" /&gt;
&lt;input type="hidden" name="action" value="reset" /&gt;
&lt;/p&gt;
&lt;/form&gt;

&lt;?php
}

add_action('admin_menu', 'mytheme_add_admin'); ?&gt;</pre>
<p>So that’s the Options page done. Test it out by enabling the Classic theme if you haven’t already, and going to Design -&gt; WordPress Classic Options.</p>
<h3>Making Use of the Options</h3>
<p>Now that we’ve made the options page, we need to make them do something. For this, open <em>header.php</em>.</p>
<p>What we’ll be doing is:</p>
<ol>
<li>Retrieve the options.</li>
<li>Check if the disable box is checked. If it hasn’t, we…</li>
<li>Check if a title was provided. If it was, we display it.</li>
<li>Otherwise, we display a generic “Welcome!” title.</li>
<li>Check if a message was provided. If it was, we display it.</li>
<li>Otherwise, a generic message is used.</li>
<li>Finally, if the box <em>was</em> checked, we display nothing.</li>
</ol>
<p><strong>1. Retrieve Options</strong></p>
<p>At the bottom of your<em> header.php</em> page, type the following</p>
<pre>&lt;?
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
?&gt;</pre>
<p>The above retrieves our options and places them in a variable for us to reference. The options are now avaliable as:</p>
<p>$wpc_welcome_disable</p>
<p>$wpc_welcome_title</p>
<p>$wpc_welcome_message</p>
<p><strong>2. Check the ‘Disable’ box</strong></p>
<pre>&lt;?
if ($wpc_welcome_disable == "false") { ?&gt;</pre>
<p>A checkbox will return “false” if unchecked, and “true” is checked. The next code we enter will only be processed if the checkbox is returning false.</p>
<p><strong>3. Check a title was provided &amp; display it</strong></p>
<p><strong> </strong></p>
<pre>&lt;?</pre>
<pre>if ($wpc_welcome_title) { ?&gt;
&lt;h4&gt;&lt;? echo $wpc_welcome_title; ?&gt;&lt;/h4&gt;</pre>
<p>Here we check if there was something entered for the Title. Then display it (echo) inside H4 tags.</p>
<p><strong>4. Otherwise, display a generic title</strong></p>
<pre>&lt;? } else { ?&gt;
&lt;h4&gt;Welcome!&lt;/h4&gt;
&lt;? } ?&gt;</pre>
<p>If there isn’t a title (else), we display a simple “Welcome” title.</p>
<p><strong>5 &amp; 6. Check a message was provided. Display it. Otherwise, generic.</strong></p>
<pre>&lt;? if ($wpc_welcome_message) { ?&gt;
&lt;p&gt;&lt;? echo $wpc_welcome_message; ?&gt;&lt;/p&gt;
&lt;? } else { ?&gt;
&lt;p&gt;Hello and welcome to our site. We hope you enjoy your stay!&lt;/p&gt;
&lt;? } ?&gt;</pre>
<p>The above code uses the same methods as in the previous steps, but uses $wpc_welcome_message instead.</p>
<p><strong>7. If the box <em>was</em> checked, display nothing</strong></p>
<pre>&lt;? } else { ?&gt;

    &lt;!-- You could insert something here which will display when the box IS checked. --&gt;

&lt;? } ?&gt;</pre>
<p>If the box was checked, the above is processed – in our case, just a HTML comment. Ideally, you can just use the last line.</p>
<h3>Summary</h3>
<p>And there you have it! While the actual options we created are very simplistic, you can use the very same techniques to create a much more robust page.</p>
<p>For example, here is a part of the options page for my <a href="http://themeforest.net/item/gamepress/17397?ref=danharper">GamePress</a> theme:</p>
<div><a href="http://themeforest.net/theme_previews/preview_frame/17397?index=8"><img src="http://blog.themeforest.net/wp-content/uploads/2008/09/gamepress.gif" alt="GamePress Options" /></a></div>
<p>Thanks for reading this tutorial and I hope it was useful. Look out for more WordPress-related articles here each week!</p>
<p><a href="http://danharper.me/files/adminoptions.zip"><strong>/* Download Complete Source Files */</strong></a></p>


<p>Related posts:<ol><li><a href='http://cq-cser.cn/2009/11/how-to-create-and-use-wordpress-page-templates/' rel='bookmark' title='Permanent Link: How to: Create and use WordPress page templates'>How to: Create and use WordPress page templates</a></li>
<li><a href='http://cq-cser.cn/2010/03/7-must-have-wordpress-plugins-for-every-blog/' rel='bookmark' title='Permanent Link: 7 Must Have WordPress Plugins For Every Blog'>7 Must Have WordPress Plugins For Every Blog</a></li>
<li><a href='http://cq-cser.cn/2010/02/jquery%e8%87%aa%e5%ad%a6%e7%ac%94%e8%ae%b01/' rel='bookmark' title='Permanent Link: jquery自学笔记1'>jquery自学笔记1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://cq-cser.cn/2009/12/create-an-options-page-for-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

