 |
 |
 |
 |
#247508 - 05/23/03 04:50 PM
** Raffle Mod **
|
Addict
Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
|
I'm sure this could be applied to any site.. so hopefully someone can find time to hammer this one out. <br /> <br />What I want to do is hold online raffles once a month on our site. So essentially, this is what I want to do. Have a seperate page (doesn't have to be built into threads.. just need it to use some DB info). And on that page you can put a picture and type about the raffle and what the prize is and all that junk. <br /> <br />Then, have a small form on the bottom of the page where a user enters their full name and mailing address, the quantity of raffle tickets... then when they hit submit it forwards them a paypal address that you specify with the correct amount of money. <br /> <br />So for example, if someone wanted to buy 5 tickets and they are $1 a piece, when they hit submit, 5 virtual raffle tickets are credited towards their account, and they are forwarded to paypal to finish the purchase. <br /> <br />Then... have a very simple admin area of the raffle script where it tallys up all the entries.. hit a button, and spits out a winner (or more if you have more prizes). Fairly simple eh? <br /> <br /><img src="/forum/images/graemlins/laugh.gif" alt="" /> Ok, well.. that is a basic idea, although I did think of one glitch, and that is with the payment setup. What would could happen is people could submit the form for tickets.. which got entered, and then never pay via paypal. This would be bad, and would be easily exploited. <br /> <br />So my idea was when someone buys tickets, their tickets are flagged as pending approval. Then, when I see the paypal payment come in, I go to the raffle admin area and check them off as approved, so they are officially in the running. <br /> <br />I figure this would be an incredibly simple way to generate money for the site. For example we have 1600 members. If I purchased a 100 dollar Optima battery (which 90% of the users would want and use)... and charge $1 dollar per ticket, I know I could recoup the cost in a matter of hours most likely since most people will buy more th an 1 ticket. <br /> <br />So.. anyone else want something like this or up to the challenge of coding it? <img src="/forum/images/graemlins/smile.gif" alt="" />
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247517 - 11/22/03 04:12 PM
Re: ** Raffle Mod **
[Re: palmen]
|
Journeyman
Registered: 08/25/02
Posts: 106
|
Its been a long time since anyone has posted to this thread, but i searched for this topic and here it is! <br /><br />I too am thinking about something to this effect... While YES it may be illegal in certain areas to offer raffles for money, im pretty sure its not illegal to do it for free...<br /><br />I was thinking about how this could be done so that it would be legal, but also help benifit our websites... And came up with this idea....<br /><br />Those of us here who have "supporting members".. members who have dontated, or paid for memberships on our sites.. Espcially ones who have made hacks to our sites to give those users speecial groups with the little gifs next to their names etc... Those users are given special group numbers...<br /><br />If we could get a hack or software that when you would push (click) a button, it would pull the information (username and email address) of only those users with certain specified user groups, and put them into its own database listing... Then you could click another button, and it would draw a username, send them an email and post their name as a winner somewhere on the site (a-la sometime like the "there is # users in chat" header thingy)...<br /><br />I have seen some software http://www.yourphppro.com/ where he has a raffle script, and i have talked to this guy before about it... I am going to see if there is a way he can make his program simply retrieve the user info we want and do the raffle from that software... <br /><br />Doing it this way, you dont charge for a raffle. You simple reward those who have supported your website with donations or memberships. I dont think that would be illegal.<br /><br />Deejay
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247528 - 11/24/03 12:04 PM
Re: ** Raffle Mod **
[Re: c0bra]
|
Hacker
Registered: 02/03/02
Posts: 989
|
Well, here is mine - I've been using it for almost a year now. It looks for people who made at least 1 post during the month, have at least 75 posts (we give away big stuff - this month a 42" Plasma television, so want people who are posting and not lurking) and do not allow Banned users (or those with registered alter-egos).<br /><br /> <?<br /> require ("./main.inc.php");<br /><br /> $query = "SELECT b.B_PosterId,u.U_Totalposts,u.U_Number,u.U_Username FROM w3t_Posts b<br /> LEFT JOIN w3t_Users u ON u.U_Number=b.B_PosterId<br /> WHERE MONTH(FROM_UNIXTIME(b.B_Posted))=8 AND u.U_Status != 'Banned' AND u.U_Extra2 = ''<br /> AND MONTH(FROM_UNIXTIME(u.U_Registered)) < 8 AND MONTH(FROM_UNIXTIME(u.U_LastOn)) > 7";<br /> $sth = $dbh -> do_query($query);<br /><br /> $totalusers = $dbh -> total_rows($sth);<br /> <br /> print "<body><font size=\"1\" face=\"MS Sans Serif, Geneva\">";<br /> print "There were " . number_format($totalusers) . " total posts made during July<br>";<br /> $entries=array();<br /> <br /> for( $x=0; $x < $totalusers; $x++ ) {<br /> list ($PosterId,$totalposts,$number,$username) = $dbh -> fetch_array($sth);<br /> // Excluded members are me and Administrator<br /> if ( $PosterId != 2 && $PosterId != 3 && $totalposts > 75 ) $entries[$PosterId] = $username;<br /> }<br /> <br /> print "The number of members eligable for this drawing is: " . count($entries) . "<br><br>";<br /><br /> $winners = array(); <br /> for ( $x = 1; $x < 11; $x++ ) {<br /> $winner = array_rand($entries);<br /> if ( in_array($winner, $winners) ) {<br /> $x--;<br /> }<br /> else {<br /> print "Pick #$x: <font size=\"5\"><b>" . $entries[$winner] . "</b></font><br />";<br /> $winners[] = $winner;<br /> }<br /> }<br /> <br /> print "</font></body>";<br />?><br /><br />This generates 10 semi-finalists which are then fed into a second script which picks 3 random names and finally a winner. This is done over three days to make it more interesting.
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247532 - 11/24/03 03:34 PM
Re: ** Raffle Mod **
[Re: sf49rminer]
|
Junior Member
Registered: 05/12/03
Posts: 1109
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247533 - 11/24/03 04:16 PM
Re: ** Raffle Mod **
[Re: BlarC]
|
Member
Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247534 - 11/24/03 04:36 PM
Re: ** Raffle Mod **
[Re: sf49rminer]
|
Hacker
Registered: 02/03/02
Posts: 989
|
contest2.php looks like: <br /> <br /> <? <br /> require ("./main.inc.php"); <br /> <br /> print "<body><font size=\"1\" face=\"MS Sans Serif, Geneva\">"; <br />$entries = array("User1","User2","User3","User4","User5","User6","User7","User8","User9","User10"); <br /> <br /> print "The number of members eligable for this drawing is: " . count($entries) . "<br><br>"; <br /> <br /> $winners = array(); <br /> for ( $x = 1; $x < 6; $x++ ) { <br /> $winner = array_rand($entries); <br /> if ( in_array($winner, $winners) ) { <br /> $x--; <br /> } <br /> else { <br /> print "Pick #$x: <font size=\"5\"><b>" . $entries[$winner] . "</b></font><br />"; <br /> $winners[] = $winner; <br /> } <br /> } <br /> <br /> print "</font></body>"; <br />?> <br /> <br /> <br />and the one that picks the winner is contest3.php: <br /> <br /> <? <br /> $entries = array("User1","User2","User3","User4","User5"); <br /> <br /> print "The number of members eligable for this drawing is: " . count($entries) . "<br><br>"; <br /> print "The winner is: <font size=\"5\"><b>" . $entries[mt_rand(0,4)] . "</b></font><br />"; <br />?> <br /> <br /> <br />These two are a little manual in that you update the arrays; but it does provide a level of randomness which is good. Like I said, I've been running this for a year now and giving away some great prizes (next month is a 42" Plasma television!). <br /> <br />Chuck will tell you - I write a ton of this stuff but hate documenting it. lol
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|