当前位置: 首页>>代码示例>>PHP>>正文


PHP account::hasDP方法代码示例

本文整理汇总了PHP中account::hasDP方法的典型用法代码示例。如果您正苦于以下问题:PHP account::hasDP方法的具体用法?PHP account::hasDP怎么用?PHP account::hasDP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account的用法示例。


在下文中一共展示了account::hasDP方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instant80

 public static function instant80($values)
 {
     die("This feature is disabled. <br/><i>Also, you shouldn't be here...</i>");
     $values = mysql_real_escape_string($values);
     $values = explode("*", $values);
     connect::connectToRealmDB($values[1]);
     if (character::isOnline($values[0]) == TRUE) {
         echo '<b class="red_text">Please log out your character before proceeding.';
     } else {
         $service_values = explode("*", $GLOBALS['service']['instant80']);
         if ($service_values[1] == "dp") {
             if (account::hasDP($_SESSION['cw_user'], $GLOBALS['service']['instant80']['price']) == FALSE) {
                 echo '<b class="red_text">Not enough ' . $GLOBALS['donation']['coins_name'] . '</b>';
                 $error = true;
             }
         } elseif ($service_values[1] == "vp") {
             if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service']['instant80']['price']) == FALSE) {
                 echo '<b class="red_text">Not enough Vote Points.</b>';
                 $error = true;
             }
         }
         if ($error != true) {
             //User got coins. Boost them up to 80 :D
             connect::connectToRealmDB($values[1]);
             mysql_query("UPDATE characters SET level='80' WHERE guid = '" . $values[0] . "'");
             account::logThis("Performed an instant max level on " . character::getCharName($values[0], NULL), 'Instant', NULL);
             echo '<h3 class="green_text">The character level was set to 80!</h3>';
         }
     }
 }
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:30,代码来源:character.php

示例2: mysql_query

</table>
</form>
<?php 
}
if (isset($_POST['ir_step3'])) {
    $guid = (int) $_POST['ir_char'];
    $instance = (int) $_POST['ir_instance'];
    if ($GLOBALS['service'][$service]['currency'] == "vp") {
        if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service'][$service]['price']) == FALSE) {
            echo '<span class="alert">You do not have enough Vote Points!';
        } else {
            connect::selectDB($_POST['ir_realm']);
            mysql_query("DELETE FROM instance WHERE id='" . $instance . "'");
            account::deductVP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$service]['price']);
            echo '<span class="approved">The instance lock was removed!</span>';
        }
    } elseif ($GLOBALS['service'][$service]['currency'] == "dp") {
        if (account::hasDP($_SESSION['cw_user'], $GLOBALS['service'][$service]['price']) == FALSE) {
            echo '<span class="alert">You do not have enough ' . $GLOBALS['donation']['coins_name'];
        } else {
            connect::selectDB($_POST['ir_realm']);
            mysql_query("DELETE FROM instance WHERE id='" . $instance . "'");
            account::deductDP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$service]['price']);
            echo '<span class="approved">The instance lock was removed!</span>';
            account::logThis("Performed an Instance reset on " . character::getCharName($guid, server::getRealmId($_POST['ir_realm'])), "instancereset", server::getRealmId($_POST['ir_realm']));
        }
    }
}
?>
<br/>
<a href="?p=instancereset">Start over</a>
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:31,代码来源:instancereset.php

示例3: process_cart

