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 checked your store.php and you don't even have the lottery code in it.
You forget the most important step in the instruction file:
PHP Code:
**********************************
Open file: root/store.php
**********************************
--------
Find(on the end of the file):
--------
?>
--------
Add BEFORE it:
--------
// ###################### Start Lottery #######################
if ($action=="lottery") {
$lott = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
$storeid=$lott[id];
$cost=$lott[costs];
$need=$points - $cost;
if ($cost>$points) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}
if ($reet=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber='2' AND userid='$bbuserinfo[userid]'")) {
eval("standarderror(\"".gettemplate('store_lottery_error')."\");");
} else {
eval("dooutput(\"".gettemplate("store_lottery")."\");");
}
}
// ###################### Start Lottery Update #######################
if ($action=="lotteryupdate") {
if ($reet=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber='2' AND userid='$bbuserinfo[userid]'")) {
eval("standarderror(\"".gettemplate('store_lottery_error')."\");");
}
$contest = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
$checkcost=$contest[costs];
if ($checkcost != $cost) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}
if ($checkcost>$points) {
eval("standarderror(\"".gettemplate('store_error')."\");");
}
$addlot = $DB_site->query("INSERT INTO storelottery (id,lotnumber,lotname,jackpot,startdate,enddate,userid,username) VALUES (NULL,'2','0','0','0','0','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."')");
$changeusernow = $DB_site->query("UPDATE user SET storep=storep-$cost WHERE userid='$bbuserinfo[userid]'");
$changestorenow = $DB_site->query("UPDATE store SET sold=sold+1 WHERE id=$storeid");
$updatelottery = $DB_site->query("UPDATE storelottery SET jackpot=jackpot+$cost WHERE lotnumber='1'");
$storequant = $DB_site->query_first("SELECT * FROM store WHERE action='lottery'");
if ($storequant[quantity]=='0') {
$ilove++++++s="";
} elseif ($storequant[quantity]=='1') {
$closequan = $DB_site->query("UPDATE store SET quantity='0', ok='N' WHERE id=$storeid");
} else {
$updatequan = $DB_site->query("UPDATE store SET quantity=quantity-1 WHERE id=$storeid");
}
$moneycheck = $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$money = $moneycheck[storep];
eval("dooutput(\"".gettemplate("store_lottery_updated")."\");");
}
**********************************
Save file: root/store.php
**********************************
You have the action code "lotteryupdate" in it but u don't have the action code "lottery" in it.
man we have been wanting that hack to work so bad , where do you vote around here for hacker of the year , this guy gets my vote , he even came to my forums and checked it out.
Originally posted by xxxsaint man we have been wanting that hack to work so bad , where do you vote around here for hacker of the year , this guy gets my vote , he even came to my forums and checked it out.