vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBookie for vBulletin 3.5 (https://vborg.vbsupport.ru/showthread.php?t=94128)

innersanctum 04-03-2006 07:12 PM

I figured it out. I had to import the vBookie integratration plugin that was included with vBux/vbPlaza.

EDIT: I spoke too soon. Even after I get everthing enabled, the newthread template still doesn't display the vBookie event option.

EDIT PART 2: Stupid forum permissions. *LOL*

gwhooooey 04-03-2006 09:30 PM

Quote:

Originally Posted by innersanctum
I figured it out. I had to import the vBookie integratration plugin that was included with vBux/vbPlaza.

How do you do that?.. I had a look but.. couldn't figure it out. :cross-eyed:

ForeverForums 04-05-2006 09:21 AM

To integrate this with vBookie:

1) Goto vBookie Options in the Admin CP. Select Custom for the Cash/Points System.

2) Import the PLUGIN --> plugin-vbookievbplaza.xml

Devadam 04-05-2006 01:28 PM

how can we limit the stakes on the betting ?

Railen 04-05-2006 03:59 PM

Quote:

Originally Posted by Devadam
how can we limit the stakes on the betting ?

Open 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 100){
                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");
        }
    } 

Open your vBulletin database and look at the phrase table.
Find the largest phraseid, then create a new row with a phraseID that's one larger than the largest one so far. The other values are as follows:
languageid : -1
varname : vbookie_exceeded_max_bet
text : You have exceeded the maximum amount of $100 per bet.
phrasetypeid : 1000
product : bookiehack

Obviously, change the $100 max to whatever you want your max to be.

Railen 04-05-2006 04:25 PM

Something that would be nice...

vBarcade adds a trophy icon next to your name in the postbit if you have a high score in one of the games. It'd be nice to have a dollarsign or something similar to signify the richest person (or 2, 3). Richest person gets 3 dollar signs, 2nd richest gets 2, 3rd richest gets 1.

Now, I'm great with PHP, but you can't just insert PHP into vBulletin and have it work. It refers to $post and $show variables, etc, which are defined in places I'm not completely sure. While it might make great sense, it only succeeds in making people new to making changes to plugins, and the vBulletin system in general, confused. For example, what I did above will be overwritten once an upgrade is done. While it's easy enough to add back in, the obvious way to fix this would be adding to the plugin itself.

While I'm sure I'm not the only person who wants a postbit icon, the rate at which changes are made makes me think they won't get done if I don't do them myself. Does anyone have experience in making a change like this? If so, could you give me a quick rundown of what would be needed to implement this change?

If the author would share what is needed, I'd be fully willing to work on getting this done, and possibly work on a vBa CMPS module as well. I just need a bit of direction here. I can then share my changes with the author, who could wrap it into his plugin. Win/win for everyone....

Thanks.

mclark2112 04-06-2006 02:15 AM

Something is wrong with this. The odds are very screwed up. I set up an event with 19 outcomes. I had to edit the event a couple of times... Never changing the outcomes or the odds, but the system has re orddered the outcomes, and when looking at the bets placed, some people have different odds for the same outcome, but I never changed the odds...

http://www.champcarfanatics.com/foru...ad.php?t=33178

Railen 04-07-2006 02:48 PM

I'm absolutely certain that the following is misleading:
Total Bets: 282
Total Staked: 19287
Total Won: 9499

This makes it look like the bookie has made nearly 10k off users.

I'm looking at the SQL queries and I'm certain that total bets and total staked are correct. However, the total won does not show RETURNED STAKES.

If there's 1 event with 1 bet, odds 1/1 and I win on a $100 bet, the stats should show:
Total Bets: 1
Total Staked: 100
Total Won: 200

However, they DON'T. They would actually show:
Total Bets: 1
Total Staked: 100
Total Won: 100

This makes it look like the bookie has broken even, when the bookie is really down $100.
I'm working on new SQL query to fix this.

Railen 04-07-2006 03:01 PM

Ok, fixed it.

In vbookie.php find:
PHP Code:

    while ($bit $db->fetch_array($result)) 
    {
        
// ATTN: Hardcoded HTML
        
$system_totals_bits .= "<b>$vbphrase[total_bets]:</b> $bit[bets]<br /><b>$vbphrase[vbookie_total_staked]:</b> $bit[stake]<br /><b>$vbphrase[total_won]:</b> $bit[won]<br />";
        
//exec_switch_bg();
        //eval('$bits .= "' . fetch_template('vbookie_view_my_bet') . '";');
    


Replace with:
PHP Code:

    while ($bit $db->fetch_array($result)) 
    {
        
// ATTN: Hardcoded HTML
        
$amtWon $bit[won];
        
$system_totals_bits .= "<b>$vbphrase[total_bets]:</b> $bit[bets]<br /><b>$vbphrase[vbookie_total_staked]:</b> $bit[stake]<br /><b>$vbphrase[total_won]:</b> $amtWon<br />";
        
//exec_switch_bg();
        //eval('$bits .= "' . fetch_template('vbookie_view_my_bet') . '";');
    
}

    
$result $db->query_read("SELECT SUM(item.bet_amount_placed) returnedStakes FROM " TABLE_PREFIX "vbookie_bets_placed AS item WHERE bet_amount_won != 0");
    
$newbit $db->fetch_array($result); 
    
// ATTN: Hardcoded HTML
    
$bookieProfitLoss $amtWon $newbit[returnedStakes];
    
$system_totals_bits .= "<b>Stakes returned:</b> $newbit[returnedStakes]<br /><b>Bookie profit/loss:</b> $bookieProfitLoss"

It uses hardcoded phrases, but whatever. I never understood why vBulletin puts all its phrases in a database anyway. (Anyone care to explain?)

psybernaut 04-07-2006 10:04 PM

Quote:

Originally Posted by Railen
It uses hardcoded phrases, but whatever. I never understood why vBulletin puts all its phrases in a database anyway. (Anyone care to explain?)

Isn't it to make it independent of language, and to make it easier for people to modify phrases if they don't have easy access to the server the site is hosted on?


All times are GMT. The time now is 04:37 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.03088 seconds
  • Memory Usage 1,781KB
  • 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
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (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