예제 #1
0
        }
    }
}
if ($_GET['op'] == "") {
    output("`&");
    motditem("Testing!", "Please see the testing message below.");
    output("`%");
    $sql = "SELECT * FROM motd ORDER BY motddate DESC limit 20";
    $result = db_query($sql);
    for ($i = 0; $i < db_num_rows($result); $i++) {
        $row = db_fetch_assoc($result);
        if ($row['motddate'] > $session['user']['lastmotd'] || $i < 5) {
            if ($row['motdtype'] == 0) {
                motditem($row['motdtitle'] . ($session['user']['superuser'] >= 3 ? "[<a href='motd.php?op=del&id=" . $row['motditem'] . "' onClick=\"return confirm('Are you sure you want to delete this item?');\">Del</a>]" : ""), $row['motdbody']);
            } else {
                pollitem($row['motditem'], $row['motdtitle'] . ($session['user']['superuser'] >= 3 ? "[<a href='motd.php?op=del&id=" . $row['motditem'] . "' onClick=\"return confirm('Are you sure you want to delete this item?');\">Del</a>]" : ""), $row['motdbody']);
            }
        }
    }
    output("`&");
    motditem("Testing!", "For those who might be unaware, this game is in testing.  We are working on it when we have time.  Feel free to drop suggestions, I'm open to anything :-)");
    output("`@Commentary:`0`n");
    viewcommentary("motd");
}
/*
motditem("Spring Fashions","My lovely wife is in the process of updating the armor and weapons found in the local shoppes.  There will be a new set for each dragon kill, so you'll never wear the same armor or wield the same weapon twice!");
motditem("Dragon Points!","You probably already noticed by now, but there is a new system named Dragon Points.  These afford you another way to permanently increase  your character's abilities.  You gain one Dragon Point for each dragon slaying.");
motditem("Getting slain in the fields","There is a new drawback, and a new upside to getting attacked in the fields.  If you die in the fields when someone else attacked you, you lose 5% of your exp, along with your gold.  But if you are victorious when someone else attacks you, you get their gold, and 10% of THEIR exp.  When you attack others in the field has not changed, you can get 10% of your victim's exp and all their gold if you win, and you lose 15% of your exp, and all of your gold if you lose.  You cannot attack someone 2 levels below you any longer either, only 1 level below, and 2 levels above.");
motditem("New Days","New days should now occur automatically when the clock in the village reaches midnight.  Due to a bug on my part though, some accounts got goofed up.  Please email me at trash@mightye.org if you are not able to play the game, and I'll fix your account.");
*/
$session['needtoviewmotd'] = false;
$pagestr = "";
if ($totaltoday > $newsperpage) {
    $pagestr = sprintf_translate("(Items %s - %s of %s)", $pageoffset + 1, min($pageoffset + $newsperpage, $totaltoday), $totaltoday);
}
$sql2 = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor ORDER BY motddate DESC LIMIT 1";
$result2 = db_query_cached($sql2, "lastmotd");
while ($row = db_fetch_assoc($result2)) {
    require_once "lib/motd.php";
    require_once "lib/nltoappon.php";
    if ($row['motdauthorname'] == "") {
        $row['motdauthorname'] = "`@Green Dragon Staff`0";
    }
    if ($row['motdtype'] == 0) {
        motditem($row['motdtitle'], $row['motdbody'], $row['motdauthorname'], $row['motddate'], "");
    } else {
        pollitem($row['motditem'], $row['motdtitle'], $row['motdbody'], $row['motdauthorname'], $row['motddate'], false);
    }
}
output_notl("`n");
output("`c`b`!News since the last new Game Day %s`0`b`c", $pagestr);
while ($row = db_fetch_assoc($result)) {
    output_notl("`c`2-=-`@=-=`2-=-`@=-=`2-=-`@=-=`2-=-`0`c");
    if ($session['user']['superuser'] & SU_EDIT_COMMENTS) {
        $del = translate_inline("Del");
        rawoutput("[ <a href='superuser.php?op=newsdelete&newsid=" . $row['newsid'] . "&return=" . URLEncode($_SERVER['REQUEST_URI']) . "'>{$del}</a> ]&nbsp;");
        addnav("", "superuser.php?op=newsdelete&newsid={$row['newsid']}&return=" . URLEncode($_SERVER['REQUEST_URI']));
    }
    tlschema($row['tlschema']);
    if ($row['arguments'] > "") {
        $arguments = array();
        $base_arguments = unserialize($row['arguments']);