Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
vBookie - vBulletin Betting Hack Details »»
vBookie - vBulletin Betting Hack
Version: 1.00, by tjdrico tjdrico is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 06-03-2004 Last Update: Never Installs: 359
 
No support by the author.

vBookie

Introduction

vBookie is a 'bookmakers' or betting extension to vBulletin. It enables authorised members to post Events and Outcomes that forum members can bet on. Each Outcome has its own set of odds, and odds can be modified through the life of an Event (bets that are placed are stored with the prevailing odds, so even if the odds change, your users are paid at the correct rate).

Once the results are known, Events can be settled and forums members awarded their winnings.

vBookie uses its own vCash by default, but this has no more use than as 'bragging rights'. However, vBookie also comes with a built-in switch to allow it to use either uCash or Petz money instead. That means that all bets are paid for and settled using uCash or Petz money, making betting even more attractive than just for fun on forums with uShop/Petz installed. Although vBookie does not have any built-in facility to integrate with any other store hacks, it's a very simple job to hack vBookie itself to integrate it with any store/points system you care to use.

Features
  • master switch to turn vBookie off
  • option to use uCash
  • option to use Petz money
  • settings to restrict the creation of Events to specific user groups
  • settings to restrict which user groups can bet on Events
  • settings to restrict which user groups can edit or settle other people's Events
  • per-Event, specify whether punters may bet on more than one outcome
  • optional 'charity mode' so that the poorest members of the forum always have something to play with
  • supplied with a module for vBadvanced

Please click if you install this hack, thanks. Please also let me know - send me an email or a PM. If you'd let me know the forum URL too that'd be cool!

vBookie is free, and will remain free.

Updates

1.0.0 -> 1.0.1

- adds the ability to delete Events. See this post for upgrade instructions if you already have 1.0.0

1.0.1 -> 1.0.2

Corrected a minor bug with the charity mode when using uCash. See this post for manual upgrade instructions from 1.0.1.

1.0.2 -> 1.0.3

Corrected a minor bug with the richest people display when using uCash. Just overwrite includes/functions_vbookie.php with the one from the new Zip file.

1.0.3 -> 1.0.4

Corrected some date display problems when using "Detailed" dates. For manual update instructions, see this post.

Corrected Petz bug whereby all winnings were paid to the bet's owner rather than individual winners. To upgrade from 1.03 or earlier, see this post or overwrite includes/functions.vbookie.php with the 1.0.4 version.

Problems?

-> Petz - If you are using Petz there is a bug in all versions up to and inclusing 1.0.3. Your players won't get paid their winning, and all payouts will end up in the account of the person that posted the Event. To correct this, please see this post. This fix will be incororated into 1.0.4 onwards.

-> If you can't post Events, or can't bet on them make sure you have set your user permissions

-> If you have an SQL error Invalid SQL: UPDATE SET =25 WHERE <25 make sure you are using version 1.0.3 or later.

-> If you have any other general problems, please check the installation/hack instructions and make sure you have carried out all the steps and also check that you made the changes correctly

Anything else, ask in this thread.

Other Stuff

-> If you are using Detailed Date & Time display and have a problem with Event dates appearing as '1 Minute Ago', see this post.

-> If you want to use poster 'Reputation' as the currency for vBookie, see this post.

About Odds

Odds of "5/1" are "amount won per amount placed". This means that I would win 5 for every 1 placed. Of course, if I win, I get my stake back as well. Odds of "1/5" means that I win 1 for every 5 placed. I'd have to place 25 to win just 5.

Decimal Odds

Decimal odds are just another way of displaying the same information. 2.0 is the same as 2/1. 0.2 is the same as 1/5. vBookie only lets you specify odds in terms of x/y, but if you think in terms of decimal you can still work out what odds to provide. Simply think of your decimal odds as "2.0 / 1.0" or "0.5 / 1.0" and then multiply each side through by 10 or 100 until there are only zeros to the right of the decimal point, then just take the whole number part.

2.0 / 1.0 has no decimals, so this is the same as 2/1

0.5 / 1.0 has a 0.5, so multiply both parts by 10 to get 5.0 / 10.0. Then you can specify your odds as 5 / 10. You might also realise that this is the same as 1/2. The technique is a simple way to work out any odds you may need to specify.

Odds of 0.65 -> 0.65 / 1.0 -> 65.0 / 100.0 or 65/100. Then you can divide through by 5 to get to 13 / 20, although this step isn't necessary.


_______________________________________

Show Your Support

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

Comments
  #102  
Old 06-09-2004, 11:22 PM
Pro Pro is offline
 
Join Date: Aug 2002
Location: Cali
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm... my bad - i found it on your website.

GREAT SYSTEM! THANKS! I'LL TRY TO DONATE SOON!
Reply With Quote
  #103  
Old 06-10-2004, 04:44 AM
limey's Avatar
limey limey is offline
 
Join Date: Dec 2001
Location: -
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack tjdrico! One of the best. Will install when I can.
Reply With Quote
  #104  
Old 06-10-2004, 06:24 AM
nydk nydk is offline
 
Join Date: May 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by limey
Cool hack tjdrico! One of the best. Will install when I can.
I had some problems, but I worked through it... but now I was wondering this:

- Richest Members in vBookie Stats only shows my richest uShop/uCash members, except the 2 richest. The two richest have like $13.xx and $17.xx, and 3rd richest has $7.xx ... the list in vBookie starts at the $7.xx person. (If that made any sense)

