예제 #1
0
파일: users.php 프로젝트: Yanrs/PkmnChan
';
if (mysql_num_rows($query) == 0) {
    echo '<div class="info">Could not find any users.</div>';
} else {
    echo '		
	<div class="franks">
		<table class="pretty-table">
			<tr>
				<th><a href="?' . $qs . '&amp;sort=' . $idOrder . '">ID</a></th>
				<th><a href="?' . $qs . '&amp;sort=' . $usernameOrder . '">Username</a></th>
				<th><a href="?' . $qs . '&amp;sort=' . $lastSeenOrder . '">Last Seen</a></th>
				<th>Options</th>
			</tr>
	';
    while ($row = mysql_fetch_assoc($query)) {
        $row = cleanHtml($row);
        $banText = $row['banned'] == 1 ? '&nbsp;[<span style="color: #FF0000; font-size: 8pt;">BANNED</span>]' : '';
        $lastseen = $row['lastseen'] == 0 ? 'Never' : secondsToTimeSince(time() - $row['lastseen']);
        echo '
			<tr>
				<td>' . $row['id'] . '</td>
				<td><a href="profile.php?id=' . $row['id'] . '">' . $row['username'] . '</a>' . $banText . '</td>
				<td>' . $lastseen . '</td>
				<td><a href="battle_user.php?id=' . $row['id'] . '">Battle User</a></td>
			</tr>
		';
    }
    echo '</table></div>';
    $pagination->echoPagination();
}
include '_footer.php';
예제 #2
0
파일: lottery.php 프로젝트: Yanrs/PkmnChan
include '_header.php';
printHeader('Lottery');
if (isset($_POST['enter'])) {
    $query = mysql_query("SELECT `lottery` FROM `users` WHERE `id`='{$uid}'");
    $row = mysql_fetch_assoc($query);
    $hasEntered = $row['lottery'];
    if ($hasEntered == 0) {
        mysql_query("UPDATE `users` SET `lottery`='1' WHERE `id`='{$uid}'");
        echo '<div class="notice">You have been entered into the lottery!</div>';
    } else {
        echo '<div class="error">You have already been entered into the lottery!</div>';
    }
}
$nextDraw = getConfigValue('lottery_next_draw');
$winnerUid = getConfigValue('lottery_winner_uid');
$timeLeft = secondsToTimeSince($nextDraw - $time);
$prizePokemon = getConfigValue('lottery_pokemon');
$pokemonPrefix = getConfigValue('lottery_pokemon_prefix');
$fullPrizeName = trim($pokemonPrefix . $prizePokemon);
$winnerPrizePokemon = getConfigValue('lottery_winner_pokemon');
$winnerPokemonPrefix = getConfigValue('lottery_winner_pokemon_prefix');
$winnerFullPrizeName = trim($winnerPokemonPrefix . $winnerPrizePokemon);
$query = mysql_query("SELECT `username` FROM `users` WHERE `id`='{$winnerUid}'");
$row = mysql_fetch_assoc($query);
$winnerUsername = $row['username'];
$query = mysql_query("SELECT COUNT(`id`) AS `lottery_users` FROM `users` WHERE `lottery`='1'");
$row = mysql_fetch_assoc($query);
$lotteryUsers = $row['lottery_users'];
echo '
	<div style="text-align: center;">
		The prize for the next draw is a ' . $fullPrizeName . '!<br />
예제 #3
0
파일: profile.php 프로젝트: Yanrs/PkmnChan
										<td><?php 
    echo number_format($userRow['lost']);
    ?>
</td>
									</tr>
									<tr>
										<td>Clan:</td>
										<td><?php 
    echo $clanName;
    ?>
</td>
									</tr>
									<tr>
										<td>Last Seen:</td>
										<td><?php 
    echo secondsToTimeSince(time() - $userRow['lastseen']);
    ?>
</td>
									</tr>
									<tr>
										<td>Trainer Level:</td>
										<td><?php 
    echo expToLevel($userRow['trainer_exp']);
    ?>
</td>
									</tr>
									<tr>
										<td>Premium:</td>
										<td><?php 
    echo $premium;
    ?>
예제 #4
0
require_once 'config.php';
require_once 'functions.php';
if (!isLoggedIn()) {
    redirect('index.php');
}
include '_header.php';
printHeader('Daily Prize');
$message = '';
$uid = $_SESSION['userid'];
$user = mysql_fetch_object(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $uid . "'"));
$multi1 = mysql_query("SELECT * FROM `users` WHERE `ip2`='" . $user->ip2 . "' AND `dailyprize`='0'");
$multi = mysql_num_rows($multi1);
$time = time();
$timeLeft = $user->last_dailyprize + 86400;
$next_dailyprize = secondsToTimeSince($timeLeft - $time);
if ($timeLeft <= $time) {
    mysql_query("UPDATE `users` SET `dailyprize` = '0' WHERE `id`='{$user->id}'");
}
if (isset($_POST['submit'])) {
    if ($user->dailyprize >= 1 || $multi > 2) {
        if ($multi < 3) {
            $message = "<p class='error'>You've had your daily prize today.<br>\n\t\t\t\t\tTill next daily prize you have left {$next_dailyprize} <br>\n\t\t\t\t\tCome back tomorrow.</p>";
        }
        if ($multi > 2) {
            $message = "<p class='error'>Too many people with your IP address have already took the daily prize today.</p>";
        }
    } else {
        mysql_query("UPDATE `users` SET `dailyprize` = '0' WHERE `id`='{$user->id}'");
        $rand = rand(1, 2);
        $rand2 = rand(1, 100);
예제 #5
0
    $type = rand(1, 5) == 3 ? 'Shiny ' : '';
    giveUserPokemonByName($uid, $rPoke['name'], $level, $type);
    mysql_query("UPDATE `users` SET `last_promo`='{$timeNow}' WHERE `id`='{$uid}'");
    echo '

		<img src="images/pokemon/' . $type . $rPoke['name'] . '.png" /><br />

		You have received a level ' . $level . ', ' . $type . $rPoke['name'] . '!

	';
} else {
    echo '

		You already got the promo for today!<br />

		The next free gift will be available in ' . secondsToTimeSince($midnightTomorrow - $timeNow) . '

	';
}
echo '</div>';
echo '</div>';
?>

  </div>      

        

<center><script type="text/javascript"><!--

google_ad_client = "ca-pub-9678842478299123";
예제 #6
0
            <tr>
                <td>Price in money:</td>
	        	<td>
	        		<input type="text" name="money" value="' . number_format($pCostMoney) . '" />
	        	</td>
	        </tr>
            <tr>
                <td>Price in tokens:</td>
            	<td>
	        		<input type="text" name="tokens" value="' . number_format($pCostTokens) . '" />
	        	</td>
	        </tr>
            <tr>
                <td>Last Update:</td>
                <td>
	        		' . secondsToTimeSince(time() - $pLastUpdate) . ' ago.
	        	</td>
	        </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
	        		<input type="checkbox" onclick="document.getElementById(\'submit\').disabled = this.checked ? \'\' : \'disabled\' ;" />
                    <span class="small">Check this to enable <br />the submit button.</span><br /><br />
                    <span class="small">This is here to stop <br />admins from mistakenly clicking<br /> save and allowing users<br /> to claim the promo twice.</span>
	        	</td>
	        </tr>
	        <tr>
	        	<td>&nbsp;</td>
	        	<td><input type="submit" id="submit" name="save" value="Save" disabled="disabled" /></td>
	        </tr>
        </table>