vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Lottery Addon For The Store Hack (https://vborg.vbsupport.ru/showthread.php?t=40056)

Lesane 06-18-2002 10:00 PM

Lottery Addon For The Store Hack
 
Info:
This addon for the store hack gives you the ability to add a Lottery on your store. A lottery with the same principles as a normal lottery. Users buy a lottery ticket in the store and after the specified enddate you or any other admin execute the lottery script in the admincp wich search for a random user from the database and checks if the user bought a ticket and if so then he will receive the jackpot if not then the lottery stays online.

The jackpot will be increased with the amount of the lottery ticket everytime when a new member buy's a ticket.

What to do:
2 Query's: 1 new table, 1 new row.
3 File Edit's: Admin/Index.php, Store.php & Storeadmin.php
1 Template Edit: Store_bit
2 New Templates: store_lottery_error & store_lottery_updated

Some Features:
- A new action on the store: Lottery
- Winner will be picked randomly
- Winner will be pm'ed with a winner's message
- Losers will be pm'ed with a loser's message
- Define Start Date of the lottery
- Define End Date of the lottery
- Define title of the lottery
- Define the amount of a ticket
- Maximum of 1 Ticket Per User
- And more....

This lottery addon will only work with the latest version of the store hack and is compatible with any Vbulletin 2.*.* version.

Have fun with the addon,
Lesane.

Lovaboye 06-19-2002 09:36 PM

word? can wait to install this!

Velocd 06-19-2002 09:40 PM

Another excellent hack from another excellent coder. Great job Lesane ;)

inetd 06-19-2002 09:41 PM

AAA!
I install small time later :)

squawell 06-19-2002 09:56 PM

Lesane another excellent hack u did......

great job.... i like!!:D:D:D:D

BigJohnson 06-19-2002 10:02 PM

Very amazing. I love you Lesane.

Lovaboye 06-19-2002 10:10 PM

were in the store does this show up? we need a pic

ZiRu$ 06-19-2002 10:16 PM

dope man.......can't wait on your Betting Hack now :)

Lovaboye 06-19-2002 10:38 PM

never mind its cool, but if we wanted to change the ammount of tickets a person can buy what do we change?

TalkHardRandy 06-19-2002 10:44 PM

SWEET!!!!

Itworx4me 06-19-2002 11:13 PM

This Query doesn't work:
INSERT INTO store VALUES (NULL, 'lottery', 'Buy A Ticket For The Lottery Entitled: ', '20', '0', 'lottery.gif', 'Buy a lottery ticket and hope that you will win the jackpot.', 'N','0');

Get this error when applying to database:
SQL-query :

INSERT INTO store VALUES (NULL, 'lottery', 'Buy A Ticket For The Lottery Entitled: ', '20', '0', 'lottery.gif', 'Buy a lottery ticket and hope that you will win the jackpot.', 'N','0')

MySQL said:

Column count doesn't match value count at row 1

inetd 06-20-2002 12:44 AM

Good work, Lesane :)
Please release Gambling add-on and You will be the God of HACKS! :)

BigJohnson 06-20-2002 01:20 AM

Yes gambling addon on seems to be so amazing and i was dying for that one as well. I will kill anyone for that one. You are already god. You are simply amazing.

Velocd 06-20-2002 01:27 AM

Thats some power you got there Lesane, they're starting to refer to you as "GOD" ;)

Neo 06-20-2002 02:22 AM

Oo There will never be unique rpg forum will there?

Velocd 06-20-2002 02:26 AM

