vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - vBookie for vBulletin 4 (https://vborg.vbsupport.ru/showthread.php?t=233473)

gazzak 09-10-2011 12:35 PM

If you could build in the feature to take the money from the bookie directly then it would be fantastic.

So what happens if the bookie can't afford to pay out?

Edit: I just tried this and the event will still pay out even if the bookies account hits zero. That is open to abuse. How can we stop the event paying out more than the bookie has on hand?

FReeSTER 09-17-2011 12:29 PM

this is breaking up my new style just on the Bookie thread.

I did added this {vb:raw headinclude_bottom}
but same.

billybobilou 09-17-2011 02:33 PM

Bonjours
J'ai une erreur quand je clic sur "Bet statistics":
Quote:

Warning: mysqli_query(): Empty query in [path]/includes/class_core.php on line 1300
Merci

Hello
I get an error when I click on "Bet statistics":
[QUOTE] Warning: mysqli_query (): Empty query in [path] / includes / class_core.php on line 1300 [/ QUOTE]
thank you

dartho 09-17-2011 09:25 PM

That should not happen. Do you still get an error after you have created a vBookie event?

starman? 09-19-2011 05:07 PM

Quote:

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.
I see vBPlaza / vBux has just been re- released. How would I go about integrating your product with that? Any help appreciated. thanks.

billybobilou 10-06-2011 11:57 AM

Bonjour dartho, oui ça ce produit a chaque fois
merci
Good morning dartho, yes this this product has every time
thank you

rootsxrocks 10-07-2011 12:32 AM

Quote:

Originally Posted by Mickie D (Post 2238076)
Little problem with this.

When I had the original on vb3 it would give and take money from the bookie.

so whatever the members betted, went into the bookies cash, and if they won they would receive the money from the bookie, if they lost the bookie would keep the cash.

My users liked this as it put an edge on the game - nicking a little from there friends.

Now when they play the money goes no where but they win or lose the amount.

Does anyone have any ideas why the bookie is not getting the money before the game ?

Thanks for any help.

Mick

Quote:

Originally Posted by dartho (Post 2241994)
Ah - I remember now, you're probably using this version whioch would explain why you did not have to modifiy the code: https://vborg.vbsupport.ru/showthrea...17#post2157617

Quote:

Originally Posted by Mickie D (Post 2242296)
I got it working!

It was a very easy fix - you just change the "CASE".

If anyone is interested and all credits to the original add on maker... I done nothing really!

You will need to follow the instructions from this post
https://vborg.vbsupport.ru/showpost....&postcount=716

But when it comes to the edit for function_vbookie.php use this code below

Code:

// Additional pay/debit bookie
function vbookie_take_bookie_cash($userid, $amount)
{
    global $vbulletin;

    $bookie = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=$userid");

    switch ($vbulletin->options['vbookiecash'])
    {
        case 'vCash':
       
       
            if($amount > $bookie['vbookie_cash'])
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=0 WHERE userid=$userid");
            }
            else
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=vbookie_cash-$amount WHERE userid=$userid");
            }
            break;
        case 'uCash':
            if($amount > $bookie['ucash'])
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=0 WHERE userid=$userid");
            }
            else
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=ucash-$amount WHERE userid=$userid");
            }
            break;
        case 'eBux':
            if($amount > $bookie['ebux'])
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=0 WHERE userid=$userid");
            }
            else
            {
                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=ebux-$amount WHERE userid=$userid");
            }
            break;
        case 'custom':
            ($hook = vBulletinHook::fetch_hook('vbookie_take_bookie_cash')) ? eval($hook) : false;
    }
}


Quote:

Originally Posted by dartho (Post 2242360)
Excellent - glad you go it working!

This is the kind of accountability I was hoping to have while using a second currency with vb credits deluxe, I had hoped it would be something that was worked on. I should have been coming here to look for it I suppose. I need to have limits on the betting or keep the bookies money as a bank and discard any use of the credits for bets.

reeshe 10-07-2011 02:17 AM

I see how to use experience points with this but is there a way to use vbactivity with this? Thanks in advance

vanquish.securi 10-08-2011 05:05 AM

