Comsenz Inc.'; var $magic = array(); var $parameters = array(); function getsetting(&$magic) { $settings = array( 'addsize' => array( 'title' => 'attachsize_addsize', 'type' => 'select', 'value' => array( array('5', '5M'), array('10', '10M'), array('20', '20M'), array('50', '50M'), array('100', '100M'), ), 'default' => '10' ), ); return $settings; } function setsetting(&$magicnew, &$parameters) { $magicnew['addsize'] = in_array($parameters['addsize'], array(5,10,20,50,100)) ? intval($parameters['addsize']) : '10'; } function usesubmit() { global $_G; $addsize = !empty($this->parameters['addsize']) ? intval($this->parameters['addsize']) : 10; C::t('common_member_field_home')->increase($_G['uid'], array('addsize' => $addsize)); usemagic($this->magic['magicid'], $this->magic['num']); updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']); showmessage('magics_attachsize_message', '', array('num'=>intval($this->parameters['addsize'])), array('alert' => 'right', 'showdialog' => 1)); } function show() { magicshowtips(lang('magic/attachsize', 'attachsize_info', array('num'=>intval($this->parameters['addsize'])))); } } ?>