This isn't really an RPG hack, but to answer your question anyway--no, 'fraid not :(

Erwin 06-20-2002 02:40 AM

Lesane is very generous to release his hacks. I applaud him - he deserves all the accolades he gets.

Peace 06-20-2002 02:50 AM

I'm getting errors and the "lottery Option" link/Page in the AdminCP can't be found. I followed the directions carefully. Help me solve these problems.







Parse error: parse error in /home/www/theonlinelounge/forums/store.php3 on line 2

Parse error: parse error in /home/www/theonlinelounge/forums/admin/storeadmin.php3 on line 3



When I click on "Lottery Options" in the AdminCP, I get this error

The page cannot be found


LightBringer 06-20-2002 03:21 AM

Hey Lesane... Great hack.

For some feedback, I'd like to let you know that a small bug is found with the "starting Jackpot" count.

I started the count with 5000 and then bought one ticket.

Since I was the only user that bought it...I won.

Well..I was awarded the cost of the ticket...not the cost of the ticket + the starting Jackpot

My understanding was the inital jackpot count would be given...if this is incorrect..please let me know.

Thanks.

bandersen 06-20-2002 10:42 AM

Installing.... thanks Lesane!!

Peace 06-20-2002 11:44 AM

Quote:

Originally posted by Peace
I'm getting errors and the "lottery Option" link/Page in the AdminCP can't be found. I followed the directions carefully. Help me solve these problems.


Parse error: parse error in /home/www/theonlinelounge/forums/store.php3 on line 2

Parse error: parse error in /home/www/theonlinelounge/forums/admin/storeadmin.php3 on line 3



When I click on "Lottery Options" in the AdminCP, I get this error

The page cannot be found



Hi, Lesane, can I get some help with these errors? Thanks.

Lesane 06-20-2002 11:55 AM

Quote:

Originally posted by LightBringer
Hey Lesane... Great hack.

For some feedback, I'd like to let you know that a small bug is found with the "starting Jackpot" count.

I started the count with 5000 and then bought one ticket.

Since I was the only user that bought it...I won.

Well..I was awarded the cost of the ticket...not the cost of the ticket + the starting Jackpot

My understanding was the inital jackpot count would be given...if this is incorrect..please let me know.

Thanks.

Ieek, didn't thought about the starting jackpot amount.

Here is the fix, open admin/storeadmin.php and find:

PHP Code:

$totalp $DB_site->query_first("SELECT COUNT(userid) AS usert FROM storelottery WHERE lotnumber=2");
$usertotaal number_format($totalp[usert]);
        
$kutje=$usertotaal*$costt

And Replace It With:

PHP Code:

$jack=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber=1");
$kutje=$jack[jackpot]; 

Thanks for letting me know, Txt file in 1st post is updated.

Lesane 06-20-2002 12:00 PM

Quote:

Originally posted by Lovaboye
never mind its cool, but if we wanted to change the ammount of tickets a person can buy what do we change?
It's made so that an user can buy 1 ticket per lottery. There is no purpose for buying more tickets since it takes a random user from the user table and the winner will only get rewarded once. The only difference is that when someone bought more tickets, for example 3, the he will be pm'ed 3 times.

Lesane 06-20-2002 12:03 PM

Quote:

Originally posted by Itworx4me
This Query doesn't work:
INSERT INTO store VALUES (NULL, 'lottery', 'Buy A Ticket For The Lottery Entitled: ', '20', '0', 'lottery.gif', 'Buy a lottery ticket and hope that you will win the jackpot.', 'N','0');

Get this error when applying to database:
SQL-query :

INSERT INTO store VALUES (NULL, 'lottery', 'Buy A Ticket For The Lottery Entitled: ', '20', '0', 'lottery.gif', 'Buy a lottery ticket and hope that you will win the jackpot.', 'N','0')

MySQL said:


Column count doesn't match value count at row 1

I suggest you to upgrade to the latest store version ;)

Meanwhile, use this query:

PHP Code:

