August, 2010Archive for

Thinkphp htaccess rewrite的问题

我的网站Thinkphp配置URL_MODE为2, 传到服务器就出现这样的错误,无论进什么页面都会跳转到首页. htaccess文件的配置如下: 后来发现问题出现在Apache的版本上,好像不同版本对rewrite的解析不一样。 修改htaccess如下后,工作正常:

Javascript trim function

In programming, trim is a string manipulation function or algorithm. The most popular variants of the trim function strip only the beginning or end of the string. Typically named ltrim and rtrim respectively. This Javascript code trim implementation removes all leading and trailing occurrences of a set of characters specified. If no characters are specified it will trim whitespace characters from the beginning or end or both of the string. Without the second parameter, Javascript function ...

How to set up A Records and MX Records

URL FORWARDING RECORDS HOST NAME TYPE DATA Forward (F) Forward (F) URL Forwarding records are used to redirect domains to another URL. A common purpose is to point a domain to a website or page hosted elsewhere which usually has a longer URL such as Keep in mind that the DATA part of the forwarding record must be a complete URL like...

css min/max-width fix in IE6

We can use Javascript expression in css to make sure the min-width, max-width that works for IE6.

jQuery iPhone UI – A Library That Mimics iPhone Interface

Few days ago, the jQuery team announced that they are working on jQuery Mobile which will probably become quickly popular on creating mobile web apps. for the fans of the library. On the other hand, there are already ready-to-use solutions like the pretty-complete jQuery iPhone UI (check the "Mobile Development" category for others). It is a jQuery library which emulates the iPhone interface that is handy for creating iPhone web applications. The library includes widgets like menu, ...

5 Ways To Improve Your Adsense Earnings

Here are some 5 proven ways on how best to improve your Adsense earnings: 1. Concentrating on one format of Adsense ad. The one format that worked well for the majority is the Large Rectangle (336X280). This same format have the tendency to result in higher CTR, or the click-through rates. Why choose this format out of the many you can use? Basically because the ads will look like normal web links, and people, being used to clicking on them, click these types of links. They may or may not kno...

Free download javascript slideshow

Download javascript slideshow here


这里使用了两个表,第一个表为Post表,第二个表为Category表。 MYSQL语句为: ThinkPHP中Join的写法: 如果你在ThinkPHP中设置了表的前缀,那么在写Join的时候,表名也要加上前缀。

ThinkPHP 2.0 多语言使用Bug

项目中使用到了thinkphp2.0的多语言功能,发现一些bug 语言配置如下: 在Lang目录下创建en-us,zh-cn,zh-tw目录 ThinkPHP使用$_SERVER['HTTP_ACCEPT_LANGUAGE']来自动检测浏览器支持语言, 然后保存到cookie中,并读取相应的语言包。 这里有两个问题: 1. 浏览器的返回值的大小写不同, 如Firefox:en-us, 谷歌chrome:en-US 返回值是小写的时候没有问题,大写的时候(chrome)就会产生找不到语言包的情况。 2. 浏览器的支持语言不存在的时候,也会产生找不到语言包的情况。 比如说有的浏览器返回值是 en-gb 解决办法如下, 打开/ThinkPHP/Lib/Think/Core/App.class.php文件,查看checkLanguage()函数,找到: 替换以上代码为: 修改完成后,一定记得清除/Runtime/~runtime.php文件,然后清除浏览器的cookie,刷新页面,一切就都正常了。...