• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior ACC]Lottery Winers

Meferot

New Member
Joined
Jan 28, 2008
Messages
57
Reaction score
1
It's for http://otland.net/f82/lottery-system-v2-45937/

Create file lottery.php and paste:

PHP:
<?PHP
$main_content .= '<center><h1>Lottery</h1><h3>Lotterys held at 9:00, 14:00, 19:00 and 24:00 hour, polish time.</h3></center><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Player Name</b></center></td><td CLASS=white width=184 colspan=2><center><b>Winning Item</b></center></td><td width=100 CLASS=white><center><b>World</b></center></td></tr>';
$lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC;');
foreach($lottery as $result) {
 $players++;
            if(is_int($players / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];

$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a></center></td><TD WIDTH=5%><img src=\'/images/'.urlencode($result['item']).'.gif\'></td><TD WIDTH=30%><b>'.$result['item'].'</b></td><TD WIDTH=30%><center>Norah World</center></td></tr>';
}
$main_content .= '</table>';
?>

Open index.php and under:

Code:
	case "latestnews":
		$topic = "Latest News";
		$subtopic = "latestnews";
		include("latestnews.php");
	break;

Paste:

Code:
	case "lottery";
		$subtopic = "lottery";
		$topic = "Lottery";
		include("lottery.php");
	break;

Preview:

lottery.jpg
 
You gotta add all items in /htdocs/images/
example:
terra hood.gif

I think everyone's item names are the ids of the item like 1234.gif
 
If you use Windows import images to folder: htdocs/images/ and on linux: /var/www/images/

Name of images must look like:

crown+armor.gif
 
i got that error :/

'; $lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC;'); foreach($lottery as $result) { $players++; if(is_int($players / 2)) $bgcolor = $config['site']['lightborder']; else $bgcolor = $config['site']['darkborder']; $main_content .= ''; } $main_content .= '
 
I have problem:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\lottery.php on line 4

My lottery.php is like yours:
PHP:
<?PHP
$main_content .= '<center><h1>Lottery</h1><h3>Lotterys held at 9:00, 14:00, 19:00 and 24:00 hour, polish time.</h3></center><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Player Name</b></center></td><td CLASS=white width=184 colspan=2><center><b>Winning Item</b></center></td><td width=100 CLASS=white><center><b>World</b></center></td></tr>';
$lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC;');
foreach($lottery as $result) {
$players++;
            if(is_int($players / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];

$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a></center></td><TD WIDTH=5%><img src=\'/images/'.urlencode($result['item']).'.gif\'></td><TD WIDTH=30%><b>'.$result['item'].'</b></td><TD WIDTH=30%><center>Norah World</center></td></tr>';
}
$main_content .= '</table>';
?>

I have that error in header of account maker.
But i can see table ( player name, winning name, etc)

Also i would like to ask if I have to paste some scripts into my OTS folder (movements or something else) or it will give items to players without that?
Thanks in adventage

 
Back
Top