This is a Lottry page for Modern Aac grounded on http://otland.net/f82/lottery-system-v2-45937/ .
How to include the page?
Go to this page http://127.0.0.1/index.php/admin/createPage
input there the code
And then you can add it into the menu in index.tpl
For the SQL Querys look at the original topic.
Regards
How to include the page?
Go to this page http://127.0.0.1/index.php/admin/createPage
input there the code
Code:
<?PHP
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC LIMIT 1;');
foreach($lottery as $result) {
ECHO '
<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
<tr bgcolor="#eeddb9" style="color: red;"><th width="100%"><center>Lottry</center></th></tr>
<tr><td><center>Every X hours we will choose one player who will win random item!</tr></td>
<tr><td><center>Last Winner on '.$config['server_name'].' is <b><a href="'.WEBSITE.'/index.php/character/view/'.urlencode($result['name']).'">'.$result['name'].'</a></b> won <i>'.$result['item'].'</i> Congratulations!</tr></td>
</td></table>';
}
$lottery2 = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 1 ORDER BY id DESC LIMIT 1;');
foreach($lottery2 as $result) {
ECHO '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
<tr><td><center>Last Winner on World1: <a href="/index.php/character/view/'.urlencode($result['name']).'">'.$result['name'].'</a> won <i>'.$result['item'].'</i> Congratulations!</center></tr></td>';
ECHO '</table><br />';
}
?>
And then you can add it into the menu in index.tpl
For the SQL Querys look at the original topic.
Regards