function process_cart($cart, $charaID, $character, $accountID, $realm)
{
    if (!isset($_SESSION[$cart . 'Cart'])) {
        return;
    }
    $host = $GLOBALS['realms'][$realm]['host'];
    $rank_user = $GLOBALS['realms'][$realm]['rank_user'];
    $rank_pass = $GLOBALS['realms'][$realm]['rank_pass'];
    $ra_port = $GLOBALS['realms'][$realm]['ra_port'];
    $totalPrice = 0;
    $entrys = array_keys($_SESSION[$cart . 'Cart']);
    if (count($entrys) > 0) {
        // Array of valid items
        $items = array();
        // Generate List
        $query = "SELECT entry, price FROM shopitems WHERE in_shop = '{$cart}' AND entry IN (";
        $query .= implode(', ', $entrys);
        $query .= ")";
        if ($result = mysql_query($query)) {
            while ($row = mysql_fetch_assoc($result)) {
                $item = $_SESSION[$cart . 'Cart'][$row['entry']];
                if ($item) {
                    // Update Price
                    $item['price'] = $row['price'];
                    $item['totalPrice'] = $row['price'] * $item['quantity'];
                    $totalPrice = $totalPrice + $item['totalPrice'];
                    // Valid Item!
                    $items[$row['entry']] = $item;
                    unset($item);
                }
            }
        }
        if ($cart == 'donate' and account::hasDP($_SESSION['cw_user'], $totalPrice) == FALSE) {
            die("You do not have enough {$GLOBALS['donation']['coins_name']}!");
        } else {
            if ($cart == 'vote' and account::hasVP($_SESSION['cw_user'], $totalPrice) == FALSE) {
                die("You do not have enough Vote Points!");
            }
        }
        foreach ($items as $entry => $info) {
            $num = $info['quantity'];
            while ($num > 0) {
                $qty = $num > 12 ? 12 : $num;
                $command = "send items " . $character . " \"Your requested item\" \"Thanks for supporting us!\" " . $entry . ":" . $qty . " ";
                if ($error = sendRA($command, $rank_user, $rank_pass, $host, $ra_port)) {
                    echo 'Connection problems...Aborting | Error: ' . $error;
                    exit;
                } else {
                    shop::logItem($cart, $entry, $charaID, $accountID, $realm, $qty);
                    if ($cart == 'donate') {
                        account::deductDP($accountID, $info['price'] * $qty);
                    } else {
                        account::deductVP($accountID, $info['price'] * $qty);
                    }
                    // Update quantity incase of errors on the next loop
                    $_SESSION[$cart . 'Cart'][$entry]['quantity'] -= $qty;
                }
                $num = $num - $qty;
            }
            // All $entry have been sent
            unset($_SESSION[$cart . 'Cart'][$entry]);
        }
    }
    // Empty Cart
    unset($_SESSION[$cart . 'Cart']);
}
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:66,代码来源:shop.php

示例4: explode

 if (empty($entry) || empty($character_realm) || empty($type)) {
     echo '<b class="red_text">Please specify a character.</b>';
 } else {
     connect::selectDB('webdb');
     $realm = explode("*", $character_realm);
     $result = mysql_query("SELECT price FROM shopitems WHERE entry='" . $entry . "'");
     $row = mysql_fetch_assoc($result);
     $account_id = account::getAccountIDFromCharId($realm[0], $realm[1]);
     $account_name = account::getAccountName($account_id);
     if ($type == 'vote') {
         if (account::hasVP($account_name, $row['price']) == FALSE) {
             die('<b class="red_text">You do not have enough Vote Points</b>');
         }
         account::deductVP($account_id, $row['price']);
     } elseif ($type == 'donate') {
         if (account::hasDP($account_name, $row['price']) == FALSE) {
             die('<b class="red_text">You do not have enough ' . $GLOBALS['donation']['coins_name'] . '</b>');
         }
         account::deductDP($account_id, $row['price']);
     }
     shop::logItem($type, $entry, $realm[0], $account_id, $realm[1], 1);
     $result = mysql_query("SELECT * FROM realms WHERE id='" . $realm[1] . "'");
     $row = mysql_fetch_assoc($result);
     if ($row['sendType'] == 'ra') {
         require '../misc/ra.php';
         require '../classes/character.php';
         sendRa("send items " . character::getCharname($realm[0]) . " \"Your requested item\" \"Thanks for supporting us!\" " . $entry . " ", $row['rank_user'], $row['rank_pass'], $row['host'], $row['ra_port']);
     } elseif ($row['sendType'] == 'soap') {
         require '../misc/soap.php';
         require '../classes/character.php';
         sendSoap("send items " . character::getCharname($realm[0]) . " \"Your requested item\" \"Thanks for supporting us!\" " . $entry . " ", $row['rank_user'], $row['rank_pass'], $row['host'], $row['soap_port']);
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:31,代码来源:sendReward.php


注:本文中的account::hasDP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。