View Single Post
  #1679  
Old 11-22-2007, 04:15 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ezurick View Post
Hi... Great program/plugin! I have been using this for several months and love it... but I am running into issues that are within the program that I can't change. I am running vbookie 1.0.7 and vb 3.6.8... and I am using the vbCredits 1.4.

I had a recent issue with one of my vbCredits settings and many of my members earned like 2K a post or reply. I quickly resolved the settings... but now I have a few users (that were posting at that time) with large balances... Anyway, I had my football odds set at 5 to 1... This gave many new users an opportunity to bet small and win a nice pot to play arcade and such... I recently had 2 users (same person with different accounts) bet 20K on the 5 to 1... on both the win and lose... So they of course will win a million either way. There is absoultely no way to change that odds... cause if I change the odds, their odds remain the same... and there is no way to limit their bets. I need a way to limit any bet... this is extremely important and I can't understand why others haven't asked this... I have no way to change members bets either... So now I am stuck with allowing this bet to continue, or close it down and I don't want to do that... there are too many other members with proper bets and odds... Any help?

Actually, there is too a way to set a cap limit on bets and it was explained within this thread.

Here is how you do it, simply add a conditional within the conditional to test the value of each bet (eval each $stake variable with the loop).. this simple if statement will work fine and do the trick..

PHP Code:
if ($stake 1000){
                eval(
standard_error(fetch_error('vbookie_exceeded_max_bet')));
            } 
So ... do this (when you have time that is)..

Edit File vbookie.php.

Find:

PHP Code:
   foreach ($vbulletin->GPC['option'] AS $option_id => $stake)
    {
        if (
$stake 0)
        {
            
$db->query_write("INSERT INTO " TABLE_PREFIX "vbookie_bets_placed (option_id, item_id, userid, bet_amount_placed, bet_odds_against, bet_odds_for, bet_private) VALUES ($option_id$item_id, " $vbulletin->userinfo['userid'] . ", $stake, " $odds_against["$option_id"] . ", " $odds_for["$option_id"] . ", '$private')");
            
$db->query_write("UPDATE " TABLE_PREFIX "vbookie_item_options SET option_n_bets_placed=option_n_bets_placed+1, option_amount_staked=option_amount_staked+$stake WHERE option_id=$option_id");
        }
    } 
Replace with:

PHP Code:
   foreach ($vbulletin->GPC['option'] AS $option_id => $stake)
    {
        if (
$stake 0)
        {
            if (
$stake 1000){
                eval(
standard_error(fetch_error('vbookie_exceeded_max_bet')));
            }
            
$db->query_write("INSERT INTO " TABLE_PREFIX "vbookie_bets_placed (option_id, item_id, userid, bet_amount_placed, bet_odds_against, bet_odds_for, bet_private) VALUES ($option_id$item_id, " $vbulletin->userinfo['userid'] . ", $stake, " $odds_against["$option_id"] . ", " $odds_for["$option_id"] . ", '$private')");
            
$db->query_write("UPDATE " TABLE_PREFIX "vbookie_item_options SET option_n_bets_placed=option_n_bets_placed+1, option_amount_staked=option_amount_staked+$stake WHERE option_id=$option_id");
        }
    } 

Then all that is left it to Create the Phrase

languageid : -1
varname : vbookie_exceeded_max_bet
text : You have exceeded the maximum amount of $1000 per bet.
phrasetypeid : 1000
product : bookiehack

Obviously, the $1000 max can be changed to what ever the heck you want it to be... I've taken it farther and an interface that allows the creator of the event to set a cap on it (Cap per event).... and no, it won't be released, so please don't ask.

Again, this isn't MY solution, it was posted in this thread. Search is a wonderful tool.. use it.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01349 seconds
  • Memory Usage 1,809KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete