本文整理汇总了PHP中superusernav函数的典型用法代码示例。如果您正苦于以下问题:PHP superusernav函数的具体用法?PHP superusernav怎么用?PHP superusernav使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了superusernav函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: worldmapen_editor_real
function worldmapen_editor_real()
{
global $session;
page_header("World Editor");
require_once "lib/superusernav.php";
superusernav();
// initialize the internal static maps
worldmapen_loadMap();
worldmapen_loadTerrainDefs();
$op = httpget("op");
$act = httpget("act");
$subop = httpget("subop");
debug("op={$op}, act={$act}, subop={$subop}");
switch ($subop) {
case "regen":
worldmapen_editor_regen($op, $subop, $act);
break;
case "manual":
worldmapen_editor_manual($op, $subop, $act);
break;
case "terrain":
worldmapen_editor_terrain($op, $subop, $act);
break;
default:
worldmapen_viewmap(false);
break;
}
addnav("Replace Cities", "runmodule.php?module=worldmapen&op=edit&subop=regen");
addnav("Manually Place Cities", "runmodule.php?module=worldmapen&op=edit&subop=manual");
addnav("Edit terrain type", "runmodule.php?module=worldmapen&op=edit&subop=terrain");
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:editor.php
示例2: clancommentaryoverview_run
function clancommentaryoverview_run()
{
page_header("Clan Commentary Overview");
$numcomments = get_module_setting("numcomments");
require_once "lib/superusernav.php";
superusernav();
addnav("C?Commentary Overview", "moderate.php");
addnav("Clan Halls");
$sql = "SELECT clanid, clanname, clanshort FROM " . db_prefix("clans") . " ORDER BY clanid";
$res = db_query($sql);
// since these are proper names, they shouldn't be translated
tlschema("notranslate");
while ($row = db_fetch_assoc($res)) {
addnav(array("<%s> %s", $row['clanshort'], $row['clanname']), "moderate.php?area=clan-{$row['clanid']}");
}
tlschema();
$sql = "SELECT clanid, clanname FROM " . db_prefix("clans") . " ORDER BY clanid";
$res = db_query($sql);
$firstclan = 1;
while ($clan = db_fetch_assoc($res)) {
$cid = $clan['clanid'];
$csql = "SELECT * FROM " . db_prefix("commentary") . " WHERE section='clan-" . $cid . "' ORDER BY postdate DESC LIMIT " . $numcomments;
$cres = db_query($csql);
if (db_num_rows($cres) > 0) {
if ($firstclan == 1) {
$firstclan = 0;
addnav("", "runmodule.php?module=clancommentaryoverview");
$buttonrefresh = translate_inline("Refresh");
rawoutput("<form action='runmodule.php?module=clancommentaryoverview' method='post'>");
rawoutput("<input type='submit' class='button' value='{$buttonrefresh}'>");
rawoutput("</form>");
}
rawoutput("<hr>");
$cname = $clan['clanname'];
addnav("", "moderate.php?area=clan-" . $cid);
rawoutput("<a href='moderate.php?area=clan-" . $cid . "'>");
output_notl("`b`^%s`b`0", $cname);
rawoutput("</a>");
output_notl("`n");
$carray = array();
while ($ccomment = db_fetch_assoc($cres)) {
array_push($carray, $ccomment);
}
while ($ccomment = array_pop($carray)) {
clancommentaryoverview_displaycomment($ccomment);
}
}
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:50,代码来源:clancommentaryoverview.php
示例3: int
+-----------+---------------------+------+-----+---------+----------------+
| payid | int(11) | | PRI | NULL | auto_increment |
| info | text | | | | |
| response | text | | | | |
| txnid | varchar(32) | | MUL | | |
| amount | float(9,2) | | | 0.00 | |
| name | varchar(50) | | | | |
| acctid | int(11) unsigned | | | 0 | |
| processed | tinyint(4) unsigned | | | 0 | |
| filed | tinyint(4) unsigned | | | 0 | |
| txfee | float(9,2) | | | 0.00 | |
+-----------+---------------------+------+-----+---------+----------------+
*/
page_header("Payment Log");
require_once "lib/superusernav.php";
superusernav();
$op = httpget('op');
if ($op == "") {
$sql = "SELECT info,txnid FROM " . db_prefix("paylog") . " WHERE processdate='0000-00-00'";
$result = db_query($sql);
while ($row = db_fetch_assoc($result)) {
$info = unserialize($row['info']);
$sql = "UPDATE " . db_prefix('paylog') . " SET processdate='" . date("Y-m-d H:i:s", strtotime($info['payment_date'])) . "' WHERE txnid='" . addslashes($row['txnid']) . "'";
db_query($sql);
}
$sql = "SELECT substring(processdate,1,7) AS month, sum(amount)-sum(txfee) AS profit FROM " . db_prefix('paylog') . " GROUP BY month DESC";
$result = db_query($sql);
addnav("Months");
while ($row = db_fetch_assoc($result)) {
addnav(array("%s %s %s", date("M Y", strtotime($row['month'] . "-01")), getsetting("paypalcurrency", "USD"), $row['profit']), "paylog.php?month={$row['month']}");
}
示例4: findcomm_run
function findcomm_run()
{
global $session;
$op = httpget('op');
page_header("Find Commentary");
if ($op != "enter") {
addnav("Find Another Name", "runmodule.php?module=findcomm&op=enter");
}
switch ($op) {
case "enter":
output("Type in the name of the person whose commentary you wish to find.`n`n");
rawoutput("<form action='runmodule.php?module=findcomm&op=list' method='post'>");
rawoutput("Name: <input type='text' name='name'>");
rawoutput("<input type='submit' class='button' value='" . translate_inline("Find") . "'></form>");
addnav("", "runmodule.php?module=findcomm&op=list");
break;
case "list":
$del = httppost('del');
if ($del != "") {
$sql = "SELECT " . db_prefix("commentary") . ".*," . db_prefix("accounts") . ".name," . db_prefix("accounts") . ".login, " . db_prefix("accounts") . ".clanrank," . db_prefix("clans") . ".clanshort FROM " . db_prefix("commentary") . " INNER JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("commentary") . ".author LEFT JOIN " . db_prefix("clans") . " ON " . db_prefix("clans") . ".clanid=" . db_prefix("accounts") . ".clanid WHERE commentid IN ('" . join("','", array_keys($del)) . "')";
$res = db_query($sql);
while ($row = db_fetch_assoc($res)) {
$sql = "INSERT LOW_PRIORITY INTO " . db_prefix("moderatedcomments") . " (moderator,moddate,comment) \r\n\t\t\t\t\t\t\tVALUES ('{$session['user']['acctid']}','" . date("Y-m-d H:i:s") . "','" . addslashes(serialize($row)) . "')";
db_query($sql);
}
$sql = "DELETE FROM " . db_prefix("commentary") . " \r\n\t\t\t\t\t\tWHERE commentid IN ('" . join("','", array_keys($del)) . "')";
db_query($sql);
output("Comments Deleted.`n`n");
}
$id = httpget('id');
if ($id == "") {
$name = httppost('name');
$search = "%";
for ($i = 0; $i < strlen($name); $i++) {
$search .= substr($name, $i, 1) . "%";
}
debug($search);
$sql = "SELECT name,acctid FROM " . db_prefix("accounts") . " \r\n\t\t\t\t\t\tWHERE (name LIKE '{$search}' OR login LIKE '{$search}') \r\n\t\t\t\t\t\tLIMIT 25";
$res = db_query($sql);
$count = db_num_rows($res);
$n = translate_inline("Name");
rawoutput("<table border=0 cellpadding=2 align='center' cellspacing=1 bgcolor='#999999'>", true);
rawoutput("<tr class='trhead'><td>{$n}</td></tr>");
$i = 0;
while ($row = db_fetch_assoc($res)) {
$i++;
$ac = $row['acctid'];
rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'><td>");
rawoutput("<a href='runmodule.php?module=findcomm&op=list&id=" . rawurlencode($ac) . "'>");
output_notl("%s", $row['name']);
rawoutput("</a>");
addnav("", "runmodule.php?module=findcomm&op=list&id=" . rawurlencode($ac));
rawoutput("</td></tr>");
}
rawoutput("</table>");
} else {
$sql = "SELECT DISTINCT section FROM " . db_prefix("commentary") . " \r\n\t\t\t\t\t\tWHERE author='{$id}' \r\n\t\t\t\t\t\tORDER BY section ASC";
$res = db_query($sql);
$section = translate_inline("Section");
$comments = translate_inline("Comments");
rawoutput("<form action='runmodule.php?module=findcomm&op=list&id={$id}' method='post'>");
rawoutput("<table border=0 cellpadding=2 align='center' cellspacing=1 bgcolor='#999999'>", true);
rawoutput("<tr class='trhead'><td>{$section}</td><td>{$comments}</td></tr>");
$i = 0;
while ($row = db_fetch_assoc($res)) {
$i++;
$ac = $row['acctid'];
rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'><td>");
output_notl("`b%s`b`0", $row['section']);
rawoutput("</td><td>");
output_notl("%s", findcomm_findcomment($row['section'], $id), true);
rawoutput("</td></tr>");
}
rawoutput("</table>");
rawoutput("<input type='submit' class='button' value='" . translate_inline("Delete") . "'></form>");
addnav("", "runmodule.php?module=findcomm&op=list&id={$id}");
}
break;
}
require_once "lib/superusernav.php";
superusernav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:83,代码来源:findcomm.php
示例5: claneditor_run
function claneditor_run()
{
global $session;
tlschema("claneditor");
$dt = httpget("dt");
$op = httpget('op');
if ($dt != "") {
$sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanid='{$dt}'";
$result = db_query($sql);
$claninfo = db_fetch_assoc($result);
if (db_num_rows($result) == 0) {
$op = "";
}
}
addcommentary();
$ranks = array(CLAN_APPLICANT => "`!Applicant`0", CLAN_MEMBER => "`#Member`0", CLAN_OFFICER => "`^Officer`0", CLAN_LEADER => "`&Leader`0", CLAN_FOUNDER => "`\$Founder");
$args = modulehook("clanranks", array("ranks" => $ranks, "clanid" => $dt));
$ranks = translate_inline($args['ranks'], "clan");
superusernav();
addnav("Clans");
addnav("List Clans", "runmodule.php?module=claneditor&op=list");
addnav("Create a New Clan", "runmodule.php?module=claneditor&op=new");
if ($op == "" || $op == "list") {
page_header("Clan Listing");
rawoutput("<table border='0' padding='0'><tr><td>");
$sql = "SELECT MAX(" . db_prefix("clans") . ".clanid) AS clanid, MAX(clanname) AS clanname,count(" . db_prefix("accounts") . ".acctid) AS c FROM " . db_prefix("clans") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("clans") . ".clanid=" . db_prefix("accounts") . ".clanid AND clanrank>" . CLAN_APPLICANT . " GROUP BY " . db_prefix("clans") . ".clanid ORDER BY c DESC";
$result = db_query($sql);
if (db_num_rows($result) > 0) {
output("`%Karissa`7 steps in as if by magic, listing the clans for you.`n");
output("`@`bList of Clans:`b`0`n`n");
$v = 0;
$memb_n = translate_inline("(%s members)");
$memb_1 = translate_inline("(%s member)");
rawoutput('<table cellspacing="0" cellpadding="2" align="left">');
output_notl("<tr class='trhead'><td>%s</td><td>%s</td></tr>", translate_inline("`b`&Name of Clan`b"), translate_inline("`&`iNumber of Members`i"), true);
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($row['c'] == 0) {
$sql = "DELETE FROM " . db_prefix("clans") . " WHERE clanid={$row['clanid']}";
db_query($sql);
} else {
rawoutput('<tr class="' . ($v % 2 ? "trlight" : "trdark") . '"><td>', true);
if ($row['c'] == 1) {
$memb = sprintf($memb_1, $row['c']);
} else {
$memb = sprintf($memb_n, $row['c']);
}
output_notl("• <a href='runmodule.php?module=claneditor&op=mview&dt=%s'>%s</a></td><td>%s`n", $row['clanid'], full_sanitize(htmlentities($row['clanname']), ENT_COMPAT, getsetting("charset", "ISO-8859-1")), $memb, true);
rawoutput('</td></tr>');
addnav("", "runmodule.php?module=claneditor&op=mview&dt={$row['clanid']}");
$v++;
}
}
rawoutput("</table>", true);
} else {
output("`7There are no clans in the database.`n`c");
}
rawoutput("</td></tr><tr><td>");
output_notl("<br>[<a href='runmodule.php?module=claneditor&op=new'>%s</a>]", translate_inline("Create a New Clan"), true);
addnav("", "runmodule.php?module=claneditor&op=new");
rawoutput("</td></tr></table>");
page_footer();
} elseif ($op == "new") {
page_header("Clan Creation");
$apply = httpget('apply');
if ($apply == 1) {
$id = httpget("id");
$ocn = httppost('clanname');
$ocs = httppost('clanshort');
$clanname = stripslashes($ocn);
$clanname = full_sanitize($clanname);
$clanname = preg_replace("'[^[:alpha:] \\'-]'", "", $clanname);
$clanname = addslashes($clanname);
httppostset('clanname', $clanname);
$clanshort = full_sanitize($ocs);
$clanshort = preg_replace("'[^[:alpha:]]'", "", $clanshort);
httppostset('clanshort', $clanshort);
$sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanname='{$clanname}'";
$result = db_query($sql);
$e = translate_inline("`%Karissa`7 hands you a form to start a clan.");
$e1 = translate_inline("`%Karissa`7 looks over your form but informs you that your clan name must consist only of letters, spaces, apostrophes, or dashes. Also, your short name can consist only of letters. She hands you a blank form.");
$e2 = translate_inline("`%Karissa`7 looks over your form but informs you that you must have at least 5 and no more than 50 characters in your clan's name (and they must consist only of letters, spaces, apostrophes, or dashes), then hands you a blank form.");
$e3 = translate_inline("`%Karissa`7 looks over your form but informs you that you must have at least 2 and no more than 5 characters in your clan's short name (and they must all be letters), then hands you a blank form.");
$e4 = translate_inline("`%Karissa`7 looks over your form but informs you that the clan name %s is already taken, and hands you a blank form.");
$e5 = translate_inline("`%Karissa`7 looks over your form but informs you that the short name %s is already taken, and hands you a blank form.");
if ($ocs == "" && $ocn == "" && !httppostisset('clanname') && !httppostisset('clanshort')) {
output_notl($e);
clanform();
} elseif ($clanname != $ocn || $clanshort != $ocs) {
output_notl($e1);
clanform();
} elseif (strlen($clanname) < 5 || strlen($clanname) > 50) {
output_notl($e2);
clanform();
} elseif (strlen($clanshort) < 2 || strlen($clanshort) > 5) {
output_notl($e3);
clanform();
} elseif (db_num_rows($result) > 0) {
output_notl($e4, stripslashes($clanname));
clanform();
//.........这里部分代码省略.........
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:claneditor.php
示例6: charrestore_run
function charrestore_run()
{
check_su_access(SU_EDIT_USERS);
require_once "lib/superusernav.php";
page_header("Character Restore");
superusernav();
addnav("Functions");
addnav("Search", "runmodule.php?module=charrestore&op=list");
if (httpget("op") == "list") {
output("Please note that only characters who have reached at least level %s in DK %s will have been saved!`n`n", get_module_setting("lvl_threshold"), get_module_setting("dk_threshold"));
rawoutput("<form action='runmodule.php?module=charrestore&op=list' method='POST'>");
addnav("", "runmodule.php?module=charrestore&op=list");
output("Character Login: ");
rawoutput("<input name='login' value=\"" . htmlentities(stripslashes(httppost("login")), ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\"><br>");
output("After date: ");
rawoutput("<input name='start' value=\"" . htmlentities(stripslashes(httppost("start")), ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\"><br>");
output("Before date: ");
rawoutput("<input name='end' value=\"" . htmlentities(stripslashes(httppost("end")), ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\"><br>");
$submit = translate_inline("Submit");
rawoutput("<input type='submit' value='{$submit}' class='button'>");
rawoutput("</form>");
//do the search.
$login = httppost("login");
$start = httppost("start");
$end = httppost("end");
if ($start > "") {
$start = strtotime($start);
}
if ($end > "") {
$end = strtotime($end);
}
if ($login . $start . $end > "") {
$path = charrestore_getstorepath();
debug($path);
$d = dir($path);
$count = 0;
while (($entry = $d->read()) !== false) {
$e = explode("|", $entry);
if (count($e) < 2) {
continue;
}
$name = str_replace("_", " ", $e[0]);
$date = strtotime($e[1]);
if ($login > "") {
if (strpos(strtolower($name), strtolower($login)) === false) {
continue;
}
}
if ($start > "") {
if ($date < $start) {
continue;
}
}
if ($end > "") {
if ($date > $end) {
continue;
}
}
$count++;
rawoutput("<a href='runmodule.php?module=charrestore&op=beginrestore&file=" . rawurlencode($entry) . "'>{$name}</a> (" . date("M d, Y", $date) . ")<br>");
addnav("", "runmodule.php?module=charrestore&op=beginrestore&file=" . rawurlencode($entry));
}
if ($count == 0) {
output("No characters matching the specified criteria were found.");
}
}
} elseif (httpget("op") == "beginrestore") {
$user = unserialize(join("", file(charrestore_getstorepath() . httpget("file"))));
$sql = "SELECT count(*) AS c FROM " . db_prefix("accounts") . " WHERE login='{$user['account']['login']}'";
$result = db_query($sql);
$row = db_fetch_assoc($result);
rawoutput("<form action='runmodule.php?module=charrestore&op=finishrestore&file=" . rawurlencode(stripslashes(httpget("file"))) . "' method='POST'>");
addnav("", "runmodule.php?module=charrestore&op=finishrestore&file=" . rawurlencode(stripslashes(httpget("file"))));
if ($row['c'] > 0) {
output("`\$The user's login conflicts with an existing login in the system.");
output("You will have to provide a new one, and you should probably think about giving them a new name after the restore.`n");
output("`^New Login: ");
rawoutput("<input name='newlogin'><br>");
}
$yes = translate_inline("Do the restore");
rawoutput("<input type='submit' value='{$yes}' class='button'>");
output("`n`#Some user info:`0`n");
$vars = array("login" => "Login", "name" => "Name", "laston" => "Last On", "email" => "Email", "dragonkills" => "DKs", "level" => "Level", "gentimecount" => "Total hits");
while (list($key, $val) = each($vars)) {
output("`^{$val}: `#%s`n", $user['account'][$key]);
}
rawoutput("<input type='submit' value='{$yes}' class='button'>");
rawoutput("</form>");
} elseif (httpget("op") == "finishrestore") {
$user = unserialize(join("", file(charrestore_getstorepath() . httpget("file"))));
$sql = "SELECT count(*) AS c FROM " . db_prefix("accounts") . " WHERE login='" . (httppost('newlogin') > '' ? httppost('newlogin') : $user['account']['login']) . "'";
$result = db_query($sql);
$row = db_fetch_assoc($result);
if ($row['c'] > 0) {
redirect("runmodule.php?module=charrestore&op=beginrestore&file=" . rawurlencode(stripslashes(httpget("file"))));
} else {
if (httppost("newlogin") > "") {
$user['account']['login'] = httppost('newlogin');
}
$sql = "DESCRIBE " . db_prefix("accounts");
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:charrestore.php
示例7: drinks_editor
function drinks_editor()
{
global $mostrecentmodule;
if (!get_module_pref("canedit")) {
check_su_access(SU_EDIT_USERS);
}
page_header("Drink Editor");
require_once "lib/superusernav.php";
superusernav();
addnav("Drink Editor");
addnav("Add a drink", "runmodule.php?module=drinks&act=editor&op=add&admin=true");
$op = httpget('op');
$drinkid = httpget('drinkid');
$header = "";
if ($op != "") {
addnav("Drink Editor Main", "runmodule.php?module=drinks&act=editor&admin=true");
if ($op == 'add') {
$header = translate_inline("Adding a new drink");
} else {
if ($op == 'edit') {
$header = translate_inline("Editing a drink");
}
}
} else {
$header = translate_inline("Current drinks");
}
output_notl("`&<h3>{$header}`0</h3>", true);
$drinksarray = array("Drink,title", "drinkid" => "Drink ID,hidden", "name" => "Drink Name", "costperlevel" => "Cost per level,int", "hpchance" => "Chance of modifying HP (see below),range,0,10,1", "turnchance" => "Chance of modifying turns (see below),range,0,10,1", "alwayshp" => "Always modify hitpoints,bool", "alwaysturn" => "Always modify turns,bool", "drunkeness" => "Drunkeness,range,1,100,1", "harddrink" => "Is drink hard alchohol?,bool", "hpmin" => "Min HP to add (see below),range,-20,20,1", "hpmax" => "Max HP to add (see below),range,-20,20,1", "hppercent" => "Modify HP by some percent (see below),range,-25,25,5", "turnmin" => "Min turns to add (see below),range,-5,5,1", "turnmax" => "Max turns to add (see below),range,-5,5,1", "remarks" => "Remarks", "buffname" => "Name of the buff", "buffrounds" => "Rounds buff lasts,range,1,20,1", "buffroundmsg" => "Message each round of buff", "buffwearoff" => "Message when buff wears off", "buffatkmod" => "Attack modifier of buff", "buffdefmod" => "Defense modifier of buff", "buffdmgmod" => "Damage modifier of buff", "buffdmgshield" => "Damage shield modifier of buff", "buffeffectfailmsg" => "Effect failure message (see below)", "buffeffectnodmgmsg" => "No damage message (see below)", "buffeffectmsg" => "Effect message (see below)");
if ($op == "del") {
$sql = "DELETE FROM " . db_prefix("drinks") . " WHERE drinkid='{$drinkid}'";
module_delete_objprefs('drinks', $drinkid);
db_query($sql);
$op = "";
httpset('op', "");
}
if ($op == "save") {
$subop = httpget("subop");
if ($subop == "") {
$drinkid = httppost("drinkid");
list($sql, $keys, $vals) = postparse($drinksarray);
if ($drinkid > 0) {
$sql = "UPDATE " . db_prefix("drinks") . " SET {$sql} WHERE drinkid='{$drinkid}'";
} else {
$sql = "INSERT INTO " . db_prefix("drinks") . " ({$keys}) VALUES ({$vals})";
}
db_query($sql);
if (db_affected_rows() > 0) {
output("`^Drink saved!");
} else {
$str = db_error();
if ($str == "") {
output("`^Drink not saved: no changes detected.");
} else {
output("`^Drink not saved: `\$%s`0", $sql);
}
}
} elseif ($subop == "module") {
$drinkid = httpget("drinkid");
// Save module settings
$module = httpget("editmodule");
// This should obey the same rules as the configuration editor
// So disabling
//$sql = "DELETE FROM " . db_prefix("module_objprefs") . " WHERE objtype='drinks' AND objid='$drinkid' AND modulename='$module'";
//db_query($sql);
$post = httpallpost();
reset($post);
while (list($key, $val) = each($post)) {
set_module_objpref("drinks", $drinkid, $key, $val, $module);
}
output("`^Saved.");
}
if ($drinkid) {
$op = "edit";
httpset("drinkid", $drinkid, true);
} else {
$op = "";
}
httpset('op', $op);
}
if ($op == "activate") {
$sql = "UPDATE " . db_prefix("drinks") . " SET active=1 WHERE drinkid='{$drinkid}'";
db_query($sql);
$op = "";
httpset('op', "");
}
if ($op == "deactivate") {
$sql = "UPDATE " . db_prefix("drinks") . " SET active=0 WHERE drinkid='{$drinkid}'";
db_query($sql);
$op = "";
httpset('op', "");
}
if ($op == "") {
$op = translate_inline("Ops");
$id = translate_inline("Id");
$nm = translate_inline("Name");
$dkn = translate_inline("Drunkeness");
$hard = translate_inline("Hard Alchohol?");
$edit = translate_inline("Edit");
$deac = translate_inline("Deactivate");
$act = translate_inline("Activate");
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:misc_functions.php
示例8: alt_char_list_run
//.........这里部分代码省略.........
while ($row = db_fetch_assoc($result)) {
$i++;
rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td>");
output_notl("`&%s (%s)`0", $row['name'], $row['login']);
rawoutput("</td><td style='text-align:center;'>");
$sql_ip = "SELECT name, login FROM {$ac} WHERE lastip = '{$row['lastip']}' AND acctid != {$row['acctid']}";
$res_ip = db_query($sql_ip);
if (db_num_rows($res_ip) > 0) {
while ($row_ip = db_fetch_assoc($res_ip)) {
output_notl("`b%s`b (%s)`n", $row_ip['name'], $row_ip['login']);
}
} else {
output_notl("%s", $nmf);
}
rawoutput("</td><td style='text-align:center;'>");
$sql_id = "SELECT name, login FROM {$ac} WHERE uniqueid = '{$row['uniqueid']}' AND acctid != {$row['acctid']}";
$res_id = db_query($sql_id);
if (db_num_rows($res_id) > 0) {
while ($row_id = db_fetch_assoc($res_id)) {
output_notl("`b%s`b (%s)`n", $row_id['name'], $row_id['login']);
}
} else {
output_notl("%s", $nmf);
}
rawoutput("</td><td style='text-align:center;'>");
$sql_email = "SELECT name, login FROM {$ac} WHERE emailaddress = '{$row['emailaddress']}' AND acctid != {$row['acctid']}";
$res_email = db_query($sql_email);
if (db_num_rows($res_email) > 0) {
while ($row_email = db_fetch_assoc($res_email)) {
output_notl("`b%s`b (%s)`n", $row_email['name'], $row_email['login']);
}
} else {
output_notl("%s", $nmf);
}
rawoutput("</td></tr>");
}
}
rawoutput("</table>");
if ($total > $pp) {
addnav("Pages");
for ($p = 0; $p < $total; $p += $pp) {
addnav(array("Page %s (%s-%s)", $p / $pp + 1, $p + 1, min($p + $pp, $total)), "runmodule.php?module=alt_char_list&page=" . ($p / $pp + 1));
}
}
break;
case "search":
addnav("Main Page", "runmodule.php?module=alt_char_list");
if (httppost('submit')) {
$name = httppost('char_name');
$search = "%";
for ($i = 0; $i < strlen($name); $i++) {
$search .= substr($name, $i, 1) . "%";
}
debug($search);
$sql = "SELECT name, acctid, lastip, uniqueid, emailaddress FROM {$ac} WHERE (name LIKE '{$search}' OR login LIKE '{$search}')";
$res = db_query($sql);
$count = db_num_rows($res);
$n = translate_inline("Name");
$ip = translate_inline("IP");
$id = translate_inline("ID");
$email = translate_inline("Email");
rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center' bgcolor='#999999'>");
rawoutput("<tr class='trhead'><td>{$n}</td><td>{$ip}</td><td>{$id}</td><td>{$email}</td></tr>");
$i = 0;
while ($row = db_fetch_assoc($res)) {
$i++;
$id = $row['acctid'];
rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'><td>");
rawoutput("<a href='runmodule.php?module=alt_char_list&id=" . rawurlencode($id) . "'>");
output_notl("%s", $row['name']);
rawoutput("</a>");
addnav("", "runmodule.php?module=alt_char_list&id=" . rawurlencode($id));
rawoutput("</td><td>");
output_notl("%s", $row['lastip']);
rawoutput("</td><td>");
output_notl("%s", $row['uniqueid']);
rawoutput("</td><td>");
output_notl("%s", $row['emailaddress']);
rawoutput("</td></tr>");
}
rawoutput("</table>");
} else {
$char_name = translate_inline("Character Name");
rawoutput("<form action='runmodule.php?module=alt_char_list&op=search' method='post'>");
rawoutput("{$char_name}: <input type='text' name='char_name'/><br/>");
rawoutput("<input class='button' type='submit' name='submit' value='" . translate_inline("Submit") . "'/></form>");
}
addnav("", "runmodule.php?module=alt_char_list&op=search");
break;
}
addnav("Other Actions");
addnav("Search", "runmodule.php?module=alt_char_list&op=search");
$ret = urlencode(httpget("ret"));
if ($ret != "") {
addnav("Return to viewing character", "bio.php?char={$char}&ret={$ret}");
}
require_once "lib/superusernav.php";
superusernav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:alt_char_list.php
示例9: dag_manage
function dag_manage()
{
page_header("Dag's Bounty Lists");
require_once "lib/superusernav.php";
superusernav();
// Add some bounty expiration for closed bounties
$sql = "DELETE FROM " . db_prefix("bounty") . " WHERE status=1 AND windate <'" . date("Y-m-d H:i:s", strtotime("-" . getsetting("expirecontent", 180) / 10 . " days")) . "'";
db_query($sql);
addnav("Actions");
addnav("A?View All Bounties", "runmodule.php?module=dag&manage=true&op=viewbounties&type=1&sort=1&dir=1&admin=true");
addnav("O?View Open Bounties", "runmodule.php?module=dag&manage=true&op=viewbounties&type=2&sort=1&dir=1&admin=true");
addnav("C?View Closed Bounties", "runmodule.php?module=dag&manage=true&op=viewbounties&type=3&sort=1&dir=1&admin=true");
addnav("R?Refresh List", "runmodule.php?module=dag&manage=true&admin=true");
rawoutput("<form action='runmodule.php?module=dag&manage=true&op=viewbounties&type=search&admin=true' method='POST'>");
addnav("", "runmodule.php?module=dag&manage=true&op=viewbounties&type=search&admin=true");
output("Setter: ");
rawoutput("<input name='setter' value=\"" . htmlentities(stripslashes(httppost('setter'))) . "\">");
output(" Winner: ");
rawoutput("<input name='getter' value=\"" . htmlentities(stripslashes(httppost('getter'))) . "\">");
output(" Target: ");
rawoutput("<input name='target' value=\"" . htmlentities(stripslashes(httppost('target'))) . "\">");
output_notl("`n");
output("Order by: ");
$id = translate_inline("ID");
$amt = translate_inline("Amount");
$targ = translate_inline("Target");
$set = translate_inline("Setter");
$sdate = translate_inline("Set Date");
$stat = translate_inline("Status");
$win = translate_inline("Winner");
$wdate = translate_inline("Win Date");
$desc = translate_inline("Descending");
$asc = translate_inline("Ascending");
$search = translate_inline("Search");
rawoutput("<select name='s'>\r\n\t\t<option value='1'" . (httppost('s') == '1' ? " selected" : "") . ">{$id}</option>\r\n\t\t<option value='2'" . (httppost('s') == '2' ? " selected" : "") . ">{$amt}</option>\r\n\t\t<option value='3'" . (httppost('s') == '3' ? " selected" : "") . ">{$targ}</option>\r\n\t\t<option value='4'" . (httppost('s') == '4' ? " selected" : "") . ">{$set}</option>\r\n\t\t<option value='5'" . (httppost('s') == '5' ? " selected" : "") . ">{$sdate}</option>\r\n\t\t<option value='6'" . (httppost('s') == '6' ? " selected" : "") . ">{$stat}</option>\r\n\t\t<option value='7'" . (httppost('s') == '7' ? " selected" : "") . ">{$win}</option>\r\n\t\t<option value='8'" . (httppost('s') == '8' ? " selected" : "") . ">{$wdate}</option>\r\n\t\t</select>");
rawoutput("<input type='radio' name='d' value='1'" . (httppost('d') == 1 ? " checked" : "") . "> {$desc}");
rawoutput("<input type='radio' name='d' value='2'" . (httppost('d') == 1 ? "" : " checked") . "> {$asc}");
output_notl("`n");
rawoutput("<input type='submit' class='button' value='{$search}'>");
rawoutput("</form>");
$op = httpget('op');
if ($op == "") {
// ***ADDED***
// By Andrew Senger
// Adding for new Bounty Code
output_notl("`n`n");
output("`c`bThe Bounty List`b`c`n");
$sql = "SELECT bountyid,amount,target,setter,setdate FROM " . db_prefix("bounty") . " WHERE status=0 ORDER BY bountyid ASC";
$result = db_query($sql);
rawoutput("<table border=0 cellpadding=2 cellspacing=1 bgcolor='#999999'>");
$amt = translate_inline("Amount");
$lev = translate_inline("Level");
$name = translate_inline("Name");
$loc = translate_inline("Location");
$sex = translate_inline("Sex");
$alive = translate_inline("Alive");
$last = translate_inline("Last On");
rawoutput("<tr class='trhead'><td><b>{$amt}</b></td><td><b>{$lev}</b></td><td><b>{$name}</b></td><td><b>{$loc}</b></td><td><b>{$sex}</b></td><td><b>{$alive}</b></td><td><b>{$last}</b></td>");
$listing = array();
$totlist = 0;
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
$amount = (int) $row['amount'];
$sql = "SELECT name,alive,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE acctid={$row['target']}";
$result2 = db_query($sql);
if (db_num_rows($result2) == 0) {
/* this person has been deleted, clear bounties */
$sql = "UPDATE " . db_prefix("bounty") . " SET status=1 WHERE target={$row['target']}";
db_query($sql);
continue;
}
$row2 = db_fetch_assoc($result2);
$yesno = 0;
for ($j = 0; $j <= $i; $j++) {
if ($listing[$j]['Name'] == $row2['name']) {
$listing[$j]['Amount'] = $listing[$j]['Amount'] + $amount;
$yesno = 1;
}
}
if ($yesno == 0) {
$listing[] = array('Amount' => $amount, 'Level' => $row2['level'], 'Name' => $row2['name'], 'Location' => $row2['location'], 'Sex' => $row2['sex'], 'Alive' => $row2['alive'], 'LastOn' => $row2['laston']);
$totlist = $totlist + 1;
}
}
usort($listing, 'dag_sortbounties');
for ($i = 0; $i < $totlist; $i++) {
rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td>");
output_notl("`^%s`0", $listing[$i]['Amount']);
rawoutput("</td><td>");
output_notl("`^%s`0", $listing[$i]['Level']);
rawoutput("</td><td>");
output_notl("`^%s`0", $listing[$i]['Name']);
rawoutput("</td><td>");
output($loggedin ? "`#Online`0" : $listing[$i]['Location']);
rawoutput("</td><td>");
output($listing[$i]['Sex'] ? "`!Female`0" : "`!Male`0");
rawoutput("</td><td>");
output($listing[$i]['Alive'] ? "`1Yes`0" : "`4No`0");
rawoutput("</td><td>");
$laston = relativedate($listing[$i]['LastOn']);
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:misc_functions.php
示例10: riddles_editor
function riddles_editor()
{
global $session;
require_once "lib/nltoappon.php";
if (!get_module_pref("canedit")) {
check_su_access(SU_EDIT_RIDDLES);
}
$op = httpget('op');
$id = httpget('id');
page_header("Riddle Editor");
require_once "lib/superusernav.php";
superusernav();
addnav("Riddle Editor");
addnav("Riddle Editor Home", "runmodule.php?module=riddles&act=editor&admin=true");
addnav("Add a riddle", "runmodule.php?module=riddles&act=editor&op=edit&admin=true");
if ($op == "save") {
$id = httppost('id');
$riddle = trim(httppost('riddle'));
$answer = trim(httppost('answer'));
if ($id > "") {
$sql = "UPDATE " . db_prefix("riddles") . " SET riddle='" . nltoappon($riddle) . "', answer='{$answer}' WHERE id='{$id}'";
} else {
$sql = "INSERT INTO " . db_prefix("riddles") . " (riddle,answer,author) VALUES('" . nltoappon($riddle) . "','{$answer}','{$session['user']['login']}')";
}
db_query($sql);
if (db_affected_rows() > 0) {
$op = "";
httpset("op", "");
output("Riddle saved.");
} else {
output("The query was not executed for some reason I can't fathom.");
output("Perhaps you didn't actually make any changes to the riddle.");
}
} elseif ($op == "del") {
$sql = "DELETE FROM " . db_prefix("riddles") . " WHERE id='{$id}'";
db_query($sql);
$op = "";
httpset("op", "");
output("Riddle deleted.");
}
if ($op == "") {
$sql = "SELECT * FROM " . db_prefix("riddles");
$result = db_query($sql);
$i = translate_inline("Id");
$ops = translate_inline("Ops");
$rid = translate_inline("Riddle");
$ans = translate_inline("Answer");
$auth = translate_inline("Author");
rawoutput("<table border=0 cellpadding=2 cellspacing=1 bgcolor='#999999'><tr class='trhead'><td>{$i}</td><td>{$ops}</td><td>{$rid}</td><td>{$ans}</td><td>{$auth}</td></tr>");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'>");
rawoutput("<td valign='top'>");
output_notl("%s", $row['id']);
rawoutput("</td><td valign='top'>");
$conf = translate_inline("Are you sure you wish to delete this riddle?");
$edit = translate_inline("Edit");
$del = translate_inline("Delete");
$elink = "runmodule.php?module=riddles&act=editor&op=edit&id=" . $row['id'] . "&admin=true";
$dlink = "runmodule.php?module=riddles&act=editor&op=del&id=" . $row['id'] . "&admin=true";
output_notl("[");
rawoutput("<a href='{$elink}'>{$edit}</a>");
output_notl("|");
rawoutput("<a href='{$dlink}' onClick='return confirm(\"{$conf}\");'>{$del}</a>");
output_notl("]");
addnav("", $elink);
addnav("", $dlink);
rawoutput("</td><td valign='top'>");
output_notl("`&%s`0", $row['riddle']);
rawoutput("</td><td valign='top'>");
output_notl("`#%s`0", $row['answer']);
rawoutput("</td><td valign='top'>");
output_notl("`^%s`0", $row['author']);
rawoutput("</td></tr>");
}
rawoutput("</table>");
} elseif ($op == "edit") {
$sql = "SELECT * FROM " . db_prefix("riddles") . " WHERE id='{$id}'";
$result = db_query($sql);
rawoutput("<form action='runmodule.php?module=riddles&act=editor&op=save&admin=true' method='POST'>", true);
addnav("", "runmodule.php?module=riddles&act=editor&op=save&admin=true");
if ($row = db_fetch_assoc($result)) {
output("`bEdit a riddle`b`n");
$title = "Edit a riddle";
$i = $row['id'];
rawoutput("<input type='hidden' name='id' value='{$i}'>");
} else {
output("`bAdd a riddle`b`n");
$title = "Add a riddle";
$row = array("riddle" => "", "answer" => "", "author" => $session['user']['login']);
}
$form = array("Riddle,title", "riddle" => "Riddle text,textarea", "answer" => "Answer", "author" => "Author,viewonly");
require_once "lib/showform.php";
showform($form, $row);
rawoutput("</form>");
output("`^NOTE:`& Separate multiple correct answers with semicolons (;)`n`n");
output("`7The following are ignored at the start of answers: `&a, an, and, the, my, your, someones, someone's, someone, his, hers`n");
output("`7The following are ignored at the end of answers: `&s, ing, ed`0`n`n");
output("`\$NOTE: Riddles are displayed in the language they are stored in the database.");
output("Similarly, answers are expected in the language stored in the database.");
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:riddles.php
示例11: translationwizard_run
function translationwizard_run()
{
global $session, $logd_version, $coding;
check_su_access(SU_IS_TRANSLATOR);
//check again Superuser Access
$op = httpget('op');
page_header("Translation Wizard");
//get some standards
$languageschema = get_module_pref("language", "translationwizard");
//these lines grabbed the local scheme, in 1.1.0 there is a setting for it
$coding = getsetting("charset", "ISO-8859-1");
$viewsimple = get_module_pref("view", "translationwizard");
$mode = httpget('mode');
$namespace = httppost('ns');
$from = httpget('from');
$page = get_module_setting(page);
if (httpget('ns') != "" && $namespace == "") {
$namespace = httpget('ns');
}
//if there is no post then there is maybe something to get
$trans = httppost("transtext");
if (is_array($trans)) {
$transintext = $trans;
} else {
if ($trans) {
$transintext = array($trans);
} else {
$transintext = array();
}
}
$trans = httppost("transtextout");
if (is_array($trans)) {
$transouttext = $trans;
} else {
if ($trans) {
$transouttext = array($trans);
} else {
$transouttext = array();
}
}
//end of the header
if ($op == "") {
$op = "default";
}
require "./modules/translationwizard/errorhandler.php";
require "./modules/translationwizard/{$op}.php";
require_once "lib/superusernav.php";
superusernav();
require "./modules/translationwizard/build_nav.php";
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:51,代码来源:translationwizard.php