space_reward.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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: space_reward.php 33848 2013-08-21 06:24:53Z hypowang $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
  12. $page = empty($_GET['page'])?1:intval($_GET['page']);
  13. if($page<1) $page=1;
  14. $id = empty($_GET['id'])?0:intval($_GET['id']);
  15. $_GET['flag'] = empty($_GET['flag']) ? 0 : intval($_GET['flag']);
  16. $_GET['fuid'] = empty($_GET['fuid']) ? 0 : intval($_GET['fuid']);
  17. $opactives['reward'] = 'class="a"';
  18. $_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
  19. $_GET['order'] = preg_replace("/[^\[A-Za-z0-9_\]]/", '', $_GET['order']);
  20. $perpage = 20;
  21. $perpage = mob_perpage($perpage);
  22. $start = ($page-1)*$perpage;
  23. ckstart($start, $perpage);
  24. $list = $userlist = array();
  25. $hiddennum = $count = $pricount = 0;
  26. $gets = array(
  27. 'mod' => 'space',
  28. 'uid' => $space['uid'],
  29. 'do' => 'reward',
  30. 'view' => $_GET['view'],
  31. 'order' => $_GET['order'],
  32. 'flag' => $_GET['flag'],
  33. 'type' => $_GET['type'],
  34. 'fuid' => $_GET['fuid'],
  35. 'searchkey' => $_GET['searchkey']
  36. );
  37. $theurl = 'home.php?'.url_implode($gets);
  38. $multi = '';
  39. $conditions['special'] = 3;
  40. $conditions['specialthread'] = 1;
  41. $f_index = '';
  42. $ordersql = 't.dateline DESC';
  43. $need_count = true;
  44. require_once libfile('function/misc');
  45. if($_GET['view'] == 'me') {
  46. $conditions = array('authorid' => $space['uid'], 'special' => 3, 'specialthread' => 1);
  47. } else {
  48. space_merge($space, 'field_home');
  49. if($space['feedfriend']) {
  50. $fuid_actives = array();
  51. require_once libfile('function/friend');
  52. $fuid = intval($_GET['fuid']);
  53. if($fuid && friend_check($fuid, $space['uid'])) {
  54. $conditions = array('authorid' => $fuid, 'special' => 3, 'specialthread' => 1);
  55. $fuid_actives = array($fuid=>' selected');
  56. } else {
  57. $conditions['authorid'] = explode(',', $space['feedfriend']);
  58. }
  59. $query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
  60. foreach($query as $value) {
  61. $userlist[] = $value;
  62. }
  63. } else {
  64. $need_count = false;
  65. }
  66. }
  67. $actives = array($_GET['view'] =>' class="a"');
  68. if($need_count) {
  69. if($_GET['view'] != 'me') {
  70. $conditions['sticky'] = 0;
  71. }
  72. if($searchkey = stripsearchkey($_GET['searchkey'])) {
  73. $conditions['keywords'] = $searchkey;
  74. $searchkey = dhtmlspecialchars($searchkey);
  75. }
  76. if($_GET['flag'] < 0) {
  77. $wheresql .= " AND t.price < '0'";
  78. $conditions['pricesless'] = 0;
  79. $alltype .= '1';
  80. } elseif($_GET['flag'] > 0) {
  81. $wheresql .= " AND t.price > '0'";
  82. $conditions['pricemore'] = 0;
  83. $alltype .= '0';
  84. }
  85. $count = C::t('forum_thread')->count_search($conditions);
  86. if($count) {
  87. foreach(C::t('forum_thread')->fetch_all_search($conditions, 0, $start, $perpage, 'dateline') as $value) {
  88. if(empty($value['author']) && $value['authorid'] != $_G['uid']) {
  89. $hiddennum++;
  90. continue;
  91. }
  92. $list[] = procthread($value);
  93. }
  94. $multi = multi($count, $perpage, $page, $theurl);
  95. }
  96. }
  97. $creditid = 0;
  98. if($_G['setting']['creditstransextra'][2]) {
  99. $creditid = intval($_G['setting']['creditstransextra'][2]);
  100. } elseif ($_G['setting']['creditstrans']) {
  101. $creditid = intval($_G['setting']['creditstrans']);
  102. }
  103. if($_G['uid']) {
  104. $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view'];
  105. $navtitle = lang('core', 'title_'.$_GET['view'].'_reward');
  106. } else {
  107. $_GET['order'] = !$_GET['order'] ? 'dateline' : $_GET['order'];
  108. $navtitle = lang('core', 'title_'.$_GET['order'].'_reward');
  109. }
  110. include_once template("diy:home/space_reward");
  111. ?>