Version: 1.00, by Lesane
Developer Last Online: Oct 2004
Version: 2.2.x
Rating:
Released: 06-18-2002
Last Update: Never
Installs: 119
No support by the author.
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I seem to be getting double of the hack when I click on Lottery Options ? Isit supposed to be this way or did I do something wrong ? In addition, is there anyway I can display the jackpot amount in the store so users know how much they stand to win ?
Originally posted by AZone Also I have another mistake after end of lottery:
<!--
Updating user, set storeaction to offline and delete lottery and lotteryusers...
'User' is rewarded with 20 points.
'User' is pm'ed with the winner's message.
Lottery action on the store is set to offline.
Lottery and his users are deleted.
Done!
Updating user, set storeaction to offline and delete lottery and lotteryusers...
Database error in vBulletin Control Panel 2.2.8:
Invalid SQL: UPDATE user SET storep=storep+ WHERE userid='1'
mysql error: You have an error in your SQL syntax near 'WHERE userid='1'' at line 1
mysql error number: 1064
--!>
I got exactly the same error, and i've made the changes to storeadmin.php as you advised so that it will only pick a user who has bought a ticket. Seems users can't get the initial amount in the jackpot as well
It would appear with the latest version of the store hack, all the lottery stuff is already in the storeadmin.php file, so in the instructions for the lottery hack, ignore the additions they say to make to storeadmin.php. That's why everything appears twice.
It's also causing that error at the end of the lottery since the first lottery ends and deletes the info from the tables, the second instance of it can't end the lottery and produces that error we've been seeing.
SO, to fix the problem, open storeadmin.php and find both sets of lottery code and delete one of them. Mine works great now... clicking "Install".
Im sorry but Im completelt new to installing hacks..I managed to install the board and its working fine...I really want the lottery and all the other add ons, but I have no clue as to what you mean by making queries. How do I make a query?
Yes I do realize this the problem I am having is this
When I MANUALLY end a lottery and NO WINNER is choosed by the random function. The current users are still IN the lottery and the lottery doesnt close. My board is small so not many people buy tickets. What I would like to do is when I push the end lottery button and a random winner IS NOT choose the people who bought tickets are reset so they can buy tickets again. Otherwise it will be MONTHS before they will be able to buy again. Plus the lottery doenst end when no winner is choosen it just stays there.
here is a fix
in storeadm.php
find:
PHP Code:
$graa=$DB_site->query("SELECT * FROM user WHERE posts>100 ORDER BY RAND() desc LIMIT 15");
replace by
PHP Code:
$graa=$DB_site->query("SELECT * FROM storelottery WHERE lotnumber='2' ORDER BY RAND() desc LIMIT 1");
The hack works great, there is just one problem I'm having since I've installed it. Noone's post count increases when they post. I've posted like 20 times and my post count is still the same. Any ideas on where I can even attempt to look?
I also recently installed the Store Hack and am not sure which one caused it.
The store hack gives values based on the posts so one of its features is that it increments the users post count. Make sure you havent installed another hack that does the same action. In my board I installed the user class hack. Since that hack is based on post counts it included a piece of that incremented the users post count. When it was added after the store hack code the user would get their count incremented once by the store and the once more by the user class. Make sure you dont have something like that.
When you delete the extra store code in the storeadmin.php becareful wich piece you delete. If you delete the pieces lowest in the file you will delete the bug fix that pays out the entire jackpot and not just the money from tickets sold. That fix is in the pieces higher up in the code.
Lesane...fantastik hack...the one question you never answered was could you make an addon that would be for awarding things the admins choose.....like merchandise. We set the price and as an action the person buying is deducted the money and the admin is sent a PM saying they bought the item. We could then initiate contact with the person to arrange delivery. Just an idea...
Originally posted by Cyclonus888 The store hack gives values based on the posts so one of its features is that it increments the users post count. Make sure you havent installed another hack that does the same action. In my board I installed the user class hack. Since that hack is based on post counts it included a piece of that incremented the users post count. When it was added after the store hack code the user would get their count incremented once by the store and the once more by the user class. Make sure you dont have something like that.
When you delete the extra store code in the storeadmin.php becareful wich piece you delete. If you delete the pieces lowest in the file you will delete the bug fix that pays out the entire jackpot and not just the money from tickets sold. That fix is in the pieces higher up in the code.
Lesane...fantastik hack...the one question you never answered was could you make an addon that would be for awarding things the admins choose.....like merchandise. We set the price and as an action the person buying is deducted the money and the admin is sent a PM saying they bought the item. We could then initiate contact with the person to arrange delivery. Just an idea...