vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   RPG Integration Hack (https://vborg.vbsupport.ru/forumdisplay.php?f=102)
-   -   Lottery problems :/ (https://vborg.vbsupport.ru/showthread.php?t=80416)

KaiSan 04-23-2005 09:45 AM

Lottery problems :/
 
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!

Revan 04-23-2005 10:25 PM

That means there's no tickets to draw from, and hence the lottery is never drawn.

neo88 04-24-2005 04:19 PM

im also having this error, but i sold 21 tickets & im getting the exact error as Kaisan. Anyway of resolving this?

Revan 04-25-2005 09:06 AM

Try the following:
PHP Code:

// lotteryadmin.php, find:
    
$tickets $DB_site->num_rows($ticketfetch);
    if (
$tickets == 0
    {
        
define('CP_REDIRECT''lotteryadmin.php?do=edit');
        
print_stop_message('rpg_lottery_ticket_error');
    }

// move to AFTER the following
    
$lotteryinfo $DB_site->fetch_array($ticketfetch);

// Replace:
$tickets $DB_site->num_rows($ticketfetch);

// With:
$tickets count($lotteryinfo); 

If this works, I'll release it as an official fix (and also patch the mistake of forgetting to add that phrase to the XML file).

neo88 04-25-2005 03:24 PM

That code didnt work. & add what phrase to the xml file...?

Revan 04-25-2005 03:48 PM

rpg_lottery_ticket_error should have a text :P
And I'll look better into it in abit then.

balls. I see the mistake. Instead of count($tickets), count($lotteryinfo). Try that

asianboi 04-30-2005 03:39 PM

arhhhh are you saying

Quote:

// lotteryadmin.php, find:

$tickets = $DB_site->num_rows($ticketfetch);
if ($tickets == 0)
{
define('CP_REDIRECT', 'lotteryadmin.php?do=edit');
print_stop_message('rpg_lottery_ticket_error');
}

// Replace:
$tickets = $DB_site->num_rows($ticketfetch);

// With:
$tickets = count($lotteryinfo);
because when i move after

Quote:

// move to AFTER the following
$lotteryinfo = $DB_site->fetch_array($ticketfetch);
I do not see

Quote:

$tickets = $DB_site->num_rows($ticketfetch);
and can you please tell us where exactuly to add the phrase so that it will work?

Revan 04-30-2005 04:28 PM

The $tickets line does not disappear even if it's moved.
And add the phrase:
Quote:

ACP -> Phrase Manager -> Add New Phrase.
Phrase Type: Control Panel Stop Message
Varname: rpg_lottery_ticket_error
Text: This lottery does not have any tickets to draw from.

asianboi 04-30-2005 07:22 PM

Hi Revan

Thanks for helping us with the phrase

I clicked on the PICK WINNER and this is what I received

"This lottery does not have any tickets to draw from."

But i do have 9 people buying the lottery ticket.


my lotteryadmin.php is now

Code:


$tickets = $DB_site->num_rows($ticketfetch);
if ($tickets == 0)
{
define('CP_REDIRECT', 'lotteryadmin.php?do=edit');
print_stop_message('rpg_lottery_ticket_error');
}

// Replace:
$tickets = $DB_site->num_rows($ticketfetch);

// With:
$tickets = count($lotteryinfo);


Revan 04-30-2005 11:31 PM

PHP 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');
    } 

thats the relevant section of code, which I have every reason to believe works.


All times are GMT. The time now is 05:12 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.01060 seconds
  • Memory Usage 1,747KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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