Ejemplo n.º 1
0
 public function output()
 {
     global $_G;
     $only_count = false;
     if (isset($_GET["only_count"]) && $_GET["only_count"] == 1) {
         $only_count = true;
     }
     if ($only_count) {
         $variable = array("count" => $GLOBALS['count']);
         bigapp_core::result(bigapp_core::variable($variable));
         return;
     }
     $variable = array("count" => $GLOBALS['count'], "list" => array_values(mobile_core::getvalues($GLOBALS['list'], array('/^.+?$/'), array('fuid', 'fusername', 'note', 'dateline', 'gid'))));
     $uidarr = array();
     foreach ($variable["list"] as &$item) {
         $uid = $item["fuid"];
         $username = $item["fusername"];
         unset($item["fuid"]);
         unset($item["fusername"]);
         $item["uid"] = $uid;
         $item["username"] = $username;
         $item["avatar"] = avatar($uid, 'big', 'true');
         $uidarr[] = $uid;
     }
     ////////////////////////////////
     // map group
     $ugmap = BigAppAPI::get_user_group_map($uidarr);
     foreach ($variable["list"] as &$item) {
         $uid = $item["uid"];
         $item["groupname"] = "unknown";
         if (!isset($ugmap[$uid])) {
             $item["groupid"] = 0;
         } else {
             $gid = $ugmap[$uid];
             $item["groupid"] = $gid;
             if (isset($_G['cache']['usergroups'][$gid]['grouptitle'])) {
                 $item['groupname'] = preg_replace('/<.*?\\>/', '', $_G['cache']['usergroups'][$gid]['grouptitle']);
             }
         }
     }
     ////////////////////////////////
     bigapp_core::result(bigapp_core::variable($variable));
 }