php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#247508 - 05/23/03 04:50 PM ** Raffle Mod **
msula Offline
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
#247509 - 05/23/03 05:57 PM Re: ** Raffle Mod ** [Re: palmen]
shortbus Offline
Code Monkey

Registered: 04/19/02
Posts: 631
Loc: Enid, Oklahoma
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.<br /><br />just fyi, hope that helps

Top
#247510 - 05/23/03 08:31 PM Re: ** Raffle Mod ** [Re: wilstephens]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
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 <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#247511 - 05/23/03 09:59 PM Re: ** Raffle Mod ** [Re: palmen]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
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.<br /><br />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.
_________________________
/Gardener | Complete list of my mods

Top
#247512 - 05/24/03 06:41 PM Re: ** Raffle Mod ** [Re: c0bra]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
regarding the event-handler.com script...<br /><br />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.<br /><br />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 <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#247513 - 05/24/03 07:15 PM Re: ** Raffle Mod ** [Re: palmen]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Gardner, <br /> <br />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. <br /> <br />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. <br /> <br />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). <br /> <br />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!) <br /> <br />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!
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#247514 - 05/24/03 08:19 PM Re: ** Raffle Mod ** [Re: gailg]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
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.
_________________________
/Gardener | Complete list of my mods

Top
#247515 - 05/24/03 09:43 PM Re: ** Raffle Mod ** [Re: palmen]
coloradok5 Offline
Enthusiast

Registered: 07/11/01
Posts: 462
Loc: Colorado
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. <img src="/forum/images/graemlins/crazy.gif" alt="" />

Top
#247516 - 05/24/03 09:57 PM Re: ** Raffle Mod ** [Re: bisbell]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
becoming a registered non-profit or even for-profit org wouldn't be a problem <img src="/forum/images/graemlins/smile.gif" alt="" /> We have had raffles at events in the past... but never in an online situation. But you are right, there are legalities involved.

Top
#247517 - 11/22/03 04:12 PM Re: ** Raffle Mod ** [Re: palmen]
Deejay_dup1 Offline
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
#247518 - 11/22/03 04:18 PM Re: ** Raffle Mod ** [Re: darenu]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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...

Top
#247519 - 11/22/03 04:49 PM Re: ** Raffle Mod ** [Re: 234234]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
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.<br /><br />The admin can set up all the monsters themselves and decide the toughness and experience points gained when they are killed.<br /><br />Not very family oriented, I know, but still a bit of fun. =]
_________________________
/Gardener | Complete list of my mods

Top
#247520 - 11/22/03 07:21 PM Re: ** Raffle Mod ** [Re: c0bra]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
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...<br /><br />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....<br /><br />Deej

Top
#247521 - 11/22/03 07:26 PM Re: ** Raffle Mod ** [Re: darenu]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
Have all who are to be in the contest in a group and run this query to get a random user selected from those.<br /><br />SELECT U_Username FROM w3t_Users WHERE U_Groups LIKE '%-8-%' ORDER BY RAND() LIMIT 1
_________________________
/Gardener | Complete list of my mods

Top
#247522 - 11/23/03 01:45 AM Re: ** Raffle Mod ** [Re: c0bra]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
hey this is cool hahaha <br /> <br />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) <br /> <br />Like so????? <br /> <br />SELECT U_Username FROM w3t_Users WHERE U_Groups LIKE '%-5-%' '%-6-%' '%-7-%'ORDER BY RAND() LIMIT 1 <br />

Top
#247523 - 11/23/03 01:30 PM Re: ** Raffle Mod ** [Re: darenu]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
It should probably look like this:<br /><br />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
_________________________
/Gardener | Complete list of my mods

Top
#247524 - 11/23/03 03:08 PM Re: ** Raffle Mod ** [Re: c0bra]
Deejay_dup1 Offline
Journeyman

Registered: 08/25/02
Posts: 106
Awesome... Thanks!<br /><br />Deej

Top
#247525 - 11/24/03 08:03 AM Re: ** Raffle Mod ** [Re: darenu]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
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.
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#247526 - 11/24/03 08:29 AM Re: ** Raffle Mod ** [Re: gailg]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Well adding something like this to the query would specify that <br /> <br /> AND U_Laston > UNIX_TIMESTAMP( DATE_SUB(CURDATE(), INTERVAL 1 MONTH) ) <br /> <br />But yes a box to allow the admin to select what variables to select might be better <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> and alot more flexible.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#247527 - 11/24/03 10:15 AM Re: ** Raffle Mod ** [Re: sf49rminer]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1966
Loc: Sweden, Stockholm
Yeah, now that we've worked out the query, maybe someone could whip up a script to run it?
_________________________
/Gardener | Complete list of my mods

