本文整理汇总了PHP中HTMLEntities函数的典型用法代码示例。如果您正苦于以下问题:PHP HTMLEntities函数的具体用法?PHP HTMLEntities怎么用?PHP HTMLEntities使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLEntities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MB_Convert_Encoding
function MB_Convert_Encoding($str, $to_encoding, $from_encoding = Null)
{
if ($from_encoding == 'UTF-8' && $to_encoding == 'HTML-ENTITIES') {
return HTMLSpecialChars_Decode(UTF8_Decode(HTMLEntities($str, ENT_QUOTES, 'utf-8', False)));
} else {
return @IConv($from_encoding, $to_encoding, $str);
}
}
示例2: namecolor_form
function namecolor_form()
{
$regname = get_player_basename();
output("Your name currently is this:");
rawoutput($regname);
output(", which looks like %s`7`n`n", $regname);
output("How would you like your name to look?`n");
rawoutput("<form action='runmodule.php?module=namecolor&op=namepreview' method='POST'><input name='newname' value=\"" . HTMLEntities($regname, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\"> <input type='submit' class='button' value='Preview'></form>");
addnav("", "runmodule.php?module=namecolor&op=namepreview");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:10,代码来源:namecolor.php
示例3: db_query
function db_query($sql, $die = true)
{
//debug("SQL Query: ".$sql);
if (defined("DB_NODB") && !defined("LINK")) {
return array();
}
global $session, $dbinfo, $allqueries, $allqueriesbyfile;
$dbinfo['queriesthishit']++;
$fname = DBTYPE . "_query";
$starttime = getmicrotime();
$thisquery = array();
$thisquery['query'] = $sql;
$r = $fname($sql, LINK);
if (!$r && $die === true) {
if (defined("IS_INSTALLER")) {
return array();
} else {
if ($session['user']['superuser'] & SU_DEVELOPER || 1) {
require_once "lib/show_backtrace.php";
die("<pre>" . HTMLEntities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "</pre>" . db_error(LINK) . show_backtrace());
} else {
die("A most bogus error has occurred. I apologise, but the page you were trying to access is broken. Please use your browser's back button and try again.");
}
}
}
$endtime = getmicrotime();
if ($endtime - $starttime >= 1.0 && $session['user']['superuser'] & SU_DEBUG_OUTPUT) {
$s = trim($sql);
if (strlen($s) > 800) {
$s = substr($s, 0, 400) . " ... " . substr($s, strlen($s) - 400);
}
debug("Slow Query (" . round($endtime - $starttime, 2) . "s): " . HTMLEntities($s, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "`n");
}
$thisquery['time'] = round($endtime - $starttime, 5);
$trace = debug_backtrace();
$thisquery['file1'] = $trace[0]['file'];
$thisquery['line1'] = $trace[0]['line'];
$thisquery['file2'] = $trace[1]['file'];
$thisquery['line2'] = $trace[1]['line'];
$allqueries[] = $thisquery;
$allqueriesbyfile[$thisquery['file1']]['time'] += $thisquery['time'];
$allqueriesbyfile[$thisquery['file1']]['hits'] += 1;
unset($dbinfo['affected_rows']);
$dbinfo['affected_rows'] = db_affected_rows();
$dbinfo['querytime'] += $endtime - $starttime;
return $r;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:47,代码来源:dbwrapper_mysql.php
示例4: db_query
/**
* Execute a SQLite query.
* @return void
*/
function db_query(string $sql = '', bool $die = true)
{
global $session, $dbinfo, $sqlite_resource;
if (defined("DB_NODB") && !defined("LINK") && !is_object($sqlite_resource)) {
return [];
}
$dbinfo['queriesthishit']++;
$starttime = getmicrotime();
//var_dump($sql);
if (IS_INSTALLER) {
$r = @$sqlite_resource->query($sql);
} else {
$r = $sqlite_resource->query($sql);
}
if (!$r && $die === true) {
if (defined("IS_INSTALLER")) {
return [];
} else {
if ($session['user']['superuser'] & SU_DEVELOPER || 1) {
require_once "lib/show_backtrace.php";
die("<pre>" . HTMLEntities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "</pre>" . db_error(LINK) . show_backtrace());
} else {
die("Please use your browser's back button and try again.");
}
}
}
$endtime = getmicrotime();
if ($endtime - $starttime >= 1.0 && $session['user']['superuser'] & SU_DEBUG_OUTPUT) {
$s = trim($sql);
if (strlen($s) > 800) {
$s = substr($s, 0, 400) . " ... " . substr($s, strlen($s) - 400);
}
debug("Slow Query (" . round($endtime - $starttime, 2) . "s): " . HTMLEntities($s, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "`n");
}
unset($dbinfo['affected_rows']);
$dbinfo['affected_rows'] = db_affected_rows();
$dbinfo['querytime'] += $endtime - $starttime;
return $r;
}
示例5: redirect
function redirect($location, $reason = false)
{
global $session, $REQUEST_URI;
// This function is deliberately not localized. It is meant as error
// handling.
if (strpos($location, "badnav.php") === false) {
//deliberately html in translations so admins can personalize this, also in once scheme
$session['allowednavs'] = array();
addnav("", $location);
$session['output'] = "<a href=\"" . HTMLEntities($location, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">" . translate_inline("Click here.", "badnav") . "</a>";
$session['output'] .= translate_inline("<br><br>If you cannot leave this page, notify the staff via <a href='petition.php'>petition</a> and tell them where this happened and what you did. Thanks.", "badnav");
}
restore_buff_fields();
$session['debug'] .= "Redirected to {$location} from {$REQUEST_URI}. {$reason}<br>";
saveuser();
@header("Location: {$location}");
//echo "<html><head><meta http-equiv='refresh' content='0;url=$location'></head></html>";
//echo "<a href='$location'>$location</a><br><br>";
//echo $location;
//echo $session['debug'];
exit;
}
示例6: redirect
function redirect($location, $reason = false)
{
global $session, $REQUEST_URI;
// This function is deliberately not localized. It is meant as error
// handling.
if (strpos($location, "badnav.php") === false) {
//deliberately html in translations so admins can personalize this, also in once scheme
$session['allowednavs'] = array();
addnav("", $location);
addnav("", HTMLEntities($location, ENT_COMPAT, getsetting("charset", "ISO-8859-1")));
$session['output'] = "<a href=\"" . HTMLEntities($location, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">" . translate_inline("Click here.", "badnav") . "</a>";
$session['output'] .= translate_inline("<br><br><b>You've got a BadNav!</b> <a href=\"http://enquirer.improbableisland.com/dokuwiki/doku.php?id=badnav\">Click here to find out what that is.</a> If you see this message consistently, please add your tuppence'orth to <a href='http://enquirer.improbableisland.com/forum/viewtopic.php?showtopic=19239'>this forum thread</a>.<br /><br />If you cannot leave this page by clicking the first link above, notify the staff via <a href='petition.php'>petition</a> and tell them what you were doing just before this happened. Also copy and paste everything that appears below this message. Thanks!<br><br>BADNAV REPORT<br>Attempted redirect: \"" . $location . "\"<br>Sanitized attempted redirect: \"" . HTMLEntities($location, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\"<br>Redirect reason: \"" . $reason . "\"", "badnav");
}
restore_buff_fields();
$session['debug'] .= "Redirected to {$location} from {$REQUEST_URI}. {$reason}<br>";
saveuser();
@header("Location: {$location}");
//echo "<html><head><meta http-equiv='refresh' content='0;url=$location'></head></html>";
//echo "<a href='$location'>$location</a><br><br>";
//echo $location;
//echo $session['debug'];
exit;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:23,代码来源:redirect.php
示例7: addnav
if ($row['acctid'] > 0) {
addnav("Edit User Record", "user.php?op=edit&userid={$row['acctid']}&returnpetition={$_GET['id']}");
}
output("`@From: ");
$row[body] = stripslashes($row[body]);
if ($row['login'] > "") {
output("<a href=\"mail.php?op=write&to=" . rawurlencode($row[login]) . "&body=" . URLEncode("\n\n----- Your Petition -----\n" . $row[body]) . "&subject=RE:+Petition\" target=\"_blank\" onClick=\"" . popup("mail.php?op=write&to=" . rawurlencode($row[login]) . "&body=" . URLEncode("\n\n----- Your Petition -----\n" . $row[body]) . "&subject=RE:+Petition") . ";return false;\"><img src='images/newscroll.png' width='16' height='16' alt='Write Mail' border='0'></a>", true);
}
output("`^`b{$row['name']}`b`n");
output("`@Date: `^`b{$row['date']}`b`n");
output("`@Body:`^`n");
$body = HTMLEntities($row[body]);
$body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i", "<a href='mailto:\\1?subject=RE: Petition&body=" . str_replace("+", " ", URLEncode("\n\n----- Your Petition -----\n" . $row[body])) . "'>\\1</a>", $body);
$body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i", "<span class='colLtRed'>\\1</span>", $body);
$output .= "<span style='font-family: fixed-width'>" . nl2br($body) . "</span>";
output("`n`@Commentary:`n");
viewcommentary("pet-{$_GET['id']}", "Add", 200);
if ($_GET['viewpageinfo']) {
output("`n`n`@Page Info:`&`n");
$row[pageinfo] = stripslashes($row[pageinfo]);
$body = HTMLEntities($row[pageinfo]);
$body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i", "<a href='mailto:\\1?subject=RE: Petition&body=" . str_replace("+", " ", URLEncode("\n\n----- Your Petition -----\n" . $row[body])) . "'>\\1</a>", $body);
$body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i", "<span class='colLtRed'>\\1</span>", $body);
$output .= "<span style='font-family: fixed-width'>" . nl2br($body) . "</span>";
}
if ($row[status] == 0) {
$sql = "UPDATE petitions SET status=1 WHERE petitionid='{$_GET['id']}'";
$result = db_query($sql);
}
}
page_footer();
示例8: HandleNews
function HandleNews($Data, $Code)
{
if ($Code !== 200) {
return;
}
global $PSA, $m;
$Data = JSON_Decode($Data, true);
if ($Data === false || empty($Data)) {
$m->set('mc_status_mojang', '', 300);
return;
}
$PSA = '';
foreach ($Data as $Message) {
if ($Message['game'] !== 'Minecraft') {
continue;
}
if (!empty($PSA)) {
$PSA .= '<hr class="dotted">';
}
$PSA .= '<h3 style="margin-top:0">' . HTMLEntities($Message['headline']) . ' <span class="muted" style="font-weight:400">(from <a href="http://help.mojang.com/">help.mojang.com</a>)</span></h3>' . $Message['message'];
}
$m->set('mc_status_mojang', $PSA, 300);
}
示例9: addnav
addnav("", "taunt.php?op=save&tauntid={$_GET['tauntid']}");
if ($_GET['tauntid'] != "") {
$sql = "SELECT * FROM taunts WHERE tauntid=\"{$_GET['tauntid']}\"";
$result = db_query($sql) or die(db_error(LINK));
$row = db_fetch_assoc($result);
$taunt = $row['taunt'];
$taunt = str_replace("%s", "him", $taunt);
$taunt = str_replace("%o", "he", $taunt);
$taunt = str_replace("%p", "his", $taunt);
$taunt = str_replace("%x", "Pointy Twig", $taunt);
$taunt = str_replace("%X", "Sharp Teeth", $taunt);
$taunt = str_replace("%W", "Large Green Rat", $taunt);
$taunt = str_replace("%w", "JoeBloe", $taunt);
output("Preview: {$taunt}`0`n`n");
}
$output .= "Taunt: <input name='taunt' value=\"" . HTMLEntities($row['taunt']) . "\" size='70'><br>";
output("The following codes are supported (case matters):`n");
output("%w = Fight loser name`n");
output("%x = Fight loser weapon`n");
output("%s = Fight loser Subjective (him her)`n");
output("%p = Fight loser possessive (his her)`n");
output("%o = Fight loser objective (he she)`n");
output("%W = Fight winner name`n");
output("%X = Fight winner weapon`n");
output("<input type='submit' class='button' value='Save'>", true);
output("</form>", true);
} else {
if ($_GET['op'] == "del") {
$sql = "DELETE FROM taunts WHERE tauntid=\"{$_GET['tauntid']}\"";
db_query($sql) or die(db_error(LINK));
redirect("taunt.php?c=x");
示例10: db_fetch_assoc
output("<input type='hidden' name='to' value='".HTMLEntities($row['login'])."'><input type='hidden' name='amount' value='$amt'><input type='submit' class='button' value='Complete Transfer'></form>",true);
addnav("","bank.php?op=transfer3");
}elseif(db_num_rows($result)>100){
output("The banker looks at you disgustedly and suggests you try narrowing down the field of who you want to send money to just a little bit!`n`n");
output("<form action='bank.php?op=transfer2' method='POST'>Transfer <u>h</u>ow much: <input name='amount' id='amount' accesskey='h' width='5' value='$amt'>`n",true);
output("T<u>o</u>: <input name='to' accesskey='o' value='". $_POST['to'] . "'> (partial names are ok, you will be asked to confirm the transaction before it occurs).`n",true);
output("<input type='submit' class='button' value='Preview Transfer'></form>",true);
output("<script language='javascript'>document.getElementById('amount').focus();</script>",true);
addnav("","bank.php?op=transfer2");
}elseif(db_num_rows($result)>1){
output("<form action='bank.php?op=transfer3' method='POST'>",true);
output("`6Transfer `^$amt`6 to <select name='to' class='input'>",true);
for ($i=0;$i<db_num_rows($result);$i++){
$row = db_fetch_assoc($result);
//output($row[name]." ".$row[login]."`n");
output("<option value=\"".HTMLEntities($row['login'])."\">".preg_replace("'[`].'","",$row['name'])."</option>",true);
}
output("</select><input type='hidden' name='amount' value='$amt'><input type='submit' class='button' value='Complete Transfer'></form>",true);
addnav("","bank.php?op=transfer3");
}else{
output("`6No one matching that name could be found! Please try again.");
}
}else if($_GET['op']=="transfer3"){
$amt = abs((int)$_POST['amount']);
output("`6`bTransfer Completion`b`n");
if ($session[user][gold]+$session[user][goldinbank]<$amt){
output("`6How can you transfer `^$amt`6 gold when you only possess ".($session[user][gold]+$session[user][goldinbank])."`6?");
}else{
$sql = "SELECT name,acctid,level,transferredtoday FROM accounts WHERE login='{$_POST['to']}'";
$result = db_query($sql);
if (db_num_rows($result)==1){
示例11: db_prefix
$sql = "SELECT name,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE acctid=\"{$userid}\"";
$result = db_query($sql);
$row = db_fetch_assoc($result);
if ($row['name'] != "") {
output("Setting up ban information based on `\$%s`0", $row['name']);
}
rawoutput("<form action='user.php?op=saveban' method='POST'>");
output("Set up a new ban by IP or by ID (recommended IP, though if you have several different users behind a NAT, you can try ID which is easily defeated)`n");
rawoutput("<input type='radio' value='ip' id='ipradio' name='type' checked>");
output("IP: ");
rawoutput("<input name='ip' id='ip' value=\"" . HTMLEntities($row['lastip'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">");
output_notl("`n");
rawoutput("<input type='radio' value='id' name='type'>");
output("ID: ");
rawoutput("<input name='id' value=\"" . HTMLEntities($row['uniqueid'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">");
output("`nDuration: ");
rawoutput("<input name='duration' id='duration' size='3' value='14'>");
output("Days (0 for permanent)`n");
$reason = httpget("reason");
if ($reason == "") {
$reason = translate_inline("Don't mess with me.");
}
output("Reason for the ban: ");
rawoutput("<input name='reason' size=50 value=\"{$reason}\">");
output_notl("`n");
$pban = translate_inline("Post ban");
$conf = translate_inline("Are you sure you wish to issue a permanent ban?");
rawoutput("<input type='submit' class='button' value='{$pban}' onClick='if (document.getElementById(\"duration\").value==0) {return confirm(\"{$conf}\");} else {return true;}'>");
rawoutput("</form>");
output("For an IP ban, enter the beginning part of the IP you wish to ban if you wish to ban a range, or simply a full IP to ban a single IP`n`n");
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:user_setupban.php
示例12: db_query
$sql = "SELECT count,last,uri FROM referers WHERE site='".addslashes($row['site'])."' ORDER BY {$order}";
$result1 = db_query($sql);
$skippedcount=0;
$skippedtotal=0;
for ($k=0;$k<db_num_rows($result1);$k++){
$row1=db_fetch_assoc($result1);
$diffsecs = strtotime("now")-strtotime($row1['last']);
if ($diffsecs<=604800){
output("<tr class='trlight'><td>",true);
output($row1['count']);
output("</td><td valign='top'>",true);
//output((int)($diffsecs/86400)."d".(int)($diffsecs/3600%3600)."h".(int)($diffsecs/60%60)."m".(int)($diffsecs%60)."s");
output(dhms($diffsecs));
output("</td><td valign='top'>",true);
if ($row1['uri']>"")
output("<a href='".HTMLEntities($row1['uri'])."' target='_blank'>".HTMLEntities(substr($row1['uri'],0,150))."</a>`n",true);
else
output("`i`bNone`b`i`n");
output("</td></tr>",true);
}else{
$skippedcount++;
$skippedtotal+=$row1['count'];
}
}
if ($skippedcount>0){
output("<tr class='trlight'><td>$skippedtotal</td><td valign='top' colspan='2'>`i$skippedcount records skipped (over a week old)`i</td></tr>",true);
}
//output("</td></tr>",true);
}
output("</table>",true);
page_footer();
示例13: output_notl
output_notl("`^`b%s`b`n", $row['name']);
output("`@Date: `^`b%s`b (%s)`n", $row['date'], relativedate($row['date']));
output("`@Status: %s`n", $statuses[$row['status']]);
if ($row['closedate'] != '0000-00-00 00:00:00') {
output("`@Last Update: `^%s`@ on `^%s (%s)`n", $row['closer'], $row['closedate'], dhms(strtotime('now') - strtotime($row['closedate']), true));
}
output("`@Body:`^`n");
$body = htmlentities(stripslashes($row['body']), ENT_COMPAT, getsetting("charset", "ISO-8859-1"));
$body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i", "<a href='mailto:\\1?subject=RE: {$peti}&body=" . str_replace("+", " ", URLEncode("\n\n----- {$yourpeti} -----\n" . $row['body'])) . "'>\\1</a>", $body);
$body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i", "<span class='colLtRed'>\\1</span>", $body);
rawoutput("<span style='font-family: fixed-width'>" . nl2br($body) . "</span>");
commentdisplay("`n`@Commentary:`0`n", "pet-{$id}", "Add information", 200);
if ($viewpageinfo) {
output("`n`n`@Page Info:`&`n");
$row['pageinfo'] = stripslashes($row['pageinfo']);
$body = HTMLEntities($row['pageinfo'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"));
$body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i", "<a href='mailto:\\1?subject=RE: {$peti}&body=" . str_replace("+", " ", URLEncode("\n\n----- {$yourpeti} -----\n" . $row['body'])) . "'>\\1</a>", $body);
$body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i", "<span class='colLtRed'>\\1</span>", $body);
rawoutput("<pre>" . nl2br($body) . "</pre>");
}
}
if ($id && $op != "") {
$prevsql = "SELECT p1.petitionid, p1.status FROM " . db_prefix("petitions") . " AS p1, " . db_prefix("petitions") . " AS p2\n WHERE p1.petitionid<'{$id}' AND p2.petitionid='{$id}' AND p1.status=p2.status ORDER BY p1.petitionid DESC LIMIT 1";
$prevresult = db_query($prevsql);
$prevrow = db_fetch_assoc($prevresult);
if ($prevrow) {
$previd = $prevrow['petitionid'];
$s = $prevrow['status'];
$status = $statuses[$s];
addnav("Navigation");
addnav(array("Previous %s", $status), "viewpetition.php?op=view&id={$previd}");
示例14: addnav
addnav("Refresh the list", "inn.php?op=bartender&act=listupstairs");
output("%s`0 lays out a set of keys on the counter top, and tells you which key opens whose room. The choice is yours, you may sneak in and attack any one of them.", $barkeep);
pvplist($iname, "pvp.php", "?act=attack&inn=1");
} else {
if ($act == "colors") {
output("%s`0 leans on the bar. \"`%So you want to know about colors, do you?`0\" he asks.", $barkeep);
output("You are about to answer when you realize the question was posed in the rhetoric.");
output("%s`0 continues, \"`%To do colors, here's what you need to do.", $barkeep);
output(" First, you use a ` mark (found right above the tab key) followed by 1, 2, 3, 4, 5, 6, 7, !, @, #, \$, %, ^, &.", true);
output("Each of those corresponds with a color to look like this:");
output_notl("`n`1`1 `2`2 `3`3 `4`4 `5`5 `6`6 `7`7 ", true);
output_notl("`n`!`! `@`@ `#`# `\$`\$ `%`% `^`^ `&`& `n", true);
output("`% Got it?`0\" You can practice below:");
rawoutput("<form action=\"{$REQUEST_URI}\" method='POST'>", true);
$testtext = httppost('testtext');
output("You entered %s`n", prevent_colors(HTMLEntities($testtext, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))), true);
output("It looks like %s`n", $testtext);
$try = translate_inline("Try");
rawoutput("<input name='testtext' id='input'>");
rawoutput("<input type='submit' class='button' value='{$try}'>");
rawoutput("</form>");
rawoutput("<script language='javascript'>document.getElementById('input').focus();</script>");
output("`0`n`nThese colors can be used in your name, and in any conversations you have.");
addnav("", $REQUEST_URI);
} else {
if ($act == "specialty") {
$specialty = httpget('specialty');
if ($specialty == "") {
output("\"`2I want to change my specialty,`0\" you announce to %s`0.`n`n", $barkeep);
output("With out a word, %s`0 grabs you by the shirt, pulls you over the counter, and behind the barrels behind him.", $barkeep);
output("There, he rotates the tap on a small keg labeled \"Fine Swill XXX\"`n`n");
示例15: rawoutput
rawoutput("<input name='name' id='name'> <input type='submit' class='button' value='{$submit}'>");
rawoutput("</form>");
rawoutput("<script language='JavaScript'>document.getElementById('name').focus()</script>");
} else {
output("Which player did you mean?`n`n");
rawoutput("<table cellpadding='3' cellspacing='0' border='0'>");
rawoutput("<tr class='trhead'><td>Name</td><td>Level</td></tr>");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'><td>");
rawoutput("<a href='runmodule.php?module=dwellingseditor&op=keys&subop=givekey3&keyid={$keyid}&dwid={$dwid}&keyowner=" . HTMLEntities($row['acctid']) . "'>");
output_notl($row['name']);
rawoutput("</a></td><td>");
output_notl($row['level']);
rawoutput("</td></tr>");
addnav("", "runmodule.php?module=dwellingseditor&op=keys&subop=givekey3&keyid={$keyid}&dwid={$dwid}&keyowner=" . HTMLEntities($row['acctid']));
}
rawoutput("</table>");
}
}
if ($subop == "givekey3") {
$keyowner = httpget('keyowner');
if ($keyid == "") {
$sql = "SELECT keyid FROM " . db_prefix("dwellingkeys") . " WHERE keyowner = 0 AND dwid = {$dwid} LIMIT 1";
$result = db_query($sql);
$row = db_fetch_assoc($result);
$keyid = $row['keyid'];
}
if ($keyid == "") {
$sql = "INSERT INTO " . db_prefix("dwellingkeys") . " (dwid,dwidowner,keyowner) VALUES ({$dwid}," . $session['user']['acctid'] . ",{$keyowner})";
} else {
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:case_keys.php