INSERT INTO store VALUES (NULL'lottery''Buy A Ticket For The Lottery Entitled: ''20''0''lottery.gif''Buy a lottery ticket and hope that you will win the jackpot.''N'


Lesane 06-20-2002 12:09 PM

Quote:

Originally posted by Peace
I'm getting errors and the "lottery Option" link/Page in the AdminCP can't be found. I followed the directions carefully. Help me solve these problems.

Parse error: parse error in /home/www/theonlinelounge/forums/store.php3 on line 2

Parse error: parse error in /home/www/theonlinelounge/forums/admin/storeadmin.php3 on line 3



When I click on "Lottery Options" in the AdminCP, I get this error

The page cannot be found


That's because you are using a .php3 version.

Open admin/index.php and find:

PHP Code:

makenavoption("Lottery Options","storeadmin.php?action=lottery"); 

And change it to:

PHP Code:

makenavoption("Lottery Options","storeadmin.php3?action=lottery"); 


Lesane 06-20-2002 12:13 PM

Thanks everyone for the feedback. Thumbsup.

Peace 06-20-2002 12:21 PM

Thanks

Lesane, I did that and I'm still getting these errors

Parse error: parse error in /home/www/theonlinelounge/forums/admin/storeadmin.php3 on line 3


Parse error: parse error in /home/www/theonlinelounge/forums/store.php3 on line 2



Can you identify line 3 in storeadmin and line 2 in store and give me examples of the correct code and I'll compare it to the codes in those files? Maybe I'm missing something.

LightBringer 06-20-2002 02:14 PM

Lesane, thanks for the starting jackpot fix! :) Works like a champ now.

N9ne 06-20-2002 03:11 PM

YAY! IT'S FINALLY OUT! OMG **INSTALLS!**

hacker of the lifetime: Lesane!!

BigJohnson 06-20-2002 04:09 PM

Could there be a area in someones profile that will say how many bought tickets and how many wins that user has. That would be pretty cool.

Alfo 06-20-2002 04:24 PM

GReat Hack Lesane.

Thanks again

trainer 06-20-2002 04:40 PM

ok have a question... my site has over 10k members and about 1/2 are not active. is there a way to pick a winny out of the tickets sold rather then from all the members. couple be weeks before someone wins.

also how does this stop people from creating bogus accounts just to buy another ticket?

great idea just thinking aloud...

-=Sniper=- 06-20-2002 08:51 PM

ok this is a great hack, will be using it in the near future!
would it not be better to create another table, which contains all the people who enter, so a user may get multiple entrys into the lottery! simply his user name will go into the table, and the script will choose, that way the more tickets a users buys the more chance he/she has off wining!

also I have another idea, a bit like the above but instead it would be like entrying points to win a DVD, A Game, or something! you can create your own prize, where people enter their points to win stuff...

thanks for the great hack!

ULTIMATESSJ 06-20-2002 09:16 PM

whenever i try to buy a lottery ticket it always says this

Invalid SQL: UPDATE store SET quantity=quantity-1 WHERE id=10
mysql error: Unknown column 'quantity' in 'field list'

mysql error number: 1054

Date: Thursday 20th of June 2002 06:10:37 PM
Script: http://www.animexplosion.com/forums/forums/store.php
Referer: http://www.animexplosion.com/forums/...action=lottery

Peace 06-20-2002 09:29 PM

Lesane, I fixed the error problems. Thanks for the nice hack and your help.

Itworx4me 06-20-2002 11:17 PM

My start dates are set wrong. Like in 1969. The money in the Jackpot don't show up either. How do I fix this?

Peace 06-20-2002 11:32 PM

Lesane, a question, what's the postbit or link code for "richest" person? I want to display the "richest person" on my forum home.

MrBojangle1 06-21-2002 03:09 AM

well I am also having probs even with the new sql query code

CHoooo 06-21-2002 03:12 AM

Like they said before "God of Hacks" :D

Limpkinw 06-21-2002 05:51 AM

Great hack!

Question...

When the lottery is ended is there a way to reset the tickets purchased so the ones in the previous Lotto have to buy again?

Hopefully I am clear about what I mean... Just tring to keep it interesting for the people "in" cause if for exp. it takes a month for anyone to win they won't be able to participate for a month


All times are GMT. The time now is 04:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01391 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete