<?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>无忧岛</title>
	<atom:link href="http://www.islandcn.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.islandcn.com</link>
	<description>其实天空一直很蓝,只是你许久没有仰望了</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:19:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>chrome和火狐打开shtml显示为源码的解决方法</title>
		<link>http://www.islandcn.com/post/979.html</link>
		<comments>http://www.islandcn.com/post/979.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 08:19:08 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[shtml]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[火狐]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=979</guid>
		<description><![CDATA[今天用帝国cms生成出后缀为shtml的文件 就在我用火狐和chrome查看兼容性的时候意外的发现浏览页面出现的都是源码,而且中文都成乱码了 解决方案: 打开配置文件 httpd.conf 查找 #AddType text/html .shtml #AddOutputFilter INCLUDES .shtml 这两行代码,然后把前面的注释符&#8221;#&#8221;去掉即可,然后重启apache就可以正常浏览了]]></description>
			<content:encoded><![CDATA[<p>今天用帝国cms生成出后缀为shtml的文件<br />
就在我用火狐和chrome查看兼容性的时候意外的发现浏览页面出现的都是源码,而且中文都成乱码了</p>
<p>解决方案:<br />
打开配置文件 httpd.conf 查找</p>
<blockquote><p>
#AddType text/html .shtml<br />
#AddOutputFilter INCLUDES .shtml
</p></blockquote>
<p>这两行代码,然后把前面的注释符&#8221;#&#8221;去掉即可,然后重启apache就可以正常浏览了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/979.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>帝国cms 添加字段出现 Row size too large&#8230;错误的解决方法</title>
		<link>http://www.islandcn.com/post/977.html</link>
		<comments>http://www.islandcn.com/post/977.html#comments</comments>
		<pubDate>Tue, 07 Feb 2012 03:48:13 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[字段]]></category>
		<category><![CDATA[帝国cms]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=977</guid>
		<description><![CDATA[帝国cms 添加字段出现 Row size too large...错误的解决方法]]></description>
			<content:encoded><![CDATA[<p>Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs<br />
alter table ***_ecms_infoclass_shop add zz_columnname text not null,add z_columnname varchar(255) not null,add qz_columnname varchar(255) not null,add save_columnname varchar(10) not null;</p>
<p>出现以上错误信息的话不妨到数据库中看看,事实上这不是mysql的问题,而是cms的问题,你可以用mysql的管理工具到数据库的对应表中查看结构,你会发现你添加的字段已经存在mysql表中了,而在帝国cms的表字段管理页中你是看不到这个字段的存在的,这时你需要在mysql中删除那个字段然后再从帝国cms后台重新添加字段.</p>
<p>那么怎么样添加才不会出错?<br />
注意的一个点就是 再添加的时候把&#8221;采集项&#8221;选择为&#8221;否&#8221;(默认是&#8221;是&#8221;) 继续添加就不会出现问题了.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/977.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>帝国CMS 图片集字段在内容页中打散 提取全部图片的方法</title>
		<link>http://www.islandcn.com/post/975.html</link>
		<comments>http://www.islandcn.com/post/975.html#comments</comments>
		<pubDate>Mon, 06 Feb 2012 11:53:12 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[帝国cms]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=975</guid>
		<description><![CDATA[帝国CMS 图片集字段在内容页中打散 提取全部图片的方法]]></description>
			<content:encoded><![CDATA[<pre name="code" class="php">

&lt;?php
    $str=$navinfor[morepic];

    $exp=explode(&quot;\\r\\n&quot;,$str);
for($i=0;$i&lt;count($exp);$i++)
{
    $exp1=explode(&quot;::::::&quot;,$exp[$i]);
?&gt;
    &lt;li&gt;&lt;img src=&quot;&lt;?=$exp1[1]?&gt;&quot;  alt=&quot;&lt;?=$exp1[2]?&gt;&quot; title==&quot;&lt;?=$exp1[2]?&gt;&quot; /&gt;&lt;/li&gt;
&lt;?php
}
?&gt;
</pre>
<p>注:<?=$exp1[1]?> 为图片地址<br />
<?=$exp1[2]?> 为图片说明</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/975.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux零基础教程 vi编辑器常用命令</title>
		<link>http://www.islandcn.com/post/964.html</link>
		<comments>http://www.islandcn.com/post/964.html#comments</comments>
		<pubDate>Sun, 04 Dec 2011 11:32:57 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=964</guid>
		<description><![CDATA[以前从未使用过linux,一直想彻底的去下定决心学习学习,但是因为手上又没有linux的工作学习环境,以前用的linux主机一直是虚拟主机,由服务商把环境完全配置好了,有问题直接就跟服务商反馈,然后他们给你操作的. 前阵子心血来潮在本地服务器上安装了CentOS5,但是也没来得及去好好系统的学习,前些天因为几个站的备案下不来,于是下狠心把网站搬到国外去,于是找大B买了款512M的linux VPS,正好自己也可以多个学习的机会. 今天在装ECSHOP的时候遇到个问题,安装完毕之后登录后台就会有&#8221;您的服务器设置了 open_base_dir 且没有包含 /tmp/，您将无法上传文件。&#8220;的错误提示. 网上搜索了一下,不少人遇到这个问题,但是大多教程是让到 &#8220;/home/httpd/islandcn.com/conf/&#8221; 这个目录去修改名为&#8221;kloxo.islandcn.com的配置文件. 我的VPS配置是 CentOS和Kloxo面板,可能因为kloxo的面板的版本问题,我打开到&#8221;/home/httpd/islandcn.com/&#8220;目录根本找不到conf的目录,下面只有个php.ini,看了下php.ini的配置又完全没问题,里面有一个open_basedir的参数,但是是被注释掉的. 最后用查找功能找到了这个文件的目录在&#8221;home/apache/conf/domains/islandcn.com.conf&#8220;这里. 于是进去修改保存,重启,问题解决了. 解决&#8221;您的服务器设置了 open_base_dir 且没有包含 /tmp/，您将无法上传文件。&#8220;问题的办法是在此文件中找到 IfModule mod_php5.c这一项的配置: php_admin_value open_basedir &#8220;/home/httpd/&#8230;/httpd/script&#8221; 将上面粗体部分改成 改为 open_base_dir (basedir中间加了一个下划线) 下面主要把实现的命令说一下: 1.VI编辑器的进入和退出 进入VI编辑器: vi 文件名 退出VI编辑器: :q! – 不做修改直接退出 :wq 保存后退出 等同于 :x 2.文件内容的插入与修改 2.1 光标控制命令 h 光标左移,l 光标右移,j 光标上移,k 光标下移 以上命令在命令符前输入数字n ，则光标会往该方向移n 个字符 2.2 删除命令 x为删除一个字符 2.3 [...]]]></description>
			<content:encoded><![CDATA[<div>以前从未使用过linux,一直想彻底的去下定决心学习学习,但是因为手上又没有linux的工作学习环境,以前用的linux主机一直是虚拟主机,由服务商把环境完全配置好了,有问题直接就跟服务商反馈,然后他们给你操作的.</div>
<p></p>
<div>前阵子心血来潮在本地服务器上安装了CentOS5,但是也没来得及去好好系统的学习,前些天因为几个站的备案下不来,于是下狠心把网站搬到国外去,于是找大B买了款512M的linux VPS,正好自己也可以多个学习的机会.</div>
<p></p>
<div>今天在装ECSHOP的时候遇到个问题,安装完毕之后登录后台就会有&#8221;<strong>您的服务器设置了 open_base_dir 且没有包含 /tmp/，您将无法上传文件。</strong>&#8220;的错误提示.</div>
<p></p>
<div>网上搜索了一下,不少人遇到这个问题,但是大多教程是让到 &#8220;<strong>/home/httpd/islandcn.com/conf/</strong>&#8221; 这个目录去修改名为&#8221;<strong>kloxo.islandcn.com</strong>的配置文件.</div>
<p></p>
<div>我的VPS配置是 CentOS和Kloxo面板,可能因为kloxo的面板的版本问题,我打开到&#8221;<strong>/home/httpd/islandcn.com/</strong>&#8220;目录根本找不到conf的目录,下面只有个php.ini,看了下php.ini的配置又完全没问题,里面有一个open_basedir的参数,但是是被注释掉的.</p>
<p>最后用查找功能找到了这个文件的目录在&#8221;<strong>home/apache/conf/domains/islandcn.com.conf</strong>&#8220;这里.  于是进去修改保存,重启,问题解决了.</p>
<p>解决&#8221;<strong>您的服务器设置了 open_base_dir 且没有包含 /tmp/，您将无法上传文件。</strong>&#8220;问题的办法是在此文件中找到 IfModule mod_php5.c这一项的配置:</div>
<p></p>
<p>php_admin_value <strong>open_basedir </strong>&#8220;/home/httpd/&#8230;/httpd/script&#8221;<br />
将上面粗体部分改成<br />
改为 <strong>open_base_dir</strong> (basedir中间加了一个下划线)</p>
<div>下面主要把实现的命令说一下:</p>
<p>1.VI编辑器的进入和退出<br />
进入VI编辑器: vi 文件名<br />
退出VI编辑器: :q! – 不做修改直接退出<br />
:wq 保存后退出 等同于 :x</div>
<p></p>
<div>2.文件内容的插入与修改<br />
2.1 光标控制命令</p>
<p>h 光标左移,l 光标右移,j 光标上移,k 光标下移<br />
以上命令在命令符前输入数字n ，则光标会往该方向移n 个字符<br />
2.2 删除命令</p>
<p>x为删除一个字符<br />
2.3 字符插入命令 i</p>
<p>在打开vi编辑器状态之后如果你按下&#8221;i&#8221; 下面会有 &#8220;insert&#8221; 的状态提醒,此时你可以在光标处插入你输入的字符.当你不需要插入字符的时候记得按&#8221;ESC&#8221;来返回来命令模式.</p></div>
<p></p>
<div>2.4 字符的搜索<br />
搜索命令是&#8221;/&#8221;,在输入/之后输入你要搜索的关键词,然后回车,如果有多处匹配结果可以用&#8221;n&#8221;来移动到下一个结果,如果你要返回上一个结果则需要用&#8221;N&#8221;</div>
<p></p>
<div>2.5 文件的搜索<br />
find搜索,这个命令也是十分重要的,我的配置文件就是用它来找的,面板的类型不一样所以配置文件可能存放的位置也不一样,于是我们需要搜索出文件所在位置加以判断和修改.命令的具体写法是</p>
<p>find -name 文件名(文件名可以写 php.ini 或者 conf等等配置文件名信息)</p></div>
<p></p>
<div>以上命令足以任意修改文件了,如果确定修改之后需要保存退出,然后重启服务.</p>
<p>更多的教程可以参考此文: http://www.centos.bz/2011/10/linux-file-view-edit/</p></div>
<p></strong></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/964.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>html静态页的最佳化301转向方法 rel=&#8221;canonical&#8221;</title>
		<link>http://www.islandcn.com/post/961.html</link>
		<comments>http://www.islandcn.com/post/961.html#comments</comments>
		<pubDate>Thu, 10 Nov 2011 06:30:23 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=961</guid>
		<description><![CDATA[各种动态页的301转向就不用再说了,网上特别多. 但是对于html页面来说,301至今也没有个权威的标准说法. 很多人用js和http-equiv=&#8221;refresh&#8221;等标签来设置重定向,但是返回的也都是非301状态,今天又试着找了很多资料,得出下面的办法是最佳化的. 先说下rel=&#8221;canonical&#8221;这个标签吧 这个标签是谷歌首先提出来的,作用是用来规范网页,也就是这么一种情况下使用的: 假设一个产品类目的页面,然后它可能有几种排序方式 A. 按照产品的价格排序 我们记录它的地址是: URLA B. 按照产品上架时间排序 我们记录它的地址是: URLB C. 按照产品的热门度排序 我们记录它的地址是: URLC 同样的一类产品可能出现上面几个或者更多的URL,但是实际上对搜索引擎来说它们页面内容除了排序不一样以外,其它实质的内容几乎是相同的.所以这里便出现了规范网页这一说.也就是让你提出一个标准网页.那么这个标签如何使用呢? 假设我们去URLA为标准的规范网页,那么我们只需要在URLB和URLC的HEAD标签中加入 &#60;link rel=&#34;canonical&#34; href=&#34;URLA&#34; /&#62; 这行代码即可了,这里的URLA就是规范网页的地址,也就是你需要301重定向的地址.这里就完成了网页地址的统一. 那么继续说HTML如何应用这个标签做跳转呢?这里很多朋友可能已经如何实现了.其实很简单,因为从搜索引擎的角度来说,它已经明白你的意图了,还剩下的就是用户体验了.再用html或者js实现一个重定向就可以了.可以采用以下代码: &#60;meta http-equiv=&#34;refresh&#34; content=&#34;0; url=http://new-domain.com/&#34; /&#62; &#60;link rel=&#34;canonical&#34; href=&#34;http://new-domain.com&#34; /&#62; 问题:百度是否支持canonical标签呢? 答案:网上有人无意中做了个实验，发现其实百度也是支持的，让所有产品页面加上都加上rel=”canonical” 并且指向首页，结果在百度的收录数目减少了2万条，产品页面撤了该标签以后，收录恢复，所以其实百度也支持rel=”canonical” 更多参考资料 谷歌关于rel=&#8221;canonical&#8221;的详细说明]]></description>
			<content:encoded><![CDATA[<p>各种动态页的301转向就不用再说了,网上特别多.<br />
但是对于html页面来说,301至今也没有个权威的标准说法.<br />
很多人用js和http-equiv=&#8221;refresh&#8221;等标签来设置重定向,但是返回的也都是非301状态,今天又试着找了很多资料,得出下面的办法是最佳化的.<br />
先说下rel=&#8221;canonical&#8221;这个标签吧<br />
这个标签是谷歌首先提出来的,作用是用来<strong>规范网页</strong>,也就是这么一种情况下使用的:<br />
假设一个产品类目的页面,然后它可能有几种排序方式<br />
A. 按照产品的价格排序 我们记录它的地址是: URLA<br />
B. 按照产品上架时间排序 我们记录它的地址是: URLB<br />
C. 按照产品的热门度排序 我们记录它的地址是: URLC<br />
同样的一类产品可能出现上面几个或者更多的URL,但是实际上对搜索引擎来说它们页面内容除了排序不一样以外,其它实质的内容几乎是相同的.所以这里便出现了<strong>规范网页</strong>这一说.也就是让你提出一个标准网页.那么这个标签如何使用呢?<br />
假设我们去URLA为标准的规范网页,那么我们只需要在URLB和URLC的HEAD标签中加入</p>
<pre name="code" class="html">

&lt;link rel=&quot;canonical&quot; href=&quot;URLA&quot; /&gt;
</pre>
<p>这行代码即可了,这里的URLA就是规范网页的地址,也就是你需要301重定向的地址.这里就完成了网页地址的统一.</p>
<p>那么继续说HTML如何应用这个标签做跳转呢?这里很多朋友可能已经如何实现了.其实很简单,因为从搜索引擎的角度来说,它已经明白你的意图了,还剩下的就是用户体验了.再用html或者js实现一个重定向就可以了.可以采用以下代码:</p>
<pre name="code" class="html">

&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; url=http://new-domain.com/&quot; /&gt;
&lt;link rel=&quot;canonical&quot; href=&quot;http://new-domain.com&quot; /&gt;
</pre>
<p><strong>问题:百度是否支持canonical标签呢?</strong><br />
答案:网上有人无意中做了个实验，发现其实百度也是支持的，让所有产品页面加上都加上rel=”canonical” 并且指向首页，结果在百度的收录数目减少了2万条，产品页面撤了该标签以后，收录恢复，所以其实百度也支持rel=”canonical”</p>
<p>更多参考资料<br />
<a href="http://www.google.com/support/webmasters/bin/answer.py?answer=139394" target="_blank">谷歌关于rel=&#8221;canonical&#8221;的详细说明</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/961.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>timthumb.php 缩略图处理利器</title>
		<link>http://www.islandcn.com/post/954.html</link>
		<comments>http://www.islandcn.com/post/954.html#comments</comments>
		<pubDate>Thu, 20 Oct 2011 03:38:15 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[timthumb]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[缩略图]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=954</guid>
		<description><![CDATA[先说一下timthumb吧 timthumb.php是一个非常流行的Wordpress的缩略图脚本。通过timthumb.php这个插件脚本，可以方便的实现动态图像裁剪、缩放和调整。很多Wordpress杂志类型的主题都用到它，国外主题普遍采用该脚本自动生成缩略图，使用非常方便。 该项目地址:http://code.google.com/p/timthumb/ 补充说明下:应用timthumb的缩略图地址及参数: http://www.dongcheng.cc/wp-content/themes/corporattica/scripts/timthumb.php?src=http://www.dongcheng.cc/wp-content/uploads/2011/06/XSP-BM22AY.jpg&#038;h=150&#038;w=200&#038;zc=1 譬如我网站中这个主题所应用的缩略图 timthumb.php?src=这里是图片地址&#038;h=高度&#038;w=宽度&#038;zc=是否裁剪 一个问题:今天突然发现所有用到它的图片都不显示了,也就是上面的地址格式的图片都不显示了.由于我的wordpress采用了一个备份插件:BackUpWordPress ,这个插件很好使,个人极力推荐,它可以把站点目录跟数据库全部打包备份,可以每天定期备份,因为定期备份的关系我的虚拟主机空间不够了,所以起初我认为是空间受限的缘故无法生成出缩略图的原因导致的,但是把备份的打包文件全删除了也没见效果. 于是又接着找原因才发现我的timthumb.php的版本太低了是1.09的版本,用谷歌查了下这个版本有安全漏洞,大概漏洞描述为 黑客可以利用这个漏洞（大概是调用外部图像时验证上有缺陷而产生的漏洞），上传任意恶意程序到你的网站，而且作者的网站已被黑客入侵。 于是开始升级到最新版本,升级很简单直接把新文件替换掉源文件就可以了(建议备份原文件).然后就一切正常了&#8230;下面附上最新版的代码,当然也可以在谷歌代码的项目上获取. &#60;?php /** * TimThumb by Ben Gillbanks and Mark Maunder * Based on work done by Tim McDaniels and Darren Hoyt * http://code.google.com/p/timthumb/ * * GNU General Public License, version 2 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * * Examples and documentation available on the project homepage [...]]]></description>
			<content:encoded><![CDATA[<p>先说一下timthumb吧</p>
<blockquote><p>timthumb.php是一个非常流行的Wordpress的缩略图脚本。通过timthumb.php这个插件脚本，可以方便的实现动态图像裁剪、缩放和调整。很多Wordpress杂志类型的主题都用到它，国外主题普遍采用该脚本自动生成缩略图，使用非常方便。</p></blockquote>
<p>该项目地址:<a href="http://code.google.com/p/timthumb/" target="_blank">http://code.google.com/p/timthumb/</a></p>
<p>补充说明下:应用timthumb的缩略图地址及参数:</p>
<p>http://www.dongcheng.cc/wp-content/themes/corporattica/scripts/timthumb.php?src=http://www.dongcheng.cc/wp-content/uploads/2011/06/XSP-BM22AY.jpg&#038;h=150&#038;w=200&#038;zc=1</p>
<p>譬如我网站中这个主题所应用的缩略图<br />
timthumb.php?src=这里是图片地址&#038;h=高度&#038;w=宽度&#038;zc=是否裁剪</p>
<p>一个问题:今天突然发现所有用到它的图片都不显示了,也就是上面的地址格式的图片都不显示了.由于我的wordpress采用了一个备份插件:<a href="http://wordpress.org/extend/plugins/backupwordpress/" target="_blank">BackUpWordPress</a> ,这个插件很好使,个人极力推荐,它可以把站点目录跟数据库全部打包备份,可以每天定期备份,因为定期备份的关系我的虚拟主机空间不够了,所以起初我认为是空间受限的缘故无法生成出缩略图的原因导致的,但是把备份的打包文件全删除了也没见效果.</p>
<p>于是又接着找原因才发现我的timthumb.php的版本太低了是1.09的版本,用谷歌查了下这个版本有安全漏洞,大概漏洞描述为</p>
<blockquote><p>黑客可以利用这个漏洞（大概是调用外部图像时验证上有缺陷而产生的漏洞），上传任意恶意程序到你的网站，而且作者的网站已被黑客入侵。</p></blockquote>
<p>于是开始升级到最新版本,升级很简单直接把新文件替换掉源文件就可以了(建议备份原文件).然后就一切正常了&#8230;下面附上最新版的代码,当然也可以在谷歌代码的项目上获取.</p>
<pre name="code" class="php">

&lt;?php
/**
 * TimThumb by Ben Gillbanks and Mark Maunder
 * Based on work done by Tim McDaniels and Darren Hoyt
 * http://code.google.com/p/timthumb/
 *
 * GNU General Public License, version 2
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Examples and documentation available on the project homepage
 * http://www.binarymoon.co.uk/projects/timthumb/
 */

/*
	-----TimThumb CONFIGURATION-----
	You can either edit the configuration variables manually here, or you can
	create a file called timthumb-config.php and define variables you want
	to customize in there. It will automatically be loaded by timthumb.
	This will save you having to re-edit these variables everytime you download
	a new version of timthumb.

*/
define (&#039;VERSION&#039;, &#039;2.8.2&#039;);										// Version of this script
//Load a config file if it exists. Otherwise, use the values below
if( file_exists(dirname(__FILE__) . &#039;/timthumb-config.php&#039;))	require_once(&#039;timthumb-config.php&#039;);
if(! defined(&#039;DEBUG_ON&#039;) ) 			define (&#039;DEBUG_ON&#039;, false);				// Enable debug logging to web server error log (STDERR)
if(! defined(&#039;DEBUG_LEVEL&#039;) ) 			define (&#039;DEBUG_LEVEL&#039;, 1);				// Debug level 1 is less noisy and 3 is the most noisy
if(! defined(&#039;MEMORY_LIMIT&#039;) ) 			define (&#039;MEMORY_LIMIT&#039;, &#039;30M&#039;);				// Set PHP memory limit
if(! defined(&#039;BLOCK_EXTERNAL_LEECHERS&#039;) ) 	define (&#039;BLOCK_EXTERNAL_LEECHERS&#039;, false);		// If the image or webshot is being loaded on an external site, display a red &quot;No Hotlinking&quot; gif.

//Image fetching and caching
if(! defined(&#039;ALLOW_EXTERNAL&#039;) ) 		define (&#039;ALLOW_EXTERNAL&#039;, TRUE);			// Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
if(! defined(&#039;ALLOW_ALL_EXTERNAL_SITES&#039;) ) 	define (&#039;ALLOW_ALL_EXTERNAL_SITES&#039;, false);		// Less secure.
if(! defined(&#039;FILE_CACHE_ENABLED&#039;) ) 		define (&#039;FILE_CACHE_ENABLED&#039;, TRUE);			// Should we store resized/modified images on disk to speed things up?
if(! defined(&#039;FILE_CACHE_TIME_BETWEEN_CLEANS&#039;))	define (&#039;FILE_CACHE_TIME_BETWEEN_CLEANS&#039;, 86400);	// How often the cache is cleaned
if(! defined(&#039;FILE_CACHE_MAX_FILE_AGE&#039;) ) 	define (&#039;FILE_CACHE_MAX_FILE_AGE&#039;, 86400);		// How old does a file have to be to be deleted from the cache
if(! defined(&#039;FILE_CACHE_SUFFIX&#039;) ) 		define (&#039;FILE_CACHE_SUFFIX&#039;, &#039;.timthumb.txt&#039;);		// What to put at the end of all files in the cache directory so we can identify them
if(! defined(&#039;FILE_CACHE_DIRECTORY&#039;) ) 		define (&#039;FILE_CACHE_DIRECTORY&#039;, &#039;./cache&#039;);		// Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
if(! defined(&#039;MAX_FILE_SIZE&#039;) ) 		define (&#039;MAX_FILE_SIZE&#039;, 10485760);			// 10 Megs is 10485760. This is the max internal or external file size that we&#039;ll process.
if(! defined(&#039;CURL_TIMEOUT&#039;) ) 			define (&#039;CURL_TIMEOUT&#039;, 20);				// Timeout duration for Curl. This only applies if you have Curl installed and aren&#039;t using PHP&#039;s default URL fetching mechanism.
if(! defined(&#039;WAIT_BETWEEN_FETCH_ERRORS&#039;) ) 	define (&#039;WAIT_BETWEEN_FETCH_ERRORS&#039;, 3600);		//Time to wait between errors fetching remote file
//Browser caching
if(! defined(&#039;BROWSER_CACHE_MAX_AGE&#039;) ) 	define (&#039;BROWSER_CACHE_MAX_AGE&#039;, 864000);		// Time to cache in the browser
if(! defined(&#039;BROWSER_CACHE_DISABLE&#039;) ) 	define (&#039;BROWSER_CACHE_DISABLE&#039;, false);		// Use for testing if you want to disable all browser caching

//Image size and defaults
if(! defined(&#039;MAX_WIDTH&#039;) ) 			define (&#039;MAX_WIDTH&#039;, 1500);				// Maximum image width
if(! defined(&#039;MAX_HEIGHT&#039;) ) 			define (&#039;MAX_HEIGHT&#039;, 1500);				// Maximum image height
if(! defined(&#039;NOT_FOUND_IMAGE&#039;) )		define (&#039;NOT_FOUND_IMAGE&#039;, &#039;&#039;);				//Image to serve if any 404 occurs
if(! defined(&#039;ERROR_IMAGE&#039;) )			define (&#039;ERROR_IMAGE&#039;, &#039;&#039;);				//Image to serve if an error occurs instead of showing error message 

//Image compression is enabled if either of these point to valid paths

//These are now disabled by default because the file sizes of PNGs (and GIFs) are much smaller than we used to generate.
//They only work for PNGs. GIFs and JPEGs are not affected.
if(! defined(&#039;OPTIPNG_ENABLED&#039;) ) 		define (&#039;OPTIPNG_ENABLED&#039;, false);
if(! defined(&#039;OPTIPNG_PATH&#039;) ) 			define (&#039;OPTIPNG_PATH&#039;, &#039;/usr/bin/optipng&#039;); //This will run first because it gives better compression than pngcrush.
if(! defined(&#039;PNGCRUSH_ENABLED&#039;) ) 		define (&#039;PNGCRUSH_ENABLED&#039;, false);
if(! defined(&#039;PNGCRUSH_PATH&#039;) ) 		define (&#039;PNGCRUSH_PATH&#039;, &#039;/usr/bin/pngcrush&#039;); //This will only run if OPTIPNG_PATH is not set or is not valid

/*
	-------====Website Screenshots configuration - BETA====-------

	If you just want image thumbnails and don&#039;t want website screenshots, you can safely leave this as is.	

	If you would like to get website screenshots set up, you will need root access to your own server.

	Enable ALLOW_ALL_EXTERNAL_SITES so you can fetch any external web page. This is more secure now that we&#039;re using a non-web folder for cache.
	Enable BLOCK_EXTERNAL_LEECHERS so that your site doesn&#039;t generate thumbnails for the whole Internet.

	Instructions to get website screenshots enabled on Ubuntu Linux:

	1. Install Xvfb with the following command: sudo apt-get install subversion libqt4-webkit libqt4-dev g++ xvfb
	2. Go to a directory where you can download some code
	3. Check-out the latest version of CutyCapt with the following command: svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt
	4. Compile CutyCapt by doing: cd cutycapt/CutyCapt
	5. qmake
	6. make
	7. cp CutyCapt /usr/local/bin/
	8. Test it by running: xvfb-run --server-args=&quot;-screen 0, 1024x768x24&quot; CutyCapt --url=&quot;http://markmaunder.com/&quot; --out=test.png
	9. If you get a file called test.png with something in it, it probably worked. Now test the script by accessing it as follows:
	10. http://yoursite.com/path/to/timthumb.php?src=http://markmaunder.com/&amp;webshot=1

	Notes on performance:
	The first time a webshot loads, it will take a few seconds.
	From then on it uses the regular timthumb caching mechanism with the configurable options above
	and loading will be very fast.

	--ADVANCED USERS ONLY--
	If you&#039;d like a slight speedup (about 25%) and you know Linux, you can run the following command which will keep Xvfb running in the background.
	nohup Xvfb :100 -ac -nolisten tcp -screen 0, 1024x768x24 &gt; /dev/null 2&gt;&amp;1 &amp;
	Then set WEBSHOT_XVFB_RUNNING = true below. This will save your server having to fire off a new Xvfb server and shut it down every time a new shot is generated.
	You will need to take responsibility for keeping Xvfb running in case it crashes. (It seems pretty stable)
	You will also need to take responsibility for server security if you&#039;re running Xvfb as root. 

*/
if(! defined(&#039;WEBSHOT_ENABLED&#039;) ) 	define (&#039;WEBSHOT_ENABLED&#039;, false);			//Beta feature. Adding webshot=1 to your query string will cause the script to return a browser screenshot rather than try to fetch an image.
if(! defined(&#039;WEBSHOT_CUTYCAPT&#039;) ) 	define (&#039;WEBSHOT_CUTYCAPT&#039;, &#039;/usr/local/bin/CutyCapt&#039;); //The path to CutyCapt.
if(! defined(&#039;WEBSHOT_XVFB&#039;) ) 		define (&#039;WEBSHOT_XVFB&#039;, &#039;/usr/bin/xvfb-run&#039;);		//The path to the Xvfb server
if(! defined(&#039;WEBSHOT_SCREEN_X&#039;) ) 	define (&#039;WEBSHOT_SCREEN_X&#039;, &#039;1024&#039;);			//1024 works ok
if(! defined(&#039;WEBSHOT_SCREEN_Y&#039;) ) 	define (&#039;WEBSHOT_SCREEN_Y&#039;, &#039;768&#039;);			//768 works ok
if(! defined(&#039;WEBSHOT_COLOR_DEPTH&#039;) ) 	define (&#039;WEBSHOT_COLOR_DEPTH&#039;, &#039;24&#039;);			//I haven&#039;t tested anything besides 24
if(! defined(&#039;WEBSHOT_IMAGE_FORMAT&#039;) ) 	define (&#039;WEBSHOT_IMAGE_FORMAT&#039;, &#039;png&#039;);			//png is about 2.5 times the size of jpg but is a LOT better quality
if(! defined(&#039;WEBSHOT_TIMEOUT&#039;) ) 	define (&#039;WEBSHOT_TIMEOUT&#039;, &#039;20&#039;);			//Seconds to wait for a webshot
if(! defined(&#039;WEBSHOT_USER_AGENT&#039;) ) 	define (&#039;WEBSHOT_USER_AGENT&#039;, &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18&quot;); //I hate to do this, but a non-browser robot user agent might not show what humans see. So we pretend to be Firefox
if(! defined(&#039;WEBSHOT_JAVASCRIPT_ON&#039;) ) define (&#039;WEBSHOT_JAVASCRIPT_ON&#039;, true);			//Setting to false might give you a slight speedup and block ads. But it could cause other issues.
if(! defined(&#039;WEBSHOT_JAVA_ON&#039;) ) 	define (&#039;WEBSHOT_JAVA_ON&#039;, false);			//Have only tested this as fase
if(! defined(&#039;WEBSHOT_PLUGINS_ON&#039;) ) 	define (&#039;WEBSHOT_PLUGINS_ON&#039;, true);			//Enable flash and other plugins
if(! defined(&#039;WEBSHOT_PROXY&#039;) ) 	define (&#039;WEBSHOT_PROXY&#039;, &#039;&#039;);				//In case you&#039;re behind a proxy server.
if(! defined(&#039;WEBSHOT_XVFB_RUNNING&#039;) )	define (&#039;WEBSHOT_XVFB_RUNNING&#039;, false);			//ADVANCED: Enable this if you&#039;ve got Xvfb running in the background.

// If ALLOW_EXTERNAL is true and ALLOW_ALL_EXTERNAL_SITES is false, then external images will only be fetched from these domains and their subdomains.
if(! isset($ALLOWED_SITES)){
	$ALLOWED_SITES = array (
		&#039;flickr.com&#039;,
		&#039;picasa.com&#039;,
		&#039;img.youtube.com&#039;,
		&#039;upload.wikimedia.org&#039;,
		&#039;photobucket.com&#039;,
		&#039;imgur.com&#039;,
		&#039;imageshack.us&#039;,
		&#039;tinypic.com&#039;,
	);
}
// -------------------------------------------------------------
// -------------- STOP EDITING CONFIGURATION HERE --------------
// -------------------------------------------------------------

timthumb::start();

class timthumb {
	protected $src = &quot;&quot;;
	protected $is404 = false;
	protected $docRoot = &quot;&quot;;
	protected $lastURLError = false;
	protected $localImage = &quot;&quot;;
	protected $localImageMTime = 0;
	protected $url = false;
	protected $myHost = &quot;&quot;;
	protected $isURL = false;
	protected $cachefile = &#039;&#039;;
	protected $errors = array();
	protected $toDeletes = array();
	protected $cacheDirectory = &#039;&#039;;
	protected $startTime = 0;
	protected $lastBenchTime = 0;
	protected $cropTop = false;
	protected $salt = &quot;&quot;;
	protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
	protected $filePrependSecurityBlock = &quot;&lt;?php die(&#039;Execution denied!&#039;); //&quot;; //Designed to have three letter mime type, space, question mark and greater than symbol appended. 6 bytes total.
	protected static $curlDataWritten = 0;
	protected static $curlFH = false;
	public static function start(){
		$tim = new timthumb();
		$tim-&gt;handleErrors();
		$tim-&gt;securityChecks();
		if($tim-&gt;tryBrowserCache()){
			exit(0);
		}
		$tim-&gt;handleErrors();
		if(FILE_CACHE_ENABLED &amp;&amp; $tim-&gt;tryServerCache()){
			exit(0);
		}
		$tim-&gt;handleErrors();
		$tim-&gt;run();
		$tim-&gt;handleErrors();
		exit(0);
	}
	public function __construct(){
		global $ALLOWED_SITES;
		$this-&gt;startTime = microtime(true);
		date_default_timezone_set(&#039;UTC&#039;);
		$this-&gt;debug(1, &quot;Starting new request from &quot; . $this-&gt;getIP() . &quot; to &quot; . $_SERVER[&#039;REQUEST_URI&#039;]);
		$this-&gt;calcDocRoot();
		//On windows systems I&#039;m assuming fileinode returns an empty string or a number that doesn&#039;t change. Check this.
		$this-&gt;salt = @filemtime(__FILE__) . &#039;-&#039; . @fileinode(__FILE__);
		$this-&gt;debug(3, &quot;Salt is: &quot; . $this-&gt;salt);
		if(FILE_CACHE_DIRECTORY){
			if(! is_dir(FILE_CACHE_DIRECTORY)){
				@mkdir(FILE_CACHE_DIRECTORY);
				if(! is_dir(FILE_CACHE_DIRECTORY)){
					$this-&gt;error(&quot;Could not create the file cache directory.&quot;);
					return false;
				}
			}
			$this-&gt;cacheDirectory = FILE_CACHE_DIRECTORY;
			if (!touch($this-&gt;cacheDirectory . &#039;/index.html&#039;)) {
				$this-&gt;error(&quot;Could note create the index.html file.&quot;);
			}
		} else {
			$this-&gt;cacheDirectory = sys_get_temp_dir();
		}
		//Clean the cache before we do anything because we don&#039;t want the first visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires to get a stale image.
		$this-&gt;cleanCache();

		$this-&gt;myHost = preg_replace(&#039;/^www\./i&#039;, &#039;&#039;, $_SERVER[&#039;HTTP_HOST&#039;]);
		$this-&gt;src = $this-&gt;param(&#039;src&#039;);
		$this-&gt;url = parse_url($this-&gt;src);
		if(strlen($this-&gt;src) &lt;= 3){
			$this-&gt;error(&quot;No image specified&quot;);
			return false;
		}
		if(BLOCK_EXTERNAL_LEECHERS &amp;&amp; array_key_exists(&#039;HTTP_REFERER&#039;, $_SERVER) &amp;&amp; (! preg_match(&#039;/^https?:\/\/(?:www\.)?&#039; . $this-&gt;myHost . &#039;(?:$|\/)/i&#039;, $_SERVER[&#039;HTTP_REFERER&#039;]))){
			// base64 encoded red image that says &#039;no hotlinkers&#039;
			// nothing to worry about! :)
			$imgData = base64_decode(&quot;R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=&quot;);
			header(&#039;Content-Type: image/gif&#039;);
			header(&#039;Content-Length: &#039; . sizeof($imgData));
			header(&#039;Cache-Control: no-store, no-cache, must-revalidate, max-age=0&#039;);
			header(&quot;Pragma: no-cache&quot;);
			header(&#039;Expires: &#039; . gmdate (&#039;D, d M Y H:i:s&#039;, time()));
			echo $imgData;
			return false;
			exit(0);
		}
		if(preg_match(&#039;/https?:\/\/(?:www\.)?&#039; . $this-&gt;myHost . &#039;(?:$|\/)/i&#039;, $this-&gt;src)){
			$this-&gt;src = preg_replace(&#039;/https?:\/\/(?:www\.)?&#039; . $this-&gt;myHost . &#039;/i&#039;, &#039;&#039;, $this-&gt;src);
		}
		if(preg_match(&#039;/^https?:\/\/[^\/]+/i&#039;, $this-&gt;src)){
			$this-&gt;debug(2, &quot;Is a request for an external URL: &quot; . $this-&gt;src);
			$this-&gt;isURL = true;
		} else {
			$this-&gt;debug(2, &quot;Is a request for an internal file: &quot; . $this-&gt;src);
		}
		if($this-&gt;isURL &amp;&amp; (! ALLOW_EXTERNAL)){
			$this-&gt;error(&quot;You are not allowed to fetch images from an external website.&quot;);
			return false;
		}
		if($this-&gt;isURL){
			if(ALLOW_ALL_EXTERNAL_SITES){
				$this-&gt;debug(2, &quot;Fetching from all external sites is enabled.&quot;);
			} else {
				$this-&gt;debug(2, &quot;Fetching only from selected external sites is enabled.&quot;);
				$allowed = false;
				foreach($ALLOWED_SITES as $site){
					if ((strtolower(substr($this-&gt;url[&#039;host&#039;],-strlen($site)-1)) === strtolower(&quot;.$site&quot;)) || (strtolower($this-&gt;url[&#039;host&#039;])===strtolower($site))) {
						$this-&gt;debug(3, &quot;URL hostname {$this-&gt;url[&#039;host&#039;]} matches $site so allowing.&quot;);
						$allowed = true;
					}
				}
				if(! $allowed){
					return $this-&gt;error(&quot;You may not fetch images from that site. To enable this site in timthumb, you can either add it to \$ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.&quot;);
				}
			}
		}

		$cachePrefix = ($this-&gt;isURL ? &#039;timthumb_ext_&#039; : &#039;timthumb_int_&#039;);
		if($this-&gt;isURL){
			$this-&gt;cachefile = $this-&gt;cacheDirectory . &#039;/&#039; . $cachePrefix . md5($this-&gt;salt . $_SERVER [&#039;QUERY_STRING&#039;] . $this-&gt;fileCacheVersion) . FILE_CACHE_SUFFIX;
		} else {
			$this-&gt;localImage = $this-&gt;getLocalImagePath($this-&gt;src);
			if(! $this-&gt;localImage){
				$this-&gt;debug(1, &quot;Could not find the local image: {$this-&gt;localImage}&quot;);
				$this-&gt;error(&quot;Could not find the internal image you specified.&quot;);
				$this-&gt;set404();
				return false;
			}
			$this-&gt;debug(1, &quot;Local image path is {$this-&gt;localImage}&quot;);
			$this-&gt;localImageMTime = @filemtime($this-&gt;localImage);
			//We include the mtime of the local file in case in changes on disk.
			$this-&gt;cachefile = $this-&gt;cacheDirectory . &#039;/&#039; . $cachePrefix . md5($this-&gt;salt . $this-&gt;localImageMTime . $_SERVER [&#039;QUERY_STRING&#039;] . $this-&gt;fileCacheVersion) . FILE_CACHE_SUFFIX;
		}
		$this-&gt;debug(2, &quot;Cache file is: &quot; . $this-&gt;cachefile);

		return true;
	}
	public function __destruct(){
		foreach($this-&gt;toDeletes as $del){
			$this-&gt;debug(2, &quot;Deleting temp file $del&quot;);
			@unlink($del);
		}
	}
	public function run(){
		if($this-&gt;isURL){
			if(! ALLOW_EXTERNAL){
				$this-&gt;debug(1, &quot;Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.&quot;);
				$this-&gt;error(&quot;You are not allowed to fetch images from an external website.&quot;);
				return false;
			}
			$this-&gt;debug(3, &quot;Got request for external image. Starting serveExternalImage.&quot;);
			if($this-&gt;param(&#039;webshot&#039;)){
				if(WEBSHOT_ENABLED){
					$this-&gt;debug(3, &quot;webshot param is set, so we&#039;re going to take a webshot.&quot;);
					$this-&gt;serveWebshot();
				} else {
					$this-&gt;error(&quot;You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED == true to enable webshots.&quot;);
				}
			} else {
				$this-&gt;debug(3, &quot;webshot is NOT set so we&#039;re going to try to fetch a regular image.&quot;);
				$this-&gt;serveExternalImage();

			}
		} else {
			$this-&gt;debug(3, &quot;Got request for internal image. Starting serveInternalImage()&quot;);
			$this-&gt;serveInternalImage();
		}
		return true;
	}
	protected function handleErrors(){
		if($this-&gt;haveErrors()){
			if(NOT_FOUND_IMAGE &amp;&amp; $this-&gt;is404()){
				if($this-&gt;serveImg(NOT_FOUND_IMAGE)){
					exit(0);
				} else {
					$this-&gt;error(&quot;Additionally, the 404 image that is configured could not be found or there was an error serving it.&quot;);
				}
			}
			if(ERROR_IMAGE){
				if($this-&gt;serveImg(ERROR_IMAGE)){
					exit(0);
				} else {
					$this-&gt;error(&quot;Additionally, the error image that is configured could not be found or there was an error serving it.&quot;);
				}
			}

			$this-&gt;serveErrors();
			exit(0);
		}
		return false;
	}
	protected function tryBrowserCache(){
		if(BROWSER_CACHE_DISABLE){ $this-&gt;debug(3, &quot;Browser caching is disabled&quot;); return false; }
		if(!empty($_SERVER[&#039;HTTP_IF_MODIFIED_SINCE&#039;]) ){
			$this-&gt;debug(3, &quot;Got a conditional get&quot;);
			$mtime = false;
			//We&#039;ve already checked if the real file exists in the constructor
			if(! is_file($this-&gt;cachefile)){
				//If we don&#039;t have something cached, regenerate the cached image.
				return false;
			}
			if($this-&gt;localImageMTime){
				$mtime = $this-&gt;localImageMTime;
				$this-&gt;debug(3, &quot;Local real file&#039;s modification time is $mtime&quot;);
			} else if(is_file($this-&gt;cachefile)){ //If it&#039;s not a local request then use the mtime of the cached file to determine the 304
				$mtime = @filemtime($this-&gt;cachefile);
				$this-&gt;debug(3, &quot;Cached file&#039;s modification time is $mtime&quot;);
			}
			if(! $mtime){ return false; }

			$iftime = strtotime($_SERVER[&#039;HTTP_IF_MODIFIED_SINCE&#039;]);
			$this-&gt;debug(3, &quot;The conditional get&#039;s if-modified-since unixtime is $iftime&quot;);
			if($iftime &lt; 1){
				$this-&gt;debug(3, &quot;Got an invalid conditional get modified since time. Returning false.&quot;);
				return false;
			}
			if($iftime &lt; $mtime){ //Real file or cache file has been modified since last request, so force refetch.
				$this-&gt;debug(3, &quot;File has been modified since last fetch.&quot;);
				return false;
			} else { //Otherwise serve a 304
				$this-&gt;debug(3, &quot;File has not been modified since last get, so serving a 304.&quot;);
				header ($_SERVER[&#039;SERVER_PROTOCOL&#039;] . &#039; 304 Not Modified&#039;);
				$this-&gt;debug(1, &quot;Returning 304 not modified&quot;);
				return true;
			}
		}
		return false;
	}
	protected function tryServerCache(){
		$this-&gt;debug(3, &quot;Trying server cache&quot;);
		if(file_exists($this-&gt;cachefile)){
			$this-&gt;debug(3, &quot;Cachefile {$this-&gt;cachefile} exists&quot;);
			if($this-&gt;isURL){
				$this-&gt;debug(3, &quot;This is an external request, so checking if the cachefile is empty which means the request failed previously.&quot;);
				if(filesize($this-&gt;cachefile) &lt; 1){
					$this-&gt;debug(3, &quot;Found an empty cachefile indicating a failed earlier request. Checking how old it is.&quot;);
					//Fetching error occured previously
					if(time() - @filemtime($this-&gt;cachefile) &gt; WAIT_BETWEEN_FETCH_ERRORS){
						$this-&gt;debug(3, &quot;File is older than &quot; . WAIT_BETWEEN_FETCH_ERRORS . &quot; seconds. Deleting and returning false so app can try and load file.&quot;);
						@unlink($this-&gt;cachefile);
						return false; //to indicate we didn&#039;t serve from cache and app should try and load
					} else {
						$this-&gt;debug(3, &quot;Empty cachefile is still fresh so returning message saying we had an error fetching this image from remote host.&quot;);
						$this-&gt;set404();
						$this-&gt;error(&quot;An error occured fetching image.&quot;);
						return false;
					}
				}
			} else {
				$this-&gt;debug(3, &quot;Trying to serve cachefile {$this-&gt;cachefile}&quot;);
			}
			if($this-&gt;serveCacheFile()){
				$this-&gt;debug(3, &quot;Succesfully served cachefile {$this-&gt;cachefile}&quot;);
				return true;
			} else {
				$this-&gt;debug(3, &quot;Failed to serve cachefile {$this-&gt;cachefile} - Deleting it from cache.&quot;);
				//Image serving failed. We can&#039;t retry at this point, but lets remove it from cache so the next request recreates it
				@unlink($this-&gt;cachefile);
				return true;
			}
		}
	}
	protected function error($err){
		$this-&gt;debug(3, &quot;Adding error message: $err&quot;);
		$this-&gt;errors[] = $err;
		return false;

	}
	protected function haveErrors(){
		if(sizeof($this-&gt;errors) &gt; 0){
			return true;
		}
		return false;
	}
	protected function serveErrors(){
		$html = &#039;&lt;ul&gt;&#039;;
		foreach($this-&gt;errors as $err){
			$html .= &#039;&lt;li&gt;&#039; . htmlentities($err) . &#039;&lt;/li&gt;&#039;;
		}
		$html .= &#039;&lt;/ul&gt;&#039;;
		header ($_SERVER[&#039;SERVER_PROTOCOL&#039;] . &#039; 400 Bad Request&#039;);
		echo &#039;&lt;h1&gt;A TimThumb error has occured&lt;/h1&gt;The following error(s) occured:&lt;br /&gt;&#039; . $html . &#039;&lt;br /&gt;&#039;;
		echo &#039;&lt;br /&gt;Query String : &#039; . htmlentities ($_SERVER[&#039;QUERY_STRING&#039;]);
		echo &#039;&lt;br /&gt;TimThumb version : &#039; . VERSION . &#039;&lt;/pre&gt;&#039;;
	}
	protected function serveInternalImage(){
		$this-&gt;debug(3, &quot;Local image path is $this-&gt;localImage&quot;);
		if(! $this-&gt;localImage){
			$this-&gt;sanityFail(&quot;localImage not set after verifying it earlier in the code.&quot;);
			return false;
		}
		$fileSize = filesize($this-&gt;localImage);
		if($fileSize &gt; MAX_FILE_SIZE){
			$this-&gt;error(&quot;The file you specified is greater than the maximum allowed file size.&quot;);
			return false;
		}
		if($fileSize &lt;= 0){
			$this-&gt;error(&quot;The file you specified is &lt;= 0 bytes.&quot;);
			return false;
		}
		$this-&gt;debug(3, &quot;Calling processImageAndWriteToCache() for local image.&quot;);
		if($this-&gt;processImageAndWriteToCache($this-&gt;localImage)){
			$this-&gt;serveCacheFile();
			return true;
		} else {
			return false;
		}
	}
	protected function cleanCache(){
		$this-&gt;debug(3, &quot;cleanCache() called&quot;);
		$lastCleanFile = $this-&gt;cacheDirectory . &#039;/timthumb_cacheLastCleanTime.touch&#039;;

		//If this is a new timthumb installation we need to create the file
		if(! is_file($lastCleanFile)){
			$this-&gt;debug(1, &quot;File tracking last clean doesn&#039;t exist. Creating $lastCleanFile&quot;);
			if (!touch($lastCleanFile)) {
				$this-&gt;error(&quot;Could note create cache clean timestamp file.&quot;);
			}
			return;
		}
		if(@filemtime($lastCleanFile) &lt; (time() - FILE_CACHE_TIME_BETWEEN_CLEANS) ){ //Cache was last cleaned more than 1 day ago
			$this-&gt;debug(1, &quot;Cache was last cleaned more than &quot; . FILE_CACHE_TIME_BETWEEN_CLEANS . &quot; seconds ago. Cleaning now.&quot;);
			// Very slight race condition here, but worst case we&#039;ll have 2 or 3 servers cleaning the cache simultaneously once a day.
			if (!touch($lastCleanFile)) {
				$this-&gt;error(&quot;Could note create cache clean timestamp file.&quot;);
			}
			$files = glob($this-&gt;cacheDirectory . &#039;/*&#039; . FILE_CACHE_SUFFIX);
			$timeAgo = time() - FILE_CACHE_MAX_FILE_AGE;
			foreach($files as $file){
				if(@filemtime($file) &lt; $timeAgo){
					$this-&gt;debug(3, &quot;Deleting cache file $file older than max age: &quot; . FILE_CACHE_MAX_FILE_AGE . &quot; seconds&quot;);
					@unlink($file);
				}
			}
			return true;
		} else {
			$this-&gt;debug(3, &quot;Cache was cleaned less than &quot; . FILE_CACHE_TIME_BETWEEN_CLEANS . &quot; seconds ago so no cleaning needed.&quot;);
		}
		return false;
	}
	protected function processImageAndWriteToCache($localImage){
		$sData = getimagesize($localImage);
		$origType = $sData[2];
		$mimeType = $sData[&#039;mime&#039;];

		$this-&gt;debug(3, &quot;Mime type of image is $mimeType&quot;);
		if(! preg_match(&#039;/^image\/(?:gif|jpg|jpeg|png)$/i&#039;, $mimeType)){
			return $this-&gt;error(&quot;The image being resized is not a valid gif, jpg or png.&quot;);
		}

		if (!function_exists (&#039;imagecreatetruecolor&#039;)) {
		    return $this-&gt;error(&#039;GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library&#039;);
		}

		if (function_exists (&#039;imagefilter&#039;) &amp;&amp; defined (&#039;IMG_FILTER_NEGATE&#039;)) {
			$imageFilters = array (
				1 =&gt; array (IMG_FILTER_NEGATE, 0),
				2 =&gt; array (IMG_FILTER_GRAYSCALE, 0),
				3 =&gt; array (IMG_FILTER_BRIGHTNESS, 1),
				4 =&gt; array (IMG_FILTER_CONTRAST, 1),
				5 =&gt; array (IMG_FILTER_COLORIZE, 4),
				6 =&gt; array (IMG_FILTER_EDGEDETECT, 0),
				7 =&gt; array (IMG_FILTER_EMBOSS, 0),
				8 =&gt; array (IMG_FILTER_GAUSSIAN_BLUR, 0),
				9 =&gt; array (IMG_FILTER_SELECTIVE_BLUR, 0),
				10 =&gt; array (IMG_FILTER_MEAN_REMOVAL, 0),
				11 =&gt; array (IMG_FILTER_SMOOTH, 0),
			);
		}

		// get standard input properties
		$new_width =  (int) abs ($this-&gt;param(&#039;w&#039;, 0));
		$new_height = (int) abs ($this-&gt;param(&#039;h&#039;, 0));
		$zoom_crop = (int) $this-&gt;param(&#039;zc&#039;, 1);
		$quality = (int) abs ($this-&gt;param(&#039;q&#039;, 90));
		$align = $this-&gt;cropTop ? &#039;t&#039; : $this-&gt;param(&#039;a&#039;, &#039;c&#039;);
		$filters = $this-&gt;param(&#039;f&#039;, &#039;&#039;);
		$sharpen = (bool) $this-&gt;param(&#039;s&#039;, 0);
		$canvas_color = $this-&gt;param(&#039;cc&#039;, &#039;ffffff&#039;);

		// set default width and height if neither are set already
		if ($new_width == 0 &amp;&amp; $new_height == 0) {
		    $new_width = 100;
		    $new_height = 100;
		}

		// ensure size limits can not be abused
		$new_width = min ($new_width, MAX_WIDTH);
		$new_height = min ($new_height, MAX_HEIGHT);

		// set memory limit to be able to have enough space to resize larger images
		$this-&gt;setMemoryLimit();

		// open the existing image
		$image = $this-&gt;openImage ($mimeType, $localImage);
		if ($image === false) {
			return $this-&gt;error(&#039;Unable to open image.&#039;);
		}

		// Get original width and height
		$width = imagesx ($image);
		$height = imagesy ($image);
		$origin_x = 0;
		$origin_y = 0;

		// generate new w/h if not provided
		if ($new_width &amp;&amp; !$new_height) {
			$new_height = floor ($height * ($new_width / $width));
		} else if ($new_height &amp;&amp; !$new_width) {
			$new_width = floor ($width * ($new_height / $height));
		}

		// scale down and add borders
		if ($zoom_crop == 3) {

			$final_height = $height * ($new_width / $width);

			if ($final_height &gt; $new_height) {
				$new_width = $width * ($new_height / $height);
			} else {
				$new_height = $final_height;
			}

		}

		// create a new true color image
		$canvas = imagecreatetruecolor ($new_width, $new_height);
		imagealphablending ($canvas, false);

		if (strlen ($canvas_color) &lt; 6) {
			$canvas_color = &#039;ffffff&#039;;
		}

		$canvas_color_R = hexdec (substr ($canvas_color, 0, 2));
		$canvas_color_G = hexdec (substr ($canvas_color, 2, 2));
		$canvas_color_B = hexdec (substr ($canvas_color, 2, 2));

		// Create a new transparent color for image
		$color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 127);

		// Completely fill the background of the new image with allocated color.
		imagefill ($canvas, 0, 0, $color);

		// scale down and add borders
		if ($zoom_crop == 2) {

			$final_height = $height * ($new_width / $width);

			if ($final_height &gt; $new_height) {

				$origin_x = $new_width / 2;
				$new_width = $width * ($new_height / $height);
				$origin_x = round ($origin_x - ($new_width / 2));

			} else {

				$origin_y = $new_height / 2;
				$new_height = $final_height;
				$origin_y = round ($origin_y - ($new_height / 2));

			}

		}

		// Restore transparency blending
		imagesavealpha ($canvas, true);

		if ($zoom_crop &gt; 0) {

			$src_x = $src_y = 0;
			$src_w = $width;
			$src_h = $height;

			$cmp_x = $width / $new_width;
			$cmp_y = $height / $new_height;

			// calculate x or y coordinate and width or height of source
			if ($cmp_x &gt; $cmp_y) {

				$src_w = round ($width / $cmp_x * $cmp_y);
				$src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);

			} else if ($cmp_y &gt; $cmp_x) {

				$src_h = round ($height / $cmp_y * $cmp_x);
				$src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);

			}

			// positional cropping!
			if ($align) {
				if (strpos ($align, &#039;t&#039;) !== false) {
					$src_y = 0;
				}
				if (strpos ($align, &#039;b&#039;) !== false) {
					$src_y = $height - $src_h;
				}
				if (strpos ($align, &#039;l&#039;) !== false) {
					$src_x = 0;
				}
				if (strpos ($align, &#039;r&#039;) !== false) {
					$src_x = $width - $src_w;
				}
			}

			imagecopyresampled ($canvas, $image, $origin_x, $origin_y, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);

		} else {

			// copy and resize part of an image with resampling
			imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);

		}

		if ($filters != &#039;&#039; &amp;&amp; function_exists (&#039;imagefilter&#039;) &amp;&amp; defined (&#039;IMG_FILTER_NEGATE&#039;)) {
			// apply filters to image
			$filterList = explode (&#039;|&#039;, $filters);
			foreach ($filterList as $fl) {

				$filterSettings = explode (&#039;,&#039;, $fl);
				if (isset ($imageFilters[$filterSettings[0]])) {

					for ($i = 0; $i &lt; 4; $i ++) {
						if (!isset ($filterSettings[$i])) {
							$filterSettings[$i] = null;
						} else {
							$filterSettings[$i] = (int) $filterSettings[$i];
						}
					}

					switch ($imageFilters[$filterSettings[0]][1]) {

						case 1:

							imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
							break;

						case 2:

							imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
							break;

						case 3:

							imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
							break;

						case 4:

							imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
							break;

						default:

							imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
							break;

					}
				}
			}
		}

		// sharpen image
		if ($sharpen &amp;&amp; function_exists (&#039;imageconvolution&#039;)) {

			$sharpenMatrix = array (
					array (-1,-1,-1),
					array (-1,16,-1),
					array (-1,-1,-1),
					);

			$divisor = 8;
			$offset = 0;

			imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);

		}
		//Straight from WordPress core code. Reduces filesize by up to 70% for PNG&#039;s
		if ( (IMAGETYPE_PNG == $origType || IMAGETYPE_GIF == $origType) &amp;&amp; function_exists(&#039;imageistruecolor&#039;) &amp;&amp; !imageistruecolor( $image ) &amp;&amp; imagecolortransparent( $image ) &gt; 0 ){
			imagetruecolortopalette( $canvas, false, imagecolorstotal( $image ) );
		}

		$imgType = &quot;&quot;;
		$tempfile = tempnam($this-&gt;cacheDirectory, &#039;timthumb_tmpimg_&#039;);
		if(preg_match(&#039;/^image\/(?:jpg|jpeg)$/i&#039;, $mimeType)){
			$imgType = &#039;jpg&#039;;
			imagejpeg($canvas, $tempfile, $quality);
		} else if(preg_match(&#039;/^image\/png$/i&#039;, $mimeType)){
			$imgType = &#039;png&#039;;
			imagepng($canvas, $tempfile, floor($quality * 0.09));
		} else if(preg_match(&#039;/^image\/gif$/i&#039;, $mimeType)){
			$imgType = &#039;gif&#039;;
			imagegif($canvas, $tempfile);
		} else {
			return $this-&gt;sanityFail(&quot;Could not match mime type after verifying it previously.&quot;);
		}

		if($imgType == &#039;png&#039; &amp;&amp; OPTIPNG_ENABLED &amp;&amp; OPTIPNG_PATH &amp;&amp; @is_file(OPTIPNG_PATH)){
			$exec = OPTIPNG_PATH;
			$this-&gt;debug(3, &quot;optipng&#039;ing $tempfile&quot;);
			$presize = filesize($tempfile);
			$out = `$exec -o1 $tempfile`; //you can use up to -o7 but it really slows things down
			clearstatcache();
			$aftersize = filesize($tempfile);
			$sizeDrop = $presize - $aftersize;
			if($sizeDrop &gt; 0){
				$this-&gt;debug(1, &quot;optipng reduced size by $sizeDrop&quot;);
			} else if($sizeDrop &lt; 0){
				$this-&gt;debug(1, &quot;optipng increased size! Difference was: $sizeDrop&quot;);
			} else {
				$this-&gt;debug(1, &quot;optipng did not change image size.&quot;);
			}
		} else if($imgType == &#039;png&#039; &amp;&amp; PNGCRUSH_ENABLED &amp;&amp; PNGCRUSH_PATH &amp;&amp; @is_file(PNGCRUSH_PATH)){
			$exec = PNGCRUSH_PATH;
			$tempfile2 = tempnam($this-&gt;cacheDirectory, &#039;timthumb_tmpimg_&#039;);
			$this-&gt;debug(3, &quot;pngcrush&#039;ing $tempfile to $tempfile2&quot;);
			$out = `$exec $tempfile $tempfile2`;
			$todel = &quot;&quot;;
			if(is_file($tempfile2)){
				$sizeDrop = filesize($tempfile) - filesize($tempfile2);
				if($sizeDrop &gt; 0){
					$this-&gt;debug(1, &quot;pngcrush was succesful and gave a $sizeDrop byte size reduction&quot;);
					$todel = $tempfile;
					$tempfile = $tempfile2;
				} else {
					$this-&gt;debug(1, &quot;pngcrush did not reduce file size. Difference was $sizeDrop bytes.&quot;);
					$todel = $tempfile2;
				}
			} else {
				$this-&gt;debug(3, &quot;pngcrush failed with output: $out&quot;);
				$todel = $tempfile2;
			}
			@unlink($todel);
		}

		$this-&gt;debug(3, &quot;Rewriting image with security header.&quot;);
		$tempfile4 = tempnam($this-&gt;cacheDirectory, &#039;timthumb_tmpimg_&#039;);
		$context = stream_context_create ();
		$fp = fopen($tempfile,&#039;r&#039;,0,$context);
		file_put_contents($tempfile4, $this-&gt;filePrependSecurityBlock . $imgType . &#039; ?&#039; . &#039;&gt;&#039;); //6 extra bytes, first 3 being image type
		file_put_contents($tempfile4, $fp, FILE_APPEND);
		fclose($fp);
		@unlink($tempfile);
		$this-&gt;debug(3, &quot;Locking and replacing cache file.&quot;);
		$lockFile = $this-&gt;cachefile . &#039;.lock&#039;;
		$fh = fopen($lockFile, &#039;w&#039;);
		if(! $fh){
			return $this-&gt;error(&quot;Could not open the lockfile for writing an image.&quot;);
		}
		if(flock($fh, LOCK_EX)){
			@unlink($this-&gt;cachefile); //rename generally overwrites, but doing this in case of platform specific quirks. File might not exist yet.
			rename($tempfile4, $this-&gt;cachefile);
			flock($fh, LOCK_UN);
			fclose($fh);
			@unlink($lockFile);
		} else {
			fclose($fh);
			@unlink($lockFile);
			@unlink($tempfile4);
			return $this-&gt;error(&quot;Could not get a lock for writing.&quot;);
		}
		$this-&gt;debug(3, &quot;Done image replace with security header. Cleaning up and running cleanCache()&quot;);
		imagedestroy($canvas);
		imagedestroy($image);
		return true;
	}
	protected function calcDocRoot(){
		$docRoot = @$_SERVER[&#039;DOCUMENT_ROOT&#039;];
		if(!isset($docRoot)){
			$this-&gt;debug(3, &quot;DOCUMENT_ROOT is not set. This is probably windows. Starting search 1.&quot;);
			if(isset($_SERVER[&#039;SCRIPT_FILENAME&#039;])){
				$docRoot = str_replace( &#039;\\&#039;, &#039;/&#039;, substr($_SERVER[&#039;SCRIPT_FILENAME&#039;], 0, 0-strlen($_SERVER[&#039;PHP_SELF&#039;])));
				$this-&gt;debug(3, &quot;Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot&quot;);
			}
		}
		if(!isset($docRoot)){
			$this-&gt;debug(3, &quot;DOCUMENT_ROOT still is not set. Starting search 2.&quot;);
			if(isset($_SERVER[&#039;PATH_TRANSLATED&#039;])){
				$docRoot = str_replace( &#039;\\&#039;, &#039;/&#039;, substr(str_replace(&#039;\\\\&#039;, &#039;\\&#039;, $_SERVER[&#039;PATH_TRANSLATED&#039;]), 0, 0-strlen($_SERVER[&#039;PHP_SELF&#039;])));
				$this-&gt;debug(3, &quot;Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot&quot;);
			}
		}
		if($docRoot &amp;&amp; $_SERVER[&#039;DOCUMENT_ROOT&#039;] != &#039;/&#039;){ $docRoot = preg_replace(&#039;/\/$/&#039;, &#039;&#039;, $docRoot); }
		$this-&gt;debug(3, &quot;Doc root is: &quot; . $docRoot);
		$this-&gt;docRoot = $docRoot;

	}
	protected function getLocalImagePath($src){
		$src = preg_replace(&#039;/^\//&#039;, &#039;&#039;, $src); //strip off the leading &#039;/&#039;
		$realDocRoot = realpath($this-&gt;docRoot);  //See issue 224. Using realpath as a windows fix.
		if(! $this-&gt;docRoot){
			$this-&gt;debug(3, &quot;We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.&quot;);
			//We don&#039;t support serving images outside the current dir if we don&#039;t have a doc root for security reasons.
			$file = preg_replace(&#039;/^.*?([^\/\\\\]+)$/&#039;, &#039;$1&#039;, $src); //strip off any path info and just leave the filename.
			if(is_file($file)){
				return realpath($file);
			}
			return $this-&gt;error(&quot;Could not find your website document root and the file specified doesn&#039;t exist in timthumbs directory. We don&#039;t support serving files outside timthumb&#039;s directory without a document root for security reasons.&quot;);
		} //Do not go past this point without docRoot set

		//Try src under docRoot
		if(file_exists ($this-&gt;docRoot . &#039;/&#039; . $src)) {
			$this-&gt;debug(3, &quot;Found file as &quot; . $this-&gt;docRoot . &#039;/&#039; . $src);
			$real = realpath($this-&gt;docRoot . &#039;/&#039; . $src);
			if(strpos($real, $realDocRoot) === 0){
				return $real;
			} else {
				$this-&gt;debug(1, &quot;Security block: The file specified occurs outside the document root.&quot;);
				//allow search to continue
			}
		}
		//Check absolute paths and then verify the real path is under doc root
		$absolute = realpath(&#039;/&#039; . $src);
		if($absolute &amp;&amp; file_exists($absolute)){ //realpath does file_exists check, so can probably skip the exists check here
			$this-&gt;debug(3, &quot;Found absolute path: $absolute&quot;);
			if(! $this-&gt;docRoot){ $this-&gt;sanityFail(&quot;docRoot not set when checking absolute path.&quot;); }
			if(strpos($absolute, $realDocRoot) === 0){
				return $absolute;
			} else {
				$this-&gt;debug(1, &quot;Security block: The file specified occurs outside the document root.&quot;);
				//and continue search
			}
		}
		$base = $this-&gt;docRoot;
		foreach (explode(&#039;/&#039;, str_replace($this-&gt;docRoot, &#039;&#039;, $_SERVER[&#039;SCRIPT_FILENAME&#039;])) as $sub){
			$base .= $sub . &#039;/&#039;;
			$this-&gt;debug(3, &quot;Trying file as: &quot; . $base . $src);
			if(file_exists($base . $src)){
				$this-&gt;debug(3, &quot;Found file as: &quot; . $base . $src);
				$real = realpath($base . $src);
				if(strpos($real, $realDocRoot) === 0){
					return $real;
				} else {
					$this-&gt;debug(1, &quot;Security block: The file specified occurs outside the document root.&quot;);
					//And continue search
				}
			}
		}
		return false;
	}
	protected function toDelete($name){
		$this-&gt;debug(3, &quot;Scheduling file $name to delete on destruct.&quot;);
		$this-&gt;toDeletes[] = $name;
	}
	protected function serveWebshot(){
		$this-&gt;debug(3, &quot;Starting serveWebshot&quot;);
		$instr = &quot;Please follow the instructions at http://code.google.com/p/timthumb/ to set your server up for taking website screenshots.&quot;;
		if(! is_file(WEBSHOT_CUTYCAPT)){
			return $this-&gt;error(&quot;CutyCapt is not installed. $instr&quot;);
		}
		if(! is_file(WEBSHOT_XVFB)){
			return $this-&gt;Error(&quot;Xvfb is not installed. $instr&quot;);
		}
		$cuty = WEBSHOT_CUTYCAPT;
		$xv = WEBSHOT_XVFB;
		$screenX = WEBSHOT_SCREEN_X;
		$screenY = WEBSHOT_SCREEN_Y;
		$colDepth = WEBSHOT_COLOR_DEPTH;
		$format = WEBSHOT_IMAGE_FORMAT;
		$timeout = WEBSHOT_TIMEOUT * 1000;
		$ua = WEBSHOT_USER_AGENT;
		$jsOn = WEBSHOT_JAVASCRIPT_ON ? &#039;on&#039; : &#039;off&#039;;
		$javaOn = WEBSHOT_JAVA_ON ? &#039;on&#039; : &#039;off&#039;;
		$pluginsOn = WEBSHOT_PLUGINS_ON ? &#039;on&#039; : &#039;off&#039;;
		$proxy = WEBSHOT_PROXY ? &#039; --http-proxy=&#039; . WEBSHOT_PROXY : &#039;&#039;;
		$tempfile = tempnam($this-&gt;cacheDirectory, &#039;timthumb_webshot&#039;);
		$url = $this-&gt;src;
		if(! preg_match(&#039;/^https?:\/\/[a-zA-Z0-9\.\-]+/i&#039;, $url)){
			return $this-&gt;error(&quot;Invalid URL supplied.&quot;);
		}
		$url = preg_replace(&#039;/[^A-Za-z0-9\-\.\_\~:\/\?\#\[\]\@\!\$\&amp;\&#039;\(\)\*\+\,\;\=]+/&#039;, &#039;&#039;, $url); //RFC 3986
		//Very important we don&#039;t allow injection of shell commands here. URL is between quotes and we are only allowing through chars allowed by a the RFC
		// which AFAIKT can&#039;t be used for shell injection.
		if(WEBSHOT_XVFB_RUNNING){
			putenv(&#039;DISPLAY=:100.0&#039;);
			$command = &quot;$cuty $proxy --max-wait=$timeout --user-agent=\&quot;$ua\&quot; --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\&quot;$url\&quot; --out-format=$format --out=$tempfile&quot;;
		} else {
			$command = &quot;$xv --server-args=\&quot;-screen 0, {$screenX}x{$screenY}x{$colDepth}\&quot; $cuty $proxy --max-wait=$timeout --user-agent=\&quot;$ua\&quot; --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\&quot;$url\&quot; --out-format=$format --out=$tempfile&quot;;
		}
		$this-&gt;debug(3, &quot;Executing command: $command&quot;);
		$out = `$command`;
		$this-&gt;debug(3, &quot;Received output: $out&quot;);
		if(! is_file($tempfile)){
			$this-&gt;set404();
			return $this-&gt;error(&quot;The command to create a thumbnail failed.&quot;);
		}
		$this-&gt;cropTop = true;
		if($this-&gt;processImageAndWriteToCache($tempfile)){
			$this-&gt;debug(3, &quot;Image processed succesfully. Serving from cache&quot;);
			return $this-&gt;serveCacheFile();
		} else {
			return false;
		}
	}
	protected function serveExternalImage(){
		if(! preg_match(&#039;/^https?:\/\/[a-zA-Z0-9\-\.]+/i&#039;, $this-&gt;src)){
			$this-&gt;error(&quot;Invalid URL supplied.&quot;);
			return false;
		}
		$tempfile = tempnam($this-&gt;cacheDirectory, &#039;timthumb&#039;);
		$this-&gt;debug(3, &quot;Fetching external image into temporary file $tempfile&quot;);
		$this-&gt;toDelete($tempfile);
		#fetch file here
		if(! $this-&gt;getURL($this-&gt;src, $tempfile)){
			@unlink($this-&gt;cachefile);
			touch($this-&gt;cachefile);
			$this-&gt;debug(3, &quot;Error fetching URL: &quot; . $this-&gt;lastURLError);
			$this-&gt;error(&quot;Error reading the URL you specified from remote host.&quot; . $this-&gt;lastURLError);
			return false;
		}

		$mimeType = $this-&gt;getMimeType($tempfile);
		if(! preg_match(&quot;/^image\/(?:jpg|jpeg|gif|png)$/i&quot;, $mimeType)){
			$this-&gt;debug(3, &quot;Remote file has invalid mime type: $mimeType&quot;);
			@unlink($this-&gt;cachefile);
			touch($this-&gt;cachefile);
			$this-&gt;error(&quot;The remote file is not a valid image.&quot;);
			return false;
		}
		if($this-&gt;processImageAndWriteToCache($tempfile)){
			$this-&gt;debug(3, &quot;Image processed succesfully. Serving from cache&quot;);
			return $this-&gt;serveCacheFile();
		} else {
			return false;
		}
	}
	public static function curlWrite($h, $d){
		fwrite(self::$curlFH, $d);
		self::$curlDataWritten += strlen($d);
		if(self::$curlDataWritten &gt; MAX_FILE_SIZE){
			return 0;
		} else {
			return strlen($d);
		}
	}
	protected function serveCacheFile(){
		$this-&gt;debug(3, &quot;Serving {$this-&gt;cachefile}&quot;);
		if(! is_file($this-&gt;cachefile)){
			$this-&gt;error(&quot;serveCacheFile called in timthumb but we couldn&#039;t find the cached file.&quot;);
			return false;
		}
		$fp = fopen($this-&gt;cachefile, &#039;rb&#039;);
		if(! $fp){ return $this-&gt;error(&quot;Could not open cachefile.&quot;); }
		fseek($fp, strlen($this-&gt;filePrependSecurityBlock), SEEK_SET);
		$imgType = fread($fp, 3);
		fseek($fp, 3, SEEK_CUR);
		if(ftell($fp) != strlen($this-&gt;filePrependSecurityBlock) + 6){
			@unlink($this-&gt;cachefile);
			return $this-&gt;error(&quot;The cached image file seems to be corrupt.&quot;);
		}
		$imageDataSize = filesize($this-&gt;cachefile) - (strlen($this-&gt;filePrependSecurityBlock) + 6);
		$this-&gt;sendImageHeaders($imgType, $imageDataSize);
		$bytesSent = @fpassthru($fp);
		fclose($fp);
		if($bytesSent &gt; 0){
			return true;
		}
		$content = file_get_contents ($this-&gt;cachefile);
		if ($content != FALSE) {
			$content = substr($content, strlen($this-&gt;filePrependSecurityBlock) + 6);
			echo $content;
			$this-&gt;debug(3, &quot;Served using file_get_contents and echo&quot;);
			return true;
		} else {
			$this-&gt;error(&quot;Cache file could not be loaded.&quot;);
			return false;
		}
	}
	protected function sendImageHeaders($mimeType, $dataSize){
		if(! preg_match(&#039;/^image\//i&#039;, $mimeType)){
			$mimeType = &#039;image/&#039; . $mimeType;
		}
		if(strtolower($mimeType) == &#039;image/jpg&#039;){
			$mimeType = &#039;image/jpeg&#039;;
		}
		$gmdate_expires = gmdate (&#039;D, d M Y H:i:s&#039;, strtotime (&#039;now +10 days&#039;)) . &#039; GMT&#039;;
		$gmdate_modified = gmdate (&#039;D, d M Y H:i:s&#039;) . &#039; GMT&#039;;
		// send content headers then display image
		header (&#039;Content-Type: &#039; . $mimeType);
		header (&#039;Accept-Ranges: none&#039;); //Changed this because we don&#039;t accept range requests
		header (&#039;Last-Modified: &#039; . $gmdate_modified);
		header (&#039;Content-Length: &#039; . $dataSize);
		if(BROWSER_CACHE_DISABLE){
			$this-&gt;debug(3, &quot;Browser cache is disabled so setting non-caching headers.&quot;);
			header(&#039;Cache-Control: no-store, no-cache, must-revalidate, max-age=0&#039;);
			header(&quot;Pragma: no-cache&quot;);
			header(&#039;Expires: &#039; . gmdate (&#039;D, d M Y H:i:s&#039;, time()));
		} else {
			$this-&gt;debug(3, &quot;Browser caching is enabled&quot;);
			header(&#039;Cache-Control: max-age=&#039; . BROWSER_CACHE_MAX_AGE . &#039;, must-revalidate&#039;);
			header(&#039;Expires: &#039; . $gmdate_expires);
		}
		return true;
	}
	protected function securityChecks(){
	}
	protected function param($property, $default = &#039;&#039;){
		if (isset ($_GET[$property])) {
			return $_GET[$property];
		} else {
			return $default;
		}
	}
	protected function openImage($mimeType, $src){
		switch ($mimeType) {
			case &#039;image/jpg&#039;: //This isn&#039;t a valid mime type so we should probably remove it
			case &#039;image/jpeg&#039;:
				$image = imagecreatefromjpeg ($src);
				break;

			case &#039;image/png&#039;:
				$image = imagecreatefrompng ($src);
				break;

			case &#039;image/gif&#039;:
				$image = imagecreatefromgif ($src);
				break;
		}

		return $image;
	}
	protected function getIP(){
		$rem = @$_SERVER[&quot;REMOTE_ADDR&quot;];
		$ff = @$_SERVER[&quot;HTTP_X_FORWARDED_FOR&quot;];
		$ci = @$_SERVER[&quot;HTTP_CLIENT_IP&quot;];
		if(preg_match(&#039;/^(?:192\.168|172\.16|10\.|127\.)/&#039;, $rem)){
			if($ff){ return $ff; }
			if($ci){ return $ci; }
			return $rem;
		} else {
			if($rem){ return $rem; }
			if($ff){ return $ff; }
			if($ci){ return $ci; }
			return &quot;UNKNOWN&quot;;
		}
	}
	protected function debug($level, $msg){
		if(DEBUG_ON &amp;&amp; $level &lt;= DEBUG_LEVEL){
			$execTime = sprintf(&#039;%.6f&#039;, microtime(true) - $this-&gt;startTime);
			$tick = sprintf(&#039;%.6f&#039;, 0);
			if($this-&gt;lastBenchTime &gt; 0){
				$tick = sprintf(&#039;%.6f&#039;, microtime(true) - $this-&gt;lastBenchTime);
			}
			$this-&gt;lastBenchTime = microtime(true);
			error_log(&quot;TimThumb Debug line &quot; . __LINE__ . &quot; [$execTime : $tick]: $msg&quot;);
		}
	}
	protected function sanityFail($msg){
		return $this-&gt;error(&quot;There is a problem in the timthumb code. Message: Please report this error at &lt;a href=&#039;http://code.google.com/p/timthumb/issues/list&#039;&gt;timthumb&#039;s bug tracking page&lt;/a&gt;: $msg&quot;);
	}
	protected function getMimeType($file){
		$info = getimagesize($file);
		if(is_array($info) &amp;&amp; $info[&#039;mime&#039;]){
			return $info[&#039;mime&#039;];
		}
		return &#039;&#039;;
	}
	protected function setMemoryLimit(){
		$inimem = ini_get(&#039;memory_limit&#039;);
		$inibytes = timthumb::returnBytes($inimem);
		$ourbytes = timthumb::returnBytes(MEMORY_LIMIT);
		if($inibytes &lt; $ourbytes){
			ini_set (&#039;memory_limit&#039;, MEMORY_LIMIT);
			$this-&gt;debug(3, &quot;Increased memory from $inimem to &quot; . MEMORY_LIMIT);
		} else {
			$this-&gt;debug(3, &quot;Not adjusting memory size because the current setting is &quot; . $inimem . &quot; and our size of &quot; . MEMORY_LIMIT . &quot; is smaller.&quot;);
		}
	}
	protected static function returnBytes($size_str){
		switch (substr ($size_str, -1))
		{
			case &#039;M&#039;: case &#039;m&#039;: return (int)$size_str * 1048576;
			case &#039;K&#039;: case &#039;k&#039;: return (int)$size_str * 1024;
			case &#039;G&#039;: case &#039;g&#039;: return (int)$size_str * 1073741824;
			default: return $size_str;
		}
	}
	protected function getURL($url, $tempfile){
		$this-&gt;lastURLError = false;
		$url = preg_replace(&#039;/ /&#039;, &#039;%20&#039;, $url);
		if(function_exists(&#039;curl_init&#039;)){
			$this-&gt;debug(3, &quot;Curl is installed so using it to fetch URL.&quot;);
			self::$curlFH = fopen($tempfile, &#039;w&#039;);
			if(! self::$curlFH){
				$this-&gt;error(&quot;Could not open $tempfile for writing.&quot;);
				return false;
			}
			self::$curlDataWritten = 0;
			$this-&gt;debug(3, &quot;Fetching url with curl: $url&quot;);
			$curl = curl_init($url);
			curl_setopt ($curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
			curl_setopt ($curl, CURLOPT_USERAGENT, &quot;Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30&quot;);
			curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
			curl_setopt ($curl, CURLOPT_HEADER, 0);
			curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
			curl_setopt ($curl, CURLOPT_WRITEFUNCTION, &#039;timthumb::curlWrite&#039;);
			@curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
			@curl_setopt ($curl, CURLOPT_MAXREDIRS, 10);

			$curlResult = curl_exec($curl);
			fclose(self::$curlFH);
			$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
			if($httpStatus == 404){
				$this-&gt;set404();
			}
			if($curlResult){
				curl_close($curl);
				return true;
			} else {
				$this-&gt;lastURLError = curl_error($curl);
				curl_close($curl);
				return false;
			}
		} else {
			$img = @file_get_contents ($url);
			if($img === false){
				$err = error_get_last();
				if(is_array($err) &amp;&amp; $err[&#039;message&#039;]){
					$this-&gt;lastURLError = $err[&#039;message&#039;];
				} else {
					$this-&gt;lastURLError = $err;
				}
				if(preg_match(&#039;/404/&#039;, $this-&gt;lastURLError)){
					$this-&gt;set404();
				}

				return false;
			}
			if(! file_put_contents($tempfile, $img)){
				$this-&gt;error(&quot;Could not write to $tempfile.&quot;);
				return false;
			}
			return true;
		}

	}
	protected function serveImg($file){
		$s = getimagesize($file);
		if(! ($s &amp;&amp; $s[&#039;mime&#039;])){
			return false;
		}
		header (&#039;Content-Type: &#039; . $s[&#039;mime&#039;]);
		header (&#039;Content-Length: &#039; . filesize($file) );
		header (&#039;Cache-Control: no-store, no-cache, must-revalidate, max-age=0&#039;);
		header (&quot;Pragma: no-cache&quot;);
		$bytes = @readfile($file);
		if($bytes &gt; 0){
			return true;
		}
		$content = @file_get_contents ($file);
		if ($content != FALSE){
			echo $content;
			return true;
		}
		return false;

	}
	protected function set404(){
		$this-&gt;is404 = true;
	}
	protected function is404(){
		return $this-&gt;is404;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/954.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discuz X2头像上传判断解析</title>
		<link>http://www.islandcn.com/post/951.html</link>
		<comments>http://www.islandcn.com/post/951.html#comments</comments>
		<pubDate>Sun, 25 Sep 2011 11:44:47 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[DZ]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[头像上传]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=951</guid>
		<description><![CDATA[首先总结下前一次遇到的一个问题,就是设置了强制上传头像才可以发贴,但是实际上传完头像依然提示需要上传头像
解决方法:打开后台 -> 站长 -> Ucenter设置 ->在"UCenter IP 地址:"这栏写实际IP或者不写即可,默认的是"127.0.0.1"
这里要注意的是 别直接打开后台菜单的"Ucenter",而是左边的"站长"]]></description>
			<content:encoded><![CDATA[<p>首先总结下前一次遇到的一个问题,就是设置了强制上传头像才可以发贴,但是实际上传完头像依然提示需要上传头像<br />
解决方法:打开后台 -> 站长 -> Ucenter设置 ->在&#8221;UCenter IP 地址:&#8221;这栏写实际IP或者不写即可,默认的是&#8221;127.0.0.1&#8243;<br />
这里要注意的是 别直接打开后台菜单的&#8221;Ucenter&#8221;,而是左边的&#8221;站长&#8221;</p>
<p>补充下X2的头像在数据库中的判断,表 &#8220;bbs_common_member&#8221; 字段 &#8216;avatarstatus&#8221;,默认值是0,如果上传完它会变成1<br />
如果你想批量让会员变成上传过头像的状态只需要运行下面的SQL语句.</p>
<pre name="code" class="sql">

UPDATE `bbs_common_member` SET avatarstatus=1 //后面也可以加条件等等
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/951.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vb.net 2008 添加 drivelistbox,dirlistbox和filelistbox的办法</title>
		<link>http://www.islandcn.com/post/949.html</link>
		<comments>http://www.islandcn.com/post/949.html#comments</comments>
		<pubDate>Tue, 02 Aug 2011 10:25:18 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=949</guid>
		<description><![CDATA[这三个控件在.NET的工具箱里面默认是没有的,需要手工添加
右击工具箱中的任意单元 点击选择项
然后在.NET Framework组件中找到对应的选项在前面勾上即可.
]]></description>
			<content:encoded><![CDATA[<p>这三个控件在.NET的工具箱里面默认是没有的,需要手工添加<br />
右击工具箱中的任意单元 点击选择项<br />
然后在.NET Framework组件中找到对应的选项在前面勾上即可.<br />
附三者的关系代码,三者控件名分别为 drive1 dir1,实现代码:</p>
<pre name="code" class="vb">

    Private Sub Drive1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Drive1.SelectedIndexChanged
        Dir1.Path = Drive1.Drive
    End Sub

    Private Sub Dir1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dir1.SelectedIndexChanged
        File1.Path = Dir1.Path
    End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/949.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为什么drupal安装只能选择SQLite数据库?</title>
		<link>http://www.islandcn.com/post/945.html</link>
		<comments>http://www.islandcn.com/post/945.html#comments</comments>
		<pubDate>Fri, 22 Jul 2011 04:34:06 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=945</guid>
		<description><![CDATA[由于drupal使用的是pdo连接数据库，如果没有开启pdo的话，在安装drupal时，不会出现mysql供选择。]]></description>
			<content:encoded><![CDATA[<p>由于drupal使用的是pdo连接数据库，如果没有开启pdo的话，在安装drupal时，不会出现mysql供选择。<br />
解决方法：<br />
打开php.ini<br />
extension=php_pdo.dll<br />
extension=php_pdo_mysql.dll<br />
将前面的注释取消掉以加载pdo<br />
保存后重启服务即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/945.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>php_mcrypt.dll无法加载解决方法</title>
		<link>http://www.islandcn.com/post/942.html</link>
		<comments>http://www.islandcn.com/post/942.html#comments</comments>
		<pubDate>Tue, 05 Jul 2011 09:19:22 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mcrypt.dll]]></category>
		<category><![CDATA[加载]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=942</guid>
		<description><![CDATA[php_mcrypt.dll无法加载解决方法]]></description>
			<content:encoded><![CDATA[<p>今天用AppServ搭建了个PHP的环境，无论如何都加载不了php_mcrypt.dll<br />
晚上流传的集中解决办法：<br />
1.php.ini里面查找extension=php_mcrypt.dll,去掉前面的分号&#8221;;&#8221; ,重启apache.无效(注意:在AppServ中php.ini在dinwos目录下)</p>
<p>2.复制php目录下的libmcrypt.dll到windows/system32目录下,重启IIS ,无效</p>
<p>3.自己总结的办法:试着尝试了一下,将libmcrypt.dll复制到apache的bin目录下,生效</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/942.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache&#8221;You don&#8217;t have permission to access on this server.&#8221;的解决办法</title>
		<link>http://www.islandcn.com/post/934.html</link>
		<comments>http://www.islandcn.com/post/934.html#comments</comments>
		<pubDate>Mon, 20 Jun 2011 16:16:51 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[解决]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=934</guid>
		<description><![CDATA[Apache"You don't have permission to access on this server."的解决办法]]></description>
			<content:encoded><![CDATA[<p>打开配置文件httpd.conf,找到下面这行代码</p>
<blockquote><p>
<Directory /><br />
    Options FollowSymLinks<br />
    AllowOverride None<br />
    Order deny,allow<br />
    deny from all<br />
    Satisfy all<br />
</Directory>
</p></blockquote>
<p>将&#8221;<strong>deny from all</strong>&#8220;修改为&#8221;<strong>allow from all</strong>&#8220;,变成以下代码</p>
<blockquote><p>
<Directory /><br />
    Options FollowSymLinks<br />
    AllowOverride None<br />
    Order deny,allow<br />
    allow from all<br />
    Satisfy all<br />
</Directory>
</p></blockquote>
<p>保存后重启apache即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/934.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress国外模板不显示中文字符的解决方法</title>
		<link>http://www.islandcn.com/post/931.html</link>
		<comments>http://www.islandcn.com/post/931.html#comments</comments>
		<pubDate>Tue, 07 Jun 2011 08:29:06 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=931</guid>
		<description><![CDATA[通常的这一冲突总是爆发于 Web 页面的设计者（Designer）和开发者（Coder）之间。在很多场合下，Web 页面的设计者都会倾向于在他们的页面设计稿中，为文字附加使用一些“特殊”的字体和特效，以此来展示他们卓越的设计能力。比如设计一个公司的Logo，图片上的一些特殊字体是从ps字库中调出的，当然这些文字在图片上显示肯定是没有问题的]]></description>
			<content:encoded><![CDATA[<p>WordPress的国外主题的确非常多 毕竟是来是全世界的WordPress设计师和开发者一起参与的<br />
所以别把资源局限在国内的中文主题上.<br />
今天找了个主题,在使用wordpress的一个主题中发现个问题:所有中文字符都不显示了,剩下的只有英文和数字.<br />
于是查了下相关资料整理如下:<br />
如有发现这种情况的主题大多都是用<strong><a href="http://cufon.shoqolate.com/generate/" target="_blank">Cufon</a></strong>这种网页文字渲染特效使字体达到更好看的效果.</p>
<blockquote><p>
<strong>首先解释下什么是 Cufon</strong>：<br />
 Cufon 是一个用来替代 sIFR 框架， 实现在网页中对文字字体进行渲染功能的纯 JavaScript 开源类库(cufon-yui.js)。<br />
 为什么要使用 Cufon：<br />
 在web开发中，经常面对的一种“冲突”，即“字体（Font Family）冲突”。<br />
 通常的这一冲突总是爆发于 Web 页面的设计者（Designer）和开发者（Coder）之间。在很多场合下，Web 页面的设计者都会倾向于在他们的页面设计稿中，为文字附加使用一些“特殊”的字体和特效，以此来展示他们卓越的设计能力。比如设计一个公司的Logo，图片上的一些特殊字体是从ps字库中调出的，当然这些文字在图片上显示肯定是没有问题的，但是如果要在网页中用文本来显示这些效果，就是会让开发人员抓狂了，因为浏览器并不支持所有的字体，这种情况Cufon就会大显身手了。
</p></blockquote>
<p>由此我们可以看出原来是Cufon在捣乱,因为它不支持中文字体的缘故所以中文字符都无法显示.</p>
<p>那么知道核心问题我们就知道该如何解决了,只要找到对应的目录文件和引用的地方给它删除了就可以了.<br />
一般引用文件基本都是在header.php中,直接用编辑器的查找功能查找关键词&#8221;Cufon&#8221;即可. 找到引用的哪行然后删除即可.当然为了文件的整洁,多余的文件也可以删除,一般都在js目录中.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/931.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>网站关闭12天百度权重恢复全过程</title>
		<link>http://www.islandcn.com/post/928.html</link>
		<comments>http://www.islandcn.com/post/928.html#comments</comments>
		<pubDate>Mon, 30 May 2011 16:49:00 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[百度]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=928</guid>
		<description><![CDATA[本站记录权重恢复过程 记录下自5月13日 站点被关闭之后的一些情况 5月13日 站点关闭进入备案阶段,独立IP,用IP依然可以访问 5月26日 站点恢复正常 百度收录了七百多页的站点 收录还剩几十页. 用site命令查看已经不见首页了. 站点依然正常更新. 5月30日 站点收录多出几页 用site命令查看已经看到首页,快照停留在5月11日 持续查看更新中.]]></description>
			<content:encoded><![CDATA[<p>本站记录权重恢复过程<br />
记录下自5月13日 站点被关闭之后的一些情况<br />
5月13日 站点关闭进入备案阶段,独立IP,用IP依然可以访问</p>
<p>5月26日 站点恢复正常<br />
百度收录了七百多页的站点 收录还剩几十页.<br />
用site命令查看已经不见首页了.<br />
站点依然正常更新.</p>
<p>5月30日 站点收录多出几页<br />
用site命令查看已经看到首页,快照停留在5月11日</p>
<p>持续查看更新中.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/928.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IETester崩溃的解决方法</title>
		<link>http://www.islandcn.com/post/925.html</link>
		<comments>http://www.islandcn.com/post/925.html#comments</comments>
		<pubDate>Thu, 26 May 2011 13:24:44 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IETester]]></category>
		<category><![CDATA[崩溃]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=925</guid>
		<description><![CDATA[用IETester测试IE6老崩溃的解决办法很简单
 解决办法：
 打开IETESTER——选项——Internet选项——连接——局域网设置——自动检测设置前面的勾去掉，然后重启IeTester即可（也可以不重启）
]]></description>
			<content:encoded><![CDATA[<p>用IETester测试IE6老崩溃的解决办法很简单<br />
 解决办法：<br />
 打开IETESTER——选项——Internet选项——连接——局域网设置——自动检测设置前面的勾去掉，然后重启IeTester即可（也可以不重启）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/925.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sdcms 1.3 分类生成出错:请正确使用列表模板 的解决方法</title>
		<link>http://www.islandcn.com/post/919.html</link>
		<comments>http://www.islandcn.com/post/919.html#comments</comments>
		<pubDate>Fri, 22 Apr 2011 11:18:43 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[SDCMS]]></category>
		<category><![CDATA[分类]]></category>
		<category><![CDATA[标签]]></category>
		<category><![CDATA[生成]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=919</guid>
		<description><![CDATA[sdcms 的确是一款不错的轻量级的asp cms,但是这次升级标签调用产生些变化 如果分类生成出现&#8221;请正确使用列表模板&#8221;的提示的时候请注意修改数据列表调用标签 {@sdcms:page table=&#8221;View_info&#8221; where=&#8221;classid in({sdcms:class_allclassid}) and ispass=1&#8243; order=&#8221;Ontop desc,id desc&#8221;} &#8216;同样这里调用的变量前面也得有 @ 譬如 {@title} {@link} {@pic} {/@sdcms:page} 注意 这里的 @ 相当于以前的二维循环标签,加上@之后再生成即可.]]></description>
			<content:encoded><![CDATA[<p>sdcms 的确是一款不错的轻量级的asp cms,但是这次升级标签调用产生些变化</p>
<p>如果分类生成出现&#8221;请正确使用列表模板&#8221;的提示的时候请注意修改数据列表调用标签</p>
<p> {<strong>@</strong>sdcms:page table=&#8221;View_info&#8221; where=&#8221;classid in({sdcms:class_allclassid}) and ispass=1&#8243; order=&#8221;Ontop desc,id desc&#8221;}<br />
&#8216;同样这里调用的变量前面也得有 @<br />
譬如 {@title} {@link} {@pic}<br />
{/<strong>@</strong>sdcms:page}</p>
<p>注意 这里的 @ 相当于以前的二维循环标签,加上@之后再生成即可.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/919.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sdcms 1.3使用技巧及注意事项</title>
		<link>http://www.islandcn.com/post/910.html</link>
		<comments>http://www.islandcn.com/post/910.html#comments</comments>
		<pubDate>Fri, 22 Apr 2011 06:01:48 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[SDCMS]]></category>
		<category><![CDATA[标签]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[调用]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=910</guid>
		<description><![CDATA[1.1.3模板应用及相关问题问题 1.3模板如何应用? 1.首先将模板传至skins目录中（前提模板必须是适用1.3的） 2.此时进网站后台的“界面管理”的“网站模板管理”中可以看到刚才上传的模板，此时可以进行模板应用和对模板文件进行管理 1.3模板注意事项： 1.模板根目录下必须有skins.asp和Skin.xml 2.skins.asp中的模板名称请记得定义变量 2.skins.asp和Skin.xml写法请参照默认模板的配置方法 误使用了低版本的模板发生错误该如何处理？ 1.打开Inc目录下的conn.asp，找到此行代码：Option Explicit 将之改为： &#8216;Option Explicit 意思：将此行注释掉，此时到后台重新选择系统模板的模板，然后撤销刚才的操作即可 站外调用的标签写法(1.3版本) {sdcms:loop table=&#34;view_info&#34; and ispass=1&#34;} &#60;a href=&#34;{sdcms:weburl}{link}&#34;&#62;{title}&#60;/a&#62;&#60;br&#62; {/sdcms:loop} 说明：主要是在{link}前加上：{sdcms:weburl}，其他的全局系统标签均可使用 调用指定栏目信息的方法(适合1.3) 1.调用某类别下信息的方法（含子类） {sdcms:loop table=&#34;view_info&#34; where=&#34;classid in({sdcms:allclassid(大类编号)}) and ispass=1&#34;} &#60;a href=&#34;{link}&#34;&#62;{title}&#60;/a&#62;&#60;br&#62; {/sdcms:loop} 2.同时调用多个大类下信息的方法（含子类） {sdcms:loop table=&#34;view_info&#34; where=&#34;classid in({sdcms:allclassid(大类编号1)},{sdcms:allclassid(大类编号2)},{sdcms:allclassid(大类编号3)}) and ispass=1&#34;} &#60;a href=&#34;{link}&#34;&#62;{title}&#60;/a&#62;&#60;br&#62; {/sdcms:loop}]]></description>
			<content:encoded><![CDATA[<p><strong>1.1.3模板应用及相关问题问题</strong></p>
<blockquote><p>
1.3模板如何应用?<br />
1.首先将模板传至skins目录中（前提模板必须是适用1.3的）<br />
2.此时进网站后台的“界面管理”的“网站模板管理”中可以看到刚才上传的模板，此时可以进行模板应用和对模板文件进行管理</p>
<p>1.3模板注意事项：<br />
1.模板根目录下必须有skins.asp和Skin.xml<br />
2.skins.asp中的模板名称请记得定义变量<br />
2.skins.asp和Skin.xml写法请参照默认模板的配置方法</p>
<p>误使用了低版本的模板发生错误该如何处理？<br />
1.打开Inc目录下的conn.asp，找到此行代码：Option Explicit<br />
将之改为：<br />
&#8216;Option Explicit<br />
意思：将此行注释掉，此时到后台重新选择系统模板的模板，然后撤销刚才的操作即可 </p></blockquote>
<p><strong>站外调用的标签写法(1.3版本)</strong></p>
<blockquote>
<pre name="code" class="html">
{sdcms:loop table=&quot;view_info&quot; and ispass=1&quot;}
&lt;a href=&quot;{sdcms:weburl}{link}&quot;&gt;{title}&lt;/a&gt;&lt;br&gt;
{/sdcms:loop}
</pre>
<p>说明：主要是在{link}前加上：{sdcms:weburl}，其他的全局系统标签均可使用
</p></blockquote>
<p><strong>调用指定栏目信息的方法(适合1.3)</strong></p>
<blockquote><p>
1.调用某类别下信息的方法（含子类）</p>
<pre name="code" class="html">
{sdcms:loop table=&quot;view_info&quot; where=&quot;classid in({sdcms:allclassid(大类编号)}) and ispass=1&quot;}
&lt;a href=&quot;{link}&quot;&gt;{title}&lt;/a&gt;&lt;br&gt;
{/sdcms:loop}
</pre>
<p>2.同时调用多个大类下信息的方法（含子类）</p>
<pre name="code" class="html">
{sdcms:loop table=&quot;view_info&quot; where=&quot;classid in({sdcms:allclassid(大类编号1)},{sdcms:allclassid(大类编号2)},{sdcms:allclassid(大类编号3)}) and ispass=1&quot;}
&lt;a href=&quot;{link}&quot;&gt;{title}&lt;/a&gt;&lt;br&gt;
{/sdcms:loop}
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/910.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>js实现改变iframe的元素值</title>
		<link>http://www.islandcn.com/post/905.html</link>
		<comments>http://www.islandcn.com/post/905.html#comments</comments>
		<pubDate>Wed, 30 Mar 2011 06:41:12 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[html/xhtml]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[传值]]></category>
		<category><![CDATA[框架]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=905</guid>
		<description><![CDATA[js实现改变iframe的元素值]]></description>
			<content:encoded><![CDATA[<p>第一种情况: 改变父框架的元素值<br />
假设有A.HTML,里面有iFrame嵌套了B.HTML<br />
那么现在在B.HTML中执行改变A.HTML元素的值<br />
这是今天在用PHP写到图片上传模块所遇到的问题了,完整上传模块的实现会在下文中详解,这里主要记录下JS实现的核心代码</p>
<pre name="code" class="javascript">

&lt;script language=&quot;javascript&quot;&gt;
function show(){
//改变父窗体中id为pic的内容
//如果是div可以用parent.document.getElementById(&#039;divtxt&#039;).innerText=xxx
parent.document.getElementById(&quot;pic&quot;).value = &quot;http://www.islandcn.com&quot;;
}
&lt;/script&gt;
</pre>
<p>第二种情况 改变子框架页面内元素的值</p>
<pre name="code" class="javascript">

&lt;script language=&quot;javascript&quot;&gt;
function show(){
//改变名为iframe1的iframe中的id为pic的text的内容
window.frames[&quot;iframe1&quot;].document.getElementById(&quot;pic&quot;).value = &quot;http://www.islandcn.com&quot;;
}
&lt;/script&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/905.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>正规表达式在线测试练习源码</title>
		<link>http://www.islandcn.com/post/902.html</link>
		<comments>http://www.islandcn.com/post/902.html#comments</comments>
		<pubDate>Sat, 26 Mar 2011 13:17:24 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[正规表达式]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=902</guid>
		<description><![CDATA[正规表达式在线测试练习源码]]></description>
			<content:encoded><![CDATA[<p>在线测试地址:<a href="http://www.islandcn.com/regex.html">http://www.islandcn.com/regex.html</a><br />
下面是程序源码: </p>
<pre name="code" class="html">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;
&lt;title&gt;正则表达式在线测试练习&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
body,td,th {
font-size: 14px;
}
span{
color:#FF6600;
}
textarea{
width:90%;
}
--&gt;
&lt;/style&gt;&lt;/head&gt; 

&lt;body&gt;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;2&quot; bgcolor=&quot;#CCCCCC&quot;&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#EBEBEB&quot;&gt;&lt;strong&gt;正则表达式匹配字符：&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;textarea name=&quot;objPattern&quot; onpropertychange=&quot;javascript:eval(this.id + &#039;Info.innerText=&#039; + this.value.length);&quot; cols=&quot;90%&quot; rows=&quot;2&quot; wrap=&quot;off&quot; id=&quot;objPattern&quot;&gt;src=([^ &lt;&gt;]+\.{1}(gif|jpg|png|bmp|swf)(&quot;|&#039;)?)&lt;/textarea&gt;
    &lt;span id=&quot;objPatternInfo&quot;&gt;0&lt;/span&gt;个字符&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#EBEBEB&quot;&gt;&lt;strong&gt;预进行处置的原始字符：&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;textarea name=&quot;objRawString&quot; onpropertychange=&quot;javascript:eval(this.id + &#039;Info.innerText=&#039; + this.value.length);&quot; cols=&quot;90%&quot; rows=&quot;6&quot; wrap=&quot;off&quot; id=&quot;objRawString&quot;&gt;&lt;/textarea&gt;
    &lt;span id=&quot;objRawStringInfo&quot;&gt;0&lt;/span&gt;个字符&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#EBEBEB&quot;&gt;&lt;strong&gt;处置成果（匹配原始值）：&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;textarea name=&quot;objMatchResult&quot; onpropertychange=&quot;javascript:eval(this.id + &#039;Info.innerText=&#039; + this.value.length);&quot; cols=&quot;90%&quot; rows=&quot;4&quot; wrap=&quot;off&quot; id=&quot;objMatchResult&quot;&gt;&lt;/textarea&gt;
    &lt;span id=&quot;objMatchResultInfo&quot;&gt;0&lt;/span&gt;个字符&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#EBEBEB&quot;&gt;&lt;strong&gt;处置结果（匹配子项值）：&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;textarea name=&quot;objSubMatchResult&quot; onpropertychange=&quot;javascript:eval(this.id + &#039;Info.innerText=&#039; + this.value.length);&quot; cols=&quot;90%&quot; rows=&quot;4&quot; wrap=&quot;off&quot; id=&quot;objSubMatchResult&quot;&gt;&lt;/textarea&gt;
    &lt;span id=&quot;objSubMatchResultInfo&quot;&gt;0&lt;/span&gt;个字符&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#EBEBEB&quot;&gt;
&lt;input name=&quot;objIgnoreCase&quot; type=&quot;checkbox&quot; id=&quot;objIgnoreCase&quot; value=&quot;Yes&quot; checked=&quot;checked&quot; /&gt;
    &lt;label for=&quot;objIgnoreCase&quot;&gt;疏忽大小写&lt;/label&gt;&amp;nbsp;&amp;nbsp;
&lt;input name=&quot;objFirstIndex&quot; type=&quot;checkbox&quot; id=&quot;objFirstIndex&quot; value=&quot;Yes&quot; /&gt;
    &lt;label for=&quot;objFirstIndex&quot;&gt;结果中显示字符串地位&lt;/label&gt;&amp;nbsp;&amp;nbsp;
&lt;input name=&quot;objLength&quot; type=&quot;checkbox&quot; id=&quot;objLength&quot; value=&quot;Yes&quot; /&gt;
    &lt;label for=&quot;objLength&quot;&gt;结果中显示字符串长度&lt;/label&gt;&lt;br /&gt;
    &lt;label for=&quot;objGlobal&quot;&gt;匹配次数选项：&lt;/label&gt;
    &lt;select name=&quot;objGlobal&quot; id=&quot;objGlobal&quot;&gt;
      &lt;option value=&quot;0&quot;&gt;不限匹配次数&lt;/option&gt;
      &lt;option value=&quot;1&quot;&gt;仅仅匹配一次&lt;/option&gt;
      &lt;option value=&quot;2&quot;&gt;依据所设次数&lt;/option&gt;
    &lt;/select&gt;&amp;nbsp;&amp;nbsp;
    &lt;label for=&quot;objExeCount&quot;&gt;匹配次数：&lt;/label&gt;
    &lt;input name=&quot;objExeCount&quot; type=&quot;text&quot; id=&quot;objExeCount&quot; value=&quot;10&quot; /&gt;&amp;nbsp;&amp;nbsp;&lt;span id=&quot;objTimer&quot;&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height=&quot;30&quot; bgcolor=&quot;#FFFFFF&quot;&gt;&lt;input type=&quot;button&quot; onclick=&quot;vbscript:RegularTest()&quot; name=&quot;Submit&quot; value=&quot;开端匹配&quot; /&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;script language=&quot;vbscript&quot;&gt;
Function RegularTest
&#039;On Error Resume Next&#039;
objMatchResult.value=&quot;正在匹配...&quot;
objSubMatchResult.value=&quot;正在匹配...&quot;
Dim objRegExp,aryMatchs,objMatch,StartTime,strMatch,strSubMatch,I,J
StartTime=Timer
Set objRegExp= New RegExp
objRegExp.IgnoreCase = IIf(objIgnoreCase.checked,True,False)
objRegExp.Pattern = objPattern.value
objRegExp.Global = IIf(objGlobal.value=&quot;1&quot;,False,True)
Set aryMatchs = objRegExp.Execute(objRawString.value)
I=1
For Each objMatch In aryMatchs
strMatch=strMatch &amp; vbNewLine &amp; I &amp; &quot;: &quot; &amp; objMatch.value &amp; IIf(objFirstIndex.checked,&quot; 地位:&quot; &amp; objMatch.FirstIndex,&quot;&quot;) &amp; IIf(objLength.checked,&quot; 长度:&quot; &amp; objMatch.Length,&quot;&quot;)
If objMatch.SubMatches.Count&lt;&gt;0 Then
For J=0 To objMatch.SubMatches.Count-1
strSubMatch=strSubMatch &amp; vbNewLine &amp; I &amp; &quot;-$&quot; &amp; (J+1) &amp; &quot;: &quot; &amp; objMatch.SubMatches(J)
Next
strSubMatch=strSubMatch &amp; vbNewLine
End If
If objGlobal.value=&quot;2&quot; And I&gt;=CInt(objExeCount.value) Then
Exit For
End If
I=I+1
Next
Set objRegExp=Nothing
objTimer.innerText=&quot;匹配成果：&quot; &amp; aryMatchs.Count &amp; &quot;个.破费：&quot; &amp; FormatNumber((Timer-StartTime)*1000,6) &amp; &quot;ms.&quot;
If Err.Number=0 Then
objMatchResult.value=Mid(strMatch,3)
objSubMatchResult.value=Mid(strSubMatch,3)
Else
objMatchResult.value=Err.Description
Err.Clear
End If
End Function 

Function IIf(bolExp,reTrue,reFalse)
If bolExp Then
IIf=reTrue
Else
IIf=reFalse
End If
End Function
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt; 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/902.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php+mysql数据库查询分页示例</title>
		<link>http://www.islandcn.com/post/900.html</link>
		<comments>http://www.islandcn.com/post/900.html#comments</comments>
		<pubDate>Mon, 21 Mar 2011 13:24:18 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[分页]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=900</guid>
		<description><![CDATA[MYSQL数据分页查询原理 SELECT * FROM table LIMIT [offset,] rows &#124; rows OFFSET offset LIMIT 子句可以被用于强制 SELECT 语句返回指定的记录数。LIMIT 接受一个或两个数字参数。参数必须是一个整数常量。如果给定两个参数，第一个参数指定第一个返回记录行的偏移量，第二个参数指定返回记录行的最大数目。初始记录行的偏移量是 0(而不是 1)： 为了与 PostgreSQL 兼容，MySQL 也支持句法： LIMIT # OFFSET #。 mysql&#62; SELECT * FROM table LIMIT 5,10; // 检索记录行 6-15 //为了检索从某一个偏移量到记录集的结束所有的记录行，可以指定第二个参数为 -1： mysql&#62; SELECT * FROM table LIMIT 95,-1; // 检索记录行 96-last. //如果只给定一个参数，它表示返回最大的记录行数目： mysql&#62; SELECT * FROM table [...]]]></description>
			<content:encoded><![CDATA[<p>MYSQL数据分页查询原理</p>
<pre name="code" class="sql">

SELECT * FROM table  LIMIT [offset,] rows | rows OFFSET offset
</pre>
<p>LIMIT 子句可以被用于强制 SELECT 语句返回指定的记录数。LIMIT 接受一个或两个数字参数。参数必须是一个整数常量。如果给定两个参数，第一个参数指定第一个返回记录行的偏移量，第二个参数指定返回记录行的最大数目。初始记录行的偏移量是 0(而不是 1)： 为了与 PostgreSQL 兼容，MySQL 也支持句法： LIMIT # OFFSET #。 </p>
<pre name="code" class="sql">

mysql&gt; SELECT * FROM table LIMIT 5,10;  // 检索记录行 6-15

//为了检索从某一个偏移量到记录集的结束所有的记录行，可以指定第二个参数为 -1：
mysql&gt; SELECT * FROM table LIMIT 95,-1; // 检索记录行 96-last.

//如果只给定一个参数，它表示返回最大的记录行数目：
mysql&gt; SELECT * FROM table LIMIT 5;     //检索前 5 个记录行

//换句话说，LIMIT n 等价于 LIMIT 0,n。
</pre>
<p>OK,上面大概简述了一下MYSQL分页查询的原理,下面正式切入今天的正题PHP+MYSQL分页的应用,其实这个分页函数是网上转来的,但是编码很乱,也没有换行 我将它整理好了,并且测试使用没问题后贴到这里来了,如果你要拷贝此代码,请点击上方的 view plain 然后复制:</p>
<pre name="code" class="php">

&lt;?
//为了避免重复包含文件而造成错误，加了判断函数是否存在的条件：
if(!function_exists(pageft)){ 

//定义函数pageft(),三个参数的含义为：
//$totle：信息总数；
//$displaypg：每页显示信息数，这里设置为默认是20；
//$url：分页导航中的链接，除了加入不同的查询信息“page”外的部分都与这个URL相同。
//　　　默认值本该设为本页URL（即$_SERVER[&quot;REQUEST_URI&quot;]），但设置默认值的右边只能为常量，所以该默认值设为空字符串，在函数内部再设置为本页URL。
function pageft($totle,$displaypg=20,$url=&#039;&#039;){

//定义几个全局变量：
//$page：当前页码；
//$firstcount：（数据库）查询的起始项；
//$pagenav：页面导航条代码，函数内部并没有将它输出；
//$_SERVER：读取本页URL“$_SERVER[&quot;REQUEST_URI&quot;]”所必须。
global $page,$firstcount,$pagenav,$_SERVER;

//为使函数外部可以访问这里的“$displaypg”，将它也设为全局变量。注意一个变量重新定义为全局变量后，原值被覆盖，所以这里给它重新赋值。
$GLOBALS[&quot;displaypg&quot;]=$displaypg;

if(!$page) $page=1;

//如果$url使用默认，即空值，则赋值为本页URL：
if(!$url){ $url=$_SERVER[&quot;REQUEST_URI&quot;];}

//URL分析：
$parse_url=parse_url($url);
$url_query=$parse_url[&quot;query&quot;]; //单独取出URL的查询字串
if($url_query){
//因为URL中可能包含了页码信息，我们要把它去掉，以便加入新的页码信息。
//这里用到了正则表达式，请参考“PHP中的正规表达式”（http://www.pconline.com.cn/pcedu/empolder/wz/php/10111/15058.html）
$url_query=ereg_replace(&quot;(^|&amp;)page=$page&quot;,&quot;&quot;,$url_query);

//将处理后的URL的查询字串替换原来的URL的查询字串：
$url=str_replace($parse_url[&quot;query&quot;],$url_query,$url);

//在URL后加page查询信息，但待赋值：
if($url_query) $url.=&quot;&amp;page&quot;; else $url.=&quot;page&quot;;
}else {
$url.=&quot;?page&quot;;
}

//页码计算：
$lastpg=ceil($totle/$displaypg); //最后页，也是总页数
$page=min($lastpg,$page);
$prepg=$page-1; //上一页
$nextpg=($page==$lastpg ? 0 : $page+1); //下一页
$firstcount=($page-1)*$displaypg;

//开始分页导航条代码：
$pagenav=&quot;显示第 &lt;B&gt;&quot;.($totle?($firstcount+1):0).&quot;&lt;/B&gt;-&lt;B&gt;&quot;.min($firstcount+$displaypg,$totle).&quot;&lt;/B&gt; 条记录，共 $totle 条记录&lt;BR&gt;&quot;;

//如果只有一页则跳出函数：
if($lastpg&lt;=1) return false;

$pagenav.=&quot; &lt;a href=&#039;$url=1&#039;&gt;首页&lt;/a&gt; &quot;;
if($prepg) $pagenav.=&quot; &lt;a href=&#039;$url=$prepg&#039;&gt;上一页&lt;/a&gt; &quot;; else $pagenav.=&quot; 上一页 &quot;;
if($nextpg) $pagenav.=&quot; &lt;a href=&#039;$url=$nextpg&#039;&gt;下一页&lt;/a&gt; &quot;; else $pagenav.=&quot; 下一页 &quot;;
$pagenav.=&quot; &lt;a href=&#039;$url=$lastpg&#039;&gt;尾页&lt;/a&gt; &quot;;

//下拉跳转列表，循环列出所有页码：
$pagenav.=&quot;　到第 &lt;select name=&#039;topage&#039; size=&#039;1&#039; onchange=&#039;window.location=\&quot;$url=\&quot;+this.value&#039;&gt;\n&quot;;
for($i=1;$i&lt;=$lastpg;$i++){
if($i==$page) $pagenav.=&quot;&lt;option value=&#039;$i&#039; selected&gt;$i&lt;/option&gt;\n&quot;;
else $pagenav.=&quot;&lt;option value=&#039;$i&#039;&gt;$i&lt;/option&gt;\n&quot;;
}
$pagenav.=&quot;&lt;/select&gt; 页，共 $lastpg 页&quot;;
}
}
?&gt;
</pre>
<p>首先将以上代码保存为 page.php<br />
使用方法:<br />
在需要应用的页面中,包含进分页文件</p>
<pre name="code" class="php">

include_once $_SERVER[&#039;DOCUMENT_ROOT&#039;].&#039;/host/inc/page.php&#039;;
</pre>
<pre name="code" class="php">

	//get page
	$rs=mysql_query(&quot;select * from Table&quot;);
	$total=mysql_num_rows($rs);
	//调用pageft()，每页显示10条信息（使用默认的20时，可以省略此参数）,使用本页URL（默认，所以省略掉）。
	pageft($total,10);
	//现在产生的全局变量就派上用场了：
$sql=&quot;select * from Table order by ID desc limit $firstcount,$displaypg&quot;;
	$result=mysql_query($sql);
	while($rows=mysql_fetch_array($result))
	{
	echo	 &#039;此处省略&#039;;
	}

	//输出分页导航条代码：
	echo $pagenav;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/900.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Warning: session_start() 错误的解决方法</title>
		<link>http://www.islandcn.com/post/896.html</link>
		<comments>http://www.islandcn.com/post/896.html#comments</comments>
		<pubDate>Fri, 18 Mar 2011 11:11:58 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[解决]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=896</guid>
		<description><![CDATA[php Warning: Warning: session_start() 错误的解决方法 session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at .... )]]></description>
			<content:encoded><![CDATA[<p>错误代码:</p>
<blockquote><p>Warning: session_start() [function.session-start]: Cannot send session cache limiter &#8211; headers already sent (output started at &#8230;. )</p></blockquote>
<p>解决方法:<br />
1.在语句<strong>session_start();</strong>前面有没有html代码,应该将这句语句放到最前面.如果是UTF-8编码应该用编辑器(EditPlus,UltraEdit.Notepad++等)将文件中的BOM删除.切忌勿用windows自带的记事本软件.</p>
<p>2.session的保存路径.配置方法:修改php.ini中的<strong>session.save_path = &#8220;C:/phpsession&#8221;</strong> [后边的路径自己设置，并且要保证此目录存在]</p>
<p>3.检查php.ini中的<strong>session.auto_start</strong>参数,如果是<strong>session.auto_start = 0 </strong>那么将它修改为 <strong>session.auto_start = 1</strong></p>
<p>4.用<strong>ob_start()</strong>开启缓冲区将输出信息写入缓存区,可以避免<strong>headers</strong>先于session_start()输出,写入缓存区的内容可由<strong>flush()</strong>或者<strong>ob_end_flush()</strong>输出到浏览器.以下是此方法的示例代码</p>
<pre name="code" class="php">

ob_start();
echo &quot;test&quot;;
session_start();
ob_end_flush();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/896.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Godaddy域名转入2011最新图文教程</title>
		<link>http://www.islandcn.com/post/868.html</link>
		<comments>http://www.islandcn.com/post/868.html#comments</comments>
		<pubDate>Tue, 15 Mar 2011 14:34:15 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[转入]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=868</guid>
		<description><![CDATA[Godaddy域名转入2011最新图文教程 手把手教你将域名转入godaddy]]></description>
			<content:encoded><![CDATA[<p>这几天把在<a href="http://www.name.com" target="_blank">name.com</a>的域名成功的转入了<a href="http://www.godaddy.com" target="_blank">godaddy</a>,原因很简单: name.com我没有信用卡无法续费 dm/:(  而godaddy支持支付宝.  前后也挺麻烦 其实网上教程也不少,但是因为godaddy的小小改版,可能英文欠佳的同学不太喜欢,所以今天把详细的注意事项和步骤全部记录一下.</p>
<p><strong>第一步 准备工作 (此步骤都在原域名注册商那里操作)</strong><br />
<strong>whois隐私保护</strong><br />
首先注意的是:如果你的域名在转入之前有whois保护的话,第一步需要关闭whois隐私保护,当时我在name.com注册的时候是免费的whois隐私保护,如果开启了whois隐私保护的话,Administrative邮箱是收不到邮件的.</p>
<p>就拿name.com的举例吧,打开域名管理</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;">﻿</div>
<p><a rel="attachment wp-att-870" href="http://www.islandcn.com/post/868.html/1-2"><img class="alignnone size-medium wp-image-870" title="关闭name的域名whois隐私保护" src="http://www.islandcn.com/wp-content/uploads/2011/03/1.jpg" alt="关闭name的域名whois隐私保护" width="478" height="62" /></a><br />
点击图片中的位置,将状态设置为&#8221;disabled&#8221;即可关闭whois隐私保护<br />
小提示: 很多查询WHOIS查询的地方不能及时查询WHOIS信息,也就是说你的隐私保护关闭了之后,你可能查到的依然是有WHOIS隐私保护的信息,这里推荐下:http://www.dynadot.com 这里查询的都是即时的信息.</p>
<p><strong>Administrative邮箱</strong><br />
这个我查了些资料,有人说最好用gmail hotmail之类的邮箱,不要用国内的163或者sina之类的信箱. 以防收不到信或者慢.<br />
这里就name.com的Administrative邮箱修改做下说明:<br />
打开域名管理之后点击右侧的&#8221;Edit Contacts&#8221;修改&#8221;<strong><span style="font-family: Verdana; font-size: xx-small;">Email</span></strong>&#8220;那一栏的邮箱地址:</p>
<p><a href="/wp-content/uploads/2011/03/2.jpg"><img class="alignnone" title="name.com修改Administrative邮箱地址" src="/wp-content/uploads/2011/03/2.jpg" alt="name.com修改Administrative邮箱地址" width="310" height="412" /></a></p>
<p><strong>域名解锁和转移码</strong></p>
<p><a href="/wp-content/uploads/2011/03/3.jpg"><img class="alignnone" title="name.com的域名解锁设置" src="/wp-content/uploads/2011/03/3.jpg" alt="name.com的域名解锁设置" width="363" height="44" /></a></p>
<p>Domain Lock: 域名锁定设置,将状态改为 unlocked</p>
<p>同时记录下Auth Code(转移授权码),一会儿会用到</p>
<p>原域名注册设置大概就到这里了.下面工作主要进入godaddy的设置.</p>
<p><strong>第二步 域名的接入 Godaddy账户内操作</strong></p>
<p>登录Godaddy的账户.</p>
<p><a rel="attachment wp-att-877" href="http://www.islandcn.com/post/868.html/godaddy1"><img class="alignnone size-full wp-image-877" title="从Godaddy转入域名" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy1.jpg" alt="从Godaddy转入域名" width="407" height="278" /></a></p>
<p>鼠标放到Domains 出现菜单 选择 Transfer Domain.</p>
<p><a rel="attachment wp-att-878" href="http://www.islandcn.com/post/868.html/godaddy2"><img class="alignnone size-full wp-image-878" title="输入要转入godaddy的域名" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy2.jpg" alt="输入要转入godaddy的域名" width="614" height="114" /></a></p>
<p>输入你要转入的域名 然后按 GO</p>
<p><a rel="attachment wp-att-879" href="http://www.islandcn.com/post/868.html/godaddy3"><img class="alignnone size-full wp-image-879" title="准备结算转入的域名" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy3.jpg" alt="准备结算转入的域名" width="663" height="179" /></a></p>
<p>确定好之后 点击 Proceed To Checkout</p>
<p><a rel="attachment wp-att-880" href="http://www.islandcn.com/post/868.html/godaddy4"><img class="alignnone size-full wp-image-880" title="godaddy域名转入教程" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy4.jpg" alt="godaddy域名转入教程" width="567" height="206" /></a></p>
<p>选择 No Thanks</p>
<p><a href="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy6.jpg"><img class="alignnone size-full wp-image-881" title="转入续费时间及nameserver服务器设置" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy6.jpg" alt="转入续费时间及nameserver服务器设置" width="658" height="331" /></a></p>
<p>此处注意的是 在<strong>Select Your Transfer Nameservers </strong>默认的是保持域名当前的DNS服务器,如果选择下一个的话就是改成godaddy的dns服务器.然后点击最下面的下一步(此处就跳过了godaddy的增值服务部分Your Privacy and Domain Protection 和Activate Your Website, Email &amp; More )</p>
<p><a rel="attachment wp-att-882" href="http://www.islandcn.com/post/868.html/godaddy7"><img class="alignnone size-full wp-image-882" title="进入结算状态" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy7.jpg" alt="进入结算状态" width="341" height="270" /></a></p>
<p>点击<strong>Continue to Checkout</strong>来结算 如果有优惠码的话点击上面的&#8221;<strong>Enter Promo or Source Code</strong>&#8220;然后点右边的&#8221;<strong>apply</strong>&#8221;</p>
<p><a rel="attachment wp-att-884" href="http://www.islandcn.com/post/868.html/godaddy8"><img class="alignnone size-full wp-image-884" title="选择付款方式" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy8.jpg" alt="选择付款方式" width="610" height="86" /></a></p>
<p>这里选择 支付宝付款,如果是其他方式付款对应选择就可以了</p>
<p><a rel="attachment wp-att-885" href="http://www.islandcn.com/post/868.html/godaddy9"><img class="alignnone size-full wp-image-885" title="进入支付宝结算页" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy9.jpg" alt="进入支付宝结算页" width="301" height="394" /></a></p>
<p>把上面的框勾上,然后点击 <strong>PLACE ORDER NOW</strong></p>
<p>完成付款后打开<strong>My ACCOUNT </strong>点击左侧的</p>
<div class="pc_sb_brktxt">Domain Related -  Domain Transfers</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-886" href="http://www.islandcn.com/post/868.html/godaddy10"><img class="alignnone size-full wp-image-886" title="domain transfers" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy10.jpg" alt="domain transfers" width="231" height="292" /></a></div>
<div class="pc_sb_brktxt">这里需要注意的是 如果到Domain Transfers的页面中看不到你的域名 需要等待一段时间.</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-887" href="http://www.islandcn.com/post/868.html/godaddy11"><img class="alignnone size-full wp-image-887" title="重发邮件" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy11.jpg" alt="重发邮件" width="527" height="157" /></a></div>
<div class="pc_sb_brktxt">这一步如果收到信就免了,收不到信的朋友在换了<strong>Administrative邮箱</strong>之后需要点击这里重发邮件.</div>
<div class="pc_sb_brktxt">打开<strong>Administrative邮箱</strong>查收邮件标题为 transfer of  你的域名 的邮件. 有些信箱需要到垃圾邮件或者订阅邮件中找.如果收不到邮件建议更换邮箱</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-888" href="http://www.islandcn.com/post/868.html/godaddy13"><img class="alignnone size-full wp-image-888" title="交易ID和安全码需要记录下来" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy13.jpg" alt="交易ID和安全码需要记录下来" width="500" height="166" /></a></div>
<div class="pc_sb_brktxt">这里的<strong>Transaction ID和 Security Code </strong>需要记录下来,待会儿要用到.</div>
<div class="pc_sb_brktxt">继续返回到上一步,也就是Domain Transfers的页面</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-889" href="http://www.islandcn.com/post/868.html/godaddy12"><img class="alignnone size-full wp-image-889" title="准备转移输入交易ID和安全码" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy12.jpg" alt="准备转移输入交易ID和安全码" width="275" height="128" /></a></div>
<div class="pc_sb_brktxt">下一步输入刚刚记录下来的<strong>Transaction ID</strong>和 <strong>Security Code </strong>然后next</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-890" href="http://www.islandcn.com/post/868.html/godaddy14"><img class="alignnone size-full wp-image-890" title="即将完成转入" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy14.jpg" alt="即将完成转入" width="586" height="277" /></a></div>
<div class="pc_sb_brktxt">在这里选择<strong> Authorize </strong>表示批准的意思,然后选择 Next</div>
<div class="pc_sb_brktxt"><a rel="attachment wp-att-892" href="http://www.islandcn.com/post/868.html/godaddy15-2"><img class="alignnone size-full wp-image-892" title="输入域名的转移码" src="http://www.islandcn.com/wp-content/uploads/2011/03/godaddy151.jpg" alt="输入域名的转移码" width="551" height="257" /></a></div>
<div class="pc_sb_brktxt">输入转移码之后点击 Finish</div>
<div class="pc_sb_brktxt">恭喜你,到这一步 已经完成了,剩下的工作就是等待了</div>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/868.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决Navicat 8 for MySQL 中文乱码的问题</title>
		<link>http://www.islandcn.com/post/874.html</link>
		<comments>http://www.islandcn.com/post/874.html#comments</comments>
		<pubDate>Tue, 15 Mar 2011 07:20:40 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[navicat]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=874</guid>
		<description><![CDATA[选择“高级”属性页,将“使用MySQL字符集”的勾去掉，并选择将“编码”选择为“936 (ANSI/OEM - Simplified Chinese GBK)” ,可以直接输入936根据提示来选择.
]]></description>
			<content:encoded><![CDATA[<p>解决方法：<br />
1、右键连接选择&#8221;关闭连接&#8221;<br />
2、右击连接库选择“连接属性”；<br />
3、选择“高级”属性页,将“使用MySQL字符集”的勾去掉，并选择将“编码”选择为“936 (ANSI/OEM &#8211; Simplified Chinese GBK)” ,可以直接输入936根据提示来选择.<br />
4、关闭保存，重新连接。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/874.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>局域网内两台笔记本电脑无线共享上网的解决方案</title>
		<link>http://www.islandcn.com/post/863.html</link>
		<comments>http://www.islandcn.com/post/863.html#comments</comments>
		<pubDate>Sat, 15 Jan 2011 05:55:52 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[WIN7]]></category>
		<category><![CDATA[XP]]></category>
		<category><![CDATA[无线网络]]></category>
		<category><![CDATA[笔记本]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=863</guid>
		<description><![CDATA[今天把两台笔记本无线共享上网的方法解决了,而且比较简单的方法,总结一下做个记录. 网络上的方法未必都适合你. 网络环境: 一根网线,通过路由器(非无线路由)上网 设备: 两台笔记本电脑 软件环境: 其中一台是WIN7 旗舰版,另外一台XP SP3专业版 现在问题是通过网线接入实现两台电脑同时可以上网. 在问题解决之前谷歌了很多资料,都不行,无疑网络上都是常规的 设置本地连接共享,然后建立无线连接等等 这里我的解决方法是: 1.让WIN7做主机,其他电脑通过代理此电脑上网,理由: 微软的软件自古来都是从高向下兼容的,为了避免有兼容性上的问题,所以让高版本的WIN7机器为核心 2.WIN7的设置篇     2.1 -&#62; 右键电脑右下角的网络连接的小电脑图标 -&#62; 打开网络和共享中心 -&#62; 点击左侧的[更改适配器设置] -&#62; 将[本地连接]与[无线网络连接]选中右键选择[桥接] -&#62; 成功之后就会看到一个名称为[网桥]的新设备     2.2 -&#62; 打开[网络和共享中心] -&#62; 点击[管理无线网络] -&#62; 添加 -&#62; 创建临时网络 -&#62; 下一步 -&#62; 网络名设置[记住了] -&#62; 安全类型选择WEP -&#62; 安全密钥(注意,这里的密码规则要求比较高,推荐长度长些,另外要大小写字母及数字混用) -&#62; 保存这个网络可以勾上 -&#62; 下一步完成 至此,核心的工作已经完成了. 3. 客户端设置篇     [...]]]></description>
			<content:encoded><![CDATA[<p>今天把两台笔记本无线共享上网的方法解决了,而且比较简单的方法,总结一下做个记录. <strong>网络上的方法未必都适合你.</strong></p>
<p>网络环境: 一根网线,通过路由器(非无线路由)上网</p>
<p>设备: 两台笔记本电脑</p>
<p>软件环境: 其中一台是WIN7 旗舰版,另外一台XP SP3专业版</p>
<p>现在问题是通过网线接入实现两台电脑同时可以上网.</p>
<p>在问题解决之前谷歌了很多资料,都不行,无疑网络上都是常规的 设置本地连接共享,然后建立无线连接等等</p>
<p>这里我的解决方法是:</p>
<p>1.让WIN7做主机,其他电脑通过代理此电脑上网,理由: 微软的软件自古来都是从高向下兼容的,为了避免有兼容性上的问题,所以让高版本的WIN7机器为核心</p>
<p>2.WIN7的设置篇</p>
<p>    2.1 -&gt; 右键电脑右下角的网络连接的小电脑图标 -&gt; 打开网络和共享中心 -&gt; 点击左侧的[更改适配器设置] -&gt; 将[本地连接]与[无线网络连接]选中右键选择[桥接] -&gt; 成功之后就会看到一个名称为[网桥]的新设备</p>
<p>    2.2 -&gt; 打开[网络和共享中心] -&gt; 点击[管理无线网络] -&gt; 添加 -&gt; 创建临时网络 -&gt; 下一步 -&gt; 网络名设置[记住了] -&gt; 安全类型选择WEP -&gt; 安全密钥(注意,这里的密码规则要求比较高,推荐长度长些,另外要大小写字母及数字混用) -&gt; 保存这个网络可以勾上 -&gt; 下一步完成</p>
<p>至此,核心的工作已经完成了.</p>
<p>3. 客户端设置篇</p>
<p>    右键右下角无线网络的图标 -&gt; 查看可用的无线网络 -&gt; 选择刚刚上一步过程中创建临时网络输入的名称 -&gt; 连接</p>
<p>连接成功之后 右击网络图标 -&gt; 状态 -&gt; 属性 -&gt;使用以下IP地址 -&gt; 指定一个跟主机(WIN7系统的机器)网段内的IP,如果主机的IP是 192.169.0.2 那么这里你可以写 192.168.0.XX ,尽量往后面写,以免IP冲突.</p>
<p>网络网关及DNS的配置跟主机配置一致即可.</p>
<p>完成之后可以ping下主机的IP,譬如如果主机IP是 192.168.0.2,你可以通过ping命令测试一下,如果OK,再测试ping下外网.</p>
<p>怎么样 是不是很方便呢?(另外好像有款软件是专门设置共享上网的,叫&#8221;<strong>闪联任意通</strong>&#8220;,有兴趣的朋友也可以试试)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/863.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DotA 6.70正式发布</title>
		<link>http://www.islandcn.com/post/858.html</link>
		<comments>http://www.islandcn.com/post/858.html#comments</comments>
		<pubDate>Sat, 25 Dec 2010 05:27:23 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Dota]]></category>
		<category><![CDATA[6.70]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[dota]]></category>
		<category><![CDATA[改动]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=858</guid>
		<description><![CDATA[DotA 6.70地图下载地址: http://www.localdota.com/map/official/dota-6-70/ DotA 6.70地图 详细改动说明&#62;&#62; 此次地图大致修改内容: 新增两名新英雄: 凤凰 巨牙海民 新增物品 古之忍耐姜歌 使用后,附近玩家控制单位获得提升10%攻速和移速的buff,持续6秒. 可使用三次,不能充值. 勇气勋章 同时降低你和目标敌方单位6点护甲,持续7秒 诡计之雾 使用后,可使900范围内玩家控制单位获得buff,隐形并提升 10%移速.并且不会显示在小地图上.(似乎意思是假设河道有对面的真眼和假眼, 你们路过河道去Gank也不会显示在小地图上) 在你进入距离对方英雄或塔900范围内时,buff移除. 如果你攻击野怪,小兵,Roshan,该效果也会驱散 另有物品与英雄修改.详细请下面的链接点击进入 DotA 6.70地图 详细改动说明&#62;&#62;]]></description>
			<content:encoded><![CDATA[<p>DotA 6.70地图下载地址:<br />
<a title="DotA 6.70地图下载" href="http://www.localdota.com/map/official/dota-6-70/" target="_blank">http://www.localdota.com/map/official/dota-6-70/</a></p>
<p><a href="http://www.localdota.com/map/news/dota-6-70-changelog/">DotA 6.70地图 详细改动说明&gt;&gt;</a></p>
<p>此次地图大致修改内容:</p>
<p><strong>新增两名新英雄:</strong><br />
凤凰<br />
巨牙海民</p>
<p><strong>新增物品<br />
</strong><strong><br />
古之忍耐姜歌<br />
</strong>使用后,附近玩家控制单位获得提升10%攻速和移速的buff,持续6秒. 可使用三次,不能充值.</p>
<p><strong>勇气勋章<br />
</strong>同时降低你和目标敌方单位6点护甲,持续7秒</p>
<p><strong>诡计之雾</strong></p>
<p>使用后,可使900范围内玩家控制单位获得buff,隐形并提升 10%移速.并且不会显示在小地图上.(似乎意思是假设河道有对面的真眼和假眼, 你们路过河道去Gank也不会显示在小地图上)</p>
<p>在你进入距离对方英雄或塔900范围内时,buff移除. 如果你攻击野怪,小兵,Roshan,该效果也会驱散</p>
<p>另有物品与英雄修改.详细请下面的链接点击进入<br />
<a href="http://www.localdota.com/map/news/dota-6-70-changelog/">DotA 6.70地图 详细改动说明&gt;&gt;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/858.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql批量删除指定前缀的表,批量修改表名的SQL语句</title>
		<link>http://www.islandcn.com/post/855.html</link>
		<comments>http://www.islandcn.com/post/855.html#comments</comments>
		<pubDate>Tue, 14 Dec 2010 03:19:06 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[批量]]></category>
		<category><![CDATA[表名]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=855</guid>
		<description><![CDATA[mysql批量删除指定前缀的表,批量修改表名的SQL语句]]></description>
			<content:encoded><![CDATA[<pre name="code" class="sql">

Select CONCAT( &#039;drop table &#039;, table_name, &#039;;&#039; )
FROM information_schema.tables
Where table_name LIKE &#039;uc_%&#039;;
</pre>
<p>注意: like &#8216;<strong>uc_</strong>%&#8217; 其中 uc_是你需要替换的表前缀.<br />
执行查询,会自动生成出 drop table table_name这样的SQL语句.<br />
然后复制 drop语句 可以执行删除的操作了.</p>
<p>这么一来也可以安全的审核一下语句,避免误操作..</p>
<p>顺便补充一下一个批量修改表名的操作方法</p>
<pre name="code" class="sql">

Select CONCAT( &#039;ALTER TABLE &#039;, table_name, &#039;RENAME TO &#039;, table_name,&#039;;&#039; )
FROM information_schema.tables
Where table_name LIKE &#039;uc_%&#039;;
</pre>
<p>下面这种代码是今天遇到的,表头前面是 db,但是没有下横线显得很乱,于是批量将&#8221;dbtable_name&#8221;改成&#8221;db_table_name&#8221;<br />
主要用的函数是mysql的substring函数</p>
<blockquote><p>mysql教程 substring 字符截取函数<br />
substring(str,pos)语法</p>
<p>substring(filed,m):截取filed字段从第m个字符开始到结束的字符串；</p>
<p>substring(filed,m,n):截取filed字段从第m个字符开始的长度为n的字符串；</p>
<p>str,字符</p>
<p>pos,从第几个开始取</p></blockquote>
<pre name="code" class="sql">

Select CONCAT( &#039;ALTER TABLE &#039;, table_name, &#039;RENAME TO db_&#039;, substring(table_name,3),&#039;;&#039; )
FROM information_schema.tables
Where table_name LIKE &#039;db%&#039;;
</pre>
<p>会得到结果</p>
<pre name="code" class="sql">

ALTER TABLE uc_aaa RENAME TO uc_aaa;
ALTER TABLE uc_bbb RENAME TO uc_bbb;
</pre>
<p>批量复制一下到记事本或者 et之类的编辑工具中,然后批量替换 RENAME TO uc 成 RENAME TO 你想要的表前缀<br />
完成后 再执行.</p>
<p>这样就完成了表名的批量修改拉&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/855.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>掌门人官方论坛被黑,掌门人用户请注意平台账户安全&#8230;</title>
		<link>http://www.islandcn.com/post/850.html</link>
		<comments>http://www.islandcn.com/post/850.html#comments</comments>
		<pubDate>Thu, 09 Dec 2010 03:58:09 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Dota]]></category>
		<category><![CDATA[dota]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[平台]]></category>
		<category><![CDATA[掌门人]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=850</guid>
		<description><![CDATA[掌门人官方论坛被黑,此次看到掌门人论坛只是被挂上了链接,通过网页链接增加了目标网站的权重.没有任何破坏性,但是是可以借此达到破坏效果的,如果挂上木马那么后果不堪设想.]]></description>
			<content:encoded><![CDATA[<p>大概前两天,因为<a href="http://www.islandcn.com/post/848.html" target="_blank">掌门人更新包被NOD32干掉</a>的事儿去官方论坛看看结果的,就这样一来 看到了有意思的一幕,在论坛最下面</p>
<div class="wp-caption alignnone" style="width: 596px"><img title="掌门人官方论坛被黑" src="/wp-content/uploads/2010/12/zmr1.jpg" alt="掌门人官方论坛被黑" width="586" height="88" /><p class="wp-caption-text">掌门人官方论坛被黑</p></div>
<div class="mceTemp">打开网页源码看到</div>
<div class="wp-caption alignnone" style="width: 732px"><img title="掌门人对战平台官方论坛被黑" src="/wp-content/uploads/2010/12/zmr2.jpg" alt="掌门人官方论坛被黑" width="722" height="114" /><p class="wp-caption-text">掌门人对战平台官方论坛被黑</p></div>
<p>此次看到论坛只是被挂上了链接,通过网页链接增加了目标网站的权重.没有任何破坏性,但是是可以借此达到破坏效果的,如果挂上木马那么后果不堪设想.这个小黑也够粗心的,挂黑链也不注意下UTF-8跟gbk编码,结果都成乱码了 所以被发现了,要是编码统一是完全不会在页面显示出来的.也是常用的挂黑链的方法.</p>
<p>官方论坛被黑了这么多天,日发帖几千的论坛就没一个人反映? 官方就没一个人发现这个问题?? 实在是悲哀啊..<br />
庆幸的是,我ping了官方的升级服务器跟论坛服务器,返回的IP不一样,分别是<br />
update.zmrgame.com -&gt;221.4.209.52<br />
bbs.zmrgame.com -> 122.0.125.211</p>
<p>如果情况严重的话,官方升级服务器被黑,那么情况就可能不是那么好了,如果黑客在官方的升级包中加入木马病毒,在dll文件实行注入&#8230;<br />
受害的可是zmr大批的用户.</p>
<p>如果我猜的没错,掌门人论坛的数据库和平台的数据库是统一整合了的(现在没法测试,以前是注册平台的时候直接提交到论坛的注册地址了),我08年9月注册这个平台的,当时可以注册好多好的ID,譬如当时我比较喜欢骷髅王,于是我也给注册了 :dm/tp, 最早这个平台也是一朋友推荐给我的,那位朋友是加菲盐的fans,大概是看着他解说视频被推荐的吧,刚开始每天掌门人对战平台就是几十个人大概,最初的推广也离不开加菲盐这位dota解说,经常是不够开主.</p>
<p>如果现在掌门人平台帐号数据和论坛依然是通行的话,那么就出现了我标题中所出现的帐号安全问题了.<br />
我想官方是时候该认真对待这个问题了.  官方除了亡羊补牢及时修补安全补丁 清除后门,还有个更棘手的问题:如果数据库被拿走了又怎么办呢??我真不想看到哪天有会员说 我的帐号没了.. 这个平台还有一些VIP高级会员的..</p>
<p><strong>但愿是我想多了..</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/850.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>掌门人平台无法更新,被NOD32杀,官方到底在干什么?</title>
		<link>http://www.islandcn.com/post/848.html</link>
		<comments>http://www.islandcn.com/post/848.html#comments</comments>
		<pubDate>Thu, 09 Dec 2010 03:19:19 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Dota]]></category>
		<category><![CDATA[dota]]></category>
		<category><![CDATA[nod32]]></category>
		<category><![CDATA[zmrgame]]></category>
		<category><![CDATA[对战平台]]></category>
		<category><![CDATA[掌门人]]></category>
		<category><![CDATA[更新]]></category>
		<category><![CDATA[木马]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=848</guid>
		<description><![CDATA[一直喜欢高质量的dota环境,至少dota技术比较平衡些,而且没有那些令人恶心的全图,不败之类的东西出现
于是掌门人对站平台就成了首选了.整体来说至今感觉还是不错的,除了服务器不太稳定之外,平台体验还算不错.但是自上次更新11月26号开始,掌门人的一次更新中,有文件被nod32给杀了. ]]></description>
			<content:encoded><![CDATA[<p>一直喜欢高质量的dota环境,至少dota技术比较平衡些,而且没有那些令人恶心的全图,不败之类的东西出现<br />
于是掌门人对站平台就成了首选了.整体来说至今感觉还是不错的,除了服务器不太稳定之外,平台体验还算不错.</p>
<p>但是自上次更新11月26号开始,掌门人的一次更新中,有文件被nod32给杀了. 提示:</p>
<blockquote><p>
 http://down.zmrgame.com/p.php?ver=1115Green	可能是 Win32/Genetik 特洛伊木马 的变种	连接中断 &#8211; 已隔离	通过应用程序访问 web 时检测到威胁: C:\Program Files\Internet Explorer\iexplore.exe.<br />
 http://down.zmrgame.com/p.php?ver=1115Green > ZIP > ZMRGameClient/VLanProxy.dll	可能是 Win32/Genetik 特洛伊木马 的变种
</p></blockquote>
<p>当天我还到掌门人官方网站去发贴咨询了这个事儿:</p>
<p>http://bbs.zmrgame.com/thread-243610-1-1.html</p>
<p>只给了链接地址,未加链接,官方论坛已经被黑了,稍稍我会继续写一篇文章针对此事的.<a href="http://www.islandcn.com/post/850.html" target="_blank">掌门人官方论坛被黑>></a><br />
论坛中那位版主三天后在29号回复我&#8221; 请在防火墙等安全软件添加到信任列表&#8221; 当然也是后来才看到的,等了两天也没个结果,于是以为那个帖子被删了或者被遗忘了&#8230;</p>
<p>就在昨天开始,我又试着更新了一下掌门人对战平台,但是NOD32照样杀,但是有所不同的是:</p>
<blockquote><p>
http://update.zmrgame.com/ZipClient/20101115/VLanProxy.dll.zip	可能是 Win32/Genetik 特洛伊木马 的变种	连接中断 &#8211; 已隔离	通过应用程序访问 web 时检测到威胁: G:\KingLife Backup\D\Program Files\ZMRGameClient\ZmrUpdate.exe.<br />
 http://update.zmrgame.com/ZipClient/20101115/VLanProxy.dll.zip > ZIP > VLanProxy.dll	可能是 Win32/Genetik 特洛伊木马 的变种		</p>
</blockquote>
<p>从URL可以看得出,第一次更新的有问题的URL是:http://down.zmrgame.com/p.php?ver=1115Green 而这次是http://update.zmrgame.com/ZipClient/20101115/VLanProxy.dll.zip<br />
很显然,第一次NOD32直接把这个源头给切了,1114Green 我想前面应该是版本号,后面应该是绿色包,补丁包的意思吧<br />
而第二次 是更新到 文件VLanProxy.dll.zip的时候出问题了.</p>
<p>官方也在修正了一些问题,但是终究还是没有彻底解决. 但是更有意思的是就在昨天我看到更新过程中,看着changelog的时候看到:<br />
&#8220;<strong>如果NOD32报毒,请将NOD32升级到最新版本或者卸载</strong>&#8221;<br />
对于从事计算机工作的我来说,这会是难事么?  当时误杀我第一反应就是更新NOD32,但是发现NOD32已经最新了,于是把这个url给信任了 把文件和目录也给排除了.但是无济于事啊.<br />
所以&#8221;<strong>请将NOD32升级到最新版本或者卸载</strong>&#8221;<br />
官方给的这两个选择,只能选择后者了.<br />
我在想这个事儿,用户会为了这个游戏去不顾自己的计算机安全么? 至少我是不会为了dota去强制卸载NOD32的&#8230;</p>
<p>但是事实上,貌似事情不是偶然的,在下篇文章 我会再说个事儿.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/848.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>午夜思绪</title>
		<link>http://www.islandcn.com/post/846.html</link>
		<comments>http://www.islandcn.com/post/846.html#comments</comments>
		<pubDate>Mon, 06 Dec 2010 15:33:52 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[enya]]></category>
		<category><![CDATA[yanni]]></category>
		<category><![CDATA[恩雅]]></category>
		<category><![CDATA[情感]]></category>
		<category><![CDATA[雅尼]]></category>
		<category><![CDATA[音乐]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=846</guid>
		<description><![CDATA[这一年似乎就这样跌跌撞撞,迷迷糊糊的过去了. 已经进入12月了,再有三周又该跟2010说再见了. 昨夜在找恩雅(Enya)的音乐的时候,无意识的打出了雅尼(Yanni),就这样雅尼的音乐全部加入了播放列表. 然而更加戏剧性的是第一首就是&#8221;With An Orchid&#8221;(和兰花在一起),这首久违了有三年之久的音乐. 这首音乐伴着我走过了太多太多的路. 无尽的回忆再次浮现在脑海中&#8230;在这座城市中的一个角落里蔓延开去.]]></description>
			<content:encoded><![CDATA[<p>这一年似乎就这样跌跌撞撞,迷迷糊糊的过去了.</p>
<p>已经进入12月了,再有三周又该跟2010说再见了.</p>
<p>昨夜在找恩雅(Enya)的音乐的时候,无意识的打出了雅尼(Yanni),就这样雅尼的音乐全部加入了播放列表.</p>
<p>然而更加戏剧性的是第一首就是&#8221;With An Orchid&#8221;(和兰花在一起),这首久违了有三年之久的音乐.</p>
<p>这首音乐伴着我走过了太多太多的路.</p>
<p>无尽的回忆再次浮现在脑海中&#8230;在这座城市中的一个角落里蔓延开去.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/846.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[视频]dota 6.70 新英雄曝光</title>
		<link>http://www.islandcn.com/post/841.html</link>
		<comments>http://www.islandcn.com/post/841.html#comments</comments>
		<pubDate>Tue, 30 Nov 2010 04:10:49 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Dota]]></category>
		<category><![CDATA[6.70]]></category>
		<category><![CDATA[dota]]></category>
		<category><![CDATA[曝光]]></category>
		<category><![CDATA[英雄]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=841</guid>
		<description><![CDATA[来自国外网站的视频,dota 6.70除了新英雄火凤凰之外的四个新英雄曝光,下面看视频 ]]></description>
			<content:encoded><![CDATA[<p>来自国外网站的视频,dota 6.70除了新英雄火凤凰之外的四个新英雄曝光,这么一来初步认定DOTA 6.70会出现无名新英雄,下面请看视频</p>
<p><object width="408" height="379" data="http://player.youku.com/player.php/sid/XMjI2MDMyNzQ4/v.swf" type="application/x-shockwave-flash"><param name="align" value="middle" /><param name="src" value="http://player.youku.com/player.php/sid/XMjI2MDMyNzQ4/v.swf" /><param name="quality" value="high" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/841.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>从友情链接看cn域名</title>
		<link>http://www.islandcn.com/post/837.html</link>
		<comments>http://www.islandcn.com/post/837.html#comments</comments>
		<pubDate>Tue, 30 Nov 2010 01:05:16 +0000</pubDate>
		<dc:creator>kinglife</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[cn]]></category>
		<category><![CDATA[友情链接]]></category>
		<category><![CDATA[域名]]></category>
		<category><![CDATA[快照]]></category>
		<category><![CDATA[百度]]></category>

		<guid isPermaLink="false">http://www.islandcn.com/?p=837</guid>
		<description><![CDATA[唯独还有一个chenlb学习笔记里面还带着我的链接,发现其它的站大多数用cn域名的基本都打不开了,有些是无解析,有些是被抢注了停靠了.]]></description>
			<content:encoded><![CDATA[<p>今天大概清理了一下友情链接<br />
唯独还有一个<a href="http://blog.chenlb.com/" target="_blank">chenlb学习笔记</a>里面还带着我的链接,发现其它的站大多数用cn域名的基本都打不开了,有些是无解析,有些是被抢注了停靠了.基本可以看出,<strong>CN域名基本都被放弃了!</strong><br />
还有部分站点可能因为改版或者其它原因不存在我的链接了 <img src='http://www.islandcn.com/wp-includes/images/smilies/15.gif' alt=':dm/ng' class='wp-smiley' /> </p>
<p>清理了一下,好歹也是谷歌秒收,百度天天快照的站.  毕竟存在的时间长些,权重也高些,日后做资源都可以. 以后看来也得经常更新了.</p>
<p>在昨天的日记中<a href="http://www.islandcn.com/post/832.html" target="_blank">关于国外主机的选择,购买国外主机需要注意什么?</a>我已经说了,站点停了两天,<a href="http://www.ixwebhosting.com/" target="_blank">ixwebhosting</a>会默认给你指向他们的一个默认页,百度当天也给我快照抓下来了,都是那个全部英文的默认页标题和内容,昨天续费上线后 百度今天也把正常内容快照下来了.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.islandcn.com/post/837.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