Works great on 4.1.7. Marked.

petergharris 10-15-2011 10:55 AM

I am having a problem as regards the time setting on vbookie.

It used to work perfectly, but at the moment I am having to put on GMT+1 instead of GNT to get the right time for when I want to close the event.

The time at the bottom of the forum is correct so it doesn't have anything to do with that.

Does anyone have any ideas?

DEREKTROTTER 10-22-2011 05:16 AM

Can you please tell me how to adjust the betting limit for vBookie? I'd like to know this because when I go to the general settings for vbookie, there isn't an option there to adjust it.

rootsxrocks 10-22-2011 05:25 AM

I would sure like to know how to do that too as well as confirmation on how to make bets pay from the bookie account

dartho 10-22-2011 05:33 AM

Quote:

Originally Posted by DEREKTROTTER (Post 2260033)
Can you please tell me how to adjust the betting limit for vBookie? I'd like to know this because when I go to the general settings for vbookie, there isn't an option there to adjust it.

Derek - you have not downloaded vBookie or clicked mark as installed?

dartho 10-22-2011 05:35 AM

Check, might work:
Quote:

Originally Posted by Railen
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.


ghaleon7 10-22-2011 08:27 AM

Quote:

Originally Posted by starman? (Post 2247949)
I see vBPlaza / vBux has just been re- released. How would I go about integrating your product with that? Any help appreciated. thanks.

If at all possible can someone explain to me how to get the vBookie to use vbbux.

zapiy 10-28-2011 02:50 PM

Hi i have a page full of events with no delete option.. The threads have been fully deleted and when i click the Thread or info links i get this..

No Thread specified. If you followed a valid link, please notify the administrator

Any help please?

dartho 10-28-2011 09:25 PM

if the threads has been deleted somehow withiut deleting the event, you will need to manually remove it from your database (search vbookie_items table on the threadid)

DEREKTROTTER 11-06-2011 02:33 AM

@dartho, I installed the add on without pressing 'mark as installed'. It is now marked as installed.

Can you please tell me now how I can adjust the betting limit for vBookie. (I know it is somewhere in the php file.

:) Thanks

dartho 11-06-2011 06:46 AM

Hi Derek, it wasn't that you hadnt clicked 'Mark As Installed' so much so as hadn't even downloaded it (as 'Coder' of this thread - I can see which people who post in this thread have downloaded the mod) - which usually means you obtained the mod from a pirate site which usually means you aren't licensed. I can now see you have since downloaded so I know this is not the case (although you still aren't showing as 'Marked as Installed')

Anyway - I did actually answer your question on the previous page where you asked it: https://vborg.vbsupport.ru/showthrea...40#post2260040

DEREKTROTTER 11-15-2011 05:59 AM

The betting limit has been adjusted.

I have a very unusual problem, which you probably cannot help me with, but I'll see if you can.

There is an event which just won't go away. It had been on for ages and ages when it was already settled. It doesn't direct to a particular thread. I'm thinking this might be because the thread was deleted, before the event was settled. Am I right?

Thanks.

ChromeDome 11-18-2011 03:06 AM

I get this error when I surf on one of the vbookie pages:

Code:

Database error in vBulletin 4.1.8:

Invalid SQL:
SELECT
              SUM(bet_amount_won) AS sumbets
              FROM vb_vbookie_bets_placed
              WHERE bet_settled='Y' AND userid=1
              AND dateline > 315532800
              GROUP BY userid;

MySQL Error  : Unknown column 'dateline' in 'where clause'
Error Number  : 1054
Request Date  : Thursday, November 17th 2011 @ 11:01:50 PM
Error Date    : Thursday, November 17th 2011 @ 11:01:50 PM
Username      : Unregistered
Classname    : vB_Database_MySQLi
MySQL Version :


Successfulsteps 12-20-2011 12:13 AM

I just upgraded to 4.1.9 and keep getting this db error. Can't settle bets nor can we make new ones or create new items to bet on:

Database error in vBulletin 4.1.9:

