Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBookie for vBulletin 3.5 Details »»
vBookie for vBulletin 3.5
Version: 1.0.7, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 08-11-2005 Last Update: 02-17-2006 Installs: 633
DB Changes Uses Plugins Template Edits
Additional Files Is in Beta Stage  
No support by the author.

vBookie

Introduction

This is a Port of the original vBookie Hack created by tdjrico; full credits to him for the idea and the kind permission to port his work

A t t e n t i o n
This Hack is unsopported and incompatible with vBulletin 3.6+
You are hereby advised to not use it.
Please do not ask me about support and/or updates - there will be none.

Supporters / CoAuthors

Show Your Support

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

Comments
  #2232  
Old 06-04-2009, 12:09 AM
DS MrSinister DS MrSinister is offline
 
Join Date: Dec 2002
Location: the burgh
Posts: 553
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you set the usergroup permissions?
Reply With Quote
  #2233  
Old 06-04-2009, 09:23 AM
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Posts: 1,128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DS MrSinister View Post
did you set the usergroup permissions?
There's nothing showing in the usergroup permissions about it.
Reply With Quote
  #2234  
Old 06-05-2009, 05:54 PM
DS MrSinister DS MrSinister is offline
 
Join Date: Dec 2002
Location: the burgh
Posts: 553
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

reupload the files

and

rebuild bitfields

admincp/index.php?do=buildbitfields
Reply With Quote
  #2235  
Old 06-08-2009, 09:58 PM
DobieGillis? DobieGillis? is offline
 
Join Date: Feb 2009
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
vBookie & 3.6

The posting of vbookie events in 3.6 is broken because the hook used has moved.

To fix this problem, the following plugin must be edited ;


vBookie: Redirect to vbookie.php when posting new Event

Replace the plugin code with this ;

PHP Code:
if ($newpost['postvbookieevent']) 

    
$vbulletin->url 'vbookie.php?' $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]&vbookieeventoptions=$newpost[vbookieeventoptions]&do=newevent"
    eval(
print_standard_redirect('redirect_postthanks_moderate'truefalse));

Note: I'm not actually using vbookie atm so I can't comment on any other problems.
you rock!
Reply With Quote
  #2236  
Old 06-10-2009, 02:20 AM
mike2902's Avatar
mike2902 mike2902 is offline
 
Join Date: Apr 2009
Posts: 186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is good news..Id like to see the ability to put in a spread for games. Or put straight up odds for boxing and the like.
Reply With Quote
  #2237  
Old 06-22-2009, 04:29 AM
CyprusTM CyprusTM is offline
 
Join Date: Aug 2008
Location: Canada
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this good for Football (soccer) predictions? when will it be available for version 3.8 ?

Id love to use this on my forum for the upcoming season

Cheers
Reply With Quote
  #2238  
Old 07-06-2009, 02:24 PM
aranthorn's Avatar
aranthorn aranthorn is offline
 
Join Date: Jun 2004
Location: Chicago
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want to use vbbux as the cash system, here's what your functions_vbookie.php file should contain.

I just made the edits and tested it out, works fine.

This is a copy of the ENTIRE contents of that file.

PHP Code:
<?php
function vbookie_get_user_bet_count($item_id=0)
{
    global 
$vbulletin;

    
$user_n_bets_placed_result $vbulletin->db->query_first("
        SELECT COUNT(bet_id) AS user_n_bets_placed
        FROM " 
TABLE_PREFIX "vbookie_bets_placed
        WHERE userid = " 
$vbulletin->userinfo['userid'] . " AND item_id = $item_id
    "
);
    
    return (int)
$user_n_bets_placed_result['user_n_bets_placed'];

}

function 
vbookie_get_user_cash()
{
    global 
$vbulletin;

    switch (
$vbulletin->options['vbookiecash'])
    {
        case 
'vcash':
            
$cash = (int)$vbulletin->userinfo['vbookie_cash'];
            break;
        case 
'ucash':
            
$cash = (int)$vbulletin->userinfo['ucash'];
            break;
        case 
'ebux':
            
$cash = (int)$vbulletin->userinfo['vbbux'];
            break;
        case 
'custom':
            (
$hook vBulletinHook::fetch_hook('vbookie_get_user_cash')) ? eval($hook) : false;
        
    }
    
    return 
$cash;
}

function 
vbookie_take_user_cash($amount)
{
    global 
$vbulletin;

    switch (
$vbulletin->options['vbookiecash'])
    {
        case 
'vcash':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbookie_cash=vbookie_cash-$amount WHERE userid=" $vbulletin->userinfo['userid']);    
            break;
        case 
'ucash':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET ucash=ucash-$amount WHERE userid=" $vbulletin->userinfo['userid']);    
            break;
        case 
'ebux':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbbux=vbbux-$amount WHERE userid=" $vbulletin->userinfo['userid']);    
            
$cash = (int)$vbulletin->userinfo['ebux'];
            break;
        case 
'custom':
            (
$hook vBulletinHook::fetch_hook('vbookie_take_user_cash')) ? eval($hook) : false;
        
    }
}

function 
vbookie_give_user_cash($userid$amount)
{
    global 
$vbulletin;

    switch (
$vbulletin->options['vbookiecash'])
    {
        case 
'vcash':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbookie_cash=vbookie_cash+$amount WHERE userid=$userid");    
            break;
        case 
'ucash':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET ucash=ucash+$amount WHERE userid=$userid");    
            break;
        case 
'ebux':
            
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbbux=vbbux+$amount WHERE userid=$userid");    
            
$cash = (int)$vbulletin->userinfo['vbbux'];
            break;
        case 
'custom':
            (
$hook vBulletinHook::fetch_hook('vbookie_give_user_cash')) ? eval($hook) : false;
        
    }
}

