本文整理汇总了PHP中set_module_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP set_module_setting函数的具体用法?PHP set_module_setting怎么用?PHP set_module_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_module_setting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: marriage_lovedrinks
function marriage_lovedrinks()
{
$z = 2;
$s = get_module_setting('loveDrinksAdd');
if (is_module_installed('drinks') && $s < $z) {
$sql = array();
$ladd = array();
if ($s < 1) {
// We use 'lessthan' so more drinks can be packaged with this
$sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Love Brew', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik reaches under the bar, pulling out a purple cupid shaped bottle... as he pours it into a crystalline glass, the glass shines and he puts a pineapple within the liquid... \"Here, have a Love Brew..\" says Cedrik.. and as you try it, you feel uplifted!', '`%Love Brew', 12, 'You remember love..', 'Despair sets in.', '1.1', '.9', '1.5', '0', '', '', '')";
$ladd[] = "Love Brew";
}
if ($s < 2) {
// We use 'lessthan' so more drinks can be packaged with this
$sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Heart Mist', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik grabs for a rather garish looking bottle on the shelf behind him... as he pours it into a large yellow mug, the porcelain seems to dissolve.. ooh er.. he puts a tomato within the sweet smelling gunk... \"Here, have a Heart Mist..\" says Cedrik.. and as you try it, you see symbols of love!', '`\$Heart Mist', 18, '`%Misty hearts fly around you..', '`#The sky falls...', '1.1', '.9', '1.5', '0', '', '', '')";
$ladd[] = "Heart Misy";
}
foreach ($sql as $val) {
db_query($val);
}
foreach ($ladd as $val) {
$sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE name='{$val}' ORDER BY costperlevel";
$result = db_query($sql);
$row = db_fetch_assoc($result);
set_module_objpref('drinks', $row['drinkid'], 'loveOnly', 1, 'marriage');
}
set_module_setting('loveDrinksAdd', $z);
output("`n`c`b`^Marriage Module - Drinks have been added to the Loveshack`0`b`c");
} elseif (!is_module_active('drinks')) {
set_module_setting('loveDrinksAdd', 0);
}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:lovedrinks.php
示例2: oldhouse_dohook
function oldhouse_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "newday":
set_module_pref("scaretoday", 0);
break;
case "changesetting":
if ($args['setting'] == "villagename") {
if ($args['old'] == get_module_setting("oldhouseloc")) {
set_module_setting("oldhouseloc", $args['new']);
}
}
break;
case "village":
if ($session['user']['location'] == get_module_setting("oldhouseloc")) {
tlschema($args['schemas']['tavernnav']);
addnav($args['tavernnav']);
tlschema();
addnav("O?The Old House", "runmodule.php?module=oldhouse");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:25,代码来源:oldhouse.php
示例3: drpap_dohook
function drpap_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "village":
if ($session['user']['location'] == get_module_setting("paploc") && $session['user']['dragonkills'] >= get_module_setting("dk")) {
tlschema($args['schemas']['marketnav']);
addnav($args['marketnav']);
tlschema();
addnav("Dr Paprika's Office", "runmodule.php?module=drpap&op=enter");
}
break;
case "changesetting":
if ($args['setting'] == "villagename") {
if ($args['old'] == get_module_setting("paploc")) {
set_module_setting("paploc", $args['new']);
}
}
break;
case "dragonkilltext":
if (get_module_setting("reset") == 1) {
set_module_pref("count", 0);
}
break;
case "moderate":
$args['drpap'] = "Dr Paprika's Waiting Room";
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:drpap.php
示例4: cakeordeath_run
function cakeordeath_run()
{
global $session;
page_header("Cake Or Death");
switch (httpget("op")) {
case "examine":
// Tell the player what the deal with Cake Or Death is
$counter = number_format(get_module_setting("counter"));
output("`0A shiny wooden table sits back from the main street. Behind it, a man sits idly reading the Improbable Island Enquirer. Before him, sat on the table, is a large sponge cake. Above him is a banner, displaying the name of his game:`b'`5Cake`0 or `4Death!`0'`b`n`nHe sees you pondering the sign, and calls over to you. `b'`5Cake`0 or `4Death!`0 `b`5Cake`0 or `4Death!`0' he cries. 'Ninety-nine per cent chance of `b`5Cake`0`b!'`n`nIt's not often that an immaculately-dressed gentleman with glowing green eyes offers you a 99% chance of cake. What would you like to do?");
//add navs
addnav("CAKE!", "runmodule.php?module=cakeordeath&op=play");
addnav("Back away slowly", "village.php");
break;
case "play":
$counter = get_module_setting("counter");
addnav("Back to the Outpost", "village.php");
if ($counter > 0) {
output("The green-eyed gentleman hands you a slice of cake, on a paper plate. You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0");
set_module_setting("counter", get_module_setting("counter") - 1);
apply_buff('tastycake', array("name" => "`5Full Of Cake`0", "rounds" => 10, "atkmod" => 1.1, "defmod" => 1.1, "roundmsg" => "`5The cake you ate earlier has boosted your energy!`n", "schema" => "module-cakeordeath"));
}
if ($counter <= 0) {
output("The green-eyed gentleman hands you a slice of cake, on a paper plate. You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0`n`nMoments later, the slow-acting poison starts to take effect. The world begins to melt in front of you. Grey spots dance on the edges of your vision. Behind you, a green-eyed monster offers you another slice of cake, laughing and pointing.`n`nYou curse your luck as the hallucinations begin to kick in.");
set_module_setting("counter", 100);
apply_buff('failcake', array("name" => "`5Full Of FailCake`0", "rounds" => -1, "regen" => -10, "startmsg" => "`5You are walking on pink icing. The sky is made of jam. Your eyes are two cherries. That cake was awesome.`0`n", "roundmsg" => "`5The poisoned cake saps your strength, and you lose ten hitpoints!`0`n", "schema" => "module-cakeordeath"));
if (is_module_active("medals")) {
require_once "modules/medals.php";
medals_award_medal("failcake", "Failcake Fancier", "This player was unfortunate at the Cake or Death stand...", "medal_failcake.png");
}
}
break;
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:34,代码来源:cakeordeath.php
示例5: specificmaplocation_dohook
function specificmaplocation_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "worldnav":
if (get_module_setting("finder1") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "14,37,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder1", $session['user']['name']);
}
if (get_module_setting("finder2") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "6,33,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder2", $session['user']['name']);
}
if (get_module_setting("finder3") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "17,31,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder3", $session['user']['name']);
}
if (get_module_setting("finder4") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "25,26,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder4", $session['user']['name']);
}
if (get_module_setting("finder5") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "7,21,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder5", $session['user']['name']);
}
if (get_module_setting("finder6") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "22,20,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder6", $session['user']['name']);
}
if (get_module_setting("finder7") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "14,17,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder7", $session['user']['name']);
}
if (get_module_setting("finder8") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "3,9,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder8", $session['user']['name']);
}
if (get_module_setting("finder9") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "22,6,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder9", $session['user']['name']);
}
if (get_module_setting("finder10") == "Nobody" && get_module_pref("worldXYZ", "worldmapen") == "4,3,1") {
output("You found one of the ten boxes of cigarettes! You open it up to find a hundred of the damned things! Woohoo!");
$session['user']['gems'] += 100;
set_module_setting("finder10", $session['user']['name']);
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:59,代码来源:specificmaplocation.php
示例6: get_default_accs_list
function get_default_accs_list()
{
$accs = unserialize(get_module_setting("accessories", "mountaccessories"));
if (!is_array($accs)) {
$accs = array();
set_module_setting("accessories", serialize($accs), "mountaccessories");
}
$accs = unserialize(get_module_setting("accessories", "mountaccessories"));
return $accs;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:10,代码来源:lib.php
示例7: dpresurrect_run
function dpresurrect_run()
{
global $session;
page_header("Returning to Improbable Island");
$op = httpget('op');
if ($op == "resurrect") {
$session['user']['donationspent'] += get_module_setting("pointsrequired");
output("`\$The Watcher`0 nods. \"`7I'm not above taking the occasional bribe. That's what makes the world go round, right?`0\" You nod sadly. \"`7Prepare a rowboat, we have a restoration coming through!`0\"`n`nWelcome back to Improbable Island...");
addnav("Return to Improbable Island", "newday.php?resurrection=true");
set_module_setting("timestaken", get_module_setting("timestaken") + 1);
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:13,代码来源:dpresurrect.php
示例8: hepzibah_dohook
function hepzibah_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "changesetting":
if ($args['setting'] == "villagename") {
if ($args['old'] == get_module_setting("hepzibahloc")) {
set_module_setting("hepzibahloc", $args['new']);
}
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:14,代码来源:hepzibah.php
示例9: statue_dohook
function statue_dohook($hookname, $args)
{
global $REQUEST_URI;
global $session;
$capital = getsetting("villagename", LOCATION_FIELDS);
$hero = get_module_setting("hero");
switch ($hookname) {
case "village-desc":
if ($session['user']['location'] != $capital) {
break;
}
if ($hero == 0) {
output("`n`@The people wandering past periodically stop to admire a statue of the ancient hero, `&MightyE`@.`0`n");
} else {
$sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='{$hero}'";
$result = db_query_cached($sql, "lasthero");
$row = db_fetch_assoc($result);
output("`0The inhabitants of %s are busy erecting a statue for their newest hero, `&%s`0, on the only statue pedestal around. The remains of the statue that had stood there before lie in such ruins around the pedestal that it is no longer recognizable.`0`n`n", $session['user']['location'], $row['name']);
}
break;
case "index":
if (!get_module_setting("showonindex")) {
break;
}
$heroname = "MightyE";
if ($hero != 0) {
$sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='{$hero}'";
$result = db_query_cached($sql, "lasthero");
$row = db_fetch_assoc($result);
$heroname = $row['name'];
}
output("`@The most recent hero of the realm is: `&%s`0`n`n", $heroname);
break;
case "dragonkill":
set_module_setting("hero", $session['user']['acctid']);
invalidatedatacache("lasthero");
break;
case "namechange":
if ($hero == $session['user']['acctid']) {
invalidatedatacache("lasthero");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:45,代码来源:statue.php
示例10: farmhouses_install
function farmhouses_install()
{
module_addhook("dwellings");
module_addhook("dwellings-list-type");
if (!is_module_active('farmhouses')) {
$sql = "SELECT module FROM " . db_prefix("dwellingtypes") . " WHERE module='farmhouses'";
$res = db_query($sql);
if (db_num_rows($res) == 0) {
$sql = "INSERT INTO " . db_prefix("dwellingtypes") . " (module) VALUES ('farmhouses')";
db_query($sql);
}
}
$sql = "SELECT typeid FROM " . db_prefix("dwellingtypes") . " WHERE module='farmhouses'";
$result = db_query($sql);
$row = db_fetch_assoc($result);
set_module_setting("typeid", $row['typeid'], "farmhouses");
return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:18,代码来源:farmhouses.php
示例11: worldmapen_editor_manual
function worldmapen_editor_manual($op, $subop, $act)
{
$vloc = array();
$vname = getsetting("villagename", LOCATION_FIELDS);
$vloc[$vname] = "village";
$vloc = modulehook("validlocation", $vloc);
ksort($vloc);
if ($act == "save") {
foreach ($vloc as $loc => $val) {
$space_valx = preg_replace('/\\s/', '_', $loc . 'X');
$space_valy = preg_replace('/\\s/', '_', $loc . 'Y');
set_module_setting($loc . 'X', httppost($space_valx));
set_module_setting($loc . 'Y', httppost($space_valy));
set_module_setting($loc . 'Z', 1);
// Eventually we'll do the Z coord too
// set_module_setting($loc.'Z',
// httppost($loc."Z"));
}
output("`^`bSettings saved successfully.`b`n");
reset($vloc);
}
output("`^Maximum X value is `b%s`b`n", get_module_setting("worldmapsizeX"));
output("`^Maximum Y value is `b%s`b`n", get_module_setting("worldmapsizeY"));
$worldarray = array("World Locations,title");
foreach ($vloc as $loc => $val) {
$mapx = get_module_setting("worldmapsizeX");
$mapy = get_module_setting("worldmapsizeY");
//Added to allow setting cities outside of the map. - Making cities inaccessible via normal travel.
$myx = $mapx + 1;
$worldarray[] = array("Locations for %s,title", $loc);
$worldarray[$loc . 'X'] = array("X Coordinate,range,1,{$myx},1");
$worldarray[$loc . 'Y'] = array("Y coordinate,range,1,{$mapy},1");
}
rawoutput("<form method='post' action='runmodule.php?module=worldmapen&op=edit&subop=manual&act=save&admin=true'>");
require_once "lib/showform.php";
global $module_settings;
showform($worldarray, $module_settings['worldmapen']);
rawoutput("</form>");
addnav("", "runmodule.php?module=worldmapen&op=edit&subop=manual&act=save&admin=true");
addnav("E?Return to World Map Editor", "runmodule.php?module=worldmapen&op=edit&admin=true");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:41,代码来源:editor.php
示例12: ella_dohook
function ella_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "changesetting":
if ($args['setting'] == "villagename") {
if ($args['old'] == get_module_setting("ellaloc")) {
set_module_setting("ellaloc", $args['new']);
}
}
break;
case "newday":
$dayswait = get_module_pref("dayswait");
// let's just correct if something goes wrong somehow.
if ($dayswait < 0) {
$dayswait = 0;
}
if ($dayswait > 0) {
$dayswait--;
}
set_module_pref("dayswait", $dayswait);
if ($dayswait == 0) {
set_module_pref("candance", 1);
}
break;
case "village":
// Moved the check for candance down into the run. Buildings
// shouldn't just vanish!
if ($session['user']['location'] == get_module_setting("ellaloc")) {
tlschema($args['schemas']['marketnav']);
addnav($args['marketnav']);
tlschema();
addnav("Ella's Dance Studio", "runmodule.php?module=ella");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:38,代码来源:ella.php
示例13: crazyaudrey_run
function crazyaudrey_run()
{
global $session;
$op = httpget('op');
if ($op == "pet") {
page_header("Crazy Audrey's Zoo");
$cost = get_module_setting("cost");
$animal = get_module_setting("animal");
$lcanimal = get_module_setting("lanimal");
$plural = get_module_setting("animals");
$lcplural = get_module_setting("lanimals");
$profit = get_module_setting("profit");
output("`5You cautiously approach Crazy Audrey.");
output("Next to her is a sign that reads, \"`#%s gold to pet %s`#,`5\" and a basket filled with `^%s`5 gold!", $cost, $lcplural, $profit);
if ($session['user']['gold'] >= $cost) {
output("You place your `^%s`5 gold in the basket, and spend a few minutes petting one of the %s`5.", $cost, $lcplural);
output("Soon though, Crazy Audrey chases you off, and you stand at a distance admiring the %s`5.", $lcplural);
$session['user']['gold'] -= $cost;
debuglog("spent {$cost} gold to pet audrey's pets");
$profit += $cost;
set_module_setting("profit", $profit);
$buffname = get_module_setting("buffname");
apply_buff('crazyaudrey', array("name" => $buffname, "rounds" => 5, "activate" => "defense", "defmod" => 1.05, "schema" => "module-crazyaudrey"));
output("`5After a few minutes, you once again try to approach in order to look into her baskets.");
if (get_module_pref("played") == 0) {
addnav("Look at Crazy Audrey's baskets", "runmodule.php?module=crazyaudrey&op=baskets");
} else {
output("`5As you approach closer, Crazy Audrey looks up and screams at you. \"`%Hey!! I recognize you! You've already played with my %s`% today! Get away from here, you pervy %s`% fancier!`5\"", $lcplural, $lcanimal);
output("You quickly step back and admire the %s`5 from a safe distance.", $lcplural);
}
} else {
output("Not having `^%s`5 gold, you wander sadly away.", $cost);
}
} elseif ($op == "baskets" || $op == "play" || $op == "run") {
page_header("Crazy Audrey");
crazyaudrey_baskets("module-internal", "runmodule.php?module=crazyaudrey");
}
if ($op != "baskets") {
require_once "lib/villagenav.php";
villagenav();
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:43,代码来源:crazyaudrey.php
示例14: settings_run
function settings_run()
{
global $session;
$op = httpget('op');
$category = stripslashes(rawurldecode(httpget('cat'))) ?: 'Account';
page_header("Settings - {$category}");
switch ($op) {
case 'save':
$accounts = db_prefix('accounts');
$post = httpallpost();
unset($post['showFormTabIndex']);
foreach ($post as $key => $val) {
$post[$key] = stripcslashes($val);
}
$post['oldvalues'] = json_decode($post['oldvalues'], true);
foreach ($post['oldvalues'] as $key => $val) {
$post['oldvalues'][$key] = stripslashes($val);
}
$post = modulehook('prefs-change', $post);
if ($post['return'] != '') {
$return = $post['return'];
unset($post['return']);
}
//Fix template changes.
if (md5(md5($post['oldpass'])) == $session['user']['password'] && $post['newpass'] != '') {
require_once 'lib/systemmail.php';
$newPass = md5(md5($post['newpass']));
db_query("UPDATE {$accounts}\n SET password = '{$newPass}'\n WHERE acctid = '{$session['user']['acctid']}'");
systemmail($session['user']['acctid'], 'Account Settings', "`@Your password was changed successfully!");
}
unset($post['newpass']);
unset($post['oldpass']);
foreach ($post as $key => $val) {
if ($key == 'bio' && $val != $post['oldvalues']['bio']) {
$session['user']['bio'] = $val;
} else {
if (!is_array($val) && $val != $post['oldvalues'][$key]) {
if (strpos($key, '__user') || strpos($key, '__check')) {
$moduleKey = explode('__', $key);
set_module_pref($moduleKey[1], $val, $moduleKey[0]);
unset($moduleKey);
} else {
$session['user']['prefs'][$key] = $val;
}
}
}
}
$prefs = @serialize($session['user']['prefs']);
db_query("UPDATE {$accounts} SET prefs = '{$prefs}'\n WHERE acctid = '{$session['user']['acctid']}'");
redirect("runmodule.php?module=settings&cat={$return}&save=true");
addnav('Go back', 'runmodule.php?module=settings');
break;
default:
$modules = db_prefix('modules');
$userprefs = db_prefix('module_userprefs');
$rewrite = trim(get_module_setting('rewrite'));
$rewrite = json_decode($rewrite, true);
$languages = getsetting('serverlanguages', 'en, English');
$prefs = $session['user']['prefs'];
$prefs['bio'] = $session['user']['bio'];
$prefs['template'] = $_COOKIE['template'] ?: getsetting('defaultskin', 'jade.htm');
$prefs['email'] = $session['user']['emailaddress'];
$prefsFormat = ['Account' => ['bio' => 'Short biography, textarea', 'newpass' => 'New password, password', 'oldpass' => 'If you are changing your password, type your old one, password', 'email' => 'Email, text'], 'Display' => ['template' => 'Skin, theme', 'language' => 'Which language do you prefer?, enum, ' . $languages, 'timestamp' => 'Show timestamps in commentary?, enum, 0, None, 1, Real Time, 2, Relative Time'], 'Game Behavior' => ['emailonmail' => 'Receive emails when you receive a mail?, bool', 'systemmail' => 'Receive emails for system messages?, bool', 'Be sure to check your email\'s spam folder and add our email as a trusted sender!, note', 'dirtyemail' => 'Allow profanity in mail?, bool', 'timeoffset' => sprintf_translate('Hours to offset time (currently %s)?, int', date($prefs['timeformat'], strtotime('now') + $prefs['timeoffset'] * 3600)), 'ihavenocheer' => 'Disable holiday text?, bool', 'nojump' => 'Disable jumping to the commentary when posting or refreshing?, bool']];
if (count(explode(',', $languages)) < 3) {
unset($prefs['Display']['language']);
}
$prefsFormat = modulehook('prefs-format', $prefsFormat);
$prefsTemp = [];
$modulesFound = [];
$sql = db_query("SELECT modulename, formalname FROM {$modules}\n WHERE infokeys LIKE '%|prefs|%'\n AND active = 1\n ORDER BY modulename");
while ($row = db_fetch_assoc($sql)) {
$formal = $row['formalname'];
$modulesFound[$row['modulename']] = true;
if (module_status($row['modulename']) == MODULE_FILE_NOT_PRESENT) {
foreach ($rewrite as $key => $moduleName) {
if ($moduleName == $formal || strpos($key, $row['modulename']) !== false) {
unset($rewrite[$key]);
}
}
set_module_setting('rewrite', json_encode($rewrite));
} else {
$prefsTemp[$formal] = get_module_info($row['modulename'])['prefs'];
}
unset($prefsTemp[$formal][0]);
foreach ($prefsTemp[$formal] as $setting => $description) {
$description = explode('|', $description)[0];
if (strpos($setting, 'user_') === false) {
unset($prefsTemp[$formal][$setting]);
} else {
$structuredKey = "{$row['modulename']}__{$setting}";
if ($rewrite[$structuredKey] != $formal) {
$prefsTemp[$rewrite[$structuredKey]][$structuredKey] = $description;
} else {
$prefsTemp[$formal][$structuredKey] = $description;
}
unset($prefsTemp[$formal][$setting]);
}
}
if (count($prefsTemp[$formal]) == 0) {
unset($prefsTemp[$formal]);
//.........这里部分代码省略.........
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:101,代码来源:settings.php
示例15: iitems_worldmapdrop_dohook
function iitems_worldmapdrop_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "iitems-show-inventory":
//debug("Hook?");
$drop = httpget('dropworldmap');
if ($drop) {
$squares = unserialize(get_module_setting("iitemsquares"));
$ploc = get_module_pref("worldXYZ", "worldmapen");
if (httpget('dropmapall')) {
$qty = iitems_discard_all_items(httpget('discard'));
output("`0You drop the items to your feet. Maybe someone else will find a use for them.`n");
} else {
iitems_discard_item(httpget('discard'));
$qty = 1;
output("`0You drop the item to your feet. Maybe someone else will find a use for it.`n");
}
$squares[$ploc][$drop] += $qty;
set_module_setting("iitemsquares", serialize($squares));
}
break;
case "iitems-inventory":
//debug($args);
if ($args['master']['dropworldmap'] && httpget('from') == "worldnav") {
rawoutput("<a href=\"runmodule.php?module=iitems&op=inventory&from=" . httpget('from') . "&dropworldmap=" . $args['player']['itemid'] . "&discard=" . $args['inventorykey'] . "\">Drop this item on the Map for someone else to pick up</a><br />");
addnav("", "runmodule.php?module=iitems&op=inventory&from=" . httpget('from') . "&dropworldmap=" . $args['player']['itemid'] . "&discard=" . $args['inventorykey']);
if ($args['player']['quantity'] > 1) {
rawoutput("<a href=\"runmodule.php?module=iitems&op=inventory&from=" . httpget('from') . "&dropworldmap=" . $args['player']['itemid'] . "&discard=" . $args['inventorykey'] . "&dropmapall=true\">Drop all of these items on the Map for someone else to pick up</a><br />");
addnav("", "runmodule.php?module=iitems&op=inventory&from=" . httpget('from') . "&dropworldmap=" . $args['player']['itemid'] . "&discard=" . $args['inventorykey'] . "&dropmapall=true");
}
}
break;
case "worldnav":
$ploc = implode(",", $args);
$squares = unserialize(get_module_setting("iitemsquares"));
$itemid = httpget('iitem-pickup');
if ($itemid) {
require_once "modules/iitems/lib/lib.php";
$itemdetails = iitems_get_item_details($itemid);
//Pick up iitems
if (httpget('alliitems')) {
//Pick up all iitems
output("`0You pick up the %s %s and put them in your backpack.`n", ${$squares}[$ploc][$itemid], $itemdetails['plural']);
for ($i = 0; $i < $squares[$ploc][$itemid]; $i++) {
iitems_give_item($itemid);
}
unset($squares[$ploc][$itemid]);
} else {
//Pick up single iitem
if ($squares[$ploc][$itemid]) {
output("`0You pick up the %s and put it in your backpack.`n", $itemdetails['verbosename']);
iitems_give_item($itemid);
$squares[$ploc][$itemid]--;
if ($squares[$ploc][$itemid] === 0) {
unset($squares[$ploc][$itemid]);
}
} else {
output("`0You bend over to pick up the %s, but it's suddenly not there anymore! Some crafty bastard has pinched it from right under your nose!`n", $itemdetails['verbosename']);
}
}
set_module_setting("iitemsquares", serialize($squares));
}
//Show iitems that can be picked up
if (!is_array($squares)) {
$squares = array();
set_module_setting("iitemsquares", serialize($squares));
}
if (is_array($squares[$ploc])) {
if (count($squares[$ploc])) {
//this square has something in it!
$iitems = $squares[$ploc];
addnav("Pick up items");
require_once "modules/iitems/lib/lib.php";
foreach ($iitems as $id => $qty) {
$item = iitems_get_item_details($id);
if ($qty < 1) {
unset($squares[$ploc][$id]);
}
$showwarn = 1;
addnav(array("Pick up %s", $item['verbosename']), "runmodule.php?module=worldmapen&op=continue&iitem-pickup=" . $id);
if ($qty > 1) {
output("`0There are %s %s here.`n`n", $qty, $item['plural']);
addnav(array("Pick up all %s", $item['plural']), "runmodule.php?module=worldmapen&op=continue&iitem-pickup=" . $id . "&alliitems=1");
} else {
if ($qty == 1) {
output("`0There is a %s here.`n`n", $item['verbosename']);
}
}
}
if ($showwarn && $session['user']['dragonkills'] < 1 && $session['user']['level'] < 10) {
output("`JLogs and stone are only really useful if you're building a Dwelling. To build a Dwelling, you'll need a Land Claim stake from Improbable Central, which will set you back 100 Cigarettes. If you're not building a Dwelling, then there's not much reason to pick them up (logs and stone are really heavy!). This message will disappear once you've got a few more levels under your belt.`0`n");
}
} else {
//this square is empty, unset it
unset($squares[$ploc]);
set_module_setting("iitemsquares", serialize($squares));
}
}
break;
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:iitems_worldmapdrop.php
示例16: serialisededitor_run
function serialisededitor_run()
{
page_header('Editing Serialised Array');
$op = httpget('op');
if ($op == 'source') {
if (httpget('subop') == 'save') {
$code = httppost('code');
// Don't serialise the array as it already is.
set_module_setting('array', $code, 'serialisededitor');
output('`#Array has been serialised and saved.`0`n`n');
} else {
// Don't unserialise, leave as is.
$code = get_module_setting('array', 'serialisededitor');
}
$size = translate_inline(array('Width', 'Height'));
$submit = translate_inline('Submit');
rawoutput('<script language="JavaScript" type="text/javascript">function increase_row(target, value){target.rows = target.rows + value;}function increase_col(target, value){target.cols = target.cols + value;}</script>');
rawoutput('<form action="runmodule.php?module=serialisededitor&op=source&subop=save" method="POST">');
addnav('', 'runmodule.php?module=serialisededitor&op=source&subop=save');
rawoutput('<table border="0" cellpadding="0" cellspacing="0">');
rawoutput('<tr><td><textarea name="code" cols="40" rows="10" id="textarea">' . stripslashes($code) . '</textarea></td><td rowspan="2" valign="top"><input type="submit" onClick="increase_row(textarea,1);" value="+" /> <input type="submit" onClick="increase_row(textarea,-1);" value="-" /><br /><span class="colLtWhite">' . $size[1] . '</span></td></tr>');
rawoutput('<tr><td colspan="2"><input type="submit" onClick="increase_col(textarea,1);" value="+" /> <input type="submit" onClick="increase_col(textarea,-1);" value="-" /><br /><span class="colLtWhite">' . $size[0] . '</span></td></tr>');
rawoutput('<tr><td colspan="2"><input type="submit" class="button" value="' . $submit . '" /></td></tr>');
rawoutput('</table></form>');
} elseif ($op == 'find') {
$subop = httpget('subop');
$name = httppost('name') ? httppost('name') : '';
$search = translate_inline('Search by name: ');
$search2 = translate_inline('Search');
rawoutput('<form action="runmodule.php?module=serialisededitor&op=find&subop=search" method="POST">' . $search . '<input type="text" size="30" name="name" value="' . $name . '" /> <input type="submit" value="' . $search2 . '" class="button" /></form><br /><br />');
addnav('', 'runmodule.php?module=serialisededitor&op=find&subop=search');
if ($subop == 'search') {
$search = "%";
for ($i = 0; $i < strlen($name); $i++) {
$search .= substr($name, $i, 1) . "%";
}
$sql = "SELECT acctid, name, level, login\r\n\t\t\t\t\tFROM " . db_prefix('accounts') . "\r\n\t\t\t\t\tWHERE (locked = 0 AND name LIKE '{$search}')\r\n\t\t\t\t\tORDER BY level DESC";
$result = db_query($sql);
if (($max = db_num_rows($result)) > 0) {
if ($max > 100) {
output('`#Listing first 100:`n`n');
$max = 1
|
请发表评论