Invalid SQL:
SELECT
SUM(bet_amount_won) AS sumbets
FROM vbookie_bets_placed
WHERE bet_settled='Y' AND userid=2
AND dateline >
GROUP BY userid;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY userid' at line 6
Error Number : 1064
Request Date : Monday, December 19th 2011 @ 07:10:52 PM
Error Date : Monday, December 19th 2011 @ 07:10:52 PM
Script : http://www.1stdegreefreebies.com/for...and=1324343450
Referrer : http://www.1stdegreefreebies.com/forums/index.php
IP Address : **left off on purpose**
Username : Unregistered
Classname : vB_Database
MySQL Version :

thenamesgould 12-20-2011 06:42 AM

Hi dartho, wow, another great mod from you (or ported at least) ... I've just installed this on my forum, and it should go down a treat, I reckon! (When people aren't busy posting in the girlfriend thread).

Just one simple question, where can I edit the template for the bet info? Eg:

https://vborg.vbsupport.ru/external/2011/12/22.jpg

I want to change that odds column where it says (1.10) and (0.83) to $2.10 and $1.83, which I'm correct in saying would be the actual return, wouldn't it? Just to make it a bit simpler for the less seasoned gamblers to use. Should be easy enough, whack in a $ and add one to the numbers, I assume?

Cheers for any help. :)

dartho 12-21-2011 11:05 AM

edit the vBookie: Show Events in Showthread plugin, search for
PHP Code:

$outcome['odds_decimal'] = sprintf("%0.2f", ((float)$outcome['odds_against']/(float)$outcome['odds_for'])); 

replace with
PHP Code:

$outcome['odds_decimal'] = sprintf("%0.2f", ((float)$outcome['odds_against']/(float)$outcome['odds_for'])+1); 

then edit the vbookie_outcomebits_nobet and vbookie_outcomebits temapltes and search for
HTML Code:

<td class="{vb:raw bgclass}" align="right"> ({vb:raw outcome.odds_decimal}) </td>
and change to
HTML Code:

<td class="{vb:raw bgclass}" align="right"> (${vb:raw outcome.odds_decimal}) </td>

thenamesgould 12-22-2011 06:32 AM

Thanks dartho!!! Works perfectly, of course! :)

thenamesgould 12-25-2011 11:06 AM

I'm just having a mess around with this, and I'd like the $ change to take effect on bet.odds_decimal as well ... is that possible? This is for the event info screen. I've got the $ sign in there, but can't get the 1 to add on.

SRSC 12-25-2011 12:58 PM

Hi dartho,
Please let me know where I can find the yellow word in the pictures to translate in to my language? I use "Search in Phrases" but no thing is change
Thanks

https://vborg.vbsupport.ru/external/2011/12/3.png

https://vborg.vbsupport.ru/external/2011/12/4.png

dartho 12-25-2011 10:29 PM

@SRSC, they are all phrased an can be changed in Phrase Manager.

The language in the second screen capture you have will not change until new information is posted as those statements are recorded in the database based on phrases at the time they were created.

@thenamesgould - check the vbookie.php file andsearch for ['odds_decimal'] and make changes like you did in the plugin

SRSC 12-26-2011 06:10 AM

Quote:

Originally Posted by dartho (Post 2280971)
@SRSC, they are all phrased an can be changed in Phrase Manager.

The language in the second screen capture you have will not change until new information is posted as those statements are recorded in the database based on phrases at the time they were created.

I already changed "OPEN" to new phrase but it not change in the 1st picture? or it will change from new bet created on?
please confirm that

Jakub03 01-04-2012 04:23 AM

Is it possible to change the name vCash to something else? Instead of in profiles of showing up as vCash i want it to show MPH Chips is this possible to do?

dartho 01-04-2012 01:27 PM

eDIT THE VCASH PHRASE i THINK (oops - caps lock)

EasyEazy 01-07-2012 10:28 AM

Is there a solution for removing the navbar tab but not the subnav options?

I tried both in the options and the plug in but its removes the sub nav options.

Thanks in advance

Killabee 01-12-2012 12:13 AM

Running 4.1.9 vbulletin

installed mod and once filling out all information and trying to submit the event i get the following error message.

