Submitted by gouki on 2010, May 5, 1:54 PM
Yii的用户登录,如果不算上权限的话,恐怕真的是很简单的登录。
简单的判断,简单的处理一下就完事了。
但我今天还真的被简单的折腾了一下。
User登录,需要写几个地方
1、components目录下的UserIdentity.php中,需要加一个判断用户的方法,返回errorCode,当然没有错的话就返回0,这是常用ERROR_NONE
2、model目录下的loginForm,里面有简单的判断处理,如果登录成功,调用CWebUser中的login方法。起初的时候,我一直没找到Yii::app()->user是哪个类。。
3、由于Yii::app()->user->login方法的特殊性,因此,必须要在UserIdentity.php中设定好getId,getName,和states变量。当然最简单的就是判断是否取到用户数据,如果取到的话,直接$this->setPersistentStates($usermodel->getAttributes());如果没有id,name的变量,那么即使你登录了,还是会显示没有登录的。我就是在这里被折腾了好久。
over。。。
Tags: yii, 重构
PHP Framework | 评论:2
| 阅读:23732
Submitted by gouki on 2010, April 20, 10:31 AM
这段时间对于百思家网站(http://www.bestjia.com)的SEO已经暂时告一段落,暂时稳定一下,以便搜索引擎能够把近期的一些数据进行收录。
这几天看着搜索引擎过来的报告,发现非技术性的网站,通过百度过来的流量远超于google,因此基本上也可以确定,在国内,做电子商务网站,还是以优化百度搜索引擎为主,一些SEO技巧还是针对一下百度较好。针对google的SEO的话,还是以技术型网站居多。
这段时间是什么样的内容被搜索着呢?让我们来看一下:
- 2009壁纸十大品牌排名,关键字:壁纸十大品牌排名2010
- 简约_卫生间_装修效果图,关键字:卫生间装修效果图 简约
- 2009壁纸十大品牌排名,关键字:壁纸品牌排名
- 2010年最新中国卫浴十大品牌排名榜,关 键字:洁具十大品牌排名2010
- 2009壁纸十大品牌排名,关键字:壁纸排名
我这里只列出了排名前5的,很明显,通过搜索引擎过来的大多是“壁纸”和“洁具”,当然还有排名稍差一点的。我这里就不一一列出了。我列出上面的一些关键字,意思就是想分析一下用户的搜索行为,都是一些很常用的,而且用户对排名啥的特别关注。对于选择多的都是什么十大排名,对于少的都是什么前五名之类的。
百度在一下子收录你很多数量的文章后,慢慢慢慢的还会帮你删除掉一点,然后剩下来的如果量不多,被搜索的机会还是很少。量级,还是很有用的。其他就不说了,先藏着。哈哈
Tags: 百思家, seo, 效果, 资料, 关键字
Misc | 评论:0
| 阅读:18800
Submitted by gouki on 2008, October 26, 7:14 PM
封面放上一张,详细和更多请看详细。

» 阅读全文
Tags: 照片, 新衣服, 佑阳, 小家伙, 阳台
Scala & Ruby | 评论:0
| 阅读:20491
Submitted by gouki on 2008, October 24, 3:42 PM
Google Analytics一直为各个站长朋友提供着优质免费的服务,今天Google Analytics进行了比较大的更新,新的功能包括自定义报表,受众分析,Adsense分析,开放API,还有一些用户界面的更新.
1. 自定义报告: Lets you create reports using any source of data (such as people who have bought something on your site, average number of pageviews, geography, visiting source) as the X and Y coordinates for a chart.
2. 受众分析: Lets you look at custom slices of your Website’s audience (such as people who stay for more than two minutes, people who came from TechCrunch, people who came from the New York Times, people who bought something, people who came from Techcrunch and bought something).
3. Adsense集成: This was along time coming. You can already track how your AdWords campaigns impact traffic to your site. Now you can see data from your AdSense account as well. Marry that with Google Analytics data and you can get new insights into not only which ads you place through AdSense are doing the best, but from which referring sites. (Read more on the AdSense blog).
4. API: This will be rolling out “soon,’ but is also being announced today. Google will open up an API to Gogle Analytics that will allow developers to pipe all of the data in Google Analytics to other Websites, tools, widgets, or even mobile apps. So if someone wants to create a widget that will let people show their Google Analytics charts on their blog, that will be possible.
5. 气泡方式显示图表: The new motion charts allow you to visualize data across five dimensions (x axis, y axis, size of bubble, color of bubble, and position over time). It lets you create an animation to show you what’s been happening with your Website’s key metrics. This feature comes out of the Trendalyzer software Google bought from Gapminder in 2007. (See video below).
6. 用户界面优化: You’ll notice some new subtle shading and highlighting. But the biggest change will be in the management dashboard. Now, if you track more than one Website with Google Analytics, you will be able to see trends across all of them at once.
原文:http://www.cnbeta.com/articles/67788.htm
Tags: google, analytics, 统计, 优化, 更新
Software | 评论:0
| 阅读:22102
Submitted by gouki on 2008, September 6, 10:24 PM
今天听了点课,感悟还是有点的。软件开发会时不时的遇到点瓶颈,这其实与佛家思想还是有点关系的,当然,也许是我硬套上的吧。
佛家参惮有一种说法:看山是山,看水是水;看山不是山,看水不是水;看山还是山,看水还是水。这里说的是佛家修行的三个层次,也叫三重境界,即初期看山是山,中期有悟时,山就不再是简单的山了,最后彻悟,返朴归真,山还是山,但已经不是原来的那个山了,升华了,空灵了。把这用在游记上也是很合适的。走马观花,照象机式的记录,见山是山,见水是水,见什么写什么,流水帐,千篇一律,大同小异,这是初级阶段。再上一个层次,进到文学的创作,那就得看山不是山,看水不是水。那是什么?是山水背后的东西,附在山水之上的东西,山不再是单纯岩石泥土加草木的立体,水也不是简单的流动的液体了。
软件开发也差不多,刚开始学程序的时候,看山是山,因为这时候思想还没有成形,对于程序的理解都是停在表面上,没有什么特别的概念。随着编程时间的增长,和能力的进步,这时候看待程序、架构都比较的深层次了,于是就升级成为看山不是山,看水不是水的境界。这道坎其实很难跨越,等到真正跨越这一层,然后所以的编程语言、架构在眼里又变成那样的浅显,于是又回到了最初的看山是山看水是水的境界。
随便说说而己。不必生搬硬套
Tags: 佛家思想, 感悟, 开发, php
PHP | 评论:1
| 阅读:20450