PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/source/module/misc/misc_userstatus.php

https://github.com/jinbo51/DiscuzX
PHP | 52 lines | 39 code | 7 blank | 6 comment | 7 complexity | 7b09ba811fb389110a5a4fb826196bf4 MD5 | raw file
Possible License(s): BSD-3-Clause
  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_userstatus.php 32720 2013-03-04 10:21:58Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $output = array();
  12. $output['uid'] = $_G['uid'];
  13. $tablename = '';
  14. if($_GET['type'] === 'topic' && $typeid = intval($_GET['typeid'])) {
  15. $tablename = 'portal_topic';
  16. C::t('portal_topic')->increase($typeid, array('viewnum' => 1));
  17. } elseif($_GET['type'] === 'article' && $typeid = intval($_GET['typeid'])) {
  18. C::t('portal_article_count')->increase($typeid, array('viewnum' => 1));
  19. $tablename = 'portal_article_count';
  20. }
  21. if($tablename) {
  22. $dynamicdata = C::t($tablename)->fetch($typeid);
  23. $output['viewnum'] = $dynamicdata['viewnum'];
  24. $output['commentnum'] = $dynamicdata['commentnum'];
  25. }
  26. if($output['uid']) {
  27. $_G['style']['tplfile'] = 'misc/userstatus';
  28. if(check_diy_perm($topic)){
  29. require template('common/header_diynav');
  30. echo $diynav;
  31. }
  32. $output['diynav'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
  33. ob_end_clean();
  34. $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
  35. require template('common/header_userstatus');
  36. $output['userstatus'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
  37. ob_end_clean();
  38. $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
  39. require template('common/header_qmenu');
  40. $output['qmenu'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
  41. ob_end_clean();
  42. $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
  43. }
  44. echo helper_json::encode($output);
  45. ?>