Code:

Database error in vBulletin 4.1.9:

Invalid SQL:
UPDATE vb_user SET credits=6 WHERE credits < 6;

MySQL Error  : Unknown column 'credits' in 'where clause'
Error Number  : 1054
Request Date  : Wednesday, January 11th 2012 @ 06:06:16 PM
Error Date    : Wednesday, January 11th 2012 @ 06:06:16 PM
Script        : http://***********.com/vbookie.php
Referrer      : http://**********.com/vbookie.php
IP Address    : *************
Username      : *******
Classname    : vB_Database_MySQLi
MySQL Version : 5.1.60-community-log


dartho 01-12-2012 02:29 AM

looks like a vbcredits or otehr money add-on integration issue

Killabee 01-13-2012 02:35 AM

does this work with vbplaza / vbbux?

dartho 01-13-2012 05:12 AM

Hooks are there so that others can integrate with it - check with the developers

acast 01-15-2012 02:16 PM

Edit: It is working the code por Functions_vbookie.php to integrate vbbux in Custom.

Code:

<?php
// Last updated version 4.0.7 19-02-2010 10:07


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['ebux'];
                        break;
                case 'vbCredits':
                        $cash = (int)$vbulletin->userinfo['credits'];
                        break;
                case 'Reputation':
                        $cash = (int)$vbulletin->userinfo['reputation'];
                        break;
                case 'Custom':
                        $cash = (int)$vbulletin->userinfo['vbbux'];
                        break;
               
        }
       
        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 ebux=ebux-$amount WHERE userid=" . $vbulletin->userinfo['userid']);       
                        $cash = (int)$vbulletin->userinfo['ebux'];
                        break;
                case 'vbCredits':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits=credits-$amount WHERE userid=" . $vbulletin->userinfo['userid']);       
                        $cash = (int)$vbulletin->userinfo['credits'];
                        break;
                case 'Reputation':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET reputation=reputation-$amount WHERE userid=" . $vbulletin->userinfo['userid']);       
                        $cash = (int)$vbulletin->userinfo['reputation'];
                        break;
                case 'Custom':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=vbbux-$amount WHERE userid=" . $vbulletin->userinfo['userid']);       
                        $cash = (int)$vbulletin->userinfo['vbbux'];
                        break;
               
        }
}

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 ebux=ebux+$amount WHERE userid=$userid");       
                        $cash = (int)$vbulletin->userinfo['ebux'];
                        break;
                case 'vbCredits':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits=credits+$amount WHERE userid=$userid");       
                        $cash = (int)$vbulletin->userinfo['credits'];
                        break;
                case 'Reputation':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET reputation=reputation+$amount WHERE userid=$userid");       
                        $cash = (int)$vbulletin->userinfo['reputation'];
                        break;
                case 'Custom':
                        $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=vbbux+$amount WHERE userid=$userid");       
                        $cash = (int)$vbulletin->userinfo['vbbux'];
                        break;
               
        }
}

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, ebux AS cash FROM " . TABLE_PREFIX . "user ORDER BY cash DESC LIMIT 5";       
                        break;
                case 'vbCredits':
                        $q = "SELECT username, credits AS cash FROM " . TABLE_PREFIX . "user ORDER BY cash DESC LIMIT 5";       
                        break;
                case 'Reputation':
                        $q = "SELECT username, reputation AS cash FROM " . TABLE_PREFIX . "user ORDER BY cash DESC LIMIT 5";       
                        break;
                case 'Custom':
                        $q = "SELECT username, vbbux AS cash FROM " . TABLE_PREFIX . "user ORDER BY cash DESC LIMIT 5";       
                        break;
       
        }

        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 ebux=" . $vbulletin->options['vbookiegivetopoor'] . " WHERE ebux < " . $vbulletin->options['vbookiegivetopoor']);       
                                break;
                        case 'vbCredits':
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET credits=" . $vbulletin->options['vbookiegivetopoor'] . " WHERE credits < " . $vbulletin->options['vbookiegivetopoor']);       
                                break;
                        case 'Reputation':
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET reputation=" . $vbulletin->options['vbookiegivetopoor'] . " WHERE reputation < " . $vbulletin->options['vbookiegivetopoor']);       
                                break;
                        case 'Custom':
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=" . $vbulletin->options['vbookiegivetopoor'] . " WHERE vbbux < " . $vbulletin->options['vbookiegivetopoor']);       
                                break;
               
                }
        }
}

