示例#1
0
文件: User.php 项目: rjha/sc
 static function getAdminWidget($row, $score = 0)
 {
     $view = new \stdClass();
     //db fields
     $view->id = $row["id"];
     $view->loginId = $row["login_id"];
     $view->provider = $row["provider"];
     $view->email = $row["email"];
     $view->website = $row["website"];
     $view->name = $row["name"];
     $view->location = $row["location"];
     //display fields
     $view->pubId = PseudoId::encode($row["login_id"]);
     $view->createdOn = AppUtil::convertDBTime($row["created_on"]);
     $ts = Util::secondsInDBTimeFromNow($row["created_on"]);
     $span = 24 * 3600;
     $view->last24hr = $ts < $span ? true : false;
     $view->ban = $row["bu_bit"] == 0 ? true : false;
     $view->unban = $row["bu_bit"] == 1 ? true : false;
     $view->taint = $row["tu_bit"] == 0 ? true : false;
     $view->score = $score > 0 ? $score : "";
     $html = NULL;
     $template = "/fragments/user/admin/widget.tmpl";
     $html = Template::render($template, $view);
     return $html;
 }