diff --git a/application/admin/controllers/UserController.php b/application/admin/controllers/UserController.php index 769be8b6..2b8417ef 100755 --- a/application/admin/controllers/UserController.php +++ b/application/admin/controllers/UserController.php @@ -292,6 +292,8 @@ class Admin_UserController extends Zend_Controller_Action $groupsTable = "groups"; $userGroupTable = "usergroup"; $nameField = $paramName = "name"; + include_once("User.php"); + $u = new User($this->db); if(empty($ac) || $ac == "index") { diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php index 52c85970..b412ca22 100755 --- a/application/default/controllers/AccountController.php +++ b/application/default/controllers/AccountController.php @@ -174,8 +174,19 @@ class AccountController extends Zend_Controller_Action $result = $auth->authenticate($authAdapter); if ($result->isValid()) { - // success: store database row to auth's storage + // success: store database row to auth's storage $data = $authAdapter->getResultRowObject(null,'password'); + + //头像 + include_once("Avatar.php"); + $avatar = new Avatar(); + $data->avatar = $avatar->Get($data->email,40); + + //组ID + include_once("Users.php"); + $usr = new Users($db); + $data->gid = $usr->getGroup($data->id); + $auth->getStorage()->write($data); $db->query("update users set ts_last_login=now() where username=?",array($u)); diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 394850eb..bd476f06 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -877,12 +877,14 @@ class DataController extends Zend_Controller_Action $paginator->setView($this->view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_ajax.phtml'); + include_once("Avatar.php"); + $avatar = new Avatar(); if ($paginator) { foreach($paginator as $c) { //$author=$this->view->escape($c['author']); - $sql = "SELECT cr.id,cr.content as body,cr.reply,u.username,cr.ts_created,u.usertype, + $sql = "SELECT cr.id,cr.content as body,cr.reply,u.username,cr.ts_created,u.usertype,u.email as email, (SELECT au.uuid FROM mdauthor au WHERE au.userid=u.id AND au.uuid='$uuid') as uuid FROM comments cr LEFT JOIN users u ON cr.userid=u.id @@ -918,11 +920,16 @@ class DataController extends Zend_Controller_Action "; } } - $author=$c['author']; - $author=($c['userid'])?"".$author."":$author; - $author=($c['url'])?''.$author.'':$author; + + $img = $avatar->Get($c['email'],30); + $img = ''; + + $author = $c['author']; + $author = ($c['url'])?''.$author.'':$author; + $author = '
".($c['content'])."
$replyhtml