예제 #1
0
function fetch_znote_accounts()
{
    $results = mysql_select_multi("SELECT `account_id` FROM `znote_accounts`");
    $accounts = array();
    foreach ($results as $row) {
        $accounts[] = $row['account_id'];
    }
    return count($accounts) > 0 ? $accounts : false;
}
예제 #2
0
파일: guilds.php 프로젝트: l04d/ZnoteAAC
function guild_list($TFSVersion)
{
    $cache = new Cache('engine/cache/guildlist');
    if ($cache->hasExpired()) {
        if ($TFSVersion != 'TFS_10') {
            $guilds = mysql_select_multi("SELECT `t`.`id`, `t`.`name`, `t`.`creationdata`, `motd`, (SELECT count(p.rank_id) FROM players AS p LEFT JOIN guild_ranks AS gr ON gr.id = p.rank_id WHERE gr.guild_id =`t`.`id`) AS `total` FROM `guilds` as `t` ORDER BY `t`.`name`;");
        } else {
            $guilds = mysql_select_multi("SELECT `id`, `name`, `creationdata`, `motd`, (SELECT COUNT('guild_id') FROM `guild_membership` WHERE `guild_id`=`id`) AS `total` FROM `guilds` ORDER BY `name`;");
        }
        // Add level data info to guilds
        if ($guilds !== false) {
            for ($i = 0; $i < count($guilds); $i++) {
                $guilds[$i]['level'] = get_guild_level_data($guilds[$i]['id']);
            }
        }
        $cache->setContent($guilds);
        $cache->save();
    } else {
        $guilds = $cache->load();
    }
    return $guilds;
}
예제 #3
0
<?php

require_once '../../module.php';
// Configure module version number
$response['version']['module'] = 1;
// Fetch number of rows
$rows = getValue($_GET['rows']);
if (!$rows || $rows == 0) {
    $rows = 10;
} else {
    $rows = (int) $rows;
}
// Show which configuration is used
$response['config']['rows'] = $rows;
// Fetch top 10 players
$players = mysql_select_multi("SELECT `p`.`name`, `p`.`level`, `p`.`experience`, `p`.`vocation`, `p`.`lastlogin`, `z`.`created` FROM `players` AS `p` INNER JOIN `znote_players` AS `z` ON `p`.`id` = `z`.`player_id` WHERE `p`.`group_id`<'2'  ORDER BY `p`.`experience` DESC LIMIT {$rows};");
for ($i = 0; $i < count($players); $i++) {
    $players[$i]['vocation_name'] = $config['vocations'][$players[$i]['vocation']];
}
$response['data']['players'] = $players;
SendResponse($response);
예제 #4
0
파일: market.php 프로젝트: l04d/ZnoteAAC
			<td><a href="?compare=<?php 
        echo $o['item_id'];
        ?>
"><button>Compare</button></a></td>
		</tr>
		<?php 
    }
    ?>
	</table>
	<?php 
} else {
    // Else You want to compare price
    $compare = (int) $compare;
    // First list active bids
    $offers = mysql_select_multi("SELECT `id`, `sale`, `itemtype` AS `item_id`, `amount`, `price`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `itemtype`='{$compare}' ORDER BY `price` ASC;");
    $historyOffers = mysql_select_multi("SELECT `id`, `itemtype` AS `item_id`, `amount`, `price`, `inserted`, `expires_at` FROM `market_history` WHERE `itemtype`='{$compare}' AND `state`=255 ORDER BY `price` ASC;");
    $buylist = false;
    // Markup
    ?>
	<h1>Comparing item</h1>
	<a href="market.php"><button>Go back</button></a>
	<h2>Active offers</h2>
	<table class="table tbl-hover">
		<tr class="yellow">
			<td>Item name</td>
			<td>Item</td>
			<td>Count</td>
			<td>Price for 1</td>
			<td>Added</td>
			<td>By</td>
		</tr>
예제 #5
0
<div class="sidebar">
	<h3>Top 5 players</h3>
	<?php 
$cache = new Cache('engine/cache/topPlayer');
if ($cache->hasExpired()) {
    $players = mysql_select_multi('SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` < ' . $config['highscore']['ignoreGroupId'] . ' ORDER BY `experience` DESC LIMIT 5;');
    $cache->setContent($players);
    $cache->save();
} else {
    $players = $cache->load();
}
if ($players) {
    $count = 1;
    foreach ($players as $player) {
        echo "{$count} - <a href='characterprofile.php?name=" . $player['name'] . "'>" . $player['name'] . "</a> (" . $player['level'] . ").<br>";
        $count++;
    }
}
?>
	<br>
</div>
예제 #6
0
파일: changelog.php 프로젝트: l04d/ZnoteAAC
			<textarea rows="7" cols="40" maxlength="254" name="changelogText"><?php 
        echo $action === 2 ? $old['text'] : '';
        ?>
</textarea><br>
			<input type="submit" value="Add or update changelog">
		</form>
		<?php 
    }
}
?>

