wsq_app.inc.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: wsq_app.inc.php 35205 2015-02-12 01:39:25Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  9. exit('Access Denied');
  10. }
  11. $setting = C::t('common_setting')->fetch_all(array('mobilewechat'));
  12. $setting = (array)unserialize($setting['mobilewechat']);
  13. require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php';
  14. require_once DISCUZ_ROOT.'./source/plugin/wechat/wsq.class.php';
  15. require_once DISCUZ_ROOT.'./source/plugin/wechat/setting.class.php';
  16. WeChatSetting::menu();
  17. showtableheader(lang('plugin/wechat', 'wsq_viewapp_pubevent'));
  18. echo '<tr><td style="line-height:30px" id="pubevent">'.lang('plugin/wechat', 'wsq_viewapp_na').'</td></tr>';
  19. showtablefooter();
  20. showtableheader(lang('plugin/wechat', 'wsq_viewapp_local'));
  21. echo '<tr><td style="line-height:30px">'.lang('plugin/wechat', 'wsq_viewapp_local_comment').'</td></tr>';
  22. showtablefooter();
  23. showtableheader(lang('plugin/wechat', 'wsq_viewapp_online'));
  24. echo '<tr><td style="line-height:30px">'.lang('plugin/wechat', 'wsq_viewapp_online_comment').'</td></tr>';
  25. showtablefooter();
  26. if($setting['wsq_siteid']) {
  27. $time = TIMESTAMP;
  28. echo <<<EOF
  29. <script>
  30. function pubEventCallback(re) {
  31. if(re.errCode) {
  32. return;
  33. }
  34. if(typeof re.data.event.peId != 'undefined') {
  35. $('pubevent').innerHTML = '<h1><a href="http://mp.wsq.qq.com" target="_blank">' + re.data.event.peTitle + '</a></h1>' + re.data.event.peContent;
  36. }
  37. }
  38. </script>
  39. <script src="http://api.wsq.qq.com/publicEvent?sId={$setting[wsq_siteid]}&resType=jsonp&isAjax=1&_=$time&isDiscuz=1&callback=pubEventCallback">
  40. </script>
  41. EOF;
  42. }