mynotelist.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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: mynotelist.php 34236 2013-11-21 01:13:12Z nemohou $
  7. */
  8. if(!defined('IN_MOBILE_API')) {
  9. exit('Access Denied');
  10. }
  11. $_GET['mod'] = 'space';
  12. $_GET['do'] = 'notice';
  13. include_once 'home.php';
  14. class mobile_api {
  15. function common() {
  16. }
  17. function output() {
  18. global $_G;
  19. $noticelang = lang('notification', 'reppost_noticeauthor');
  20. $noticepreg = '/^'.str_replace(array('\{actor\}', '\{subject\}', '\{tid\}', '\{pid\}'), array('(.+?)', '(.+?)', '(\d+)', '(\d+)'), preg_quote($noticelang, '/')).'$/';
  21. $actorlang = '<a href="home.php?mod=space&uid={actoruid}">{actorusername}</a>';
  22. $actorpreg = '/^'.str_replace(array('\{actoruid\}', '\{actorusername\}'), array('(\d+)', '(.+?)'), preg_quote($actorlang, '/')).'$/';
  23. foreach($GLOBALS['list'] as $_k => $_v) {
  24. if(preg_match($noticepreg, $_v['note'], $_r)) {
  25. list(, $actor, $tid, $pid, $subject) = $_r;
  26. if(preg_match($actorpreg, $actor, $_r)) {
  27. list(, $actoruid, $actorusername) = $_r;
  28. }
  29. $GLOBALS['list'][$_k]['notevar'] = array(
  30. 'tid' => $tid,
  31. 'pid' => $pid,
  32. 'subject' => $subject,
  33. 'actoruid' => $actoruid,
  34. 'actorusername' => $actorusername,
  35. );
  36. }
  37. }
  38. $variable = array(
  39. 'list' => mobile_core::getvalues(array_values($GLOBALS['list']), array('/^\d+$/'), array('id', 'uid', 'type', 'new', 'authorid', 'author', 'note', 'dateline', 'from_id', 'from_idtype', 'from_num', 'style', 'rowid', 'notevar')),
  40. 'count' => $GLOBALS['count'],
  41. 'perpage' => $GLOBALS['perpage'],
  42. 'page' => intval($GLOBALS['page']),
  43. );
  44. mobile_core::result(mobile_core::variable($variable));
  45. }
  46. }
  47. ?>