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


PHP get_module_objpref函数代码示例

本文整理汇总了PHP中get_module_objpref函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module_objpref函数的具体用法?PHP get_module_objpref怎么用?PHP get_module_objpref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: dwshacks_dohook

function dwshacks_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "dwellings-list-type":
            addnav("Show Only Types");
            addnav(array("%s", translate_inline(ucfirst(get_module_setting("dwnameplural", "dwshacks")))), "runmodule.php?module=dwellings&op=list&showonly=dwshacks&ref={$args['ref']}&sortby={$args['sortby']}&order={$args['order']}");
            break;
        case "dwellings-list-interact":
            if ($args['type'] == "dwshacks" && $args['status'] == 1 && get_module_setting("maxkeys") == 123456789) {
                addnav("", "runmodule.php?module=dwellings&op=enter&dwid={$args['dwid']}");
                $tress = translate_inline("Tresspass");
                rawoutput("<a href='runmodule.php?module=dwellings&op=enter&dwid={$args['dwid']}'>{$tress}</a>");
            }
            break;
        case "dwellings-manage":
            $dwid = $args['dwid'];
            if (get_module_setting("maxkeys") == 123456789 && $args['type'] == "dwshacks") {
                blocknav("runmodule.php?module=dwellings&op=keys&dwid={$dwid}");
            }
            break;
        case "dwellings":
            if (get_module_objpref("city", $args['cityid'], "showdwshacks")) {
                output("  Along the narrow pathway, precariously placed wood planks are nailed and leaning on each other in a fashion that only leaves you to assume they are supposed to be %s.`0", translate_inline(get_module_setting("dwnameplural")));
                if ($args['allowbuy'] == 1 && $session['user']['dragonkills'] >= get_module_setting("dkreq")) {
                    $cityid = $args['cityid'];
                    addnav("Options");
                    addnav(array("Establish a %s", translate_inline(ucfirst(get_module_setting("dwname", "dwshacks")))), "runmodule.php?module=dwellings&op=buy&type=dwshacks&subop=presetup&cityid={$cityid}");
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:34,代码来源:dwshacks.php

示例2: creatureaddon_run

function creatureaddon_run()
{
    global $session, $args;
    $op = httpget('op');
    $header = $args['creaturename'] . " Description";
    popup_header($header);
    $description = get_module_objpref("creatures", $args['creatureid'], "description");
    output($description);
    popup_footer();
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:10,代码来源:creatureaddon.php

示例3: iitems_eboy_gypsy_run

function iitems_eboy_gypsy_run()
{
    global $session;
    page_header("eBoy's Price Chart");
    require_once "modules/iitems/lib/lib.php";
    $cost = get_module_setting("cost", "iitems_eboy_gypsy");
    if ($cost == 1) {
        $p = "Cigarette";
    } else {
        $p = "Cigarettes";
    }
    if ($session['user']['gems'] >= $cost) {
        $session['user']['gems'] -= $cost;
        output("`5You hand over the %s and the old man chuckles.  \"`!Aaah, thank ye kindly.  Now, here we are!  I'd recommend you write these down.  Now mark my words - these prices fluctuate by the `iminute`i!  That eBoy, he's a crafty bastard, y'see.  He sells things for whatever people are willing to buy them for, and not one penny less!  Even if that means putting his prices up the `isecond`i someone buys something!`5\"`n`nHe reaches under his desk and brings up a clattering rectangular machine made out of wood and brass, about the size of a fat telephone directory.  A radio antenna protrudes from one corner.`n`nTrue to his word, the spinning reels show the prices of every commodity in every outpost.  You spend a few minutes studying the readout.`n`n", $p);
        $sql = "select * from " . db_prefix("cityprefs");
        $result = db_query($sql);
        for ($i = 0; $i < db_num_rows($result); $i++) {
            $row = db_fetch_assoc($result);
            $cid = $row['cityid'];
            $name = $row['cityname'];
            $eboy = unserialize(get_module_objpref("city", $cid, "eboytrades-intelligent", "iitems_eboy_intelligent"));
            output("`b`0%s`b`n", $name);
            rawoutput("<table border=0 cellpadding=3 cellspacing=2><tr class=\"trdark\"><td>Item</td><td>Buying at</td><td>Selling at</td><td>Stock</td></tr>");
            $classcount = 1;
            foreach ($eboy as $key => $details) {
                $itemdetails = iitems_get_item_details($key);
                if ($details['price'] < 10) {
                    $details['price'] = 10;
                }
                $eboy[$key]['price'] = $details['price'];
                if ($details['stock'] < 3) {
                    $buy = round($details['price'] * 0.5);
                } else {
                    $buy = round($details['price'] * 0.7);
                }
                $classcount++;
                $class = $classcount % 2 ? "trdark" : "trlight";
                $dname = $itemdetails['verbosename'];
                $dsell = number_format($details['price']);
                $dbuy = number_format($buy);
                $dstock = number_format($details['stock']);
                rawoutput("<tr class='{$class}'><td>{$dname}</td><td align=\"center\">{$dbuy}</td><td align=\"center\">{$dsell}</td><td align=\"center\">{$dstock}</td></tr>");
            }
            rawoutput("</table>");
            output("`n`n");
        }
    } else {
        output("`5You enthusiastically agree to the price, before realising that you don't actually have that many cigarettes.  Whoops.");
    }
    addnav("Leave");
    addnav("Return to the Outpost", "village.php");
    page_footer();
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:54,代码来源:iitems_eboy_gypsy.php

示例4: dwellingscostsp_dohook

function dwellingscostsp_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "dwellings-buy-valuecheck":
            $typeid = get_module_setting("typeid", $args['type']);
            $paidsp = abs((int) httppost('paidsp'));
            if ($paidsp < 0) {
                $paidsp = 0;
            }
            $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
            if ($pointsavailable < $paidsp) {
                $args['allowpay'] = 0;
                blocknav("runmodule.php?module=dwellings&op=build&type=" . $args['type'] . "&dwid=" . $args['dwid'] . "");
                output("`nYou do not have that many site points.");
            } elseif ($paidsp > get_module_objpref("dwellingtypes", $typeid, "spcost") - get_module_objpref("dwellings", $args['dwid'], "spspent")) {
                $args['allowpay'] = 0;
                blocknav("runmodule.php?module=dwellings&op=build&type=" . $args['type'] . "&dwid=" . $args['dwid'] . "");
                output("`nYou have tried to spend more site points than you need to.");
            }
            break;
        case "dwellings-buy-setup":
            $typeid = get_module_setting("typeid", $args['type']);
            $paidsp = abs((int) httppost('paidsp'));
            if ($paidsp < 0) {
                $paidsp = 0;
            }
            $spent = get_module_objpref("dwellings", $args['dwid'], "spspent") + $paidsp;
            set_module_objpref("dwellings", $args['dwid'], "spspent", $spent);
            $session['user']['donationspent'] += $paidsp;
            if ($spent != get_module_objpref("dwellingtypes", $typeid, "spcost")) {
                $args['finished'] = 0;
            }
            break;
        case "dwellings-pay-costs":
            $typeid = get_module_setting("typeid", $args['type']);
            $costsp = get_module_objpref("dwellingtypes", $typeid, "spcost") - get_module_objpref("dwellings", $args['dwid'], "spspent");
            if ($costsp) {
                output("`#%s Site Points`0`n", $costsp);
            }
            break;
        case "dwellings-pay-input":
            $typeid = get_module_setting("typeid", $args['type']);
            $costsp = get_module_objpref("dwellingtypes", $typeid, "spcost") - get_module_objpref("dwellings", $args['dwid'], "spspent");
            $sp = translate_inline("Site Points");
            if ($costsp) {
                rawoutput("{$sp}: <input id='input' name='paidsp' width=5><br>");
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:52,代码来源:dwellingscostsp.php

示例5: uniqueforests_dohook

function uniqueforests_dohook($hookname, $args)
{
    global $session;
    require_once "modules/cityprefs/lib.php";
    $cityid = get_cityprefs_cityid("location", $session['user']['location']);
    switch ($hookname) {
        case "collect-events":
            if (get_module_objpref("city", $cityid, "use")) {
                foreach ($args as $index => $event) {
                    $event['rawchance'] = 0;
                    $events[$index] = $event;
                }
                $args = $events;
            }
            break;
        case "village":
            if (get_module_objpref("city", $cityid, "use")) {
                addnav($args['gatenav']);
                $name = get_module_objpref("city", $cityid, "name");
                blocknav("forest.php");
                addnav(array("%s", $name), "forest.php?location=uniqueforests");
            }
            break;
        case "header-forest":
            if (httpget('location') == "uniqueforests" || get_module_objpref("city", $cityid, "use")) {
                if (httpget('op') == "") {
                    global $block_new_output;
                    $block_new_output = true;
                }
                blocknav("runmodule.php", true);
                blocknav("healer.php", true);
                tlschema("module-uniqueforests");
            }
            break;
        case "footer-forest":
            if (httpget('location') == "uniqueforests" || get_module_objpref("city", $cityid, "use")) {
                $name = get_module_objpref("city", $cityid, "name");
                page_header(color_sanitize($name));
            }
            break;
        case "forest-desc":
            if (httpget('location') == "uniqueforests" || get_module_objpref("city", $cityid, "use")) {
                page_header(color_sanitize($name));
                global $block_new_output;
                $block_new_output = false;
                output(get_module_objpref("city", $cityid, "desc"));
                $block_new_output = true;
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:52,代码来源:uniqueforests.php

示例6: buildinghitpoints_get_data

function buildinghitpoints_get_data($cid)
{
    //Grab all the data from a particular Outpost
    if (!is_numeric($cid)) {
        require_once "modules/cityprefs/lib.php";
        $cid = get_cityprefs_cityid($cid);
    }
    $data = get_module_objpref("city", $cid, "buildinghitpoints");
    $ret = array();
    $ret['data'] = @unserialize($data);
    $ret['cid'] = $cid;
    return $data;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:13,代码来源:buildinghitpoints.php

示例7: mountrarity_dohook

function mountrarity_dohook($hookname, $args)
{
    switch ($hookname) {
        case "newday-runonce":
            $sql = "SELECT mountid FROM " . db_prefix("mounts") . " WHERE mountactive=1";
            $result = db_query($sql);
            while ($row = db_fetch_assoc($result)) {
                $id = $row['mountid'];
                $rarity = get_module_objpref("mounts", $id, "rarity");
                if (e_rand(1, 100) > $rarity) {
                    set_module_objpref("mounts", $id, "unavailable", 1);
                } else {
                    // You need to reset the availability if it's not unavailable
                    // otherwise, it never becomes available again!
                    set_module_objpref("mounts", $id, "unavailable", 0);
                }
            }
            break;
        case "mountfeatures":
            $rarity = get_module_objpref("mounts", $args['id'], "rarity");
            $args['features']['Rarity'] = $rarity;
            break;
        case "stables-desc":
            if (get_module_setting("showout")) {
                $sql = "SELECT mountid, mountname FROM " . db_prefix("mounts") . " WHERE mountactive=1";
                $result = db_query($sql);
                output("`nA sign by the door proclaims that the following mounts are out of stock for today:");
                while ($row = db_fetch_assoc($result)) {
                    $out = get_module_objpref("mounts", $row['mountid'], "unavailable");
                    if ($out) {
                        output("`n%s", $row['mountname']);
                    }
                }
            } else {
                output("`nIf you don't see something you like today, perhaps you should check again tomorrow.");
            }
            break;
        case "stables-nav":
            $sql = "SELECT mountid FROM " . db_prefix("mounts") . " WHERE mountactive=1";
            $result = db_query($sql);
            while ($row = db_fetch_assoc($result)) {
                $id = $row['mountid'];
                $out = get_module_objpref("mounts", $id, "unavailable");
                if ($out) {
                    blocknav("stables.php?op=examine&id={$id}");
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:51,代码来源:mountrarity.php

示例8: clanbuffs_dohook

function clanbuffs_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "footer-hof":
            if (get_module_setting("hof")) {
                addnav("Warrior Rankings");
                addnav("Clan Buffs", "runmodule.php?module=clanbuffs&op=hof");
            }
            break;
        case "footer-clan":
            if ($session['user']['clanid'] != 0 and httpget("op") == "") {
                if ($session['user']['clanrank'] > 0) {
                    addnav("Clan Buffs", "runmodule.php?module=clanbuffs&op=enter");
                }
            }
            break;
        case "village":
        case "forest":
        case "clanhall":
            if (get_module_pref("refreshbuff")) {
                set_module_pref("refreshbuff", 0);
                include_once "modules/clanbuffs/clanbuffs_func.php";
                apply_clan_buff_for_one();
                output("`n`n`c`b`!Your clan's aura has been upgraded and refreshed!`0`b`c`n`n");
            }
            break;
        case "newday":
            if ($session['user']['clanid'] != 0 && $session['user']['clanrank'] > 0) {
                if (get_module_objpref("clans", $session['user']['clanid'], "buffactive") == 1) {
                    include_once "modules/clanbuffs/clanbuffs_func.php";
                    apply_clan_buff_for_one();
                    output("`n`^Your clan's aura protects you!`n");
                }
            }
            break;
        case "changesetting":
            if ($args['setting'] == "remakecost" && $args['module'] == "clanbuffs") {
                include_once "modules/clanbuffs/clanbuffs_func.php";
                remake_costs();
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:45,代码来源:clanbuffs.php

示例9: staminamounts_dohook

function staminamounts_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "boughtmount":
        case "soldmount":
        case "stamina-newday":
            require_once "modules/staminasystem/lib/lib.php";
            $currentmount = $session['user']['hashorse'];
            for ($i = 1; $i <= 10; $i++) {
                if (get_module_objpref("mounts", $currentmount, "buff" . $i . "name", "staminamounts") || get_module_objpref("mounts", $currentmount, "buff" . $i . "costmod", "staminamounts") || get_module_objpref("mounts", $currentmount, "buff" . $i . "expmod", "staminamounts")) {
                    apply_stamina_buff("mountbuff" . $i, array("name" => get_module_objpref("mounts", $currentmount, "buff" . $i . "name", "staminamounts"), "action" => get_module_objpref("mounts", $currentmount, "buff" . $i . "action", "staminamounts"), "class" => get_module_objpref("mounts", $currentmount, "buff" . $i . "class", "staminamounts"), "costmod" => get_module_objpref("mounts", $currentmount, "buff" . $i . "costmod", "staminamounts"), "expmod" => get_module_objpref("mounts", $currentmount, "buff" . $i . "expmod", "staminamounts"), "rounds" => get_module_objpref("mounts", $currentmount, "buff" . $i . "rounds", "staminamounts"), "roundmsg" => get_module_objpref("mounts", $currentmount, "buff" . $i . "roundmsg", "staminamounts"), "wearoffmsg" => get_module_objpref("mounts", $currentmount, "buff" . $i . "wearoffmsg", "staminamounts")));
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:18,代码来源:staminamounts.php

示例10: descriptioncheck_run

function descriptioncheck_run()
{
    global $session;
    page_header("Creature Descriptions Checker Thing");
    output("This handy page shows all creature descriptions, win messages, lose messages, and failboat/jungle status, complete with colour codes.`n`nPlease use this page sparingly, as it's kinda resource-intensive.  Ta!`n`n");
    $sql = "SELECT * FROM " . db_prefix("creatures") . " ORDER BY creaturelevel,creaturename";
    $result = db_query($sql);
    $n = db_num_rows($result);
    for ($i = 0; $i < $n; $i++) {
        $row = db_fetch_assoc($result);
        $desc = stripslashes(get_module_objpref("creatures", $row['creatureid'], "description", "creatureaddon"));
        if ($desc == "") {
            $desc = "No Description!";
        }
        output("`0`bCreature: %s | Weapon: %s | Level: %s | Jungle: %s | FailBoat: %s`nDescription:`b`n-----`n%s`n-----`n`n", $row['creaturename'], $row['creatureweapon'], $row['creaturelevel'], $row['forest'], $row['graveyard'], $desc);
    }
    addnav("Back to the Grotto", "superuser.php");
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:19,代码来源:descriptioncheck.php

示例11: additionalkeys_run

function additionalkeys_run()
{
    global $session;
    $dwid = httpget('dwid');
    $type = httpget('type');
    $typeid = get_module_setting("typeid", $type);
    $op = httpget('op');
    $points = get_module_objpref("dwellingtypes", $typeid, "keydonationcost", "additionalkeys");
    $gem = get_module_objpref("dwellingtypes", $typeid, "keygemcost", "additionalkeys");
    $gold = get_module_objpref("dwellingtypes", $typeid, "keygoldcost", "additionalkeys");
    $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
    addnav("Navigation");
    addnav("Return to Management", "runmodule.php?module=dwellings&op=manage&dwid={$dwid}");
    page_header("Keymaker");
    switch ($op) {
        case "buykeys":
            $type = httpget('type');
            $typeid = get_module_setting("typeid", $type);
            output("`n`0You enter the smithy and wait at the desk until a dwarf appears. \"`2Soso, you would like to buy more keys?`0\" he asks you and you nod. ");
            output("Then he tells you that this will cost you `^%s gold, %s gems `0and `^%s donationpoints`0. \"`2Still interested?`0\"", $gold, $gem, $points);
            addnav("Keymaker");
            addnav("Yes", "runmodule.php?module=additionalkeys&op=yes&dwid={$dwid}&type={$type}");
            break;
        case "yes":
            $type = httpget('type');
            $typeid = get_module_setting("typeid", $type);
            if ($session['user']['gold'] < $gold || $session['user']['gems'] < $gem || $pointsavailable < $points) {
                output("`n`n\"`2Did I not just tell you what it costs to get an extra key? So why do you waste my precious time?!`0\" the keymaker yells at you. ");
                output("Embarassed you just nod, what is apparently you can do best und leave the keymakers office.");
            } else {
                $add = get_module_objpref("dwellings", $dwid, "addkeys", "additionalkeys");
                $add++;
                set_module_objpref("dwellings", $dwid, "addkeys", $add, "additionalkeys");
                $session['user']['donationspent'] += $points;
                $session['user']['gems'] -= $gem;
                $session['user']['gold'] -= $gold;
                output("`n`n`0It takes a moment as the dwarf finally wipes away the sweat and returns to the desk, where you are still waiting for your key. He hands it over to you and says, \"`2Think about it carefully, whom you like to give it.`0\"");
            }
            break;
    }
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:42,代码来源:additionalkeys.php

示例12: farmhouses_dohook

function farmhouses_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "dwellings-list-type":
            addnav("Show Only Types");
            addnav(array("%s", ucfirst(get_module_setting("dwnameplural", "farmhouses"))), "runmodule.php?module=dwellings&op=list&showonly=farmhouses&ref={$args['ref']}&sortby={$args['sortby']}&order={$args['order']}");
            break;
        case "dwellings":
            if (get_module_objpref("city", $args['cityid'], "showfarmhouses")) {
                output("  Off in the distance, you can see smoke rising from chimneys of a few %s.`0", get_module_setting("dwnameplural"));
                if ($args['allowbuy'] == 1 && $session['user']['dragonkills'] >= get_module_setting("dkreq")) {
                    $cityid = $args['cityid'];
                    addnav("Options");
                    addnav(array("Establish a %s", ucfirst(get_module_setting("dwname", "farmhouses"))), "runmodule.php?module=dwellings&op=buy&type=farmhouses&subop=presetup&cityid={$cityid}");
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:farmhouses.php

示例13: dwcastles_dohook

function dwcastles_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "dwellings-list-type":
            addnav("Show Only Types");
            addnav(array("%s", ucfirst(translate_inline(get_module_setting("dwnameplural", "dwcastles")))), "runmodule.php?module=dwellings&op=list&showonly=dwcastles&ref={$args['ref']}&sortby={$args['sortby']}&order={$args['order']}");
            break;
        case "dwellings":
            if (get_module_objpref("city", $args['cityid'], "showdwcastles")) {
                output("  High on the far hills, you see waving flags of the glorious %s`0 of the rich and fabulous.", translate_inline(get_module_setting("dwnameplural")));
                if ($args['allowbuy'] == 1 && $session['user']['dragonkills'] >= get_module_setting("dkreq")) {
                    $cityid = $args['cityid'];
                    addnav("Options");
                    addnav(array("Establish a %s", ucfirst(translate_inline(get_module_setting("dwname", "dwcastles")))), "runmodule.php?module=dwellings&op=buy&type=dwcastles&subop=presetup&cityid={$cityid}");
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:dwcastles.php

示例14: darkhorse_dohook

function darkhorse_dohook($hookname, $args)
{
    switch ($hookname) {
        case "moderate":
            $args['darkhorse'] = get_module_setting("tavernname");
            break;
        case "mountfeatures":
            $tavern = get_module_objpref("mounts", $args['id'], "findtavern");
            $args['features']['Darkhorse'] = $tavern;
            break;
        case "forest":
            if (darkhorse_tavernmount()) {
                // add the nav
                addnav("Other");
                $iname = get_module_setting("tavernname");
                require_once "lib/mountname.php";
                list($name, $lcname) = getmountname();
                addnav(array("D?Take %s`0 to %s", $lcname, $iname), "runmodule.php?module=darkhorse&op=enter");
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:23,代码来源:darkhorse.php

示例15: round

             $goldvalue = round($paidgold * get_module_setting("valueper") / 100);
             $gemvalue = round($paidgems * get_module_setting("valueper") / 100);
             $sql = "INSERT INTO " . db_prefix("dwellings") . " (gold,gems,goldvalue,gemvalue,ownerid,type,location,status) VALUES ({$paidgold},{$paidgems},{$goldvalue},{$gemvalue}," . $session['user']['acctid'] . ",'{$type}','" . $session['user']['location'] . "',2)";
             $result = db_query($sql);
             // Now, here comes the trick... really nice one... No additional queries needed...
             //						$sql = "SELECT dwid FROM ".db_prefix("dwellings")." WHERE location='".$session['user']['location']."' AND ownerid=".$session['user']['acctid']." ORDER BY dwid DESC LIMIT 1";
             //						db_query($sql);
             //						$result = db_query($sql);
             //						$row = db_fetch_assoc($result);
             $dwid = db_insert_id($result);
             $finished = 1;
             $buyargs = modulehook("dwellings-buy-setup", array('type' => $type, 'dwid' => $dwid, 'finished' => $finished));
             $finished = $buyargs['finished'];
             if ($paidgold == $costgold && $paidgems == $costgems && $finished == 1) {
                 output("You have paid for your dwelling in full!");
                 if (get_module_objpref("dwelling", $dwid, "buildturns") <= get_module_setting("turncost", $type)) {
                     output("Now it's time to build it!");
                     $status = 3;
                     addnav(array("Build your %s", $dwname), "runmodule.php?module=dwellings&op=build&type={$type}&dwid={$dwid}");
                 } else {
                     $status = 1;
                     addnav(array("Enter your %s", $dwname), "runmodule.php?module=dwellings&op=enter&type={$type}&dwid={$dwid}");
                 }
                 $sql = "UPDATE " . db_prefix("dwellings") . " SET status={$status} WHERE dwid={$dwid}";
                 db_query($sql);
             } else {
                 output("`@You are now one step closer to finishing the payments on your %s`@.", $dwname);
             }
         }
     }
 }
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:case_buy.php


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