真是可恶,今天看到blog来了两百多垃圾评论,已经加上发评论要验证码了,看来真是道高一尺,魔高一丈。

DreamHost的版权控制非常严格,如果你的网站放在DreamHost上,并且有版权内容的问题,最好立刻撤掉。一个朋友就因为这样封了帐号。不仅是DreamHost,在国外对版权都控制的非常严格,所以有在国外主机上建站的,要特别注意了。

7月9日,在裕达国贸参加了Google组织的这次AdSense合作伙伴推广暨优化论坛,Google的工作人员讲了一下如何优化广告,提升广告价值,实现站长和Google携手达到共赢的目的。

发了一本Google AdSense优化宝典。并且有个优化比赛,有兴趣的话,可以参加了。

从这次会议上可以看出,Google对中国个人站长还是比较重视的。

遗憾的是,发的体恤衫都是女士的。帽子倒是男女都适合。

在百度搜索www.liumin.name竟然没东西了,原来搜索刘敏可是在第一页,不知道为什么百度这次K掉了我的blog,但是site:www.liumin.name还有东西,对baidu真是无语了;还好在Google上搜索刘敏,还在第一页。

简单来说就是登录时实现一个记住密码的功能。

在登录验证中,处理是否需要自动登录功能

  1. class myLogonValidator extends sfValidator
  2. {
  3.   public function initialize ($context, $parameters = null)
  4.   {
  5.     // initialize parent
  6.     parent::initialize($context);
  7.  
  8.     // set defaults
  9.     $this->getParameterHolder()->set('login_error', 'Invalid input');
  10.  
  11.     $this->getParameterHolder()->add($parameters);
  12.  
  13.     return true;
  14.   }
  15.  
  16.   public function execute (&$value, &$error)
  17.   {
  18.  
  19.     $autologon_cookie_param     = $this->getParameterHolder()->get('autologon_cookie');
  20.     $autologon_cookie            = $this->getContext()->getRequest()->getParameter($autologon_cookie_param);   
  21.     $username = $value;
  22.  
  23.   if ( $autoexit_cookie )
  24.    sfContext::getInstance()->getResponse()->setCookie('autologon_cookie', '', time()-3600, '/');
  25.   else 
  26.     sfContext::getInstance()->getResponse()->setCookie('autologon_cookie', $username, time()+2592000, '/');
  27.   return true;
  28. }

这里如果用户选择了自动登录,那么把$username保存到autologon_cookie中
Continue reading »

© 2011 刘敏的Blog Suffusion theme by Sayontan Sinha