用eclipse和pdt配置php开发及调试环境
2010年05月7日
by junstyle
336 views
0 comments
2010年05月7日
by junstyle
336 views
0 comments
2010年05月6日
by junstyle
169 views
0 comments
# 形式:年/月/日/Postname.html
# 自定义链接 /%year%/%monthnum%/%day%/%postname%.html
# URL:http://www.junstyle.com.cn
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*) /index\.php\?category_name=$1
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/?(.*) /index\.php\?author_name=$1
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /page/(.*)/ /index\.php\?paged=$1
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?.html/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+).html/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+).html/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
# 形式:年/月/日/Postname/
# 自定义链接 /%year%/%monthnum%/%day%/%postname%/
# URL:http://www.junstyle.com.cn
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*)/ /index\.php\?category_name=$1
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/?(.*) /index\.php\?author_name=$1
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /page/(.*)/ /index\.php\?paged=$1
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5
RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
# 形式:/post/PostID.html
# 自定义链接 /post/%post_id%.html
# URL:http://www.junstyle.com.cn
RewriteRule /post/tag/(.*) /index\.php\?tag=$1
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap|taotao) /index\.php\?pagename=$1
RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /post/category/?(.*) /index\.php\?category_name=$1
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/?(.*) /index\.php\?author_name=$1
RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
# RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
# RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
RewriteRule /post/([0-9]+).html /index\.php\?p=$1 [I]
RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=$2&paged=$1
RewriteRule /page/(.*) /index\.php\?paged=$1
RewriteRule /post/date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /post/([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1
RewriteRule /post/([0-9]+).html/trackback /wp-trackback\.php\?p=$1
2010年05月6日
by junstyle
172 views
0 comments
JS getYear在firefox下有问题
用了JS的getYear()方法,但是发现生成的代码竟然有108(本应该是2008),发现这是firefox下的问题。在 Firefox 里面 getYear 返回的是 "当前年份-1900" 的值,而IE里面则:当today的年份小于2000的时候,和firefox一样。当today的年份大于等于2000的时候 在返回的基础上额外加上1900 如:today年份是1999 返回99(同firefox) today年份是2000 返回100+1900=2000 所以最好用 getFullYear或者getUTCFullYear 去获取完整的年份 var year = today.getFullYear();在IE,FireFox都适用。
如:(js代码)
var today = new Date();
var fullyear = today.getFullYear();
var year = today.getYear();
document.write(fullyear + "<br>");
document.write(year + "<br>");
结果:
2010
110
function DateDiff(sDate1,sDate2){
//sDate1和sDate2是年-月-日格式
var arrDate,objDate1,objDate2,intDays;
arrDate=sDate1.split("-");
objDate1=new Date(arrDate[1]+'-'+arrDate[2]+'-'+arrDate[0]);//转换为月-日-年格式
arrDate=sDate2.split("-");
objDate2=new Date(arrDate[1]+'-'+arrDate[2]+'-'+arrDate[0]);
intDays=parseInt(Math.abs(objDate1-objDate2)/1000/60/60/24); //把相差的毫秒数转换为天数
return intDays;
}
alert(DateDiff("2007-1-1","2008-1-1"));
2010年04月22日
by junstyle
238 views
1 comment
<script>
window.sc="<img src='http://www.businessinfo.co.uk/labs/hackvertor/images/logo.gif?"+Math.random()+"'>";
</script>
<iframe src="javascript:parent.sc"></iframe>
<img src=https://www.xxx.com/redirect?target=http://www.baidu.com/xxx.jpg />
利用在https下的一个第三方提供redirect的接口,重定向到http的一个页面,是不发送referer的。
参考自:http://hi.baidu.com/aullik5/blog/item/d55d97efca1333222df53445.html
2010年04月15日
by junstyle
290 views
0 comments
这个问题困扰我很久了,一直都懒得处理,今天看到下面的文章可以解决。
不管是哪个语言版本的 WordPress,总会把文章中的'(英文单引号)替换成‘和’(中文单引号),把"(英文双引号)替换成“和”(中文双引号)。更有意思的是英文的三 个句号(...)居然会被转换为中文的半个省略号(…)。这么处理可能是基于方便数据库存储的考虑吧,或者也许WordPress的开发人员是中国人 吧:) 对于一般的文章没有什么问题,对于经常要在文章里面贴代码的人来说就麻烦了,因为中文引号的代码人家COPY回去是没法用的。
这个替换是在文件wp-includes/formatting.php中进行的。
解决方法:
修改位于”WordPress安装目录/wp-includes/”目录里面的”formatting.php”文件, 在第25行到第43行的这个for循环语句的第一个if条件里, 你应该能看到以下4行代码(或者你直接搜索这些代码查找也可以):
查找以下代码并注释掉:
// static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
成为:
// static strings //屏蔽转换为中文标点符号 //$curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions //$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
保存即可。
此外,也有人编写了一个插件Quotmarks Replacer来处理这个事情。插件库里面可以搜索到,不想修改源代码的朋友可以使用这个插件。
2010年04月15日
by junstyle
594 views
0 comments
IE6确实太讨厌,但现在还是有很多用户,没办法。position:absolute定位在IE6下存在left和bottom的定位错误问题:
1. left 定位问题:
<div style="position:relative;border:1px solid orange;text-align:right;">
<a href="http://www.junstyle.com.cn">http://www.junstyle.com.cn</a>
<div style="position:absolute;top:0;left:0;background:#ccc;">定位</div>
</div>
如果position:absolute的父层,也就是position:relative的层没有设置宽或高,那么在IE6下,出现left错位的 bug,其原因是没有触发haslayout。
解决方法:1. 给position:relative层加上width或height;2. 给position:relative层加上zoom:1,触发layout。
2. bottom定位问题:
<div style="position:relative;border:1px solid orange;text-align:center; zoom:1; ">
<a href="http://www.junstyle.com.cn">http://www.junstyle.com.cn</a>
<div style="position:absolute;bottom:0;left:0;background:#ccc;">定位< /div>
</div>
如果position:absolute的父层,也就是position:relative的层没有设置宽或高,那么在IE6下,出现bottom错位的 bug,其原因是没有触发haslayout。
解决方法:1. 给position:relative层加上width或height;2. 给position:relative层加上zoom:1,触发layout。
其中,还有一个问题,奇偶数问题,如果高度是奇数,在IE6下,会出现bottom:1px这样的现象,解决问题的办法就是把高度设为偶数。
IE6赶快淘汰吧!
2010年04月13日
by junstyle
401 views
0 comments
Javascript里面的new Date("xxxx/xx/xx")这个日期的构造方法有一个妙处,当你传入的是"xxxx/xx/0"(0号)的话,得到的日期是"xx"月的前一个月的最后一天("xx"月的最大取值是69,题外话),如果传入"1999/13/0",会得到"1998/12/31"。而且最大的好处是当你传入"xxxx/3/0",会得到xxxx年2月的最后一天,它会自动判断当年是否是闰年来返回28或29,不用自己判断,太方便了!!所以,我们想得到选择年选择月有多少天的话,只需要
var d=new Date("选择年/选择月+1/0");
alert(d.getDate());
下面是使用Javascript编写的获取某年某月有多少天的getDaysInOneMonth(year, month)方法:
function getDaysInOneMonth(year, month){
month = parseInt(month,10)+1;
var d= new Date(year+"/"+month+"/0");
return d.getDate();
}
2010年04月10日
by junstyle
466 views
2 comments
今天关闭firefox,然后重启它又出现了这个错误:”无法初始化应用程序安全组件。很有可能您的程序个人目录中的文件出现问题。请检查并确认此目录没有读/写限制,而且您的硬盘没有写满或接近于写满。推荐您退出程序并修正问题。如果继续使用此会话,您在访问安全特性时将会看到程序运行发生错误。“,已经是第二次出现这个错误了,不知道是怎么回事,以前用32位的vista都没出现过这个错误,现在换了64位的win7老是出现这个问题,很是烦人,想想第一次处理这个问题时把我所有的浏览记录都搞不见了,这次出现问题一定要弄个安全的解决办法。在网上看到以下的解决方法,可能存在以下几种情况。
检查您的硬盘驱动器的剩余容量。为了做到 Windows机器上的:
1。打开我的电脑
2。右键单击在C:驱动器
3。选择属性。一个对话框将会出现。
4。转到常规选项卡如果报告不到1MB的可用空间,您需要提供更大的空 间。
检查您的配置文件夹中的文件权限。档名为 cert8.db不能是只读的。若要在Windows机器上的:
1。打开您的配置文件夹在Windows资源管理器。
2。右键单击该文件名为cert8.db。
3。选择属性。一个对话框将会出现。
4。转到常规选项卡
5。确保“只读”复选框未选中。
6。按确定。
在您的个人文件夹文件cert8.db可能已损坏。删 除这个文件,而应用程序(火狐,SeaMonkey,建立等)已关闭。[1]要做到这在Windows的机器:
1。关闭应用程序中选择文件 - >“退出。
2。打开您的配置文件夹在Windows资源管理器。
3。点击名为cert8.db文件。
4。按删除。
5。重新启动该应用程序。Cert8.db将重新创建 时,你这样做。
实在无法解决的话,你只能创建一个新的配置文件了。具体操作方法:随便找个firefox的快捷方式,右键单击,选择“属性”,选择弹出选项卡顶部的”快捷方式“栏,在”目标“一项中,在文字 最后加入” -p“,然后”确定“。之后关掉所有已经在运行的firefox窗口,再双击刚刚修改过的firefox快捷方式,就会弹出一个窗口提示选择配置文件,新建一个配置文件即可。
2010年04月9日
by junstyle
296 views
0 comments
// Unix时间戳格式转换为DateTime时间格式
public DateTime GetTime(string timeStamp)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime);
return dtStart.Add(toNow);
}
// DateTime时间格式转换为Unix时间戳格式
public int ConvertDateTimeInt(System.DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
return (int)(time - startTime).TotalSeconds;
}
2010年04月9日
by junstyle
625 views
0 comments
在SQL Server 2008企业管理器中更改表结构时(特别是修改了某个字段的类型时),总是会弹出:必须要先删除原来的表,然后重新创建新表,才能完成表的更改,如果强行更改会出现以下提示:不允许保存更改。您所做的 更改要求删除并重新创建以下表。您对无法重新创建的标进行了更改或者启用了“阻止保存要求重新创建表的更改”选项。如何避免此提示,可从“工具”菜单中 选择“选项”,在“选项”对话框中,选择Designers,选择“表设计器和数据库设计器”,清除“ 阻止保存要求重新创建表的更改”复选框。
