helper_manyou.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: helper_manyou.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class helper_manyou {
  12. public static function manyoulog($logtype, $uids, $action, $fid = '') {
  13. global $_G;
  14. if($_G['setting']['my_app_status'] && $logtype == 'user') {
  15. $action = daddslashes($action);
  16. $values = array();
  17. $uids = is_array($uids) ? $uids : array($uids);
  18. foreach($uids as $uid) {
  19. $uid = intval($uid);
  20. C::t('common_member_log')->insert(array('uid' => $uid, 'action' => $action, 'dateline' => TIMESTAMP), false, true);
  21. }
  22. }
  23. }
  24. public static function getuserapp($panel = 0) {
  25. require_once libfile('function/manyou');
  26. manyou_getuserapp($panel);
  27. return true;
  28. }
  29. public static function getmyappiconpath($appid, $iconstatus=0) {
  30. if($iconstatus > 0) {
  31. return getglobal('setting/attachurl').'./'.'myapp/icon/'.$appid.'.jpg';
  32. }
  33. return 'http://appicon.manyou.com/icons/'.$appid;
  34. }
  35. public static function checkupdate() {
  36. global $_G;
  37. if($_G['setting']['my_app_status'] && empty($_G['setting']['my_closecheckupdate']) && $_G['group']['radminid'] == 1) {
  38. $sid = $_G['setting']['my_siteid'];
  39. $ts = $_G['timestamp'];
  40. $key = md5($sid.$ts.$_G['setting']['my_sitekey']);
  41. echo '<script type="text/javascript" src="http://notice.uchome.manyou.com/notice?sId='.$sid.'&ts='.$ts.'&key='.$key.'" charset="UTF-8"></script>';
  42. }
  43. }
  44. }
  45. ?>