function 
vbookie_abandon_event($item_id=0)
{
    global 
$vbulletin;

    if ((int)
$item_id)
    {
        
$q "UPDATE "TABLE_PREFIX "vbookie_items SET item_status='ABANDONED' WHERE item_id=$item_id";
        
$vbulletin->db->query($q);

        
// update running totals
        
$q "UPDATE " TABLE_PREFIX "vbookie_item_options SET option_amount_staked=0, option_n_bets_placed=0 WHERE item_id=$item_id";    
        
$vbulletin->db->query($q);

        
// update running totals
        
$q "UPDATE " TABLE_PREFIX "vbookie_items SET item_n_bets_placed=0, item_amount_staked=0 WHERE item_id=$item_id";    
        
$vbulletin->db->query($q);

        
$result $vbulletin->db->query_read("SELECT p.userid, p.bet_amount_placed FROM " TABLE_PREFIX "vbookie_bets_placed AS p LEFT JOIN " TABLE_PREFIX "user AS u ON(u.userid = p.userid) WHERE p.item_id=$item_id");

        while (
$bet $vbulletin->db->fetch_array($result)) 
        {
            
// pay the money back
            
vbookie_give_user_cash($bet['userid'], $bet['bet_amount_placed']);
        }
    }
}

function 
vbookie_get_richest()
{
    global 
$vbulletin;

    switch (
$vbulletin->options['vbookiecash'])
    {
        case 
'vcash':
            
$q "SELECT username, vbookie_cash AS cash FROM " TABLE_PREFIX "user ORDER BY cash DESC LIMIT 5";    
            break;
        case 
'ucash':
            
$q "SELECT username, ucash AS cash FROM " TABLE_PREFIX "user ORDER BY cash DESC LIMIT 5";    
            break;
        case 
'ebux':
            
$q "SELECT username, vbbux AS cash FROM " TABLE_PREFIX "user ORDER BY cash DESC LIMIT 5";    
            break;
        case 
'custom':
            (
$hook vBulletinHook::fetch_hook('vbookie_get_richest')) ? eval($hook) : false;
    
    }

    return 
$vbulletin->db->query_read($q);
}

function 
vbookie_do_charity()
{
    global 
$vbulletin;


    if (
$vbulletin->options['vbookiegivetopoor'])
    {
        switch (
$vbulletin->options['vbookiecash'])
        {
            case 
'vcash':
                
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbookie_cash=" $vbulletin->options['vbookiegivetopoor'] . " WHERE vbookie_cash < " $vbulletin->options['vbookiegivetopoor']);    
                break;
            case 
'ucash':
                
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET ucash=" $vbulletin->options['vbookiegivetopoor'] . " WHERE ucash < " $vbulletin->options['vbookiegivetopoor']);    
                break;
            case 
'ebux':
                
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "user SET vbbux=" $vbulletin->options['vbookiegivetopoor'] . " WHERE vbbux < " $vbulletin->options['vbookiegivetopoor']);    
                break;
            case 
'custom':
                (
$hook vBulletinHook::fetch_hook('vbookie_do_charity')) ? eval($hook) : false;
        
        }
    }
}

function 
vbookie_delete_event($eventinfo)
{
    global 
$vbulletin;
    
// if we're deleting an event that has bets on it but hasn't yet been settled,
    // we must give people their money back.
    
if ($eventinfo['item_status'] == 'OPEN' OR $eventinfo['item_status'] == 'CLOSED')
    {
        
// abandon the bet
        
vbookie_abandon_event($eventinfo['item_id']);
    }

    
$vbulletin->db->query_write("DELETE FROM "TABLE_PREFIX "vbookie_bets_placed WHERE item_id=$eventinfo[item_id]");
    
$vbulletin->db->query_write("DELETE FROM "TABLE_PREFIX "vbookie_item_options WHERE item_id=$eventinfo[item_id]");
    
$vbulletin->db->query_write("DELETE FROM "TABLE_PREFIX "vbookie_items WHERE item_id=$eventinfo[item_id]");

    
// update the thread this was attached to to remove the event.
    
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "thread SET vbookie_item_id=0 WHERE vbookie_item_id=$eventinfo[item_id]");
}
?>
Reply With Quote
  #2239  
Old 07-06-2009, 02:26 PM
aranthorn's Avatar
aranthorn aranthorn is offline
 
Join Date: Jun 2004
Location: Chicago
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CyprusTM View Post
is this good for Football (soccer) predictions? when will it be available for version 3.8 ?

Id love to use this on my forum for the upcoming season

Cheers
That's exactly what I had to install it for.

Running on 3.7.1 (because I got sick of upgrading vbulletin every 2 weeks)
Reply With Quote
  #2240  
Old 07-15-2009, 01:47 AM
Viruseater Viruseater is offline
 
Join Date: Mar 2002
Location: Newport Beach, CA
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this has probably been covered but in a thread with 150 pages of replies, and the terrible search engine vb has I can't find this answer.

I've got everything working, except changing the dates of the lines opening. I can't edit or set either. does this make sense? I need to stop an event on aug 1 but it stays at the date i made the event at 1am.

thoughts?
Reply With Quote
  #2241  
Old 07-20-2009, 08:22 PM
Chase Chase is offline
 
Join Date: May 2002
Location: Northern Ohio
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any updates on the progress of the rewrite of this script. I really want to use this... but I want a stable version.

Out of curiosity.... does anyone with 3.8.3 installed have it working while using these instructions? https://vborg.vbsupport.ru/showpost....postcount=2152. If so, are these the ONLY instructions necessary needed to get this to work on 3.8.3?
Reply With Quote
Reply


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 01:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06561 seconds
  • Memory Usage 2,396KB
  • Queries Executed 26 (?)
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
  • (2)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
  • (4)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