真是可恶,今天看到blog来了两百多垃圾评论,已经加上发评论要验证码了,看来真是道高一尺,魔高一丈。
七 152007
七 122007
DreamHost的版权控制非常严格,如果你的网站放在DreamHost上,并且有版权内容的问题,最好立刻撤掉。一个朋友就因为这样封了帐号。不仅是DreamHost,在国外对版权都控制的非常严格,所以有在国外主机上建站的,要特别注意了。
7月9日,在裕达国贸参加了Google组织的这次AdSense合作伙伴推广暨优化论坛,Google的工作人员讲了一下如何优化广告,提升广告价值,实现站长和Google携手达到共赢的目的。
发了一本Google AdSense优化宝典。并且有个优化比赛,有兴趣的话,可以参加了。
从这次会议上可以看出,Google对中国个人站长还是比较重视的。
遗憾的是,发的体恤衫都是女士的。帽子倒是男女都适合。
七 092007
在百度搜索www.liumin.name竟然没东西了,原来搜索刘敏可是在第一页,不知道为什么百度这次K掉了我的blog,但是site:www.liumin.name还有东西,对baidu真是无语了;还好在Google上搜索刘敏,还在第一页。
七 032007
简单来说就是登录时实现一个记住密码的功能。
在登录验证中,处理是否需要自动登录功能
- class myLogonValidator extends sfValidator
- {
- public function initialize ($context, $parameters = null)
- {
- // initialize parent
- parent::initialize($context);
- // set defaults
- $this->getParameterHolder()->set('login_error', 'Invalid input');
- $this->getParameterHolder()->add($parameters);
- return true;
- }
- public function execute (&$value, &$error)
- {
- $autologon_cookie_param = $this->getParameterHolder()->get('autologon_cookie');
- $autologon_cookie = $this->getContext()->getRequest()->getParameter($autologon_cookie_param);
- $username = $value;
- if ( $autoexit_cookie )
- sfContext::getInstance()->getResponse()->setCookie('autologon_cookie', '', time()-3600, '/');
- else
- sfContext::getInstance()->getResponse()->setCookie('autologon_cookie', $username, time()+2592000, '/');
- return true;
- }
这里如果用户选择了自动登录,那么把$username保存到autologon_cookie中
Continue reading »