[BETA] Lottery Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
scoobie
Registered User
Posts: 237
Joined: Sun May 12, 2002 6:07 pm

Post by scoobie »

I did this

Code: Select all

Open lottery.php
------------------
FIND
-----
//end time checks

AFTER ADD
---------
$sql = "select * from phpbb_lottery where id>0";
		if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting Total Lottery Entries!'); }
	$lotteryentries = mysql_num_rows($result);
	$pool = $board_config['lottery_base'];
	$poola = $lotteryentries * $board_config['lottery_cost'];
	$pool = $pool + $poola;

-------
FIND
-------
<tr>
<td class="row2"><span class="gen">Time Until Drawn</span></td>
<td class="row2"><span class="gen">'.$lottime.'</span></td>
</tr>

------
AFTER ADD
------
<tr>
<td class="row2"><span class="gen">Entries So Far</span></td>
<td class="row2"><span class="gen">'.$lotteryentries.' entries</span></td>
</tr>
<tr>
<td class="row2"><span class="gen">Total Up For Grabs</span></td>
<td class="row2"><span class="gen">'.$pool.' '.$board_config['points_name'].'</span></td>
</tr>
You can have it all if you like... but you can pay for it the rest of your life.

User avatar
Serial^Killer
Registered User
Posts: 22
Joined: Wed Mar 12, 2003 8:25 pm

Post by Serial^Killer »

tks :)

The 1st lottery didn't work well as i said but after the 1st it was ok :)

beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »



I like it, works good !!
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede »

wonderful! I cant thank you enough for sharing :)

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede »

hehe seems to me that if I enter the lottery i win - is that possibly because its the sites admin account?

User avatar
RMS
Registered User
Posts: 517
Joined: Sun Apr 21, 2002 1:53 am
Location: I'm not sure

Post by RMS »

...so is there no way for anyone to really know who won, except to constantly check how much they have?
This is my signature.

User avatar
Serial^Killer
Registered User
Posts: 22
Joined: Wed Mar 12, 2003 8:25 pm

Post by Serial^Killer »

My problem is that when is just one guy buying tickets that guy win's but when 2 or more buy the lottery money goes to Member Nº 1 that isn't nobody (no mail or name)...

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede »

RMS wrote: ...so is there no way for anyone to really know who won, except to constantly check how much they have?


you can set Lottery Status to on - that says who won [as long as the lottery is set to redo.. as if not folks get a 'Sorry lottery is closed' sign]

I noted the same lack of winner with multiple ticket buying - I didnt check to see if it was going to member 1 [that's anonymous right?]. I love this mod - and am just setting tickets to be single purchase ATM. If anyone does come up with an idea whats happening there please share lol :) till then it's hardly a show-stopper :) Anything that gives points a little more substance is all good in my opinion - so thanks again Zarath for sharing :)

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath »

* requires : 2.0.0+ phpbb & points mod & PHP 4.2.0+


Are you sure your webservers are using php 4.2.0 or higher? It being lower would probably cause the randomizer to stuff up when picking the winner and end up doing what you seem to be having a problem with.

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede »

im running latest here Zarath. In fact I often have to fix LC quotes and stuff as its deprecated now :)

Threatcon
Registered User
Posts: 131
Joined: Tue Dec 10, 2002 5:38 am
Location: Florida
Contact:

Post by Threatcon »

This is a nice touch to your mod Zarath! You should incorporate this into your mod! 8) (see quote)

By the way, good job! Installed and working good so far, 3 more days till a winner is drawn and I'll tell you what happens! LOL Hopefully I WIN! I gave out 500 points to 3 of my forums users to register for the lottery and give it a shot. I know I can change the pay-out time to a smaller number, but just checking it out. I'm in no big hurry to win anything. Just love the mod and it's concept! NICE WORK! :D
scoobie wrote: I did this

Code: Select all

Open lottery.php
------------------
FIND
-----
//end time checks

AFTER ADD
---------
$sql = "select * from phpbb_lottery where id>0";
		if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting Total Lottery Entries!'); }
	$lotteryentries = mysql_num_rows($result);
	$pool = $board_config['lottery_base'];
	$poola = $lotteryentries * $board_config['lottery_cost'];
	$pool = $pool + $poola;

-------
FIND
-------
<tr>
<td class="row2"><span class="gen">Time Until Drawn</span></td>
<td class="row2"><span class="gen">'.$lottime.'</span></td>
</tr>

------
AFTER ADD
------
<tr>
<td class="row2"><span class="gen">Entries So Far</span></td>
<td class="row2"><span class="gen">'.$lotteryentries.' entries</span></td>
</tr>
<tr>
<td class="row2"><span class="gen">Total Up For Grabs</span></td>
<td class="row2"><span class="gen">'.$pool.' '.$board_config['points_name'].'</span></td>
</tr>

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

This mod does rock.

Zareth is a genious.

User avatar
Serial^Killer
Registered User
Posts: 22
Joined: Wed Mar 12, 2003 8:25 pm

Post by Serial^Killer »

Serial^Killer wrote: My problem is that when is just one guy buying tickets that guy win's but when 2 or more buy the lottery money goes to Member Nº 1 that isn't nobody (no mail or name)...


Does anyone knows what this problem is?

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath »

What version of PHP is your webserver running?

User avatar
Serial^Killer
Registered User
Posts: 22
Joined: Wed Mar 12, 2003 8:25 pm

Post by Serial^Killer »

4.3.1 i think...

Locked

Return to “[2.0.x] MODs in Development”