QQGroup.php 946 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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: QQGroup.php 28558 2012-03-05 02:59:09Z yexinhao $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class Cloud_Service_QQGroup {
  12. protected $_util;
  13. protected static $_instance;
  14. public static function getInstance() {
  15. global $_G;
  16. if (!(self::$_instance instanceof self)) {
  17. self::$_instance = new self();
  18. }
  19. return self::$_instance;
  20. }
  21. public function __construct() {
  22. $this->_util = Cloud::loadClass('Service_Util');
  23. }
  24. public function iframeUrl($tid, $title, $content) {
  25. global $_G;
  26. if (!$_G['adminid']) {
  27. return false;
  28. }
  29. $url = 'http://qun.discuz.qq.com/feed/push?';
  30. $params = array(
  31. 't_id' => $tid,
  32. 's_url' => $_G['siteurl'],
  33. 'title' => $title,
  34. 'content' => $content
  35. );
  36. $signUrl = $this->_util->generateSiteSignUrl($params);
  37. return $url . $signUrl;
  38. }
  39. }