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


PHP sprintf_translate函数代码示例

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


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

示例1: checkban

function checkban(string $login, bool $connect = false) : bool
{
    global $session;
    $accounts = db_prefix('accounts');
    $bans = db_prefix('accounts');
    $today = date('Y-m-d');
    $sql = db_query("SELECT lastip, uniquid, banoverride, superuser FROM {$accounts}\n        WHERE login = '{$login}'");
    $row = db_fetch_assoc($sql);
    if ($row['banoverride'] || $row['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
        return false;
    }
    db_free_result($sql);
    $sql = db_query("SELECT * FROM {$bans}\n        WHERE (\n            (ipfilter = '{$row['lastip']}' OR ipfilter = '{$_SERVER['REMOTE_ADDR']}')\n            OR (uniqueid = '{$row['uniqueid']}' OR uniqueid = '{$_COOKIE['lgi']}')\n        )\n        AND (banexpire = '000-00-00' OR banexpire >= '{$today}')");
    if (db_num_rows($sql) > 0) {
        if ($connect) {
            $session = [];
            tlschema('ban');
            $session['message'] .= translate_inline('`n`4You fall under a ban currently in place on this website:');
            while ($row = db_fetch_assoc($sql)) {
                $session['message'] .= "`n{$row['banreason']}`n";
                if ($row['banexpire'] == '0000-00-00') {
                    $session['message'] .= translate_inline("`\$This ban is permanent!`0");
                } else {
                    $session['message'] .= sprintf_translate("`^This ban will be removed `\$after`^ %s.`0", date("M d, Y", strtotime($row['banexpire'])));
                }
                db_query("UPDATE {$bans}\n                    SET lasthit = '{$today} 00:00:00'\n                    WHERE ipfilter = '{$row['ipfilter']}'\n                    AND uniqueid = '{$row['uniqueid']}'\n                    ");
            }
            $session['message'] .= translate_inline("`n`4If you wish, you may appeal your ban with the petition link.");
            tlschema();
            header('Location: home.php');
        }
        return true;
    }
    return false;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:35,代码来源:checkban.php

示例2: friendlist_unignore

function friendlist_unignore()
{
    global $session;
    $ac = httpget('ac');
    $ignored = rexplode(get_module_pref('ignored', 'friendlist', $ac));
    $iveignored = rexplode(get_module_pref('iveignored'));
    if (in_array($ac, $iveignored)) {
        $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$ac} AND locked=0";
        $result = db_query($sql);
        if (db_num_rows($result) > 0) {
            $row = db_fetch_assoc($result);
            $info = sprintf_translate("%s`Q has been removed from your list.", $row['name']);
            require_once "lib/systemmail.php";
            $t = array("`\$Ignore List Removal");
            $mailmessage = array("%s`0`@ has removed you from %s ignore list.", $session['user']['name'], $session['user']['sex'] ? translate_inline("her") : translate_inline("his"));
            systemmail($ac, $t, $mailmessage);
        } else {
            $info = translate_inline("That user no longer exists...");
        }
    }
    $ignored = array_diff($ignored, array($session['user']['acctid']));
    $ignored = rimplode($ignored);
    set_module_pref('ignored', $ignored, 'friendlist', $ac);
    if (in_array($ac, $iveignored)) {
        $iveignored = array_diff($iveignored, array($ac));
        $iveignored = rimplode($iveignored);
        set_module_pref('iveignored', $iveignored);
    }
    output_notl($info);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:friendlist_unignore.php

示例3: relativedate

function relativedate(string $indate) : string
{
    $lastOn = round((strtotime('now') - strtotime($indate)) / 86400, 0) . 'days';
    tlschema('datetime');
    if (substr($lastOn, 0, 2) == '1 ') {
        $lastOn = translate_inline('1 day');
    } else {
        if (date('Y-m-d', strtotime($lastOn)) == date('Y-m-d')) {
            $lastOn = translate_inline('Today');
        } else {
            if (date('Y-m-d', strtotime($lastOn)) == date('Y-m-d', strtotime('-1 day'))) {
                $lastOn = translate_inline('Yesterday');
            } else {
                if (strpos($indate, '0000-00-00') !== false) {
                    $lastOn = translate_inline('Never');
                } else {
                    $lastOn = sprintf_translate('%s days', round((strtotime('now') - strtotime($indate)) / 86400, 0));
                    rawoutput(tlbutton_clear());
                }
            }
        }
    }
    tlschema();
    return $lastOn;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:25,代码来源:datetime.php

示例4: commentarylocs

function commentarylocs()
{
    global $comsecs, $session;
    if (is_array($comsecs) && count($comsecs)) {
        return $comsecs;
    }
    $vname = getsetting("villagename", LOCATION_FIELDS);
    $iname = getsetting("innname", LOCATION_INN);
    tlschema("commentary");
    $comsecs['village'] = sprintf_translate("%s Square", $vname);
    if ($session['user']['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
        $comsecs['superuser'] = translate_inline("Grotto");
    }
    $comsecs['shade'] = translate_inline("Land of the Shades");
    $comsecs['grassyfield'] = translate_inline("Grassy Field");
    $comsecs['inn'] = "{$iname}";
    $comsecs['motd'] = translate_inline("MotD");
    $comsecs['veterans'] = translate_inline("Veterans Club");
    $comsecs['hunterlodge'] = translate_inline("Hunter's Lodge");
    $comsecs['gardens'] = translate_inline("Gardens");
    $comsecs['waiting'] = translate_inline("Clan Hall Waiting Area");
    if (getsetting("betaperplayer", 1) == 1 && @file_exists("pavilion.php")) {
        $comsecs['beta'] = translate_inline("Pavilion");
    }
    tlschema();
    // All of the ones after this will be translated in the modules.
    $comsecs = modulehook("moderate", $comsecs);
    rawoutput(tlbutton_clear());
    return $comsecs;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:commentary-backup-before-new.php

示例5: switch_dohook

function switch_dohook($hook, $args)
{
    switch ($hook) {
        case 'charstats':
            global $SCRIPT_NAME, $session;
            if ($SCRIPT_NAME == 'village.php' && $session['user']['specialinc'] == '') {
                addcharstat("Vital Info");
                addcharstat(sprintf_translate("<a href='login.php?op=logout'>%s</a>", "`%Log Out"), sprintf_translate("<a href='runmodule.php?module=switch' style='font-weight: bold;'>%s</a>", appoencode('`%Switch')));
                addnav('', 'login.php?op=logout');
                addnav('', 'runmodule.php?module=switch');
            }
            break;
    }
    return $args;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:15,代码来源:switch.php

示例6: changelog_dohook

function changelog_dohook($hook, $args)
{
    switch ($hook) {
        case 'header-modules':
            $module = httppost('module') ?: httpget('module');
            $op = httpget('op');
            if ($module != '') {
                if (substr($op, -1) == 'e') {
                    $op = substr($op, 0, -1);
                } else {
                    if ($op == 'mass') {
                        $method = array_keys(httpallpost())[1];
                        if (substr($method, -1) == 'e') {
                            $method = substr($method, 0, -1);
                        }
                        $op = "mass {$method}";
                        $plural = 's';
                    }
                }
                require_once 'lib/gamelog.php';
                if (is_array($module)) {
                    $lastModule = array_pop($module);
                    $module = implode(', ', $module);
                    $module .= ",`@ and `^{$lastModule}";
                }
                gamelog(sprintf_translate('`Q%sed`@ the `^%s`@ module%s.', $op, $module, $plural), get_module_setting('category'));
            }
            break;
        case 'village':
            if (get_module_setting('infonav')) {
                addnav($args['infonav']);
                addnav('View Changelog', 'runmodule.php?module=changelog&ret=village');
            }
            break;
        case 'header-about':
            addnav('About LoGD');
            addnav('View Changelog', 'runmodule.php?module=changelog&ret=about');
            break;
        case 'newday-runonce':
            $gamelog = db_prefix('gamelog');
            $date = date('Y-m-d H:i:s', strtotime('now'));
            $category = get_module_setting('category');
            db_query("UPDATE {$gamelog} SET date = '{$date}' WHERE category = '{$category}'");
            break;
    }
    return $args;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:47,代码来源:changelog.php

示例7: getmountname

function getmountname()
{
    global $playermount;
    tlschema("mountname");
    $name = '';
    $lcname = '';
    if (isset($playermount['mountname'])) {
        $name = sprintf_translate("Your %s", $playermount['mountname']);
        $lcname = sprintf_translate("your %s", $playermount['mountname']);
    }
    tlschema();
    if (isset($playermount['newname']) && $playermount['newname'] != "") {
        $name = $playermount['newname'];
        $lcname = $playermount['newname'];
    }
    return array($name, $lcname);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:17,代码来源:mountname.php

示例8: checkban

function checkban($login = false)
{
    global $session;
    if (isset($session['banoverride']) && $session['banoverride']) {
        return false;
    }
    if ($login === false) {
        $ip = $_SERVER['REMOTE_ADDR'];
        $id = $_COOKIE['lgi'];
    } else {
        $sql = "SELECT lastip,uniqueid,banoverride,superuser FROM " . db_prefix("accounts") . " WHERE login='{$login}'";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        if ($row['banoverride'] || $row['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
            $session['banoverride'] = true;
            return false;
        }
        db_free_result($result);
        $ip = $row['lastip'];
        $id = $row['uniqueid'];
    }
    $sql = "SELECT * FROM " . db_prefix("bans") . " where ((substring('{$ip}',1,length(ipfilter))=ipfilter AND ipfilter<>'') OR (uniqueid='{$id}' AND uniqueid<>'')) AND (banexpire='0000-00-00' OR banexpire>='" . date("Y-m-d") . "')";
    $result = db_query($sql);
    if (db_num_rows($result) > 0) {
        $session = array();
        tlschema("ban");
        $session['message'] .= translate_inline("`n`4You fall under a ban currently in place on this website:`n");
        while ($row = db_fetch_assoc($result)) {
            $session['message'] .= $row['banreason'] . "`n";
            if ($row['banexpire'] == '0000-00-00') {
                $session['message'] .= translate_inline("  `\$This ban is permanent!`0");
            } else {
                $session['message'] .= sprintf_translate("  `^This ban will be removed `\$after`^ %s.`0", date("M d, Y", strtotime($row['banexpire'])));
            }
            $sql = "UPDATE " . db_prefix("bans") . " SET lasthit='" . date("Y-m-d H:i:s") . "' WHERE ipfilter='{$row['ipfilter']}' AND uniqueid='{$row['uniqueidid']}'";
            db_query($sql);
            $session['message'] .= "`n";
        }
        $session['message'] .= translate_inline("`4If you wish, you may appeal your ban with the petition link.");
        tlschema();
        header("Location: index.php");
        exit;
    }
    db_free_result($result);
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:45,代码来源:checkban.php

示例9: apply_clan_buff_for_one

function apply_clan_buff_for_one()
{
    global $session;
    strip_buff("clanbuff");
    strip_buff("clanbuff2");
    strip_buff("clanbuff3");
    if (get_module_setting("allowatk") && get_module_objpref("clans", $session['user']['clanid'], "atkactive")) {
        $atkmod = 1 + get_module_setting("eatkbase") + get_module_objpref("clans", $session['user']['clanid'], "atklevel") * get_module_setting("eatkinc");
    } else {
        $atkmod = 1;
    }
    if (get_module_setting("allowdef") && get_module_objpref("clans", $session['user']['clanid'], "defactive")) {
        $defmod = 1 + get_module_setting("edefbase") + get_module_objpref("clans", $session['user']['clanid'], "deflevel") * get_module_setting("edefinc");
    } else {
        $defmod = 1;
    }
    if (get_module_setting("allowdrain") && get_module_objpref("clans", $session['user']['clanid'], "drainactive")) {
        $lifetap = get_module_setting("edrainbase") + get_module_objpref("clans", $session['user']['clanid'], "drainlevel") * get_module_setting("edraininc");
    } else {
        $lifetap = 0;
    }
    $allowinpvp = get_module_setting("allowinpvp");
    $allowintrain = get_module_setting("allowintrain");
    if (get_module_setting("allowult") && get_module_objpref("clans", $session['user']['clanid'], "ultactive")) {
        $rounds = -1;
    } else {
        $rounds = get_module_setting("eroundbase") + get_module_objpref("clans", $session['user']['clanid'], "roundlevel") * get_module_setting("eroundinc");
    }
    if (get_module_setting("allowthorn") && get_module_objpref("clans", $session['user']['clanid'], "thornactive")) {
        $damageshield = get_module_setting("ethornbase") + get_module_objpref("clans", $session['user']['clanid'], "thornlevel") * get_module_setting("ethorninc");
    } else {
        $damageshield = 0;
    }
    if (get_module_setting("allowregen") && get_module_objpref("clans", $session['user']['clanid'], "regenactive")) {
        $regen = get_module_setting("eregenbase") + get_module_objpref("clans", $session['user']['clanid'], "regenlevel") * get_module_setting("eregeninc");
    } else {
        $regen = 0;
    }
    apply_buff("clanbuff", array("name" => "`^Clan Aura`0", "atkmod" => $atkmod, "defmod" => $defmod, "lifetap" => $lifetap, "effectmsg" => sprintf_translate("`6Your Clan Aura allows you to absorb `^{damage}`6 of the damage you dealt to {badguy}!"), "allowinpvp" => $allowinpvp, "allowintrain" => $allowintrain, "rounds" => $rounds, "roundmsg" => "Your Clan's Aura strengthens you!", "schema" => "module-clanbuffs"));
    apply_buff("clanbuff2", array("damageshield" => $damageshield, "effectmsg" => sprintf_translate("`6Your Clan Aura allows you to reflect `^{damage}`6 of the damage you received {badguy}!"), "allowinpvp" => $allowinpvp, "allowintrain" => $allowintrain, "rounds" => $rounds, "schema" => "module-clanbuffs"));
    apply_buff("clanbuff3", array("regen" => $regen . "*<level>", "effectmsg" => sprintf_translate("`6Your Clan Aura allows you to regenerate `^{damage}`6 damage!"), "allowinpvp" => $allowinpvp, "allowintrain" => $allowintrain, "rounds" => $rounds, "schema" => "module-clanbuffs"));
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:42,代码来源:clanbuffs_func.php

示例10: addnews

/**
 * Adds a news item for the current user
 *
 * @param string $text Line of text for the news.
 * @param array $options List of options, including replacements, to modify the acctid, date, or hide from biographies.
 * @todo Change the date format from Y-m-d to Y-m-d H:i:s.
 */
function addnews(string $text = '', array $options = [])
{
    global $translation_namespace, $session;
    $options = modulehook('addnews', $options);
    $news = db_prefix('news');
    $replacements = [];
    foreach ($options as $key => $val) {
        if (is_numeric($key)) {
            array_push($replacements, $val);
        }
    }
    $text = sprintf_translate($text, $replacements);
    $date = $options['date'] ?? date('Y-m-d');
    $acctid = $options['acctid'] ?? $session['user']['acctid'];
    if (!$options['hide']) {
        $sql = db_query("INSERT INTO {$news} (newstext, newsdate, accountid, tlschema)\n            VALUES ('{$text}', '{$date}', '{$acctid}', '{$translation_namespace}')");
    } else {
        $sql = db_query("INSERT INTO {$news} (newstext, newsdate, tlschema)\n            VALUES ('{$text}', '{$date}', '{$translation_namespace}')");
    }
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:27,代码来源:addnews.php

示例11: friendlist_deny

function friendlist_deny()
{
    global $session;
    $ignored = rexplode(get_module_pref('ignored'));
    $friends = rexplode(get_module_pref('friends'));
    $request = rexplode(get_module_pref('request'));
    $ac = httpget('ac');
    $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$ac} AND locked=0";
    $result = db_query($sql);
    if (in_array($ac, $friends)) {
        $info = translate_inline("That user has been removed.");
        require_once "lib/systemmail.php";
        $t = "`\$Friend List Removal";
        $mailmessage = array("%s`0`@ has deleted you from %s Friend List.", $session['user']['name'], $session['user']['sex'] ? translate_inline("her") : translate_inline("his"));
        $friends = array_diff($friends, array($ac));
        $friends = rimplode($friends);
        set_module_pref('friends', $friends);
        $act = $session['user']['acctid'];
        $friends = rexplode(get_module_pref('friends', 'friendlist', $ac));
        $friends = array_diff($friends, array($act));
        $friends = rimplode($friends);
        set_module_pref('friends', $friends, 'friendlist', $ac);
        invalidatedatacache("friendliststat-" . $session['user']['acctid']);
        invalidatedatacache("friendliststat-" . $ac);
    } else {
        $info = translate_inline("That user has been denied.");
        require_once "lib/systemmail.php";
        $t = "`\$Friend Request Denied";
        $mailmessage = array("%s`0`@ has denied you your Friend Request.", $session['user']['name']);
        $request = array_diff($request, array($ac));
        $request = rimplode($request);
        set_module_pref('request', $request);
    }
    if (db_num_rows($result) > 0) {
        systemmail($ac, $t, $mailmessage);
        $row = db_fetch_assoc($result);
        $info = sprintf_translate("%s has been removed", $row['name']);
    }
    output_notl($info);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:40,代码来源:friendlist_deny.php

示例12: namecolor_dohook

function namecolor_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "pointsdesc":
            $args['count']++;
            $format = $args['format'];
            $str = translate("A colored name costs %s points for the first change and %s points for subsequent changes.");
            $str = sprintf($str, get_module_setting("initialpoints"), get_module_setting("extrapoints"));
            output($format, $str, true);
            break;
        case "lodge":
            // if (get_module_pref("boughtbefore")){
            // $cost = get_module_setting("extrapoints");
            // } else {
            // $cost = get_module_setting("initialpoints");
            // }
            // addnav(array("Colorize Name (%s points)", $cost), "runmodule.php?module=namecolor&op=namechange");
            addnav("Name Colour Changes");
            $costfirst = get_module_setting("initialpoints");
            $costsub = get_module_setting("extrapoints");
            $costperm = get_module_setting("permanent");
            $hasperm = get_module_pref("permanent");
            if ($hasperm) {
                addnav("Set Custom Name Colours (free)", "runmodule.php?module=namecolor&op=namechange");
            } else {
                if (get_module_pref("boughtbefore")) {
                    $cost = get_module_setting("extrapoints");
                } else {
                    $cost = get_module_setting("initialpoints");
                }
                $cost = sprintf_translate("%s points", $cost);
                addnav(array("Set Custom Name Colours (%s)", $cost), "runmodule.php?module=namecolor&op=namechange");
                addnav(array("Get unlimited Name Colour changes (%s points)", $costperm), "runmodule.php?module=namecolor&op=permanent");
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:39,代码来源:namecolor.php

示例13: friendlist_accept

function friendlist_accept()
{
    global $session;
    $ignored = rexplode(get_module_pref('ignored'));
    $request = rexplode(get_module_pref('request'));
    $friends = rexplode(get_module_pref('friends'));
    $ac = httpget('ac');
    if (in_array($ac, $ignored)) {
        $info = translate_inline("This user has ignored you.");
    } elseif (in_array($ac, $friends)) {
        $info = translate_inline("This user is already in your list.");
    } elseif (in_array($ac, $request)) {
        $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$ac} AND locked=0";
        $result = db_query($sql);
        if (db_num_rows($result) > 0) {
            $row = db_fetch_assoc($result);
            invalidatedatacache("friendliststat-" . $session['user']['acctid']);
            invalidatedatacache("friendliststat-" . $ac);
            $friends[] = $ac;
            $info = sprintf_translate("%s`Q has been added to your list.", $row['name']);
            require_once "lib/systemmail.php";
            $t = "`\$Friend Request Accepted";
            $mailmessage = array("%s`0`@ has accepted your Friend Request.", $session['user']['name']);
            systemmail($ac, $t, $mailmessage);
            $friends = rimplode($friends);
            set_module_pref('friends', $friends);
            $friends = rexplode(get_module_pref('friends', 'friendlist', $ac));
            $friends[] = $session['user']['acctid'];
            $friends = rimplode($friends);
            set_module_pref('friends', $friends, 'friendlist', $ac);
            $request = array_diff($request, array($ac));
            $request = rimplode($request);
            set_module_pref('request', $request);
        } else {
            $info = translate_inline("That user no longer exists...");
        }
    }
    output_notl($info);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:39,代码来源:friendlist_accept.php

示例14: blurry_dohook

function blurry_dohook($hook, $args)
{
    switch ($hook) {
        case 'everyfooter-loggedin':
            global $navbysection;
            $drunkeness = get_module_pref('drunkeness');
            if (file_exists('modules/drinks/drunkenize.php') && $drunkeness != 0) {
                require_once 'modules/drinks/drunkenize.php';
                foreach ($navbysection as $section => $navs) {
                    for ($i = 0; $i < count($navs); $i++) {
                        // Support to fix villagenav() and other arrayed navigation titles.
                        if (is_array($navs[$i][0])) {
                            $navs[$i][0] = sprintf_translate($navs[$i][0]);
                        }
                        if (strpos($navs[$i][0], '?') !== false) {
                            $navTitle = explode('?', $navs[$i][0]);
                            if (count($navTitle) > 2) {
                                $navTitle[2] = drinks_drunkenize($navTitle[2], $drunkeness);
                                $navTitle[2] = str_replace('*hic*', '', $navTitle[2]);
                            } else {
                                $navTitle[1] = drinks_drunkenize($navTitle[1], $drunkeness);
                                $navTitle[1] = str_replace('*hic*', '', $navTitle[1]);
                            }
                            $navTitle[1] = str_replace('*hic*', '', $navTitle[1]);
                            $navTitle = implode('?', $navTitle);
                            $navbysection[$section][$i][0] = stripslashes($navTitle);
                            unset($navTitle);
                        } else {
                            $navbysection[$section][$i][0] = drinks_drunkenize($navs[$i][0], $drunkeness);
                        }
                    }
                }
            }
            break;
    }
    return $args;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:37,代码来源:blurry.php

示例15: addnav

}
addnav("Game Settings");
addnav("Standard settings", "configuration.php");
addnav("", $REQUEST_URI);
module_editor_navs('settings', 'configuration.php?op=modulesettings&module=');
if ($op == "") {
    $enum = "enumpretrans";
    require_once "lib/datetime.php";
    $details = gametimedetails();
    $offset = getsetting("gameoffsetseconds", 0);
    for ($i = 0; $i <= 86400 / getsetting("daysperday", 4); $i += 300) {
        $off = $details['realsecstotomorrow'] - ($offset - $i);
        if ($off < 0) {
            $off += 86400;
        }
        $x = strtotime("+" . $off . " secs");
        $str = sprintf_translate("In %s at %s (+%s)", reltime($x), date("h:i a", $x), date("H:i", $i));
        $enum .= ",{$i},{$str}";
    }
    rawoutput(tlbutton_clear());
    $setup = array("Game Setup,title", "loginbanner" => "Login Banner (under login prompt: 255 chars)", "maxonline" => "Max # of players online (0 for unlimited), int", "allowcreation" => "Allow creation of new characters,bool", "gameadminemail" => "Admin Email", "emailpetitions" => "Should submitted petitions be emailed to Admin Email address?,bool", "Enter languages here like this: `i(shortname 2 chars) comma (readable name of the language)`i and continue as long as you wish,note", "serverlanguages" => "Languages available on this server", "defaultlanguage" => "Default Language,enum," . getsetting("serverlanguages", "en,English,fr,Français,dk,Danish,de,Deutsch,es,Español,it,Italian"), "edittitles" => "Should DK titles be editable in user editor,bool", "motditems" => "How many items should be shown on the motdlist,int", "Main Page Display,title", "homeskinselect" => "Should the skin selection widget be shown?,bool", "homecurtime" => "Should the current realm time be shown?,bool", "homenewdaytime" => "Should the time till newday be shown?,bool", "homenewestplayer" => "Should the newest player be shown?,bool", "defaultskin" => "What skin should be the default?,theme", "impressum" => "Tell the world something about the person running this server. (e.g. name and address),textarea", "Beta Setup,title", "beta" => "Enable beta features for all players?,bool", "betaperplayer" => "Enable beta features per player?,bool", "Account Creation,title", "defaultsuperuser" => "Flags automatically granted to new players,bitfield," . ($session['user']['superuser'] | SU_ANYONE_CAN_SET) . " ," . SU_INFINITE_DAYS . ",Infinite Days," . SU_VIEW_SOURCE . ",View Source Code," . SU_DEVELOPER . ",Developer Super Powers (special inc list; god mode; auto defeat master; etc)," . SU_DEBUG_OUTPUT . ",Debug Output", "newplayerstartgold" => "Amount of gold to start a new character with,int", "maxrestartgold" => "Maximum amount of gold a player will get after a dragonkill,int", "maxrestartgems" => "Maximum number of gems a player will get after a dragonkill,int", "requireemail" => "Require users to enter their email address,bool", "requirevalidemail" => "Require users to validate their email address,bool", "blockdupeemail" => "One account per email address,bool", "spaceinname" => "Allow spaces in user names,bool", "allowoddadminrenames" => "Allow admins to enter 'illegal' names in the user editor,bool", "selfdelete" => "Allow player to delete their character,bool", "Commentary/Chat,title", "soap" => "Clean user posts (filters bad language and splits words over 45 chars long),bool", "maxcolors" => "Max # of color changes usable in one comment,range,5,40,1", "postinglimit" => "Limit posts to let one user post only up to 50% of the last posts (else turn it off),bool", "Place names and People names,title", "villagename" => "Name for the main village", "innname" => "Name of the inn", "barkeep" => "Name of the barkeep", "barmaid" => "Name of the barmaid", "bard" => "Name of the bard", "clanregistrar" => "Name of the clan registrar", "deathoverlord" => "Name of the death overlord", "Referral Settings,title", "refereraward" => "How many points will be awarded for a referral?,int", "referminlevel" => "What level does the referral need to reach to credit the referer?,int", "Random events,title", "forestchance" => "Chance for Something Special in the Forest,range,0,100,1", "villagechance" => "Chance for Something Special in any village,range,0,100,1", "innchance" => "Chance for Something Special in the Inn,range,0,100,1", "gravechance" => "Chance for Something Special in the Graveyard,range,0,100,1", "gardenchance" => "Chance for Something Special in the Gardens,range,0,100,1", "Paypal,title", "paypalemail" => "Email address of Admin's paypal account", "paypalcurrency" => "Currency type", "paypalcountry-code" => "What country's predominant language do you wish to have displayed in your PayPal screen?,enum\n\t\t,US,United States,DE,Germany,AI,Anguilla,AR,Argentina,AU,Australia,AT,Austria,BE,Belgium,BR,Brazil,CA,Canada\n\t\t,CL,Chile,C2,China,CR,Costa Rica,CY,Cyprus,CZ,Czech Republic,DK,Denmark,DO,Dominican Republic\n\t\t,EC,Ecuador,EE,Estonia,FI,Finland,FR,France,GR,Greece,HK,Hong Kong,HU,Hungary,IS,Iceland,IN,India\n\t\t,IE,Ireland,IL,Israel,IT,Italy,JM,Jamaica,JP,Japan,LV,Latvia,LT,Lithuania,LU,Luxembourg,MY,Malaysia\n\t\t,MT,Malta,MX,Mexico,NL,Netherlands,NZ,New Zealand,NO,Norway,PL,Poland,PT,Portugal,SG,Singapore,SK,Slovakia\n\t\t,SI,Slovenia,ZA,South Africa,KR,South Korea,ES,Spain,SE,Sweden,CH,Switzerland,TW,Taiwan,TH,Thailand,TR,Turkey\n\t\t,GB,United Kingdom,UY,Uruguay,VE,Venezuela", "paypaltext" => "What text should be displayed as item name in the donations screen(player name will be added after it)?", "(standard: 'Legend of the Green Dragon Site Donation from',note", "General Combat,title", "autofight" => "Allow fighting multiple rounds automatically,bool", "autofightfull" => "Allow fighting until fight is over,enum,0,Never,1,Always,2,Only when not allowed to flee", "Training,title", "automaster" => "Masters hunt down truant students,bool", "multimaster" => "Can players gain multiple levels (challenge multiple masters) per game day?,bool", "displaymasternews" => "Display news if somebody fought his master?,bool", "Clans,title", "allowclans" => "Enable Clan System?,bool", "goldtostartclan" => "Gold to start a clan,int", "gemstostartclan" => "Gems to start a clan,int", "officermoderate" => "Can clan officers who are also moderators moderate their own clan even if they cannot moderate all clans?,bool", "New Days,title", "daysperday" => "Game days per calendar day,range,1,6,1", "specialtybonus" => "Extra daily uses in specialty area,range,0,5,1", "newdaycron" => "Let the newday-runonce run via a cronjob,bool", "The directory is necessary! Do not forget to set the correct one in cron.php in your main game folder!!! ONLY experienced admins should use cron jobbing here,note", "`bAlso make sure you setup a cronjob on your machine using confixx/plesk/cpanel or any other admin panel pointing to the cron.php file in your main folder`b,note", "If you do not know what a Cronjob is... leave it turned off. If you want to know more... check out: <a href='http://wiki.dragonprime.net/index.php?title=Cronjob'>http://wiki.dragonprime.net/index.php?title=Cronjob</a>,note", "resurrectionturns" => "Modify (+ or -) the number of turns deducted after a resurrection as an absolute (number) or relative (number followed by %),text", "Forest,title", "turns" => "Forest Fights per day,range,5,30,1", "dropmingold" => "Forest Creatures drop at least 1/4 of max gold,bool", "suicide" => "Allow players to Seek Suicidally?,bool", "suicidedk" => "Minimum DKs before players can Seek Suicidally?,int", "forestgemchance" => "Player will find a gem one in X times,range,10,100,1", "disablebonuses" => "Should monsters which get buffed with extra HP/Att/Def get a gold+exp bonus?,bool", "forestexploss" => "What percentage of experience should be lost?,range,10,100,1", "Multiple Enemies,title", "multifightdk" => "Multiple monsters will attack players above which amount of dragonkills?,range,8,50,1", "multichance" => "The chance for an attack from multiple enemies is,range,0,100,1", "addexp" => "Additional experience (%) per enemy during multifights?,range,0,15", "instantexp" => "During multi-fights hand out experience instantly?,bool", "maxattacks" => "How many enemies will attack per round (max. value),range,1,10", "allowpackofmonsters" => "Allow multiple monsters of the same type to appear in a battle?,bool", "Random values for type of seeking is added to random base.,note", "multibasemin" => "The base number of multiple enemies at minimum is,range,1,100,2", "multibasemax" => "The base number of multiple enemies at maximum is,range,1,100,3", "multislummin" => "The number of multiple enemies at minimum for slumming is,range,0,100,0", "multislummax" => "The number of multiple enemies at maximum for slumming is,range,0,100,1", "multithrillmin" => "The number of multiple enemies at minimum for thrill seeking is,range,0,100,1", "multithrillmax" => "The number of multiple enemies at maximum for thrill seeking is,range,0,100,2", "multisuimin" => "The number of multiple enemies at minimum for suicide is,range,0,100,2", "multisuimax" => "The number of multiple enemies at maximum for suicide is,range,0,100,4", "Stables,title", "allowfeed" => "Does Merick have feed onhand for creatures,bool", "Companions/Mercenaries,title", "enablecompanions" => "Enable the usage of companions,bool", "companionsallowed" => "How many companions are allowed per player,int", "Modules my alter this value on a per player basis!,note", "companionslevelup" => "Are companions allowed to level up?,bool", "Bank Settings,title", "fightsforinterest" => "Max forest fights remaining to earn interest?,range,0,10,1", "maxinterest" => "Max Interest Rate (%),range,5,10,1", "mininterest" => "Min Interest Rate (%),range,0,5,1", "maxgoldforinterest" => "Over what amount of gold does the bank cease paying interest? (0 for unlimited),int", "borrowperlevel" => "Max player can borrow per level (val * level for max),range5,200,5", "allowgoldtransfer" => "Allow players to transfer gold,bool", "transferperlevel" => "Max player can receive from a transfer (val * level),range,5,100,5", "mintransferlev" => "Min level a player (0 DK's) needs to transfer gold,range,1,5,1", "transferreceive" => "Total transfers a player can receive in one day,range,0,5,1", "maxtransferout" => "Amount player can transfer to others (val * level),range,5,100,5", "innfee" => "Fee for express inn payment (x or x%),int", "Mail Settings,title", "mailsizelimit" => "Message size limit per message,int", "inboxlimit" => "Limit # of messages in inbox,int", "oldmail" => "Automatically delete old messages after (days),int", "superuseryommessage" => "Warning to give when attempting to YoM an admin?", "onlyunreadmails" => "Only unread mail count towards the inbox limit?,bool", "PvP,title", "pvp" => "Enable Slay Other Players,bool", "pvpday" => "Player Fights per day,range,1,10,1", "pvpimmunity" => "Days that new players are safe from PvP,range,1,5,1", "pvpminexp" => "Experience below which player is safe from PvP,int", "pvpattgain" => "Percent of victim experience attacker gains on win,floatrange,.25,20,.25", "pvpattlose" => "Percent of experience attacker loses on loss,floatrange,.25,20,.25", "pvpdefgain" => "Percent of attacker experience defender gains on win,floatrange,.25,20,.25", "pvpdeflose" => "Percent of experience defender loses on loss,floatrange,.25,20,.25", "Content Expiration,title", "expirecontent" => "Days to keep comments and news?  (0 = infinite),int", "expiretrashacct" => "Days to keep never logged-in accounts? (0 = infinite),int", "expirenewacct" => "Days to keep 1 level (0 dragon) accounts? (0 =infinite),int", "expireoldacct" => "Days to keep all other accounts? (0 = infinite),int", "LOGINTIMEOUT" => "Seconds of inactivity before auto-logoff,int", "High Load Optimization,title", "This has been moved to the dbconnect.php,note", "LoGDnet Setup,title", "(LoGDnet requires your PHP configuration to have file wrappers enabled!!),note", "logdnet" => "Register with LoGDnet?,bool", "serverurl" => "Server URL", "serverdesc" => "Server Description (75 chars max)", "logdnetserver" => "Master LoGDnet Server (default http://logdnet.logd.com/)", "curltimeout" => "How long we wait for responses from logdnet.logd.com (in seconds),range,1,10,1|2", "Game day Setup,title", "dayduration" => "Day Duration,viewonly", "curgametime" => "Current game time,viewonly", "curservertime" => "Current Server Time,viewonly", "lastnewday" => "Last new day,viewonly", "nextnewday" => "Next new day,viewonly", "gameoffsetseconds" => "Real time to offset new day,{$enum}", "Translation Setup,title", "enabletranslation" => "Enable the use of the translation engine,bool", "It is strongly recommended to leave this feature turned on.,note", "cachetranslations" => "Cache the translations (datacache must be turned on)?,bool", "permacollect" => "Permanently collect untranslated texts (overrides the next settings!),bool", "collecttexts" => "Are we currently collecting untranslated texts?,viewonly", "tl_maxallowed" => "Collect untranslated texts if you have fewer player than this logged in. (0 never collects),int", "charset" => "Which charset should be used for htmlentities?", "Error Notification,title", "Note: you MUST have data caching turned on if you want to use this feature.  Also the first error within any 24 hour period will not generate a notice; I'm sorry: that's really just how it is for technical reasons.,note", "show_notices" => "Show PHP Notice output?,bool", "notify_on_warn" => "Send notification on site warnings?,bool", "notify_on_error" => "Send notification on site errors?,bool", "notify_address" => "Address to notify", "notify_every" => "Only notify every how many minutes for each distinct error?,int", "Miscellaneous Settings,title", "allowspecialswitch" => "The Barkeeper may help you to switch your specialty?,bool", "maxlistsize" => "Maximum number of items to be shown in the warrior list,int");
    $secstonewday = secondstonextgameday($details);
    $useful_vals = array("dayduration" => round($details['dayduration'] / 60 / 60, 0) . " hours", "curgametime" => getgametime(), "curservertime" => date("Y-m-d h:i:s a"), "lastnewday" => date("h:i:s a", strtotime("-{$details['realsecssofartoday']} seconds")), "nextnewday" => date("h:i:s a", strtotime("+{$details['realsecstotomorrow']} seconds")) . " (" . date("H\\h i\\m s\\s", $secstonewday) . ")");
    loadsettings();
    $vals = $settings + $useful_vals;
    rawoutput("<form action='configuration.php?op=save' method='POST'>");
    addnav("", "configuration.php?op=save");
    showform($setup, $vals);
    rawoutput("</form>");
}
page_footer();
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:31,代码来源:configuration.php


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