Lottery mod Fix (multiple tickets)

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Lottery mod Fix (multiple tickets)
skmaniac30
CZ Newbie
 Codezwiz Site Donator
skmaniac30 has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Jan 31, 2006
0.00 posts per day
Posts: 12
Points: 2,947
   
Eliminates users from buying more tickets than allowed.
3 files to edit

open: modules/Forums/admin/admin_lottery.php
Find:
   $l_ticktype_sing = ( $board_config['lottery_ticktype'] == 'single' ) ? 'SELECTED' : '';

Replace with:
   $l_ticktype_sing = ( $board_config['lottery_ticktype'] == 'multiple' ) ? 'SELECTED' : '';


open: modules/Forums/lottery.php
Find: on line 124
$sql_count = $db->sql_numrows($result);

Replace with:
$sql_ticketcount = $db->sql_numrows($result);

Find:
$tickbuy = ( ($board_config['lottery_ticktype'] == "single") && ($sql_count > 0) ) ? 0 : 1;

Replace with:
$tickbuy = ( ($board_config['lottery_ticktype'] == "single") && ($sql_ticketcount > 0) ) ? 0 : 1;

Find:
      if ( $tickbuy )

Replace with:
      if ( ( $tickbuy ) && ($sql_ticketcount < $board_config['lottery_mb_amount']) )

Find:
'TICKETS_OWNED' => $sql_count,

Replace with:
'TICKETS_OWNED' => $sql_ticketcount,

Find:
if ( $board_config['lottery_ticktype'] != 'multi' || !($board_config['lottery_mb']) )

Replace with:
if ( $board_config['lottery_ticktype'] != 'multiple' || !($board_config['lottery_mb']) )

Find:
if ($amount > $board_config['lottery_mb_amount']) { $amount = $board_config['lottery_mb_amount']; }

Replace with:
if( ($amount+$sql_ticketcount) > $board_config['lottery_mb_amount']) { $amount = ($board_config['lottery_mb_amount']-$sql_ticketcount); }

Find:
$msg = ( $amount < 2 ) ? sprintf($lang['lottery_ticket_bought'], $board_config['lottery_name']) : sprintf($lang['lottery_tickets_bought'], $amount, $board_config['lottery_name']);

After Add:
      $msg .= ($lang['lottery_back']);


Open: modules/Forums/language/lang_*/lang_main.php
Find:
$lang['lottery'] = 'Lottery';

After Add:
$lang['lottery_back'] = '<p><a href="modules.php?name=Forums&file=lottery">Return to lottery.</a>';


Save and close.

I think thats everything, lemme know if it works for ya


Back to top Reply with quote
#2   re: Lottery mod Fix (multiple tickets)
Taut
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif california.gif
Occupation: Entrepreneur
Gender: Female
Fav. Sports Team: SF Giants
Status: Offline
Joined: May 27, 2003
0.70 posts per day
Posts: 5530
Points: 481,695
   
ty for posting the fix



Taut

adding to sticky



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum