本帖最后由 kgne 于 2014-3-20 17:42 编辑
- <?php
- /**
- * [Discuz!] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- * $Id: magic_doodle.php 23608 2011-07-27 08:10:07Z cnteacher $
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- class magic_test {
- var $version = '1.0';
- var $name = 'test_name';
- var $description = 'test_desc';
- var $price = '0';
- var $weight = '0';
- var $useevent = 0;
- var $targetgroupperm = false;
- var $copyright = '<a target="_blank">Comsenz Inc.</a>';
- var $magic = array();
- var $parameters = array();
- function getsetting(&$magic) {}
- function setsetting(&$magicnew, &$parameters) {}
- function usesubmit() {
- global $_G;
- $getmoney = rand(1, intval($this->magic['price'] * 1.5));
- updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][3] => $getmoney), 1, 'MRC', $this->magic['magicid']);
- usemagic($this->magic['magicid'], $this->magic['num']);
- updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $_G['uid']);
- showmessage('magics_credit_message', '', array('credit' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['title'].' '.$getmoney.' '.$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['unit']), array('alert' => 'right', 'showdialog' => 1));
- }
- function show() {
- magicshowtips(lang('magic/money', 'money_info'));
- }
- }
- ?>
复制代码
- <?php
- /**
- * [Discuz!] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- * $Id: lang_doodle.php 27449 2012-02-01 05:32:35Z zhangguosheng $
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- $lang = array
- (
- 'money_name' => '测试物品',
- 'money_desc' => '可以随机获得特定积分',
- 'money_info' => '获得的钱币数目规则:大于1且小于购买价格150%的随机数',
- );
- ?>
复制代码
我直接把magic_money.php拷贝下来,然后生成了一个magic_test.php
然后把lang_money.php拷贝下来,生成了lang_test.php
然后money.gif money.small.gif都拷贝下来改名为 test.gif,test.small.gif
生成的物品没有使用项目,这个是什么回事。
如图所示,左边是正常的金钱卡,右边是测试用的道具,但是此道具无使用项目,怎么回事
|