magic_thunder.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: magic_thunder.php 27087 2012-01-05 01:49:09Z chenmengshu $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class magic_thunder {
  12. var $version = '1.0';
  13. var $name = 'thunder_name';
  14. var $description = 'thunder_desc';
  15. var $price = '20';
  16. var $weight = '20';
  17. var $useevent = 0;
  18. var $targetgroupperm = false;
  19. var $copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
  20. var $magic = array();
  21. var $parameters = array();
  22. function getsetting(&$magic) {}
  23. function setsetting(&$magicnew, &$parameters) {}
  24. function usesubmit() {
  25. global $_G;
  26. $uid = $_G['uid'];
  27. $_G['uid'] = 0;
  28. $avatar = avatar($uid, 'middle',true);
  29. include_once libfile('function/feed');
  30. feed_add(
  31. 'thunder', 'magicuse_thunder_announce_title',
  32. array(
  33. 'uid' => $uid,
  34. 'username' => "<a href=\"home.php?mod=space&uid=$uid\">$_G[username]</a>"),
  35. 'magicuse_thunder_announce_body',
  36. array(
  37. 'uid' => $uid,
  38. 'magic_thunder' =>1), '', array($avatar), array("home.php?mod=space&uid=$uid")
  39. );
  40. $_G['uid'] = $uid;
  41. usemagic($this->magic['magicid'], $this->magic['num']);
  42. updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
  43. showmessage('magics_thunder_message', 'home.php?mod=space&do=home&view=all', array('magicname'=>$_G['setting']['magics']['thunder']), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true));
  44. }
  45. function show() {
  46. magicshowtips(lang('magic/thunder', 'thunder_info'));
  47. }
  48. }
  49. ?>