Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > RPG Integration Hack
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Lottery problems :/ Details »»
Lottery problems :/
Version: , by KaiSan KaiSan is offline
Developer Last Online: May 2006 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 04-23-2005 Last Update: Never Installs: 0
 
No support by the author.

Hey everyone! ^_^

When i set the lottery for the next day (or ever for that matter) it is enever drawn :/

and when i go to pick a winner i get this message:

Could not find phrase 'rpg_lottery_ticket_error'.

>___<

Help please!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 05-01-2005, 02:14 AM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks.. i'll see if that works

Ok I used the same exact code you provided above and this is what happens when I click on the PICK winner link

Quote:
Database error in vBulletin 3.0.7:

Invalid SQL: UPDATE user SET uttpoints = uttpoints + WHERE userid=
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=' at line 1

mysql error number: 1064
My current Lottery is:

Lottery Name Started Ending Pick
Cash 5 04-30-2005 05-01-2005 [Pick]
Reply With Quote
  #13  
Old 05-01-2005, 09:11 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
    // #########################
    
$sub 'Lottery Winner!';
    
$message "Hi, $lottery[username]

You've won '
$lotteryinfo[lotteryname]' lottery!
$lottery[prize] $vboptions[rpg_currency] has been added to your pocket!";
    
// ##########################
    
process_rpg_pm($lotteryinfo['userid'], $lotteryinfo['username'], $bbuserinfo['userid'], $bbuserinfo['username'], $sub$message);
    
$DB_site->query("UPDATE " TABLE_PREFIX "user SET $vboptions[rpg_pointfield] = $vboptions[rpg_pointfield] + $lotteryinfo[prize] WHERE userid=$lotteryinfo[userid]");
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "rpg_lottery WHERE lotteryid = '$lotteryinfo[lotteryid]'");
    
$DB_site->query("DELETE FROM " TABLE_PREFIX "rpg_lottery_tickets WHERE lotteryid = '$lotteryinfo[lotteryid]'"); 
Try using this code instead of the similar to above existing code then.
Reply With Quote
  #14  
Old 05-01-2005, 01:00 PM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still get the same error. It is either I understand you incorrectly. Please be specific, because I'm not a coder like you

Code:
	$ticketfetch = $DB_site->query("
		SELECT 
			rpg_lottery_tickets.*,
			rpg_lottery.*,
			user.username,
			user.userid
		FROM 
			`" . TABLE_PREFIX . "rpg_lottery` AS `rpg_lottery`
		LEFT JOIN `" . TABLE_PREFIX . "rpg_lottery_tickets` AS `rpg_lottery_tickets` ON(rpg_lottery_tickets.lotteryid = rpg_lottery.lotteryid)
		LEFT JOIN `" . TABLE_PREFIX . "user` AS `user` ON(user.userid = rpg_lottery_tickets.userid)
		WHERE rpg_lottery.lotteryid = '$lottery[lotteryid]' 
		ORDER BY RAND() LIMIT 1
   "); 
    $lotteryinfo = $DB_site->fetch_array($ticketfetch); 
    $tickets = count($lotteryinfo); 
    if ($tickets == 0) 
    { 
        define('CP_REDIRECT', 'lotteryadmin.php?do=edit'); 
        print_stop_message('rpg_lottery_ticket_error'); 
    } 
// ######################### 
    $sub = 'Lottery Winner!'; 
    $message = "Hi, $lottery[username] 

You've won '$lotteryinfo[lotteryname]' lottery! 
$lottery[prize] $vboptions[rpg_currency] has been added to your pocket!"; 
    // ########################## 
    process_rpg_pm($lotteryinfo['userid'], $lotteryinfo['username'], $bbuserinfo['userid'], $bbuserinfo['username'], $sub, $message); 
    $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $vboptions[rpg_pointfield] = $vboptions[rpg_pointfield] + $lotteryinfo[prize] WHERE userid=$lotteryinfo[userid]"); 
    $DB_site->query("DELETE FROM " . TABLE_PREFIX . "rpg_lottery WHERE lotteryid = '$lotteryinfo[lotteryid]'"); 
    $DB_site->query("DELETE FROM " . TABLE_PREFIX . "rpg_lottery_tickets WHERE lotteryid = '$lotteryinfo[lotteryid]'");
Reply With Quote
  #15  
Old 05-01-2005, 07:35 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Argh, Ill have to run some tests on localhost as this goes beyond what I can troubleshoot without actually touching the files.
I'll have a fix ready tomorrow
Reply With Quote
  #16  
Old 05-01-2005, 10:25 PM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you sir! Hope to hear some good news from you =)
Reply With Quote
  #17  
Old 05-04-2005, 04:07 PM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
Argh, Ill have to run some tests on localhost as this goes beyond what I can troubleshoot without actually touching the files.
I'll have a fix ready tomorrow

I know you're busy, just wanting to let you know this problem has not been solved.
Reply With Quote
  #18  
Old 05-05-2005, 10:06 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It has been solved in the latest update. I sent out an email, and made an entry in the changelog.
If you still recieve the error, try redloading, reuploading the changed files, and post any errors you're still recieving.
Reply With Quote
  #19  
Old 05-05-2005, 02:55 PM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks..works great! Thumb up!
Reply With Quote
  #20  
Old 05-08-2005, 01:39 AM
asianboi asianboi is offline
 
Join Date: Apr 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a way to limit the lottery purchase? Seeems to me that the more lottery tickets a member buy.. the higher chance he/she would win
Reply With Quote
  #21  
Old 05-09-2005, 07:00 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, theres currently no way of limiting the purchases per lottery.
I will add this to the next version though.
Reply With Quote
Reply


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 08:17 AM.


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.04626 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
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
  • (1)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
  • (1)pagenav_pagelink
  • (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_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