misc_getatuser.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: misc_getatuser.php 25782 2011-11-22 05:29:19Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $result = '';
  12. $search_str = $_GET['search_str'];
  13. if($_G['uid']) {
  14. $atlist = $atlist_cookie = array();
  15. $limit = 200;
  16. if($_G['cookie']['atlist']) {
  17. $cookies = explode(',', $_G['cookie']['atlist']);
  18. foreach(C::t('common_member')->fetch_all($cookies, false, 0) as $row) {
  19. $temp[$row[uid]] = $row['username'];
  20. }
  21. foreach($cookies as $uid) {
  22. $atlist_cookie[$uid] = $temp[$uid];
  23. }
  24. }
  25. foreach(C::t('home_follow')->fetch_all_following_by_uid($_G['uid'], 0, 0, $limit) as $row) {
  26. if($atlist_cookie[$row[followuid]]) {
  27. continue;
  28. }
  29. $atlist[$row[followuid]] = $row['fusername'];
  30. }
  31. $num = count($atlist);
  32. if($num < $limit) {
  33. $query = C::t('home_friend')->fetch_all_by_uid($_G['uid']);
  34. foreach($query as $row) {
  35. if(count($atlist) == $limit) {
  36. break;
  37. }
  38. if($atlist_cookie[$row[fuid]]) {
  39. continue;
  40. }
  41. $atlist[$row[fuid]] = $row['fusername'];
  42. }
  43. }
  44. $result = implode(',', $atlist_cookie).($atlist_cookie && $atlist ? ',' : '').implode(',', $atlist);
  45. }
  46. include template('common/getatuser');
  47. ?>