<?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>NeatCN(NeatStudio工作室) &#187; News</title>
	<atom:link href="http://www.neatcn.com/topics/news/feed" rel="self" type="application/rss+xml" />
	<link>http://www.neatcn.com</link>
	<description>NeatStudio工作室</description>
	<lastBuildDate>Fri, 09 Dec 2011 13:07:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>将NeatCN.com移到phpfog上面了</title>
		<link>http://www.neatcn.com/show-84-1.shtml</link>
		<comments>http://www.neatcn.com/show-84-1.shtml#comments</comments>
		<pubDate>Fri, 09 Dec 2011 13:07:52 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[杂项]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=84</guid>
		<description><![CDATA[不错，终于移到了phpfog上面了。效率也不错，只是不知道能撑多久。 因为，好象如果量多，可能会收费。]]></description>
			<content:encoded><![CDATA[<p>不错，终于移到了phpfog上面了。效率也不错，只是不知道能撑多久。</p>
<p>因为，好象如果量多，可能会收费。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-84-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>测试word发布</title>
		<link>http://www.neatcn.com/show-81-1.shtml</link>
		<comments>http://www.neatcn.com/show-81-1.shtml#comments</comments>
		<pubDate>Fri, 01 Jul 2011 09:29:20 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/show-81-1.shtml</guid>
		<description><![CDATA[内容内容 内容内容   内容内容   内容内容]]></description>
			<content:encoded><![CDATA[<p>内容内容
</p>
<p>内容内容
</p>
<p>
 </p>
<p><img src="http://www.neatcn.com/wp-content/uploads/2011/07/070111_0929_word1.jpg" alt=""/></p>
<p>内容内容
</p>
<p> </p>
<p>内容内容</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-81-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>测试最简单的插件</title>
		<link>http://www.neatcn.com/show-26-1.shtml</link>
		<comments>http://www.neatcn.com/show-26-1.shtml#comments</comments>
		<pubDate>Tue, 16 Mar 2010 01:37:29 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Wordpress开发]]></category>
		<category><![CDATA[add_filter]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=26</guid>
		<description><![CDATA[尝试使用wordpress的时候，看了一下插件的简要信息，说白了，就是一个add_filter在调用相关信息。于是参照hello_dolly插件写了一个最简单的插件，也就是在文章内容后面加上一个版权信息。好象除了默认的模版外，其他就没有这样的提示了。所以，我就开始这样的尝试。 /** * @package NeatCN Copyright * @author neatcn / gouki * @version 0.1 */ /* Plugin Name: NeatCN WordPress Copyright Plugin URI: http://neatcn.com/# Description: 显示文章的版权信息 Author: NeatCN / gouki Version: 0.1 Author URI: http://neatcn.com/ */ function neatCopyRight ( $content &#8230; <a href="http://www.neatcn.com/show-26-1.shtml">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>尝试使用wordpress的时候，看了一下插件的简要信息，说白了，就是一个add_filter在调用相关信息。于是参照hello_dolly插件写了一个最简单的插件，也就是在文章内容后面加上一个版权信息。好象除了默认的模版外，其他就没有这样的提示了。所以，我就开始这样的尝试。</p>
<pre class="brush:php">
/**
 * @package NeatCN Copyright
 * @author neatcn / gouki
 * @version 0.1
 */
/*
Plugin Name: NeatCN WordPress Copyright
Plugin URI: http://neatcn.com/#
Description: 显示文章的版权信息
Author: NeatCN / gouki
Version: 0.1
Author URI: http://neatcn.com/
*/
function neatCopyRight ( $content )
{
	$content .= < <<EOT

wordpress测试插件【显示版权信息】，显示在文章结尾
EOT;
	echo( $content );
}
add_filter('the_content' , 'neatCopyRight' , 1 , 1000);
</pre>
<p>于是在文章内容结束后就有了这一行信息。当然上面仅仅是测试，我不会满足这点的。于是我对neatCopyRight进行了改进，插件也就变成了0.2版了。</p>
<pre class="brush:php">
/*
  说明，the_time，the_category这些函数在文章里居然没有输出值，所以还需要研究一下
  0.2是个失败的作品，晚上回家继续研究
 */
function neatCopyRight ( $content )
{
	$postTime = the_time('l, F jS, Y') . the_time();
	$currentCate = the_category(', ');
	$rssLink = post_comments_feed_link('RSS 2.0');
	$content .= < <<EOT
		<!-- 您可以参考wp-content/themes/default/single.php -->

本文发表于 $postTime , 隶属于 $currentCate 分类，你可以订阅本文的评论：$rssLink 

EOT;
	echo( $content );
}
</pre>
<p>第一个插件，连配置啥的都没有。只能算是一个尝试，尝试了一下add_filter函数而己</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-26-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>采用 CURL登录量子统计(二)</title>
		<link>http://www.neatcn.com/show-23-1.shtml</link>
		<comments>http://www.neatcn.com/show-23-1.shtml#comments</comments>
		<pubDate>Mon, 15 Mar 2010 00:51:28 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[linezing]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=23</guid>
		<description><![CDATA[本文就全是代码了。。。 $cookiefile = tempnam( './log/' , 'cookie' );//设定cookie文件的路径 。 $ch = curl_init(); $header[]="Content-Type: application/x-www-form-urlencoded"; curl_setopt($ch, CURLOPT_URL, 'http://www.linezing.com/login.php'); //登录地址 curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //发送header ，其实这个header可以不发送 curl_setopt($ch, CURLOPT_POST, 1); //这是POST数据 curl_setopt($ch, CURLOPT_POSTFIELDS, 'referer=&#038;webname=index&#038;username=用户名&#038;password=密码&#038;submit=%E7%99%BB%E5%BD%95');//http_build_query( $postData)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //这个是代表curl_exec后取返回成字符串，而不是象WEB一样跳转 curl_setopt($ch, CURLOPT_HEADER, 0); //curl返回的时候，默认都是带有header信息的，所以这里设为0，代表返回的时候不要header信息 curl_setopt($ch, &#8230; <a href="http://www.neatcn.com/show-23-1.shtml">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>本文就全是代码了。。。</p>
<pre class="brush:php">
$cookiefile = tempnam( './log/' , 'cookie' );//设定cookie文件的路径 。
$ch = curl_init();
$header[]="Content-Type: application/x-www-form-urlencoded";
curl_setopt($ch, CURLOPT_URL, 'http://www.linezing.com/login.php');  //登录地址
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);  //发送header ，其实这个header可以不发送
curl_setopt($ch, CURLOPT_POST, 1);  //这是POST数据
curl_setopt($ch, CURLOPT_POSTFIELDS, 'referer=&#038;webname=index&#038;username=用户名&#038;password=密码&#038;submit=%E7%99%BB%E5%BD%95');//http_build_query( $postData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  //这个是代表curl_exec后取返回成字符串，而不是象WEB一样跳转
curl_setopt($ch, CURLOPT_HEADER, 0);  //curl返回的时候，默认都是带有header信息的，所以这里设为0，代表返回的时候不要header信息
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); //这是在用sniff抓包的时候发现用了gzip,deflate的encoding，
curl_setopt($ch, CURLOPT_REFERER, 'http://www.linezing.com/');//记录来源的Referer
curl_setopt($ch, CURLOPT_COOKIEFILE,$cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR,$cookiefile);
curl_exec($ch);  //我这里并没有取返回值，主要是把cookie记录下来

curl_setopt($ch, CURLOPT_URL, 'http://www.linezing.com/router.php');  //登录后跳转的网址
//curl_setopt($ch, CURLOPT_COOKIEFILE,$cookiefile); 原先我在这里也记录cookie了，但事实上，我这样做之后，反而会把第一次登录时的cookie覆盖了。。。郁闷
//curl_setopt($ch, CURLOPT_COOKIEJAR,$cookiefile);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.linezing.com/');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIESESSION,1);
$res = curl_exec($ch);  

curl_setopt($ch, CURLOPT_URL, 'http://tongji.linezing.com/welcome.html');  //welcome页还会再判断是否登录，如果没有登录，会是一段JS跳到www.linezing.com
//curl_setopt($ch, CURLOPT_COOKIEFILE,$cookiefile);
//curl_setopt($ch, CURLOPT_COOKIEJAR,$cookiefile);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.linezing.com/');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIESESSION,1);
curl_exec($ch);  

curl_setopt($ch, CURLOPT_URL, 'http://tongji.linezing.com/mystat.html');
curl_setopt($ch, CURLOPT_COOKIEFILE,$cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR,$cookiefile);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIESESSION,1);
$res = curl_exec($ch);  //这里获取返回值，我是想看一下是不是正确。。。
curl_close($ch);
echo htmlSpecialChars( $res );
</pre>
<p>因为是临时写的代码，所以没有封装，但也算是尽量做了注释。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-23-1.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>采用CURL登录量子统计(一)</title>
		<link>http://www.neatcn.com/show-21-1.shtml</link>
		<comments>http://www.neatcn.com/show-21-1.shtml#comments</comments>
		<pubDate>Sat, 13 Mar 2010 15:07:32 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[linezing]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=21</guid>
		<description><![CDATA[我自己的站点用的是量子统计，所以对于量子统计就需要有更多的研究和学习。 我想的是，如果我能够通过手机，每天在自己的某个指定页面，就能够看到朋友们过来时的关键字或者搜索引擎关键字等。我就可以利用他们有针对性的对网站进行优化？也可以随时关注网站的流量等信息了。 于是，想到什么就做什么，我直接用snoopy类开始尝试提交post数据，提交后取后返回值 ，并同时打开http://tongji.linezing.com/mystat.html页面（这是一个汇总页），但结果都是提示我需要登录。 如此反复尝试多次，也尝试用curl进行登录，但都是一直失败。最后我不得不祭起抓包利器：smartsniff，这是一个小工具，但是他的抓包功能很强。于是我对我的行为开始抓包，从登录直到显示mystat.html页面，结果却发现，从登录开始，到显示mystat.html页面，一共抓了四次包，他们分别是： http://www.linezing.com/login.php 登录提交页，POST提交 http://www.linezing.com/router.php GET方式 http://tongji.linezing.com/welcome.html GET方式 http://tongji.linezing.com/mystat.html GET方式 其实我觉得奇怪的是，这四个页面是在同一台机器上，而且主机名却是bbs.linezing.com，好妖异。 不过，既然分析了抓包数据，得到这四个页面，那么剩下的就开始写代码了，欲知后事如何，请看周一的代码分析（其实是因为代码在单位的电脑上，在家里地无法更新而己），敬请关注。]]></description>
			<content:encoded><![CDATA[<p>我自己的站点用的是量子统计，所以对于量子统计就需要有更多的研究和学习。<br />
我想的是，如果我能够通过手机，每天在自己的某个指定页面，就能够看到朋友们过来时的关键字或者搜索引擎关键字等。我就可以利用他们有针对性的对网站进行优化？也可以随时关注网站的流量等信息了。</p>
<p>于是，想到什么就做什么，我直接用snoopy类开始尝试提交post数据，提交后取后返回值 ，并同时打开http://tongji.linezing.com/mystat.html页面（这是一个汇总页），但结果都是提示我需要登录。</p>
<p>如此反复尝试多次，也尝试用curl进行登录，但都是一直失败。最后我不得不祭起抓包利器：smartsniff，这是一个小工具，但是他的抓包功能很强。于是我对我的行为开始抓包，从登录直到显示mystat.html页面，结果却发现，从登录开始，到显示mystat.html页面，一共抓了四次包，他们分别是：</p>
<blockquote>
<ol>
<li>http://www.linezing.com/login.php 登录提交页，POST提交</li>
<li>http://www.linezing.com/router.php GET方式</li>
<li>http://tongji.linezing.com/welcome.html GET方式</li>
<li>http://tongji.linezing.com/mystat.html GET方式</li>
</ol>
</blockquote>
<p>其实我觉得奇怪的是，这四个页面是在同一台机器上，而且主机名却是bbs.linezing.com，好妖异。</p>
<p>不过，既然分析了抓包数据，得到这四个页面，那么剩下的就开始写代码了，欲知后事如何，请看周一的代码分析（其实是因为代码在单位的电脑上，在家里地无法更新而己），敬请关注。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-21-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何关闭WordPress修订功能</title>
		<link>http://www.neatcn.com/show-13-1.shtml</link>
		<comments>http://www.neatcn.com/show-13-1.shtml#comments</comments>
		<pubDate>Fri, 12 Mar 2010 14:35:23 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Wordpress开发]]></category>
		<category><![CDATA[reversion]]></category>
		<category><![CDATA[wp cleaner]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=13</guid>
		<description><![CDATA[WordPress其实挺不错，但是Revision却不是特别方便，因为每一次的版本保存，都会增加一条主键记录。所以，你会发现，我的网站的文章，第一条是show-1-1.shtml，第二条却是show-11-1.shtml，中间10条却是Reversion所导致的。 由此可见，这样的频繁添加记录对于数据库来说是一个不小的压力，但对于普通用户来说，这个功能却真的并不是那样重要，但所幸，还是有办法 可以解决这个问题。 只要你打开wp-config.php文件，在文件的最后require(&#8216;wp-setting.php&#8217;)前加入： /** * 当值为-1或者true时，代表保存所有的Revision * 当值为false或者0时，代表关闭Revision * 当值大于0，并且是数字是，代表保留n次Revision */ define('WP_POST_REVISIONS',false); 具体说明请查看官方的说明文档“Revision Management”。 不过，如果你已经有了Revision的控制，但却想删除它，怎么办？除了直接执行sql外，还有就是安装这个WP Cleaner插件，我这里就不多做介绍了，我用下来，感觉不错很方便。]]></description>
			<content:encoded><![CDATA[<p>WordPress其实挺不错，但是Revision却不是特别方便，因为每一次的版本保存，都会增加一条主键记录。所以，你会发现，我的网站的文章，第一条是show-1-1.shtml，第二条却是show-11-1.shtml，中间10条却是Reversion所导致的。<br />
由此可见，这样的频繁添加记录对于数据库来说是一个不小的压力，但对于普通用户来说，这个功能却真的并不是那样重要，但所幸，还是有办法 可以解决这个问题。<br />
只要你打开wp-config.php文件，在文件的最后require(&#8216;wp-setting.php&#8217;)前加入：</p>
<pre class="brush:php">/**
 * 当值为-1或者true时，代表保存所有的Revision
 * 当值为false或者0时，代表关闭Revision
 * 当值大于0，并且是数字是，代表保留n次Revision
 */
define('WP_POST_REVISIONS',false);
</pre>
<p>具体说明请查看官方的说明文档“<a href="http://codex.wordpress.org/Revision_Management" target="_blank">Revision Management</a>”。</p>
<p>不过，如果你已经有了Revision的控制，但却想删除它，怎么办？除了直接执行sql外，还有就是安装这个<a href="http://www.jiangmiao.org/blog/c/wpcleaner">WP Cleaner</a>插件，我这里就不多做介绍了，我用下来，感觉不错很方便。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-13-1.shtml/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>测试代码插入</title>
		<link>http://www.neatcn.com/show-11-1.shtml</link>
		<comments>http://www.neatcn.com/show-11-1.shtml#comments</comments>
		<pubDate>Fri, 12 Mar 2010 03:54:53 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[杂项]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=11</guid>
		<description><![CDATA[echo "Hello world ."; function test( $name ){ return "Hello " . $name ; } class nsTest{ protected $name; function __construct(){ if(func_arg_num() > 0){ $this->setName( func_arg_get(0)); } } public function setName( $name ){ $this->name = strval( $name ); } public &#8230; <a href="http://www.neatcn.com/show-11-1.shtml">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<pre class="brush: php">
echo "Hello world .";
function test( $name ){
     return "Hello " . $name ;
}
class nsTest{
    protected $name;
    function __construct(){
        if(func_arg_num() > 0){
             $this->setName( func_arg_get(0));
        }
    }

    public function setName( $name ){
         $this->name = strval( $name );
    }

    public function getName(){
         return $this->name;
    }
}
</pre>
<p>有人说我写Hello world太短了。所以我写了一个class , 一个function 来测试这个高亮插件。。没有测试，没有注意缩进，毕竟在所见所得编辑器里打代码也是很痛苦的事情</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-11-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NeatCN.com域名正式启用</title>
		<link>http://www.neatcn.com/show-1-1.shtml</link>
		<comments>http://www.neatcn.com/show-1-1.shtml#comments</comments>
		<pubDate>Thu, 11 Mar 2010 09:23:49 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[杂项]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=1</guid>
		<description><![CDATA[不再被用做个人博客了。毕竟总要留下点东西的。原来neatcn.com和neatstudio.com共用一个博客不太好。。 在未来的情况下，neatstudio.com中的博客内容，可能还会换掉。目前仅用于维持PR和记录一些信息，而且neatstudio.com中的文章还大多转贴。。 因此，还是正式启用这个域名了。 希望各位做我的友链，并保持不变。谢谢。 通过本域名访问博客的朋友，请将域名改为neatstudio.com，并继续访问，本域名将重置，并会发布更多有用的，原创的信息、文章，请多多捧场。 如果您是从搜索引擎过来，由于改版不能正确给您显示页面而带来的不便，膘叔深表抱歉，但我希望在未来的日子里，您会在这里找到更多优秀的代码。]]></description>
			<content:encoded><![CDATA[<p>不再被用做个人博客了。毕竟总要留下点东西的。原来neatcn.com和neatstudio.com共用一个博客不太好。。</p>
<p>在未来的情况下，neatstudio.com中的博客内容，可能还会换掉。目前仅用于维持PR和记录一些信息，而且neatstudio.com中的文章还大多转贴。。</p>
<p>因此，还是正式启用这个域名了。</p>
<p>希望各位做我的友链，并保持不变。谢谢。</p>
<p>通过本域名访问博客的朋友，请将域名改为neatstudio.com，并继续访问，本域名将重置，并会发布更多有用的，原创的信息、文章，请多多捧场。</p>
<p>如果您是从搜索引擎过来，由于改版不能正确给您显示页面而带来的不便，膘叔深表抱歉，但我希望在未来的日子里，您会在这里找到更多优秀的代码。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-1-1.shtml/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