<h1>Changelog</h1>
<?php 
$cache = new Cache('engine/cache/changelog');
if ($updateCache === true) {
    $changelogs = mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;");
    $cache->setContent($changelogs);
    $cache->save();
} else {
    $changelogs = $cache->load();
}
if (isset($changelogs) && !empty($changelogs) && $changelogs !== false) {
    ?>
	<table id="changelogTable">
		<tr class="yellow">
			<td>Changelogs</td>
			<?php 
    if (user_logged_in()) {
        if (is_admin($user_data)) {
            echo "<td>Delete</td><td>Update</td>";
        }
예제 #7
0
		<?php 
        }
    }
    ?>
	<form action="" method="post">
		<input type="hidden" name="username" value="ADMIN"><br>
		<textarea class="forumReply" name="reply_text" style="width: 610px; height: 150px"></textarea><br>
		<input name="" type="submit" value="Post Reply" class="btn btn-primary">
	</form>
	<?php 
} else {
    ?>
 
	<h1>Latest Tickets</h1>
	<?php 
    $tickets = mysql_select_multi("SELECT id,subject,creation,status FROM znote_tickets ORDER BY creation DESC");
    if ($tickets !== false) {
        ?>
		<table>
			<tr class="yellow">
				<td>ID:</td>
				<td>Subject:</td>
				<td>Creation:</td>
				<td>Status:</td>
			</tr>
				<?php 
        foreach ($tickets as $ticket) {
            echo '<tr class="special">';
            echo '<td>' . $ticket['id'] . '</td>';
            echo '<td><a href="admin_helpdesk.php?view=' . $ticket['id'] . '">' . $ticket['subject'] . '</a></td>';
            echo '<td>' . getClock($ticket['creation'], true) . '</td>';
예제 #8
0
<?php

require_once 'engine/init.php';
/*	PLAYER SKILLS REPAIR SCRIPT IF YOU SOMEHOW DELETE PLAYER SKILLS
	---------------------------------------------------------------
		Place in root web directory, login to admin account, 
		and enter site.com/repairSkills.php (with big S). 
*/
protect_page();
admin_only($user_data);
$Splayers = 0;
$Salready = 0;
$Sfixed = 0;
$players = mysql_select_multi("SELECT `id` FROM `players`;");
if ($players !== false) {
    $Splayers = count($players);
    foreach ($players as $char) {
        // Check if player have skills
        $skills = mysql_select_single("SELECT `value` FROM `player_skills` WHERE `player_id`='" . $char['id'] . "' AND `skillid`='2' LIMIT 1;");
        // If he dont have any skills
        if ($skills === false) {
            $Sfixed++;
            // Loop through every skill id and give him default skills.
            $query = "INSERT INTO `player_skills` (`player_id`, `skillid`, `value`, `count`) VALUES ";
            for ($i = 0; $i < 7; $i++) {
                if ($i != 6) {
                    $query .= "('" . $char['id'] . "', '{$i}', '10', '0'), ";
                } else {
                    $query .= "('" . $char['id'] . "', '{$i}', '10', '0');";
                }
            }
예제 #9
0
function fetch_znote_accounts()
{
    return mysql_select_multi("SELECT `account_id` FROM `znote_accounts`");
}
예제 #10
0
파일: Wadmin.php 프로젝트: l04d/ZnoteAAC
			<li>
				<a href='admin_helpdesk.php'>Admin Helpdesk</a>
			</li>
			<li>
				<a href='admin_shop.php'>Admin Shop</a>
			</li>
			<?php 
$new = 0;
$cat = 4;
//Category ID for feedback section
$threads = mysql_select_multi("SELECT `id`, `player_id` FROM `znote_forum_threads` WHERE `forum_id`='{$cat}' AND `closed`='0';");
if ($threads !== false) {
    $staffs = mysql_select_multi("SELECT `id` FROM `players` WHERE `group_id` > '1';");
    foreach ($threads as $thread) {
        $response = false;
        $posts = mysql_select_multi("SELECT `id`, `player_id` FROM `znote_forum_posts` WHERE `thread_id`='" . $thread['id'] . "';");
        if ($posts !== false) {
            foreach ($posts as $post) {
                foreach ($staffs as $staff) {
                    if ($post['player_id'] == $staff['id']) {
                        $response = true;
                    }
                }
            }
        }
        if (!$response) {
            $new++;
        }
    }
}
?>
예제 #11
0
파일: guilds.php 프로젝트: peonso/ZnoteAAC
			<ul>
				<li>Invite guild to war:<br>
					<input type="text" name="warinvite" placeholder="Guild name">
					<input type="number" min="10" max="999" name="limit">
					<input type="submit" value="Invite Guild">
				</li>
			</ul>
		</form>
		<style type="text/css">
			form {display: inline;}
			#btnspace{margin-left:100px;}
		</style>
		<table id="guildsTable" class="table table-striped table-hover"><tr class="yellow"><th>Aggressor</th><th>Information</th><th>Enemy</th></tr>
		<?php 
                    $i = 0;
                    $wars = mysql_select_multi("SELECT `guild1`, `guild2`, `name1`, `name2`, `started`, (SELECT `limit` FROM `znote_guild_wars` WHERE `znote_guild_wars`.`id` = `guild_wars`.`id`) AS `limit` FROM `guild_wars` WHERE (`guild1` = '{$gid}' OR `guild2` = '{$gid}') AND `status` = 0 ORDER BY `started` DESC");
                    if (!empty($wars) || $wars !== false) {
                        foreach ($wars as $war) {
                            $i++;
                            echo '<tr><td><a href="guilds.php?name=' . $war['name1'] . '">' . $war['name1'] . '</a></td><td>';
                            echo '<center><b>Pending invitation</b><br />Invited on ' . getClock($war['started'], true) . '.<br />The frag limit is set to ' . $war['limit'] . ' frags.<br />';
                            if ($war['guild1'] == $gid) {
                                echo '<br /><form action="" method="post"><input type="hidden" name="cancel_war_invite" value="' . $war['guild2'] . '" /><input type="submit" value="Cancel Invitation"></form>';
                            } else {
                                if ($war['guild2'] == $gid) {
                                    echo '<br><form action="" method="post"><input type="hidden" name="accept_war_invite" value="' . $war['guild1'] . '" /><input type="submit" value="Accept Invitation"></form>';
                                    echo '<form action="" method="post"><input type="hidden" name="reject_war_invite" value="' . $war['guild1'] . '" /><input type="submit" ID="btnspace" value="Reject Invitation"></form>';
                                }
                            }
                            echo '</center></td><td><a href="guilds.php?name=' . $war['name2'] . '">' . $war['name2'] . '</a></td></tr>';
                        }
예제 #12
0
파일: topguilds.php 프로젝트: l04d/ZnoteAAC
<?php

require_once 'engine/init.php';
include 'layout/overall/header.php';
// Cache the results
$cache = new Cache('engine/cache/topGuilds');
if ($cache->hasExpired()) {
    $guilds = mysql_select_multi("SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 10;");
    $cache->setContent($guilds);
    $cache->save();
} else {
    $guilds = $cache->load();
}
$count = 1;
function convert_number_to_words($number)
{
    $hyphen = '-';
    $conjunction = ' and ';
    $separator = ', ';
    $negative = 'negative ';
    $decimal = ' point ';
    $dictionary = array(0 => 'zero', 1 => 'First', 2 => 'Second', 3 => 'Third', 4 => 'Fourth', 5 => 'Fifth', 6 => 'Sixth', 7 => 'Seventh', 8 => 'Eighth', 9 => 'Ninth', 10 => 'Tenth', 11 => 'eleventh', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen', 20 => 'twenty', 30 => 'thirty', 40 => 'fourty', 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety', 100 => 'hundred', 1000 => 'thousand', 1000000 => 'million', 1000000000 => 'billion', 1000000000000 => 'trillion', 1000000000000000 => 'quadrillion', 1000000000000000000 => 'quintillion');
    if (!is_numeric($number)) {
        return false;
    }
    if ($number >= 0 && (int) $number < 0 || (int) $number < 0 - PHP_INT_MAX) {
        // overflow
        trigger_error('convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX, E_USER_WARNING);
        return false;
    }
    if ($number < 0) {
예제 #13
0
파일: forum.php 프로젝트: l04d/ZnoteAAC
	<?php 
    if ($guildboard !== false && $guild || $guildboard !== false && $admin) {
        //
        ?>
		<table class="table table-striped table-hover znoteTable" id="forumCategoryTable">
			<tr class="yellow">
				<th>Guild Boards</th>
				<?php 
        foreach ($charData as $char) {
            if ($char['guild'] > 0) {
                $guild = true;
            }
        }
        if ($admin || $guild) {
            if (!isset($guilds)) {
                $guilds = mysql_select_multi("SELECT `id`, `name` FROM `guilds` ORDER BY `name`;");
                $guilds[] = array('id' => '0', 'name' => 'No guild');
            }
            $guildName = array();
            foreach ($guilds as $guild) {
                $guildName[$guild['id']] = $guild['name'];
            }
            if ($admin) {
                ?>
						<th width="100">Edit</th>
						<th width="100">Delete</th>
						<?php 
            }
        }
        ?>
			</tr>
예제 #14
0
}
// Stage 1: Fetch name
if (isset($_GET['name'])) {
    $name = getValue($_GET['name']);
} else {
    $name = false;
}
//if (isset($_POST['name'])) $name = getValue($_POST['name']);
// Stage 2: Fetch user id and skills
$skills = false;
$pid = 0;
if ($name !== false) {
    if (user_character_exist($name)) {
        $pid = user_character_id($name);
        if ($config['TFSVersion'] != 'TFS_10') {
            $skills = mysql_select_multi("SELECT `value` FROM `player_skills` WHERE `player_id`='{$pid}' LIMIT 7;");
            $player = mysql_select_single("SELECT `maglevel`, `level`, `vocation` FROM `players` WHERE `id`='{$pid}' LIMIT 1;");
            $skills[] = array('value' => $player['maglevel']);
            $skills[] = array('value' => $player['level']);
            $skills[] = array('value' => $player['vocation']);
        } else {
            $player = mysql_select_single("SELECT `skill_fist`, `skill_club`, `skill_sword`, `skill_axe`, `skill_dist`, `skill_shielding`, `skill_fishing`, `maglevel`, `level`, `vocation` FROM `players` WHERE `id`='{$pid}' LIMIT 1;");
            $skills = array(0 => array('value' => $player['skill_fist']), 1 => array('value' => $player['skill_club']), 2 => array('value' => $player['skill_sword']), 3 => array('value' => $player['skill_axe']), 4 => array('value' => $player['skill_dist']), 5 => array('value' => $player['skill_shielding']), 6 => array('value' => $player['skill_fishing']), 7 => array('value' => $player['maglevel']), 8 => array('value' => $player['level']), 9 => array('value' => $player['vocation']));
        }
        //data_dump($skills, false, "Player skills");
    } else {
        $name = false;
    }
}
?>
<form action="" method="<?php 
예제 #15
0
파일: killers.php 프로젝트: l04d/ZnoteAAC
        $cache->setContent($killers);
        $cache->save();
    } else {
        $killers = $cache->load();
    }
    $cache = new Cache('engine/cache/victims');
    if ($cache->hasExpired()) {
        $victims = fetchLoosers();
        $cache->setContent($victims);
        $cache->save();
    } else {
        $victims = $cache->load();
    }
    $cache = new Cache('engine/cache/lastkillers');
    if ($cache->hasExpired()) {
        $latests = mysql_select_multi("SELECT `p`.`name` AS `victim`, `d`.`killed_by` as `killed_by`, `d`.`time` as `time` FROM `player_deaths` as `d` INNER JOIN `players` as `p` ON d.player_id = p.id WHERE d.`is_player`='1' ORDER BY `time` DESC LIMIT 20;");
        if ($latests !== false) {
            $cache->setContent($latests);
            $cache->save();
        }
    } else {
        $latests = $cache->load();
    }
    if ($killers) {
        ?>
<h1>Biggest Murders</h1>
<table id="killersTable" class="table table-striped">
	<tr class="yellow">
		<th>Name</th>
		<th>Kills</th>
	</tr>
예제 #16
0
파일: helpdesk.php 프로젝트: l04d/ZnoteAAC
                include_once 'captcha/securimage.php';
                $securimage = new Securimage();
                if ($securimage->check($_POST['captcha_code']) == false) {
                    $errors[] = 'Captcha image verification was submitted wrong.';
                }
            }
            // Reversed this if, so: first check if you need to validate, then validate.
            if ($config['validate_IP'] === true && validate_ip(getIP()) === false) {
                $errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
            }
        }
    }
    ?>
	<h1>Latest Tickets</h1>
	<?php 
    $tickets = mysql_select_multi("SELECT id,subject,creation,status FROM znote_tickets WHERE owner={$session_user_id} ORDER BY creation DESC");
    if ($tickets !== false) {
        ?>
		<table>
			<tr class="yellow">
				<td>ID:</td>
				<td>Subject:</td>
				<td>Creation:</td>
				<td>Status:</td>
			</tr>
				<?php 
        foreach ($tickets as $ticket) {
            echo '<tr class="special">';
            echo '<td>' . $ticket['id'] . '</td>';
            echo '<td><a href="helpdesk.php?view=' . $ticket['id'] . '">' . $ticket['subject'] . '</a></td>';
            echo '<td>' . getClock($ticket['creation'], true) . '</td>';
예제 #17
0
파일: forum.php 프로젝트: peonso/ZnoteAAC
     echo $config['forum']['closed'], ' ';
 }
 if ($board['hidden'] == 1) {
     echo $config['forum']['hidden'], ' ';
 }
 if ($board['guild_id'] > 0) {
     echo "[" . $board['name'] . "] ";
 }
 echo "<a href=" . $url . ">" . $guildName[$board['guild_id']] . "</a></td>";
 $categoryid = $board['id'];
 $threads = mysql_select_multi("SELECT `id`, `player_name`, `updated` FROM `znote_forum_threads` WHERE `forum_id`={$categoryid} ORDER BY `updated` ASC");
 !empty($threads) ? $threadscount = count($threads) : ($threadscount = 0);
 $replies = 0;
 foreach ($threads as $thread) {
     $threadid = $thread['id'];
     $posts = mysql_select_multi("SELECT `player_name`, `updated` FROM `znote_forum_posts` WHERE `thread_id`={$threadid} ORDER BY `updated` DESC");
     if (!empty($posts)) {
         $newreplies = count($posts);
         foreach ($posts as $post) {
             $lastposter = $post['player_name'];
             $lastpostdate = $post['updated'];
             break;
         }
     } else {
         $lastposter = $thread['player_name'];
         $lastpostdate = $thread['updated'];
         $newreplies = 0;
     }
     $replies = $replies + $newreplies;
 }
 echo "<td>" . $threadscount . "</td>";
예제 #18
0
파일: general.php 프로젝트: peonso/ZnoteAAC
function online_list()
{
    if (config('TFSVersion') == 'TFS_10') {
        return mysql_select_multi("SELECT `o`.`player_id` AS `id`, `p`.`name` as `name`, `p`.`level` as `level`, `p`.`vocation` as `vocation`, `g`.`name` as `gname` FROM `players_online` as `o` INNER JOIN `players` as `p` ON `o`.`player_id` = `p`.`id` LEFT JOIN `guild_membership` gm ON `o`.`player_id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id`");
    } else {
        return mysql_select_multi("SELECT `p`.`name` as `name`, `p`.`level` as `level`, `p`.`vocation` as `vocation`, `g`.`name` as `gname` FROM `players` p LEFT JOIN `guild_ranks` gr ON `gr`.`id` = `p`.`rank_id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `p`.`online` = '1' ORDER BY `p`.`name` DESC;");
    }
}
예제 #19
0
function fetchAllScores($rows, $tfs, $g)
{
    // Return scores ordered by type
    $data = array();
    if ($tfs == 'TFS_10') {
        $data[1] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_club` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_club` DESC LIMIT 0, {$rows};");
        $data[2] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_sword` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_sword` DESC LIMIT 0, {$rows};");
        $data[3] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_axe` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_axe` DESC LIMIT 0, {$rows};");
        $data[4] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_dist` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_dist` DESC LIMIT 0, {$rows};");
        $data[5] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_shielding` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_shielding` DESC LIMIT 0, {$rows};");
        $data[6] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_fishing` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_fishing` DESC LIMIT 0, {$rows};");
        $data[7] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `experience`, `level` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `experience` DESC LIMIT 0, {$rows};");
        $data[8] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `maglevel` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `maglevel` DESC LIMIT 0, {$rows};");
        $data[9] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `skill_fist` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `skill_fist` DESC LIMIT 0, {$rows};");
    } else {
        $data[9] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 0 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[1] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 1 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[2] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 2 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[3] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 3 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[4] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 4 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[5] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 5 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[6] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 6 AND `p`.`group_id` < {$g} ORDER BY `s`.`value` DESC LIMIT 0, {$rows};");
        $data[7] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `experience`, `level` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `experience` DESC limit 0, {$rows};");
        $data[8] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `maglevel` AS `value` FROM `players` WHERE `group_id` < {$g} ORDER BY `maglevel` DESC limit 0, {$rows};");
    }
    return $data;
}
예제 #20
0
     $updatechangelog = false;
     if ($changelog !== false) {
         // Update it
         mysql_update("UPDATE `znote_changelog` SET `text`='{$changelogText}', `time`='{$time}' WHERE `id`='" . $changelog['id'] . "' LIMIT 1;");
         echo "<h2>Changelog message updated!</h2>";
         $updatechangelog = true;
     } else {
         // Create it
         mysql_insert("INSERT INTO `znote_changelog` (`text`, `time`, `report_id`, `status`) \n                VALUES ('{$changelogText}', '{$time}', '{$changelogReportId}', '{$status}');");
         echo "<h2>Changelog message created!</h2>";
         $updatechangelog = true;
     }
     if ($updatechangelog) {
         // Cache changelog
         $cache = new Cache('engine/cache/changelog');
         $cache->setContent(mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;"));
         $cache->save();
     }
 }
 // If we should give user price
 if ($price > 0) {
     $account = mysql_select_single("SELECT `a`.`id`, `a`.`email` FROM `accounts` AS `a` \n            INNER JOIN `players` AS `p` ON `p`.`account_id` = `a`.`id`\n            WHERE `p`.`name` = '{$playerName}' LIMIT 1;");
     if ($account !== false) {
         // transaction log
         mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '{$reportId}', 'report@admin." . $user_data['name'] . " to " . $account['email'] . "', '" . $account['id'] . "', '0', '" . $price . "')");
         // Process payment
         $data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='" . $account['id'] . "';");
         // Give points to user
         $new_points = $data['old_points'] + $price;
         mysql_update("UPDATE `znote_accounts` SET `points`='{$new_points}' WHERE `account_id`='" . $account['id'] . "'");
         // Remind GM that he sent points to character
예제 #21
0
require '../engine/database/connect.php';
?>

<h1>Gesior and Modern shop points to Znote AAC shop points</h1>
<p>Convert donation/shop points from previous Gesior/Modern installation to Znote AAC:</p>
<?php 
$accounts = mysql_select_multi("SELECT `id`, `premium_points` FROM `accounts` WHERE `premium_points`>'0';");
$accountids = array();
foreach ($accounts as $acc) {
    $accountids[] = $acc['id'];
}
$accidlist = join(',', $accountids);
if ($accounts !== false) {
    echo "<p>Detected: " . count($accounts) . " accounts who have points in old system.</p>";
} else {
    die("<h1>All accounts already converted. :)</h1>");
}
$znote_accounts = mysql_select_multi("SELECT `account_id`, `points` FROM `znote_accounts` WHERE `account_id` IN ({$accidlist});");
if (count($accounts) !== count($znote_accounts)) {
    die("<h1><font color='red'>Failed to syncronize accounts. You need to convert all accounts to Znote AAC first!</font></h1>");
}
// Order old accounts by id.
$idaccounts = array();
foreach ($accounts as $acc) {
    $idaccounts[$acc['id']] = $acc['premium_points'];
}
foreach ($znote_accounts as $acc) {
    mysql_update("UPDATE `znote_accounts` SET `points`='" . ($acc['points'] + $idaccounts[$acc['account_id']]) . "' WHERE `account_id`='" . $acc['account_id'] . "' LIMIT 1;");
}
mysql_update("UPDATE `accounts` SET `premium_points`='0';");
echo "<h1><font color='green'>Successfully converted all points!</font></h1>";
예제 #22
0
                        echo '<b><font color="green">This player has never died.</font></b>';
                    }
                }
            }
        }
        ?>
				</li>
				
				<!-- END DEATH LIST -->
<!-- QUEST PROGRESSION -->
<?php 
        $totalquests = 0;
        $completedquests = 0;
        $firstrun = 1;
        if ($config['EnableQuests'] == true) {
            $sqlquests = mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = {$user_id}");
            foreach ($config['quests'] as $cquest) {
                $totalquests = $totalquests + 1;
                foreach ($sqlquests as $dbquest) {
                    if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
                        $completedquests = $completedquests + 1;
                    }
                }
                if ($cquest[3] == 1) {
                    if ($completedquests != 0) {
                        if ($firstrun == 1) {
                            ?>
					<li>
						<b> Quest progression </b>
						<table id="characterprofileQuest" class="table table-striped table-hover">
							<tr class="yellow">
예제 #23
0
    echo $order['count'];
    ?>
</td>
			<td><?php 
    echo date('Y/m/d H:i', $order['time']);
    ?>
</td>
		</tr>
		<?php 
}
?>
	</tbody>
</table>

<?php 
$orders = mysql_select_multi("SELECT `id`, `account_id`, `type`, `itemid`, `count`, `points`, `time` FROM `znote_shop_logs` ORDER BY `id` DESC;");
?>
<h2>Order History</h2>
<p>This list contains all transactions bought in the shop.</p>
<table>
	<thead>
		<th>Id</th>
		<th>Account</th>
		<th>Type</th>
		<th>Item</th>
		<th>Count</th>
		<th>points</th>
		<th>Date</th>
	</thead>
	<tbody>
		<?php 
예제 #24
0
파일: house.php 프로젝트: l04d/ZnoteAAC
        ?>
		<h2>This house is up on auction!</h2>
		<?php 
        if ($house['highest_bidder'] == 0) {
            echo "<b>This house don't have any bidders yet.</b>";
        } else {
            $bidder = mysql_select_single("SELECT `name` FROM `players` WHERE `id`='" . $house['highest_bidder'] . "' LIMIT 1;");
            echo "<b>This house have bidders! If you want this house, now is your chance!</b>";
            echo "<br><b>Active bid:</b> " . $house['last_bid'] . "gp";
            echo "<br><b>Active bid by:</b> <a href='characterprofile.php?name=" . $bidder['name'] . "' target='_BLANK'>" . $bidder['name'] . "</a>";
            echo "<br><b>Bid will end on:</b> " . getClock($house['bid_end'], true);
        }
        if ($house['bid_end'] == 0 || $house['bid_end'] > time()) {
            if (user_logged_in()) {
                // Your characters, indexed by char_id
                $yourChars = mysql_select_multi("SELECT `id`, `name`, `balance` FROM `players` WHERE `account_id`='" . $user_data['id'] . "';");
                if ($yourChars !== false) {
                    $charData = array();
                    foreach ($yourChars as $char) {
                        $charData[$char['id']] = $char;
                    }
                    ?>
					<form action="" method="post">
						<select name="char">
							<?php 
                    foreach ($charData as $id => $char) {
                        echo "<option value='{$id}'>" . $char['name'] . " [" . $char['balance'] . "]</option>";
                    }
                    ?>
						</select>
						<input type="text" name="amount" placeholder="Min bid: <?php 
예제 #25
0
     $results = mysql_select_multi("SELECT `id` AS `thread_id`, `forum_id`, `title`, `text`, `player_name` FROM `znote_forum_threads` ORDER BY `id` DESC LIMIT {$searchResults};");
     // Filter out search results in custom access boards.
     for ($i = 0; $i < count($results); $i++) {
         if (!in_array($results[$i]['forum_id'], $allowedForums)) {
             $results[$i]['forum_id'] = false;
         } else {
             $results[$i]['title'] = stripBBCode($results[$i]['title']);
             $results[$i]['text'] = stripBBCode($results[$i]['text']);
         }
     }
     //if ($results !== false) data_dump($results, false, "Search results");
     //else echo "<br><b>No results.</b>";
     break;
 case 6:
     // Search posts
     $results = mysql_select_multi("SELECT `thread_id`, `player_name`, `text` FROM `znote_forum_posts` ORDER BY `id` DESC LIMIT {$searchResults};");
     // Missing ['forum_id'], ['title'], lets get them
     for ($i = 0; $i < count($results); $i++) {
         // $results[$i]['asd']
         $thread = mysql_select_single("SELECT `forum_id`, `title` FROM `znote_forum_threads` WHERE `id`='" . $results[$i]['thread_id'] . "' LIMIT 1;");
         if ($thread !== false) {
             $results[$i]['forum_id'] = $thread['forum_id'];
             $results[$i]['title'] = $thread['title'];
             if (!in_array($results[$i]['forum_id'], $allowedForums)) {
                 $results[$i]['forum_id'] = false;
             } else {
                 $results[$i]['title'] = stripBBCode($results[$i]['title']);
                 $results[$i]['text'] = stripBBCode($results[$i]['text']);
             }
         } else {
             $results[$i]['forum_id'] = false;
예제 #26
0
파일: houses.php 프로젝트: l04d/ZnoteAAC
 // Create or fetch data from cache
 $cache = new Cache('engine/cache/houses/houses-' . $order . '-' . $type);
 $houses = array();
 if ($cache->hasExpired()) {
     $houses = mysql_select_multi("SELECT `id`, `owner`, `paid`, `warnings`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` ORDER BY {$order} {$type};");
     if ($houses !== false) {
         // Fetch player names
         $playerlist = array();
         foreach ($houses as $h) {
             if ($h['owner'] > 0) {
                 $playerlist[] = $h['owner'];
             }
         }
         if (!empty($playerlist)) {
             $ids = join(',', $playerlist);
             $tmpPlayers = mysql_select_multi("SELECT `id`, `name` FROM players WHERE `id` IN ({$ids});");
             // Sort $tmpPlayers by player id
             $tmpById = array();
             foreach ($tmpPlayers as $p) {
                 $tmpById[$p['id']] = $p['name'];
             }
             for ($i = 0; $i < count($houses); $i++) {
                 if ($houses[$i]['owner'] > 0) {
                     $houses[$i]['ownername'] = $tmpById[$houses[$i]['owner']];
                 }
             }
         }
         $cache->setContent($houses);
         $cache->save();
     }
 } else {
예제 #27
0
        $value .= '.' . substr($value2, -3, 3);
        $value2 = substr($value2, 0, strlen($value2) - 3);
    }
    @($value = $value2 . $value);
    if ($valuein > 0) {
        return '<b><font color="green">+' . $value . '</font></b>';
    } elseif ($valuein < 0) {
        return '<font color="red">' . $value . '</font>';
    } else {
        return $value;
    }
}
if (empty($type)) {
    $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`,   (`a`.`experience` - `b`.`exphist_lastexp`)  AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id`  WHERE `a`.`group_id` < 2 ORDER BY `expdiff` DESC LIMIT ' . $limit);
} elseif ($type >= 1 && $type <= 3) {
    $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id`  WHERE `a`.`group_id` < 2 ORDER BY `exphist' . (int) $type . '` DESC LIMIT ' . $limit);
}
echo '<CENTER><H2>Ranking of powergamers</H2></CENTER>
<BR>
<table class="table table-striped">
		<td><center><b>#</b></center></td>
		<td><b>Name</b></td>';
echo '<td><center>Total</center></td>';
for ($i = 3; $i >= 2; $i--) {
    echo $type == $i ? '<TD id="selectedP" width="16%"><a href="powergamers.php?type=' . $i . '">' . $i . '<b> Days Ago</b></a></B></TD>' : '<TD width="16%"><center><a href="powergamers.php?type=' . $i . '">' . $i . ' Days Ago</a></TD>';
}
echo $type == 1 ? '<TD id="selectedP" width="16%"><b><a href="powergamers.php?type=1">1 Day Ago</a></B></TD>' : '<TD width="16%"><a href="powergamers.php?type=1">1 Day Ago</a></TD>';
echo empty($type) ? '<TD id="selectedP"><b><a href="powergamers.php">Today</a></b></TD>' : '<TD><a href="powergamers.php">Today</a></TD>';
echo '</TR>';
$number_of_rows = 1;
if ($znotePlayers) {