Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools
Lottery Addon For The Store Hack Details »»
Lottery Addon For The Store Hack
Version: 1.00, by Lesane Lesane is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

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.

Comments
  #212  
Old 04-11-2003, 04:52 AM
Darnell 0216's Avatar
Darnell 0216 Darnell 0216 is offline
 
Join Date: Feb 2003
Location: Newark, NJ
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Make sure you don't have errors in the the following lines:
PHP Code:
$jack=$DB_site->query_first("SELECT * FROM storelottery WHERE lotnumber=1");
$kutje=$jack[jackpot]; 
Your error says that it's trying to add nothing (storep=storep+ WHERE) to the current storepoints which implies kutje is returning an empty value.

BTW I'm running 2.2.9 and haven't had any errors other than choosing from only those who have bought a ticket and the fact he hardcoded the colors and bullet images in which were all rectified...
  #213  
Old 04-13-2003, 03:32 AM
dstruct2k's Avatar
dstruct2k dstruct2k is offline
 
Join Date: Dec 2002
Location: Winnipeg
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone feel like telling me the meaning of "kutje"? I tried translating it to no avail....
  #214  
Old 05-02-2003, 02:00 AM
vurton vurton is offline
 
Join Date: Apr 2003
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

everything worked fine until i picked a winner

Database error in vBulletin Control Panel 2.3.0:

Invalid SQL: UPDATE user SET storep=storep+ WHERE userid='1'
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE userid='1'' at line 1

mysql error number: 1064

hmmmhhhhhhhhhhhhhh
  #215  
Old 05-02-2003, 10:22 AM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mine's ok on 2.3.0 but I want to change the userid of the winner/loser PM sender (I use Admin-Bot for jobs like this. ).
  #216  
Old 05-03-2003, 12:37 AM
Darnell 0216's Avatar
Darnell 0216 Darnell 0216 is offline
 
Join Date: Feb 2003
Location: Newark, NJ
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 07:22 AM Zelda-King said this in Post #214
Mine's ok on 2.3.0 but I want to change the userid of the winner/loser PM sender (I use Admin-Bot for jobs like this. ).
Find in storeadmin.php
PHP Code:
$pmwinner="Congratulations $username,\n\n You won the lottery named $lotop[lotname]. Your amount of points is increased with $kutje points.\n\n Thanks for your participation on this lottery.";
$pmw $DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,messageread,folderid) VALUES (NULL,'$userid','$userid','$bbuserinfo[userid]','You Won The Lottery','".addslashes($pmwinner)."',".time().",0,0)"); 
Replace $bbuserinfo[userid] with the userid you wish the message to come from.
  #217  
Old 05-03-2003, 01:33 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I knew that had to be the key. I just wasn't sure if you just stick the userid on its own or whatnot.

Right, I've now replaced '$bbuserinfo[userid]' with '192' and done the same for the loser PM. I'll see how that goes when the next lottery ends in a week.

Thanks a lot!

On another note, with the last lottery the jackpot was over 30000 but the lottery awarded little over 1000. Maybe the jackpot just went over the maximum at the last minute? I've made the jackpot for the current lottery less to see if this one goes better.
  #218  
Old 05-03-2003, 01:51 PM
Darnell 0216's Avatar
Darnell 0216 Darnell 0216 is offline
 
Join Date: Feb 2003
Location: Newark, NJ
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's a fix mentioned earlier in the thread regarding award issues... You might wanna doublecheck that problem if you haven't already corrected it. I've got my lottery to award over $10,000,000...
  #219  
Old 05-03-2003, 03:45 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

http://www.myfootballforum.com/myfoo...action=lottery

When i try to buy a ticket i click on the buy button BUT it does nothing.. Below is the code for it which i'm using.


template: store_lottery

Code:
<html>
<head>
<title>$storename - Buy A Lottery Ticket</title>
$headinclude
</head>
<body>
$header
<table cellpadding="2" cellspacing="0" border="0" width="95%"  align="center">
<tr>
        <td width="100%"><img src="https://vborg.vbsupport.ru/images/vb_bullet.gif" alt="" border="0" align="absmiddle">
        <normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;
        <a href="store.php?s=$session[sessionhash]">$storename</a> &gt; Buy A Lottery Ticket</b></normalfont></td>
</tr>
</table>
<br>
<p><form action="store.php"  name="name" method="post">
<input type="hidden" name="action" value="lotteryupdate">
<input type="hidden" name="cost" value="$cost">
<input type="hidden" name="storeid" value="$storeid">
<br>
<table cellpadding="0" align=center cellspacing="0" border="0" width="90%"><tr><td>
<table cellpadding="0" align=center cellspacing="1" border="0" bgcolor="#0A293E" width="90%">
<tr>
<td colspan="2" bgcolor="#1D6AA0"><normalfont color="#EEEEFF"><b>Verify:</b></normalfont></td>
</tr>
<tr bgcolor="#13486D" valign='top'>
<td><p><normalfont color="#000000">Buying a lottery ticket costs:</p></td>
<td><p><normalfont color="#000000">$cost</p></td>
</tr>
<tr bgcolor="#13486D" valign='top'>
<td><p><normalfont color="#000000">$pointname you have:</p></td>
<td><p><normalfont color="#000000">$points</p></td>
</tr>
<tr bgcolor="#13486D" valign='top'>
<td><p><normalfont color="#000000">$pointname after buying the lottery ticket:</p></td>
<td><p><normalfont color="#000000">$need</p></td></tr>
<tr>
<td bgcolor="#1D6AA0" colspan='2' align='center'><p id='submitrow'><input type="submit" value="Ok, Buy The Lottery Ticket">
</p></td>
</tr>
</table>
</form>
</td></tr>
</table>
$footer
</body>
</html>
Any help would be welcomed. Thanks in advance
  #220  
Old 05-04-2003, 09:31 PM
Nur1 Nur1 is offline
 
Join Date: May 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

getting problem.. well dunno if its a problem or not, but the lotto insert is appearing twice in admin

check attached gif
  #221  
Old 05-05-2003, 04:28 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nur1 I also have that problem. It doesn't seem to mess anything up, just shows everything twice though. I just ignore it.

I also have the same problem as you vurton. Members still get their money, but I get your error along with a nice vbulletin error email. I hate those LOL!

But yeah I get this too in 2.2.9. Anyone know what could be wrong?

Quote:
05-01-03 at 10:00 PM vurton said this in Post #213
everything worked fine until i picked a winner

Database error in vBulletin Control Panel 2.3.0:

Invalid SQL: UPDATE user SET storep=storep+ WHERE userid='1'
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE userid='1'' at line 1

mysql error number: 1064

hmmmhhhhhhhhhhhhhh
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:38 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05182 seconds
  • Memory Usage 2,323KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete