forumdisplay.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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: forumdisplay.php 34236 2013-11-21 01:13:12Z nemohou $
  7. */
  8. if(!defined('IN_MOBILE_API')) {
  9. exit('Access Denied');
  10. }
  11. define('MOBILE_HIDE_STICKY', !isset($_GET['hidesticky']) ? 1 : $_GET['hidesticky']);
  12. $_GET['mod'] = 'forumdisplay';
  13. include_once 'forum.php';
  14. class mobile_api {
  15. function common() {
  16. global $_G;
  17. if(!empty($_GET['pw'])) {
  18. $_GET['action'] = 'pwverify';
  19. }
  20. $_G['forum']['allowglobalstick'] = false;
  21. }
  22. function output() {
  23. global $_G;
  24. foreach($_G['forum_threadlist'] as $k => $thread) {
  25. $_G['forum_threadlist'][$k]['tid'] = $thread['icontid'];
  26. if($thread['displayorder'] > 0) {
  27. unset($_G['forum_threadlist'][$k]);
  28. continue;
  29. }
  30. $_G['forum_threadlist'][$k]['cover'] = array();
  31. if($thread['cover']) {
  32. $_img = @getimagesize($thread['coverpath']);
  33. if($_img) {
  34. $_G['forum_threadlist'][$k]['cover'] = array('w' => $_img[0], 'h' => $_img[1]);
  35. }
  36. }
  37. }
  38. $variable = array(
  39. 'forum' => mobile_core::getvalues($_G['forum'], array('fid', 'fup', 'name', 'threads', 'posts', 'rules', 'autoclose', 'password')),
  40. 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle')),
  41. 'forum_threadlist' => mobile_core::getvalues(array_values($_G['forum_threadlist']), array('/^\d+$/'), array('tid', 'author', 'authorid', 'subject', 'subject', 'dbdateline', 'dateline', 'dblastpost', 'lastpost', 'lastposter', 'attachment', 'replies', 'readperm', 'views', 'digest', 'cover')),
  42. 'sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts')),
  43. 'tpp' => $_G['tpp'],
  44. 'page' => $GLOBALS['page'],
  45. );
  46. if(!empty($_G['forum']['threadtypes']) || !empty($_GET['debug'])) {
  47. $variable['threadtypes'] = $_G['forum']['threadtypes'];
  48. }
  49. if(!empty($_G['forum']['threadsorts']) || !empty($_GET['debug'])) {
  50. $variable['threadsorts'] = $_G['forum']['threadsorts'];
  51. }
  52. $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
  53. mobile_core::result(mobile_core::variable($variable));
  54. }
  55. }
  56. ?>