Top
#247528 - 11/24/03 12:04 PM Re: ** Raffle Mod ** [Re: c0bra]
PhotoPost Offline
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 />
Code:
&lt;?<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)) &lt; 8 AND MONTH(FROM_UNIXTIME(u.U_LastOn)) &gt; 7";<br />    $sth = $dbh -&gt; do_query($query);<br /><br />    $totalusers = $dbh -&gt; total_rows($sth);<br />    <br />    print "&lt;body&gt;&lt;font size=\"1\" face=\"MS Sans Serif, Geneva\"&gt;";<br />    print "There were " . number_format($totalusers) . " total posts made during July&lt;br&gt;";<br />    $entries=array();<br />    <br />    for( $x=0; $x &lt; $totalusers; $x++ ) {<br />        list ($PosterId,$totalposts,$number,$username) = $dbh -&gt; fetch_array($sth);<br />        // Excluded members are me and Administrator<br />        if ( $PosterId != 2 &amp;&amp; $PosterId != 3 &amp;&amp; $totalposts &gt; 75 ) $entries[$PosterId] = $username;<br />    }<br />    <br />    print "The number of members eligable for this drawing is: " . count($entries) . "&lt;br&gt;&lt;br&gt;";<br /><br />    $winners = array();    <br />    for ( $x = 1; $x &lt; 11; $x++ ) {<br />        $winner = array_rand($entries);<br />        if ( in_array($winner, $winners) ) {<br />            $x--;<br />        }<br />        else {<br />            print "Pick #$x: &lt;font size=\"5\"&gt;&lt;b&gt;" . $entries[$winner] . "&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;";<br />            $winners[] = $winner;<br />        }<br />    }<br />    <br />    print "&lt;/font&gt;&lt;/body&gt;";<br />?&gt;
<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.
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#247529 - 11/24/03 12:40 PM Re: ** Raffle Mod ** [Re: gailg]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
[]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. [/]<br /><br />Neat PP, do you mind posting the other scripts (are there 2 more?) and telling us where you apply the code?

Top
#247530 - 11/24/03 02:58 PM Re: ** Raffle Mod ** [Re: BlarC]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
holy crap, 6 months later and this post comes out of nowhere <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" />

Top
#247531 - 11/24/03 03:20 PM Re: ** Raffle Mod ** [Re: palmen]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
I just rewrote it to include a selection interface. Will post shortly <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#247532 - 11/24/03 03:34 PM Re: ** Raffle Mod ** [Re: sf49rminer]
ericgtr Offline
Junior Member

Registered: 05/12/03
Posts: 1109
Cool!

Top
#247533 - 11/24/03 04:16 PM Re: ** Raffle Mod ** [Re: BlarC]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#247534 - 11/24/03 04:36 PM Re: ** Raffle Mod ** [Re: sf49rminer]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
contest2.php looks like: <br /> <br />
Code:
&lt;? <br />    require ("./main.inc.php"); <br /> <br />    print "&lt;body&gt;&lt;font size=\"1\" face=\"MS Sans Serif, Geneva\"&gt;"; <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) . "&lt;br&gt;&lt;br&gt;"; <br /> <br />    $winners = array(); <br />    for ( $x = 1; $x &lt; 6; $x++ ) { <br />        $winner = array_rand($entries); <br />        if ( in_array($winner, $winners) ) { <br />            $x--; <br />        } <br />        else { <br />            print "Pick #$x: &lt;font size=\"5\"&gt;&lt;b&gt;" . $entries[$winner] . "&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;"; <br />            $winners[] = $winner; <br />        } <br />    } <br /> <br />    print "&lt;/font&gt;&lt;/body&gt;"; <br />?&gt; <br />
<br /> <br />and the one that picks the winner is contest3.php: <br /> <br />
Code:
&lt;? <br />    $entries = array("User1","User2","User3","User4","User5"); <br /> <br />    print "The number of members eligable for this drawing is: " . count($entries) . "&lt;br&gt;&lt;br&gt;"; <br />    print "The winner is: &lt;font size=\"5\"&gt;&lt;b&gt;" .  $entries[mt_rand(0,4)] . "&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;"; <br />?&gt; <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
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
Page 1 of 2 1 2 >



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks