Previous Thread
Next Thread
Print Thread
Rate Thread
#247508 05/23/2003 4:50 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
I'm sure this could be applied to any site.. so hopefully someone can find time to hammer this one out.

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.

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.

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.

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?

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.

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.

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.

So.. anyone else want something like this or up to the challenge of coding it?

Sponsored Links
palmen #247509 05/23/2003 5:57 PM
Joined: Apr 2002
Posts: 610
Code Monkey
Code Monkey
Joined: Apr 2002
Posts: 610
event-handler.com has pretty sweet contest software that you can integrate with your mysql db. I have it on my site but it isn't running right now. Anyway, it works VERY well and you can do tons of different kinds of contests, surveys, etc. with it.

just fyi, hope that helps

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Hey, thanks for the info. If there was something that already existed.. that would be great. Would be a lot easier to just tweak a login or something rather than whip it up from scratch

palmen #247511 05/23/2003 9:59 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I have a paypal donation script on my site which checks that you have actually paid money with paypal. It's not to hard to hack that script to automate the amount to be payed and add a function to add "tickets" according to how they actually payed.

I'm not sure when I will be able to finish this script though, but if you want it I might try to finish it sooner.

c0bra #247512 05/24/2003 6:41 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
regarding the event-handler.com script...

unfortunately it falls victim to what a lot of programs do... the "Skilled at many, master of none". It can do a lot of great things.. but the things it does could be improved on for what I need it for.

So I think making something custom would yield a better result.. not only for integrating with threads stylesheets and such.. but just keeping it simple and only doing what it needs to

Sponsored Links
palmen #247513 05/24/2003 7:15 PM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Gardner,

I would be interested in seeing what you did. I have a system in place where people can donate to the site and have a tag added to their profile (appears under title) - "Silver Sponsor", "Gold Sponsor", "Platinum Sponsor" and "Diamond Sponsor". Each with a dollar amount - the more you contribute the better your rating.

I've been thinking it would be nice to automate this and keep track of a users contributions. If they give more, then the script could automatically update the users status. Right now I do the updates manually by adding a user number to an array.

I did some PayPal stuff a while back that took the call from PayPal and verified a payment - is that what you are using? Would be interested in looking at it (even if rough, I'm comfortable with code that I dont need instructions).

By the way - this system has been GREAT for getting contributions from my users. Over $1000 was donated in the first week as people were competing for the top titles! (Diamond level is $200 or more!)

We also do a monthly giveaway - last month it was a Sumsung 191t flat panel and ATI 9700 PRO video card. We dont raffle them off - instead we draw a random name from the pool of registered users who have at least 25 posts to their credit and posted at least once during the month. Each name only gets one shot to avoid post whoring. Next month we are giving away a Canon S50 digital camera and HP printer!

gailg #247514 05/24/2003 8:19 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Since the script isn't finished and doesn't contain any documentation I don't want to release it to all yet. I'll be happy to send it to you though, it is working at my setup for what I want it to do. It doesn't use different amounts yet, but it's an easy change.

palmen #247515 05/24/2003 9:43 PM
Joined: Jul 2001
Posts: 442
Enthusiast
Enthusiast
Offline
Joined: Jul 2001
Posts: 442
Jeremy, a raffle would be a great idea for our type of site, but when I checked into it a few months ago I found out that raffles are illegal unless you are some kind of non-profit org etc. something you might want to check into with your state first.

bisbell #247516 05/24/2003 9:57 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
becoming a registered non-profit or even for-profit org wouldn't be a problem We have had raffles at events in the past... but never in an online situation. But you are right, there are legalities involved.

palmen #247517 11/22/2003 5:12 PM
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Its been a long time since anyone has posted to this thread, but i searched for this topic and here it is!

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...

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....

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...

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)...

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...

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.

Deejay

Sponsored Links
darenu #247518 11/22/2003 5:18 PM
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Actually I would just be happy to finmd a nice little game like family fued or something that a few can play online to compete agaibnts one another.. heck even a game with a saved highscores table.. seen a few of those but never able to track to original owner to see what it costs...

234234 #247519 11/22/2003 5:49 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I have a heavily modified version of the Killmonster game (found somewhere on the net) which makes use of the threads user table. It is a very simple script where you attack monsters by selecting them from a dropdown list and it is randomized if you win or loose and you get som experience points depending on how hard the monster was. It is also possible to kill other users and gain a percentage of their experience points. The looks isn't integrated into threads, but that shouldn't be too hard as I use a similiar template method as threads do.

The admin can set up all the monsters themselves and decide the toughness and experience points gained when they are killed.

Not very family oriented, I know, but still a bit of fun. =]

c0bra #247520 11/22/2003 8:21 PM
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Providing games for members is easy. But I am talking about an actual raffle for prizes. A draw... Like what the inital posters in this thread were talking about...

Like putting donating users or paid membership users into a hat, and picking one winner each month for a free t-shirt or something like that....

Deej

darenu #247521 11/22/2003 8:26 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Have all who are to be in the contest in a group and run this query to get a random user selected from those.

SELECT U_Username FROM w3t_Users WHERE U_Groups LIKE '%-8-%' ORDER BY RAND() LIMIT 1

c0bra #247522 11/23/2003 2:45 AM
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
hey this is cool hahaha

Im not much of a programmer so forive the green question, but how would the query look if you wanted it to pick one person out of three different groups? (Not one person for EACH group.... Just one person total. thats it)

Like so?????

SELECT U_Username FROM w3t_Users WHERE U_Groups LIKE '%-5-%' '%-6-%' '%-7-%'ORDER BY RAND() LIMIT 1

darenu #247523 11/23/2003 2:30 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
It should probably look like this:

SELECT U_Username FROM w3t_Users WHERE U_Groups LIKE '%-5-%' OR U_Groups LIKE '%-6-%' OR U_Groups LIKE '%-7-%' ORDER BY RAND() LIMIT 1

c0bra #247524 11/23/2003 4:08 PM
Joined: Aug 2002
Posts: 100
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 100
Awesome... Thanks!

Deej

darenu #247525 11/24/2003 9:03 AM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
One thing to consider - we only allow people who participated in the past 30 days to be eligible. Since we have 1,000 members and only 300-400 are active in any given month it benefits those who are actually using the board.

gailg #247526 11/24/2003 9:29 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Well adding something like this to the query would specify that

AND U_Laston > UNIX_TIMESTAMP( DATE_SUB(CURDATE(), INTERVAL 1 MONTH) )

But yes a box to allow the admin to select what variables to select might be better and alot more flexible.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Yeah, now that we've worked out the query, maybe someone could whip up a script to run it?

c0bra #247528 11/24/2003 1:04 PM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
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).

Code
<?<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 />?>


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.

gailg #247529 11/24/2003 1:40 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
[]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. [/]

Neat PP, do you mind posting the other scripts (are there 2 more?) and telling us where you apply the code?

BlarC #247530 11/24/2003 3:58 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
holy crap, 6 months later and this post comes out of nowhere

palmen #247531 11/24/2003 4:20 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I just rewrote it to include a selection interface. Will post shortly

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Cool!

BlarC #247533 11/24/2003 5:16 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266

Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
contest2.php looks like:

Code
<? <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 />


and the one that picks the winner is contest3.php:

Code
<? <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 />


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!).

Chuck will tell you - I write a ton of this stuff but hate documenting it. lol


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)