Beispiel #1
0
            }
            if (!submitcheck('operatesubmit')) {
                include libfile('function/friend');
                $buddyarray = friend_list($_G['uid'], 20);
                include template('home/space_magic_mybox_opreation');
                dexit();
            } else {
                $magicnum = intval($_GET['magicnum']);
                $toname = dhtmlspecialchars(trim($_GET['tousername']));
                if (!$toname) {
                    showmessage('magics_username_nonexistence');
                } elseif ($magic['num'] < $magicnum) {
                    showmessage('magics_num_invalid');
                }
                $givemessage = dhtmlspecialchars(trim($_GET['givemessage']));
                givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], '0', $givemessage, $magicarray);
            }
        } else {
            showmessage('undefined_action');
        }
    }
} elseif ($action == 'log') {
    $subactives[$operation] = 'class="a"';
    $loglist = array();
    if ($operation == 'uselog') {
        $count = C::t('common_magiclog')->count_by_uid_action($_G['uid'], 2);
        if ($count) {
            $multipage = multi($count, $_G['tpp'], $page, 'home.php?mod=magic&action=log&amp;operation=uselog');
            $logs = C::t('common_magiclog')->fetch_all_by_uid_action($_G['uid'], 2, $start_limit, $_G['tpp']);
            $luids = array();
            foreach ($luids as $log) {
Beispiel #2
0
                updatemagiclog($magic['magicid'], '4', $magicnum, $price);
                showmessage('magics_succeed', 'magic.php?action=market');
            } elseif ($operation == 'drop') {
                usemagic($magic['magicid'], $magic['num'], $magicnum);
                updatemagiclog($magic['magicid'], '2', $magicnum, $price);
                showmessage('magics_succeed', 'magic.php?action=user');
            } elseif ($operation == 'give') {
                if ($allowmagics < 2) {
                    showmessage('magics_nopermission');
                }
                $toname = dhtmlspecialchars(trim($tousername));
                $magicnum = intval($magicnum);
                if (empty($tousername)) {
                    showmessage('magics_username_nonexistence');
                }
                givemagic($toname, $magic['magicid'], $magicnum, $magic['num'], '0');
            }
        }
    }
} elseif ($action == 'market') {
    $discuz_action = 172;
    if (empty($magicmarket)) {
        showmessage('magics_market_close');
    }
    if (empty($operation) || $operation == 'my' || submitcheck('searchsubmit')) {
        $ascdesc = isset($ascdesc) && in_array(strtoupper($ascdesc), array('ASC', 'DESC')) ? strtoupper($ascdesc) : 'DESC';
        $orderby = isset($orderby) && in_array(strtolower($orderby), array('price', 'num')) ? strtolower($orderby) : '';
        $magicid = isset($magicid) && is_numeric($magicid) ? intval($magicid) : 0;
        $magicadd = !empty($magicid) ? '&amp;magicid=' . $magicid : '';
        $magicadd .= !empty($orderby) ? '&amp;orderby=' . $orderby : '';
        $magicadd .= !empty($ascdesc) ? '&amp;ascdesc=' . $ascdesc : '';