示例#1
0
 function linkName()
 {
     return "<a href=\"index.php?page=song&sid=" . $this->id . "\">" . makeSafeHTML($this->name) . "</a>";
 }
示例#2
0
    header("Location: index.php");
    exit;
}
$user = new User(intval($_GET['uid']));
if ($user->id == 0) {
    header("Location: index.php");
    exit;
}
$page = 1;
if (isset($_GET['p'])) {
    $page = intval($_GET['p']);
}
$stats = getLatestStatsFrom($user, 10, $page);
?>
<div class="title"><?php 
echo makeSafeHTML($user->username);
?>
</div>
<div class="block">
	<div class="blocktitle">Profile</div>
	<div class="blockcontent">
		<table>
			<tr>
				<td width="25%">XP:</td>
				<td width="25%"><?php 
echo formatInt($user->xp);
?>
</td>
				
				<td width="25%"></td>
				<td width="25%"></td>
示例#3
0
文件: song.php 项目: Wayfur/OpenSMO
<?php

if (!isset($_GET['sid'])) {
    header("Location: index.php");
    exit;
}
$song = new Song(intval($_GET['sid']));
if ($song->id == 0) {
    header("Location: index.php");
    exit;
}
$page = 1;
if (isset($_GET['p'])) {
    $page = intval($_GET['p']);
}
$stats = getBestStatsFromSong($song, 10, $page);
?>
<div class="title"><?php 
echo makeSafeHTML($song->name);
?>
</div>
<div class="block">
	<div class="blocktitle">Best statistics</div>
	<div class="blockcontent">
		<?php 
echoStatsTable($stats, true);
?>
	</div>
</div>
示例#4
0
文件: index.php 项目: Wayfur/OpenSMO
							<div class="blocktitle">Account</div>
							<div class="blockcontent">
								<?php 
    if (!isLoggedIn()) {
        ?>
									<a href="index.php?page=login">Login</a><br />
									<a href="index.php?page=register">Register</a><br />
									<?php 
    } else {
        ?>
									<p class="newsposter">Welcome, <?php 
        echo $me->linkName();
        ?>
!</p>
									<a href="index.php?page=logout&sk=<?php 
        echo makeSafeHTML($_COOKIE['PHPSESSID']);
        ?>
">Logout</a>
									<?php 
    }
    ?>
							</div>
						</div>
						<?php 
    if (isLoggedIn() && isMod()) {
        ?>
							<div class="block">
								<div class="blocktitle">Moderator menu</div>
								<div class="blockcontent">
									<a href="index.php?page=mod_news">Add news</a><br />
								</div>
示例#5
0
function echoStatsTable($stats, $fromSong = false)
{
    ?>
	<table>
		<tr>
			<th width="8%">Grade</th>
			<th width="24%"><?php 
    echo $fromSong ? "Player" : "Song";
    ?>
</th>
			<th width="8%">Flawless</th>
			<th width="8%">Perfect</th>
			<th width="8%">Great</th>
			<th width="8%">Good</th>
			<th width="8%">Barely</th>
			<th width="8%">Miss</th>
			<th width="20%">Player settings</th>
		</tr>
		<?php 
    foreach ($stats as $stat) {
        if ($fromSong) {
            $stat->fetchUser();
        } else {
            $stat->fetchSong();
        }
        ?>
			<tr>
				<td align="center"><?php 
        $stat->echoGradeImage();
        ?>
</td>
				<?php 
        if ($fromSong) {
            ?>
					<td><?php 
            echo $stat->user->linkName();
            ?>
<br />on: <?php 
            echo getDifficulty($stat->difficulty);
            ?>
 (<?php 
            echo $stat->feet;
            ?>
)</td>
				<?php 
        } else {
            ?>
					<td><?php 
            echo $stat->song->linkName();
            ?>
<br />by: <?php 
            echo makeSafeHTML($stat->song->artist);
            ?>
<br />on: <?php 
            echo getDifficulty($stat->difficulty);
            ?>
 (<?php 
            echo $stat->feet;
            ?>
)</td>
				<?php 
        }
        ?>
				<?php 
        for ($i = 8; $i >= 3; $i--) {
            ?>
				<td align="center"><?php 
            echo $stat->notes[$i];
            ?>
</td>
				<?php 
        }
        ?>
				<td align="center"><?php 
        echo makeSafeHTML($stat->playersettings);
        ?>
</td>
			</tr>
			<?php 
    }
    ?>
	</table>
	<?php 
}
示例#6
0
						<th width="75%">Value</th>
					</tr>
					<?php 
    $res = sqlQuery("SELECT * FROM \"settings\"");
    foreach ($res as $row) {
        ?>
						<tr>
							<td><?php 
        echo makeSafeHTML($row['Key']);
        ?>
</td>
							<td><input class="fullwidth" type="text" name="value[<?php 
        echo makeSafeHTML($row['Key']);
        ?>
]" value="<?php 
        echo makeSafeHTML($row['Value']);
        ?>
" /></td>
						</tr>
						<?php 
    }
    ?>
				</table>
				<?php 
    echoHiddenSessionkey();
    ?>
				<input type="submit" name="save" value="Save" />
			</form>
		</div>
	</div>
	<?php