|
发表于 2010-1-4 23:01:23
|
显示全部楼层
建立一个library.
PHP复制代码
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
| Version: $Id: bb_user.php 141 2009-01-05 06:24:13Z David $
*/
class Bb_user
{
function Bb_user ()
{
$this->obj =& get_instance ();
date_default_timezone_set('Asia/ChongQing');
include './conf/config.inc.php';
include './uc_client/client.php';
if(!empty($_COOKIE['cookie'])) {
list($this->_uid , $this->_username ) = explode("\t", uc_authcode ($_COOKIE['my_cookie'], 'DECODE'));
} else {
$this->_uid = $this->_username = '';
}
}
function getUserId () {
return $this->_uid ;
}
function getUserName () {
return ucwords(strtolower($this->_username ));
}
复制代码 |
|