- Also, when I click the option to add an event with the thread, I don't get taken to a "Post a vBookie Event" page... any ideas... ? I did set my usergroup to be able to add events
Reply With Quote
  #105  
Old 06-10-2004, 06:34 AM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nydk
I had some problems, but I worked through it... but now I was wondering this:

- Richest Members in vBookie Stats only shows my richest uShop/uCash members, except the 2 richest. The two richest have like $13.xx and $17.xx, and 3rd richest has $7.xx ... the list in vBookie starts at the $7.xx person. (If that made any sense)

- Also, when I click the option to add an event with the thread, I don't get taken to a "Post a vBookie Event" page... any ideas... ? I did set my usergroup to be able to add events
Regarding the first, which version of the installation file did you have? Is it version 1.0.3? Check the 'includes/functions_vbookie.php' file, and the 'function vbookie_get_richest()' function. You should see this code:

PHP Code:
    if ($vbookiesettings['ucash'] == 1)
    {
        
$q "SELECT u.username, (p.".$vboptions['uttpoints_pointsfield']."+0) AS cash FROM " TABLE_PREFIX $vboptions['uttpoints_pointtable']." AS p LEFT JOIN " TABLE_PREFIX "user AS u ON u.userid=p.userid ORDER BY cash DESC LIMIT 5";    
    } 
The main point here is that there is a "+0" on the uttpoints_pointsfield column, as this forces it to be an integer rather than a string.

The second suggests that you didn't make all the changes correctly, or missed one all together. One suspect would be this one in 'newthread.php':

FIND
PHP Code:
if ($newpost['postpoll']) 
        { 
            
$url "poll.php?$session[sessionurl]t=$newpost[threadid]&polloptions=$newpost[polloptions]"
        } 
AFTER, ADD
PHP Code:
// +++ vBookie 
        
else if ($newpost['postvbookieevent']) 
        { 
            
$url "vbookie.php?$session[sessionurl]t=$newpost[threadid]&vbookieeventoptions=$newpost[vbookieeventoptions]&do=newevent"
        } 
        
// --- vBookie 
The change above is what specifies the page you are directed to after submitting a new thread. Double check all the changes prescribed in the installation instructions.
Reply With Quote
  #106  
Old 06-10-2004, 06:43 AM
nydk nydk is offline
 
Join Date: May 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the quick reply...

- Regarding the first issue(how my Store uses decimals), is there a way to fix this? Or do you suggest changing my point system over to integers?? I liked the idea of dollars and cents

- New Event... well everything seems correct... I'm gonna try to double check...

ahhhh... found it :nervous:

PHP Code:
FIND
$newpost
['polloptions'] = intval($_POST['polloptions']); 

AFTERADD
// +++ vBookie 
    
$newpost['postvbookieevent'] = $_POST['postvbookieevent']; 
    
$newpost['vbookieeventoptions'] = intval($_POST['vbookieeventoptions']); 
// --- vBookie 
That's what I forgot ... thanks again for your help

*clicked install*
Reply With Quote
  #107  
Old 06-10-2004, 07:24 AM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nydk
Thanks for the quick reply...

- Regarding the first issue(how my Store uses decimals), is there a way to fix this? Or do you suggest changing my point system over to integers?? I liked the idea of dollars and cents
Well, actually, the "+0" should just convert it to a number, not strictly an integer. The problem with the ordering was that the uttpoints field is a VARCHAR, so "ORDER BY" uses dictionary ordering. In dictionary ordering "8.5" comes after "700", so the numbers come out wrong. The "+0" forces them to be viewed as numbers, so "8.5" comes before "700".

I don't know why it uses a char field rather than a decimal or int for a numeric amount, but it seems to work OK and the +0 on my SELECT should fix it if it's not present in your copy of the file.
Reply With Quote
  #108  
Old 06-10-2004, 09:58 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tjdrico, this is a great hack and how about: don't the money the users lost goes thrash, there should be an account like 'bet master' to keep all of the money users have lost and pay how much they won. and you should make it like: in ACP admin can have the option that if he wants the money goes to someone and if yes enter the user id of that person.
hope it gives more fun ^^
Reply With Quote
  #109  
Old 06-10-2004, 12:46 PM
Okiewan's Avatar
Okiewan Okiewan is offline
 
Join Date: Dec 2001
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Silly question I'm sure, but how would one settle an event?
Is there not an option shown to do so until the end date/time has passed?
Reply With Quote
  #110  
Old 06-10-2004, 12:53 PM
tjdrico's Avatar
tjdrico tjdrico is offline
 
Join Date: Mar 2004
Location: Morecambe, UK
Posts: 148
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, the "Settle" option is only shown once the "This event will pay out after" date has been reached. If you want to settle a bet before that time, edit it and change the date. Presumably, however, one wouldn't settle an event until the result is known, so it makes sense to set the "This event will pay out after " to that time in the first place. It defaults to being the same as the "accept bets until" date/time, which should be before the result is known.
Reply With Quote
  #111  
Old 06-10-2004, 01:22 PM
Okiewan's Avatar
Okiewan Okiewan is offline
 
Join Date: Dec 2001
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent hack. HOTM level stuff!
Reply With Quote
Reply

Thread Tools

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 06:14 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.04950 seconds
  • Memory Usage 2,337KB
  • 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
  • (4)bbcode_php
  • (3)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
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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