本文整理汇总了PHP中savesetting函数的典型用法代码示例。如果您正苦于以下问题:PHP savesetting函数的具体用法?PHP savesetting怎么用?PHP savesetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了savesetting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getsetting
function getsetting($settingname, $default)
{
global $settings;
global $DB_USEDATACACHE, $DB_DATACACHEPATH;
if ($settingname == "usedatacache") {
return $DB_USEDATACACHE;
} elseif ($settingname == "datacachepath") {
return $DB_DATACACHEPATH;
}
if (!isset($settings[$settingname])) {
loadsettings();
} else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
return $settings[$settingname];
}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:settings.php
示例2: getsetting
function getsetting(string $settingname, $default)
{
global $settings, $DB_USEDATACACHE, $DB_DATACACHEPATH;
if ($settingname == 'usedatacache') {
return $DB_USEDATACACHE;
} else {
if ($settingname == 'datacachepath') {
return $DB_DATACACHEPATH;
}
}
if (!isset($settings[$settingname])) {
loadsettings();
} else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
return $settings[$settingname];
}
}
示例3: getsetting
function getsetting($settingname, $default)
{
global $settings;
loadsettings();
if (!isset($settings[$settingname])) {
savesetting($settingname, $default);
return $default;
} else {
if (trim($settings[$settingname]) == "") {
$settings[$settingname] = $default;
}
return $settings[$settingname];
}
}
示例4: charstats
//.........这里部分代码省略.........
}
if (isset($companion['suspended']) && $companion['suspended'] == true) {
$suspcode = "`7 *";
} else {
$suspcode = "";
}
addcharstat($companion['name'], $color . $companion['hitpoints'] . "`7/`&" . $companion['maxhitpoints'] . "{$suspcode}`0");
}
}
}
addcharstat("Personal Info");
if ($u['alive']) {
addcharstat("Requisition", number_format($u['gold'] . check_temp_stat("gold", 1)));
addcharstat("Cigarettes", number_format($u['gems'] . check_temp_stat("gems", 1)));
} else {
addcharstat("Cage Fights", $u['gravefights'] . check_temp_stat("gravefights", 1));
addcharstat("Favour", number_format($u['deathpower'] . check_temp_stat("deathpower", 1)));
}
if ($u['alive']) {
addcharstat("Level", "`b" . $u['level'] . check_temp_stat("level", 1) . "`b");
//exp bar
require_once "lib/experience.php";
$min = exp_for_next_level($u['level'] - 1, $u['dragonkills']);
$req = exp_for_next_level($u['level'], $u['dragonkills']);
$exp = round($session['user']['experience'], 0) . check_temp_stat("experience", 1);
if ($exp < $min) {
$min = $exp;
}
if ($req - $min > 0) {
$nonpct = floor(($req - $exp) / ($req - $min) * 100);
} else {
$nonpct = 0;
}
$pct = 100 - $nonpct;
if ($pct > 100) {
$pct = 100;
$nonpct = 0;
}
if ($pct < 0) {
$pct = 0;
$nonpct = 100;
}
if ($exp >= $req) {
$color = "blue";
if ($session['user']['level'] == 1 && $session['user']['dragonkills'] == 0) {
$expmsg = "<br />You have enough experience to level up! Challenge your master in the Dojo!";
}
} else {
$color = "white";
}
addcharstat("Experience", number_format($u['experience'] . check_temp_stat("experience", 1)) . "/{$req}<br /><table style='border: solid 1px #000000;' bgcolor='red' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='{$pct}%' bgcolor='{$color}'></td><td width='{$nonpct}%'></td></tr></table>{$expmsg}");
addcharstat("Equipment Info");
addcharstat("Weapon", $u['weapon']);
addcharstat("Armor", $u['armor']);
if ($u['hashorse']) {
addcharstat("Creature", $playermount['mountname'] . "`0");
}
}
require_once "lib/datetime.php";
$gt = gametimedetails();
addcharstat("Game State");
addcharstat("Game Time", gmdate("g:i a", $gt['gametime']));
addcharstat("New day in:", date("H:i:s", secondstonextgameday()));
modulehook("charstats");
$charstat = getcharstats($buffs);
if (!is_array($session['bufflist'])) {
$session['bufflist'] = array();
}
return $charstat;
} else {
$ret = "";
if ($ret = datacache("charlisthomepage")) {
} else {
$onlinecount = 0;
// If a module wants to do it's own display of the online chars,
// let it.
$list = modulehook("onlinecharlist", array());
if (isset($list['handled']) && $list['handled']) {
$onlinecount = $list['count'];
$ret = $list['list'];
} else {
$sql = "SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'" . date("Y-m-d H:i:s", strtotime("-" . getsetting("LOGINTIMEOUT", 900) . " seconds")) . "' ORDER BY level DESC";
$result = db_query($sql);
$ret .= appoencode(sprintf(translate_inline("`bOnline Characters (%s players):`b`n"), db_num_rows($result)));
while ($row = db_fetch_assoc($result)) {
$ret .= appoencode("`^{$row['name']}`n");
$onlinecount++;
}
db_free_result($result);
if ($onlinecount == 0) {
$ret .= appoencode(translate_inline("`iNone`i"));
}
}
savesetting("OnlineCount", $onlinecount);
savesetting("OnlineCountLast", strtotime("now"));
updatedatacache("charlisthomepage", $ret);
}
return $ret;
}
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:pageparts.php
示例5: rss_run
function rss_run()
{
if (httpget("op") == "describe") {
global $session;
page_header("RSS Feed Information");
output("This site offers RSS news feeds for periodically updated information about various aspects of the game.");
output("Click %shere%s for more information about the RSS format.`n`n", "<a href='http://www.google.com/search?q=rss+information' target='_blank'>", "</a>", true);
output("Feeds offered on this site:`n");
$format = "`#•`7 %s`n";
addnav("Get RSS News Feeds");
if (get_module_setting("do_news")) {
addnav("Daily News", "runmodule.php?module=rss&feed=news", false, true);
output($format, "Daily News", true);
}
if (get_module_setting("do_online")) {
addnav("Who's Online", "runmodule.php?module=rss&feed=online", false, true);
output($format, "Who's Online", true);
}
if (get_module_setting("do_motd")) {
addnav("MoTD", "runmodule.php?module=rss&feed=motd", false, true);
output($format, "Message of the Day (MoTD)", true);
}
addnav("Other");
addnav("About LoGD", "about.php");
if ($session['user']['loggedin']) {
addnav("Return to the news", "news.php");
} else {
addnav("Login Page", "index.php");
}
page_footer();
return;
}
$items = array();
$feedtitle = "";
$pubtime = date("Y-m-d H:i:s");
$link = getsetting("serverurl", "http://" . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . $_SERVER['SERVER_PORT']) . dirname($_SERVER['SCRIPT_NAME']));
if (!preg_match("/\\/\$/", $link)) {
$link = $link . "/";
savesetting("serverurl", $link);
}
$feed = httpget("feed");
//filter out turned-off feeds
if ($feed == "news" && !get_module_setting("do_news")) {
$feed = "";
}
if ($feed == "motd" && !get_module_setting("do_motd")) {
$feed = "";
}
if ($feed == "online" && !get_module_setting("do_online")) {
$feed = "";
}
switch ($feed) {
case "news":
$feedtitle = "LoGD News";
$sql = "SELECT newstext,arguments,newsdate,now() AS currenttime,tlschema FROM " . db_prefix("news") . " ORDER BY newsid DESC LIMIT 10";
$result = db_query_cached($sql, "mod_rss_news", get_module_setting("cache_timeout"));
while ($row = db_fetch_assoc($result)) {
$pubtime = $row['currenttime'];
$arguments = array();
$base_arguments = @unserialize($row['arguments']);
array_push($arguments, $row['newstext']);
while ($base_arguments && (list($key, $val) = each($base_arguments))) {
array_push($arguments, $val);
}
tlschema($row['tlschema']);
$title = call_user_func_array("sprintf_translate", $arguments);
tlschema();
array_push($items, array("title" => $title, "description" => $title, "pubDate" => $row['newsdate'], "link" => $link . "news.php"));
}
if (count($items) == 0) {
$items = array(array("title" => sprintf_translate("There are no news items", array()), "description" => "", "pubDate" => date("Y-m-d H:i:s"), "link" => $link . "news.php"));
}
break;
case "online":
$feedtitle = "LoGD Who's Online";
$sql = "SELECT name,alive,location,sex,level,race,now() AS currenttime FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'" . date("Y-m-d H:i:s", strtotime("-" . getsetting("LOGINTIMEOUT", 900) . " seconds")) . "' ORDER BY level DESC";
$result = db_query_cached($sql, "mod_rss_online", get_module_setting("cache_timeout"));
while ($row = db_fetch_assoc($result)) {
$pubtime = $row['currenttime'];
array_push($items, array("title" => $row['name'], "description" => sprintf_translate("Level %s " . ($row['sex'] ? "female" : "male") . " %s in %s", $row['level'], strtolower($row['race']), $row['location']), "pubDate" => $row['currenttime'], "link" => $link));
}
if (count($items) == 0) {
$items = array(array("title" => sprintf_translate("There are no characters online at this time.", array()), "description" => "", "pubDate" => date("Y-m-d H:i:s"), "link" => $link));
}
db_free_result($result);
if ($onlinecount == 0) {
$ret .= appoencode("`iNone`i");
}
break;
case "motd":
$sql = "SELECT motddate,motdbody,motdtitle,name AS motdauthorname,now() AS currenttime FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor ORDER BY motddate DESC limit 10";
$result = db_query_cached($sql, "mod_rss_motd", get_module_setting("cache_timeout"));
$feedtitle = "Message of the Day";
while ($row = db_fetch_assoc($result)) {
$pubdate = $row['currenttime'];
array_push($items, array("title" => $row['motdtitle'], "description" => "By {$row['motdauthorname']}\n{$row['motdbody']}", "pubDate" => $row['motddate'], "link" => $link . "motd.php#motd" . date("YmdHis", strtotime($row['motddate']))));
}
break;
default:
$feedtitle = "No such feed exists";
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:rss.php
示例6: strtotime
<?php
// translator ready
// addnews ready
// mail ready
require_once "lib/constants.php";
$lastexpire = strtotime(getsetting("last_char_expire", "0000-00-00 00:00:00"));
$needtoexpire = strtotime("-23 hours");
if ($lastexpire < $needtoexpire) {
savesetting("last_char_expire", date("Y-m-d H:i:s"));
$old = getsetting("expireoldacct", 45);
$new = getsetting("expirenewacct", 10);
$trash = getsetting("expiretrashacct", 1);
# First, get the account ids to delete the user prefs.
$sql1 = "SELECT login,acctid,dragonkills,level FROM " . db_prefix("accounts") . " WHERE (superuser&" . NO_ACCOUNT_EXPIRATION . ")=0 AND (1=0\n" . ($old > 0 ? "OR (laston < \"" . date("Y-m-d H:i:s", strtotime("-{$old} days")) . "\")\n" : "") . ($new > 0 ? "OR (laston < \"" . date("Y-m-d H:i:s", strtotime("-{$new} days")) . "\" AND level=1 AND dragonkills=0)\n" : "") . ($trash > 0 ? "OR (laston < \"" . date("Y-m-d H:i:s", strtotime("-" . ($trash + 1) . " days")) . "\" AND level=1 AND experience < 10 AND dragonkills=0)\n" : "") . ")";
$result1 = db_query($sql1);
$acctids = array();
$pinfo = array();
$dk0lvl = 0;
$dk0ct = 0;
$dk1lvl = 0;
$dk1ct = 0;
$dks = 0;
while ($row1 = db_fetch_assoc($result1)) {
require_once "lib/charcleanup.php";
if (!char_cleanup($row1['acctid'], CHAR_DELETE_AUTO)) {
continue;
}
array_push($acctids, $row1['acctid']);
array_push($pinfo, "{$row1['login']}:dk{$row1['dragonkills']}-lv{$row1['level']}");
if ($row1['dragonkills'] == 0) {
示例7: translator_setup
if ($session['user']['superuser'] & SU_MEGAUSER) {
$session['user']['superuser'] = $session['user']['superuser'] | SU_EDIT_USERS;
}
translator_setup();
//set up the error handler after the intial setup (since it does require a
//db call for notification)
require_once "lib/errorhandler.php";
// WARNING:
// do not hook on these modulehooks unless you really need your module to run
// on every single page hit. This is called even when the user is not
// logged in!!!
// This however is the only context where blockmodule can be called safely!
// You should do as LITTLE as possible here and consider if you can hook on
// a page header instead.
modulehook("everyhit");
if ($session['user']['loggedin']) {
modulehook("everyhit-loggedin");
}
// This bit of code checks the current system load, so that high-intensity operations can be disabled or postponed during times of exceptionally high load. Since checking system load can in itself be resource intensive, we'll only check system load once per thirty seconds, checking it against time retrieved from the database at the first load of getsetting().
global $fiveminuteload;
$lastcheck = getsetting("systemload_lastcheck", 0);
$fiveminuteload = getsetting("systemload_lastload", 0);
$currenttime = time();
if ($currenttime - $lastcheck > 30) {
$load = exec("uptime");
$load = split("load average:", $load);
$load = split(", ", $load[1]);
$fiveminuteload = $load[1];
savesetting("systemload_lastload", $fiveminuteload);
savesetting("systemload_lastcheck", $currenttime);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:common.php
示例8: charstats
//.........这里部分代码省略.........
if ($def > $u['defense']) {
$def = round($u['defense'], 1) . "`@+" . round($def - $u['defense'], 1);
} else {
// They are equal, display in the 1 signifigant digit format.
$def = round($def, 1);
}
}
addcharstat("Vital Info");
addcharstat("Name", $u['name']);
addcharstat("Level", "`b" . $u['level'] . check_temp_stat("level", 1) . "`b");
if ($u['alive']) {
addcharstat("Hitpoints", $u['hitpoints'] . check_temp_stat("hitpoints", 1) . "`0/" . $u['maxhitpoints'] . check_temp_stat("maxhitpoints", 1));
addcharstat("Turns", $u['turns'] . check_temp_stat("turns", 1));
addcharstat("Attack", $atk . check_temp_stat("attack", 1));
addcharstat("Defense", $def . check_temp_stat("defense", 1));
} else {
$maxsoul = $u['level'] * 5 + 50;
addcharstat("Soulpoints", $u['soulpoints'] . check_temp_stat("soulpoints", 1) . "`0/" . $maxsoul);
addcharstat("Torments", $u['gravefights'] . check_temp_stat("gravefights", 1));
addcharstat("Psyche", 10 + round(($u['level'] - 1) * 1.5));
addcharstat("Spirit", 10 + round(($u['level'] - 1) * 1.5));
}
addcharstat("Spirits", translate_inline("`b" . $spirits[(int) $u['spirits']] . "`b"));
if ($u['race'] != RACE_UNKNOWN) {
addcharstat("Race", translate_inline($u['race'], "race"));
} else {
addcharstat("Race", translate_inline(RACE_UNKNOWN, "race"));
}
if (count($companions) > 0) {
addcharstat("Companions");
foreach ($companions as $name => $companion) {
if ($companion['hitpoints'] > 0 || isset($companion['cannotdie']) && $companion['cannotdie'] == true) {
if ($companion['hitpoints'] < 0) {
$companion['hitpoints'] = 0;
}
if ($companion['hitpoints'] < $companion['maxhitpoints']) {
$color = "`\$";
} else {
$color = "`@";
}
if (isset($companion['suspended']) && $companion['suspended'] == true) {
$suspcode = "`7 *";
} else {
$suspcode = "";
}
addcharstat($companion['name'], $color . $companion['hitpoints'] . "`7/`&" . $companion['maxhitpoints'] . "{$suspcode}`0");
}
}
}
addcharstat("Personal Info");
if ($u['alive']) {
addcharstat("Gold", $u['gold'] . check_temp_stat("gold", 1));
} else {
addcharstat("Favor", $u['deathpower'] . check_temp_stat("deathpower", 1));
}
addcharstat("Gems", $u['gems'] . check_temp_stat("gems", 1));
addcharstat("Experience", $u['experience'] . check_temp_stat("experience", 1));
addcharstat("Equipment Info");
addcharstat("Weapon", $u['weapon']);
addcharstat("Armor", $u['armor']);
if ($u['hashorse']) {
addcharstat("Creature", $playermount['mountname'] . "`0");
}
modulehook("charstats");
$charstat = getcharstats($buffs);
if (!is_array($session['bufflist'])) {
$session['bufflist'] = array();
}
return $charstat;
} else {
$ret = "";
if ($ret = datacache("charlisthomepage")) {
} else {
$onlinecount = 0;
// If a module wants to do it's own display of the online chars,
// let it.
$list = modulehook("onlinecharlist", array());
if (isset($list['handled']) && $list['handled']) {
$onlinecount = $list['count'];
$ret = $list['list'];
} else {
$sql = "SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'" . date("Y-m-d H:i:s", strtotime("-" . getsetting("LOGINTIMEOUT", 900) . " seconds")) . "' ORDER BY level DESC";
$result = db_query($sql);
$ret .= appoencode(sprintf(translate_inline("`bOnline Characters (%s players):`b`n"), db_num_rows($result)));
while ($row = db_fetch_assoc($result)) {
$ret .= appoencode("`^{$row['name']}`n");
$onlinecount++;
}
db_free_result($result);
if ($onlinecount == 0) {
$ret .= appoencode(translate_inline("`iNone`i"));
}
}
savesetting("OnlineCount", $onlinecount);
savesetting("OnlineCountLast", strtotime("now"));
updatedatacache("charlisthomepage", $ret);
}
return $ret;
}
}
示例9: if
if (substr($laston,0,2)=="1 ") $laston="1 day";
if (date("Y-m-d",strtotime($row[laston])) == date("Y-m-d")) $laston="Today";
if (date("Y-m-d",strtotime($row[laston])) == date("Y-m-d",strtotime("-1 day"))) $laston="Yesterday";
if ($loggedin) $laston="Now";
output($laston);
output("</td></tr>",true);
}
output("</table>",true);
}else if ($HTTP_GET_VARS['op']=="addbounty"){
if ($session['user']['bounties'] >= getsetting("maxbounties",5)) {
output("Dag gives you a piercing look. `7\"Ye be thinkin' I be an assassin or somewhat? Ye already be placin' more than 'nuff bounties for t'day. Now, be ye gone before I stick a bounty on yer head fer annoyin' me.`n`n");
} else {
$fee = getsetting("bountyfee",10);
if ($fee < 0 || $fee > 100) {
$fee = 10;
savesetting("bountyfee",$fee);
}
$min = getsetting("bountymin",50);
$max = getsetting("bountymax",400);
output("Dag Durnick glances up at you and adjusts the pipe in his mouth with his teeth.`n`7\"So, who ye be wantin' to place a hit on? Just so ye be knowing, they got to be legal to be killin', they got to be at least level " . getsetting("bountylevel",3) . ", and they can't be having too much outstandin' bounty nor be getting hit to frequent like, so if they ain't be listed, they can't be contracted on! We don't run no slaughterhouse here, we run a.....business. Also, there be a " . getsetting("bountyfee",10) . "% listin' fee fer any hit ye be placin'.\"`n`n");
output("<form action='dag.php?op=finalize' method='POST'>",true);
output("`2Target: <input name='contractname'>`n", true);
output("`2Amount to Place: <input name='amount' id='amount' width='5'>`n`n",true);
output("<input type='submit' class='button' value='Finalize Contract'></form>",true);
addnav("","dag.php?op=finalize");
}
}elseif ($HTTP_GET_VARS['op']=="finalize") {
//$name = "%" . rawurldecode($_POST['contractname']) . "%";
if ($_GET['subfinal']==1){
$sql = "SELECT acctid,name,login,level,locked,age,dragonkills,pk,experience,bounty FROM accounts WHERE name='".addslashes(rawurldecode(stripslashes($_POST['contractname'])))."' AND locked=0";
//output($sql);
示例10: output
output("• Not linking back to LoGDnet`n", true);
output("Or really, any other reason that we want.`n");
output("If you've been banned already, chances are you know why, and chances are we've got no interest in removing the ban.");
output("We provide this free of charge, at the expense of considerable bandwidth and server load, so if you've had the gall to abuse our charity, don't expect it to be won back very easily.`n`n");
output("If you are well behaved, we don't have an interest in blocking you from this listing. `0`n");
rawoutput("<table border='0' cellpadding='1' cellspacing='0'>");
rawoutput("<tr class='trhead'><td>");
output("Server");
rawoutput("</td><td>");
output("Version");
rawoutput("</td>");
require_once "lib/pullurl.php";
$u = getsetting("logdnetserver", "http://logdnet.logd.com/");
if (!preg_match("/\\/\$/", $u)) {
$u = $u . "/";
savesetting("logdnetserver", $u);
}
$servers = pullurl($u . "logdnet.php?op=net");
if (!$servers) {
$servers = array();
}
$i = 0;
while (list($key, $val) = each($servers)) {
$row = unserialize($val);
// If we aren't given an address, continue on.
if (substr($row['address'], 0, 7) != "http://" && substr($row['address'], 0, 8) != "https://") {
continue;
}
// Give undescribed servers a boring descriptionn
if (trim($row['description']) == "") {
$row['description'] = "Another boring and undescribed LotGD server";
示例11: iitems_hunterslodge_run
function iitems_hunterslodge_run()
{
global $session;
page_header("Hunter's Lodge");
$op = httpget('op');
$pointsleft = $session['user']['donation'] - $session['user']['donationspent'];
$pointstotal = $session['user']['donation'];
$pointsspent = $session['user']['donationspent'];
switch ($op) {
case "superuser":
$sql = "SELECT * FROM " . db_prefix("purchaselog");
$result = db_query($sql);
$peritem = array();
$now = time();
while ($row = db_fetch_assoc($result)) {
$item = $row['purchased'];
$peritem[$item]['sold'] += 1;
$peritem[$item]['income'] += $row['amount'];
$time = strtotime($row['timestamp']);
if (isset($peritem[$item]['firstpurchase']) && $peritem[$item]['firstpurchase'] > $time) {
$peritem[$item]['firstpurchase'] = $time;
} else {
if (!isset($peritem[$item]['firstpurchase'])) {
$peritem[$item]['firstpurchase'] = $time;
}
}
}
foreach ($peritem as $item => $data) {
$timesincefirst = $now - $data['firstpurchase'];
$incomeperday = round($data['income'] / ($timesincefirst / 86400) / 100, 2);
$peritem[$item]['incomeperday'] = $incomeperday;
$peritem[$item]['item'] = $item;
}
function sortbysold($a, $b)
{
if ($b['sold'] > $a['sold']) {
return true;
} else {
return false;
}
}
function sortbyincome($a, $b)
{
if ($b['income'] > $a['income']) {
return true;
} else {
return false;
}
}
function sortbydailyincome($a, $b)
{
if ($b['incomeperday'] > $a['incomeperday']) {
return true;
} else {
return false;
}
}
rawoutput("<table width=100% border=0 cellpadding=0 cellspacing=0><tr class='trhead'><td>Item</td><td>Item Verbose Name</td><td><a href='runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbysold'>Units sold</a></td><td><a href='runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbyincome'>Profit total</a></td><td><a href='runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbydailyincome'>Profit per day</a></td></tr>");
$classcount = 1;
addnav("", "runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbysold");
addnav("", "runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbyincome");
addnav("", "runmodule.php?module=iitems_hunterslodge&op=superuser&sort=sortbydailyincome");
if (httpget('sort')) {
usort($peritem, httpget('sort'));
}
foreach ($peritem as $item => $data) {
$classcount++;
$class = $classcount % 2 ? "trdark" : "trlight";
$vname = get_item_setting("verbosename", $data['item']);
if (!$vname) {
$vname = $data['item'];
}
rawoutput("<tr class='{$class}'><td>" . $data['item'] . "</td><td>" . $vname . "</td><td>" . number_format($data['sold']) . "</td><td>\$" . number_format($data['income'] / 100, 2) . "</td><td>\$" . number_format($data['incomeperday'], 2) . "</td></tr>");
}
rawoutput("</table>");
addnav("Return");
addnav("Back to the Grotto", "superuser.php");
break;
case "explain":
output("You give a friendly nod to the proprietor, and open your mouth to ask him a question.`n`nHe grins back at you.`n`nThere's a small `ipop`iping sensation in the centre of your skull, like a muscle abruptly shifting - and you suddenly realise what this place is all about.`n`n`bAbout Supporter Points`b`nImprobable Island is entirely funded by donations from its players. When you donate, you get Supporter Points, which you can use on items in the Hunter's Lodge. You get one hundred Supporter Points per US Dollar, and donations are accepted through PayPal. To donate, click the coin slot to the lower right of your screen. Always use the \"Site Admin\" PayPal button when donating if you wish to receive Supporter Points (donations made through the \"Author\" button go to Eric Stevens, the author of the game engine on which Improbable Island was originally based - you don't get any Supporter Points for donating through this button). You can also get Supporter Points by referring new players to the site (click the Referrals link to the left) or sometimes in `4Other Ways`0 which will be announced from time to time.`n`n`bTo give presents`b`nAll Hunter's Lodge items (and most other in-game items) can be given as gifts to other players. Visit the Gifting Station in Common Ground to do so. Some items can be gifted for free - others cost one Supporter Point each to gift. Hunter's Lodge items that bestow permanent benefits (IE unlimited title change documents) can only be gifted if they're unused. In all cases, you'll get to choose your gift-wrap and whether to give anonymously or not.`n`n`bHey, it's my birthday soon. Can I ask my non-Island-playing mates to buy me points on the Island?`b`nYes! Just send them to this link:`nhttp://www.improbableisland.com/runmodule.php?module=giftpoints&acctid=%s`n`n", $session['user']['acctid']);
addnav("Okay");
addnav("Back to the Hunter's Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
addnav("Referrals", "runmodule.php?module=iitems_hunterslodge&op=referrals");
break;
case "referrals":
output("If you help bring new players to Improbable Island, you'll earn one Supporter Point every time those players hit a new Game Day. To refer players, use this address:`n`n");
$url = getsetting("serverurl", "http://" . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . $_SERVER['SERVER_PORT']) . dirname($_SERVER['REQUEST_URI']));
if (!preg_match("/\\/\$/", $url)) {
$url = $url . "/";
savesetting("serverurl", $url);
}
output_notl("%shome.php?r=%s`n`n", $url, rawurlencode($session['user']['login']));
$sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE referer={$session['user']['acctid']} ORDER BY dragonkills,level";
$result = db_query($sql);
$number = db_num_rows($result);
if ($number) {
output("Accounts you've referred:`n");
for ($i = 0; $i < $number; $i++) {
$row = db_fetch_assoc($result);
output_notl("%s`0`n", $row['name']);
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:iitems_hunterslodge.php
示例12: rawoutput
rawoutput("<input name='password' value=\"{$pass1}\" type='hidden'>");
output("Your account was created, your login name is `^%s`0.`n`n", $shortname);
$click = translate_inline("Click here to log in");
rawoutput("<input type='submit' class='button' value='{$click}'>");
rawoutput("</form>");
output_notl("`n");
if ($trash > 0) {
output("`^Characters that have never been logged into will be deleted after %s day(s) of no activity.`n`0", $trash);
}
if ($new > 0) {
output("`^Characters that have never reached level 2 will be deleted after %s days of no activity.`n`0", $new);
}
if ($old > 0) {
output("`^Characters that have reached level 2 at least once will be deleted after %s days of no activity.`n`0", $old);
}
savesetting("newestplayer", $row['acctid']);
}
}
}
} else {
output("`\$Error`^:`n%s", $msg);
$op = "";
}
}
}
if ($op == "") {
output("`&`c`bCreate a Character`b`c`0");
$refer = httpget('r');
if ($refer) {
$refer = "&r=" . htmlentities($refer, ENT_COMPAT, getsetting("charset", "ISO-8859-1"));
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:create.php
示例13: output
<?php
output("`@`c`bAll Done!`b`c");
output("Your install of Legend of the Green Dragon has been completed!`n");
output("`nRemember us when you have hundreds of users on your server, enjoying the game.");
output("Eric, JT, and a lot of others put a lot of work into this world, so please don't disrespect that by violating the license.");
if ($session['user']['loggedin']) {
addnav("Continue", $session['user']['restorepage']);
} else {
addnav("Login Screen", "./");
}
savesetting("installer_version", $logd_version);
$noinstallnavs = true;
示例14: stripslashes
if ($session['user']['location'] == $settings['innname']) {
$session['user']['location'] = stripslashes(httppost('innname'));
}
}
if (stripslashes(httppost("motditems")) != $settings['motditems']) {
invalidatedatacache("motd");
}
$post = httpallpost();
reset($post);
$old = $settings;
while (list($key, $val) = each($post)) {
if (!isset($settings[$key]) || stripslashes($val) != $settings[$key]) {
if (!isset($old[$key])) {
$old[$key] = "";
}
savesetting($key, stripslashes($val));
output("Setting %s to %s`n", $key, stripslashes($val));
gamelog("`@changed core setting `^{$key}`@ from `3{$old[$key]}`@ to `#{$val}`0", "settings");
// Notify every module
modulehook("changesetting", array("module" => "core", "setting" => $key, "old" => $old[$key], "new" => $val), true);
}
}
output("`^Settings saved.`0");
$op = "";
httpset($op, "");
} elseif ($op == "modulesettings") {
include_once "lib/gamelog.php";
if (injectmodule($module, true)) {
$save = httpget('save');
if ($save != "") {
load_module_settings($module);
示例15: modulehook
$post = modulehook("addpetition", $post);
if (!$post['cancelpetition']) {
unset($post['cancelpetition'], $post['cancelreason']);
$sql = "INSERT INTO " . db_prefix("petitions") . " (author,date,body,pageinfo,ip,id) VALUES (" . (int) $session['user']['acctid'] . ",'{$date}',\"" . addslashes(output_array($post)) . "\",\"" . addslashes(output_array($session, "Session:")) . "\",'{$_SERVER['REMOTE_ADDR']}','" . addslashes($_COOKIE['lgi']) . "')";
db_query($sql);
// Fix the counter
invalidatedatacache("petition_counts");
// If the admin wants it, email the petitions to them.
if (getsetting("emailpetitions", 0)) {
// Yeah, the format of this is ugly.
require_once "lib/sanitize.php";
$name = color_sanitize($session['user']['name']);
$url = getsetting("serverurl", "http://" . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . $_SERVER['SERVER_PORT']) . dirname($_SERVER['REQUEST_URI']));
if (!preg_match("/\\/\$/", $url)) {
$url = $url . "/";
savesetting("serverurl", $url);
}
$tl_server = translate_inline("Server");
$tl_author = translate_inline("Author");
$tl_date = translate_inline("Date");
$tl_body = translate_inline("Body");
$tl_subject = sprintf_translate("New LoGD Petition at %s", $url);
$msg = "{$tl_server}: {$url}\n";
$msg .= "{$tl_author}: {$name}\n";
$msg .= "{$tl_date} : {$date}\n";
$msg .= "{$tl_body} :\n" . output_array($post) . "\n";
mail(getsetting("gameadminemail", "postmaster@localhost.com"), $tl_subject, $msg);
}
$session['user']['password'] = $p;
output("Your petition has been sent to the server admin.");
output("Please be patient, most server admins have jobs and obligations beyond their game, so sometimes responses will take a while to be received.");
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:petition_default.php