function vbookie_delete_event($eventinfo)
{
        global $vbulletin;
        ($hook = vBulletinHook::fetch_hook('vbookie_delete_event')) ? eval($hook) : false;
        // 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]");
}

function vbookie_reset_vcash($amount)
{
        global $vbulletin;
                $q = "UPDATE " . TABLE_PREFIX . "user SET vbookie_cash =".$amount;       
        return $vbulletin->db->query($q);
               
       
}

function vbookie_set_default_vcash($amount)
{
        global $vbulletin;
                $q = "ALTER TABLE " . TABLE_PREFIX . "user CHANGE COLUMN vbookie_cash vbookie_cash BIGINT(20) UNSIGNED NULL DEFAULT ".$amount;       
        return $vbulletin->db->query($q);
}

function vbookie_give_users_vcash($amount)
{
        global $vbulletin;
                $q="UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=vbookie_cash+$amount";
        return $vbulletin->db->query($q);

}
// Additional pay/debit bookie
function vbookie_take_bookie_cash($userid, $amount)
{
        global $vbulletin;

        $bookie = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=$userid");

        switch ($vbulletin->options['vbookiecash'])
        {
                case 'vCash':
               
               
                        if($amount > $bookie['vbookie_cash'])
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=0 WHERE userid=$userid");
                        }
                        else
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=vbookie_cash-$amount WHERE userid=$userid");
                        }
                        break;
                case 'uCash':
                        if($amount > $bookie['ucash'])
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=0 WHERE userid=$userid");
                        }
                        else
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=ucash-$amount WHERE userid=$userid");
                        }
                        break;
                case 'eBux':
                        if($amount > $bookie['ebux'])
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=0 WHERE userid=$userid");
                        }
                        else
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=ebux-$amount WHERE userid=$userid");
                        }
                        break;
                case 'Custom':
                                if($amount > $bookie['vbbux'])
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=0 WHERE userid=$userid");
                        }
                        else
                        {
                                $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=vbbux-$amount WHERE userid=$userid");
                        }
                        break;
        }
}
?>


ukgamblingforum 01-23-2012 10:33 PM

Freshly installed on 4.0.4 - didn't do any template edits as instructed, activated everything, set usergroups ok and i still am not seeing anything under threads to create a bookie event (however i DO see a vbulletin menu up top).

When i go into usergroup perms for admins / supermods (groups who should be able to create events) - vbookie/vbulletin won't save the allow vbulletin options. HELP.!

ProFifaLeagues 01-23-2012 10:37 PM

Quote:

Originally Posted by ukgamblingforum (Post 2291552)
Freshly installed on 4.0.4 - didn't do any template edits as instructed, activated everything, set usergroups ok and i still am not seeing anything under threads to create a bookie event (however i DO see a vbulletin menu up top).

When i go into usergroup perms for admins / supermods (groups who should be able to create events) - vbookie/vbulletin won't save the allow vbulletin options. HELP.!


rebuild bit fields.... append this to your forums domain ...

/admincp/index.php?do=buildbitfields __________________:up:

dartho 01-24-2012 05:08 AM

Quote:

Originally Posted by ukgamblingforum (Post 2291552)
Freshly installed on 4.0.4 - didn't do any template edits as instructed, activated everything, set usergroups ok and i still am not seeing anything under threads to create a bookie event (however i DO see a vbulletin menu up top).

When i go into usergroup perms for admins / supermods (groups who should be able to create events) - vbookie/vbulletin won't save the allow vbulletin options. HELP.!

You create a new thread, and just around the usual "add poll to thread" check box, there should be an add vbokie event to trhead option


All times are GMT. The time now is 03:28 AM.

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.02706 seconds
  • Memory Usage 1,958KB
  • 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_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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