forumdisplay.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 34314 2014-02-20 01:04:24Z 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]['cover'] = array();
  26. if($thread['cover']) {
  27. $_img = @getimagesize($thread['coverpath']);
  28. if($_img) {
  29. $_G['forum_threadlist'][$k]['cover'] = array('w' => $_img[0], 'h' => $_img[1]);
  30. }
  31. }
  32. if(!$thread['authorid'] || !$thread['author']) {
  33. $_G['forum_threadlist'][$k]['author'] = $_G['setting']['anonymoustext'];
  34. $_G['forum_threadlist'][$k]['authorid'] = 0;
  35. }
  36. }
  37. $variable = array(
  38. 'forum' => mobile_core::getvalues($_G['forum'], array('fid', 'fup', 'name', 'threads', 'posts', 'rules', 'autoclose', 'password')),
  39. 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle')),
  40. 'forum_threadlist' => mobile_core::getvalues($_G['forum_threadlist'], array('/^\d+$/'), array('tid', 'author', 'authorid', 'subject', 'subject', 'dbdateline', 'dateline', 'dblastpost', 'lastpost', 'lastposter', 'attachment', 'replies', 'readperm', 'views', 'digest', 'cover')),
  41. 'sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts')),
  42. 'tpp' => $_G['tpp'],
  43. 'page' => $GLOBALS['page'],
  44. );
  45. if(!empty($_G['forum']['threadtypes']) || !empty($_GET['debug'])) {
  46. $variable['threadtypes'] = $_G['forum']['threadtypes'];
  47. }
  48. if(!empty($_G['forum']['threadsorts']) || !empty($_GET['debug'])) {
  49. $variable['threadsorts'] = $_G['forum']['threadsorts'];
  50. }
  51. $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
  52. mobile_core::result(mobile_core::variable($variable));
  53. }
  54. }
  55. ?>