This is an example似乎需要的整合。这不是CI,但它只是一些功能,可以作为一个起点。
EDITED
重新审视这个问题,在我看来,你问,因为它是麻烦,因为你必须重写的东西,WP做得非常好。
无论哪种方式,Cookie的名称都由网站的前缀和编译ID组成,它只是博客URL的md5。定义在文件“wp-includes/default-constants.php”中。
的一个你感兴趣的可以这样使用:
//$wp_url like this: http://domain.com, Exactly as written in the configuration
$cookie= "wordpress_logged_in_".md5($wp_url);
这个cookie的内容将是这样的:管理| 7C1314493656 | 7Cdd41a2cd52acbaaf68868c850f094f9f
$cookie_content= explode("|",$this->input->cookie($cookie,true));
if(count($cookie_content)>0){
$user_name= $cookie_content[0];
}else{
//No user identified, do something...
}
奖金包
在研究WP代码是w选择一个小型图书馆,直接在CI中使用WP登录和访问级别。在bitbucket GPL2许可(如WP)中可用:CiWp-Auth。
不期待自己建造这个图书馆。非常感谢您的分享。在分解的部分可以找到类似的项目:'http:// blog.marketingadept.com/integrate-codeigniter-and-wordpress /'。我现在对这个项目感到兴奋。谢谢! – user13186
此代码已过时。我很高兴能有用。问候。 –