vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vBookie - vBulletin Betting Hack (https://vborg.vbsupport.ru/showthread.php?t=65844)

Regs 06-10-2004 04:18 PM

Excellent stuff, thanks!

Quote:

Of course, you can do whatever you see fit, here. You might prefer to only allow vBookie events to be created in a specific forum, rather than in every forum. To do this, just set the permissions for specific forums as normal.
Could you clarify this a bit more? I want to set up a forum for only vbookie events but there are no settings in the adminCP for doing so? From the installation instructions I can see that there are no file edits to the admincp/forums.php file so I must be misreading the purpose or something...

Cheers,

~Regs.

tjdrico 06-10-2004 04:19 PM

Quote:

Originally Posted by immotive
i modified according to here

https://vborg.vbsupport.ru/showthrea...ror#post520745

events are recorded, but i still got the error.

Please check the contents of 'includes/functions_vbookie.php', in particular the vbookie_do_charity() function, and make sure that the first line of it says:

PHP Code:

global $DB_site$vboptions$vbookiesettings

If it does, then please report back, and tell me what the values of uttpoints_pointtable and uttpoints_pointsfield are in your uTT Store settings.

tjdrico 06-10-2004 04:23 PM

Quote:

Originally Posted by Regs
Could you clarify this a bit more? I want to set up a forum for only vbookie events but there are no settings in the adminCP for doing so? From the installation instructions I can see that there are no file edits to the admincp/forums.php file so I must be misreading the purpose or something...

Using the 'Usergroups' -> 'Forum Permissions' page, you can edit each user group, e.g. Registered Users, forum-specific permissions. You will get a warning that custom permissions must be enabled, but as long as you OK that, you can set up forum-specific permissions and restrict vBookie to that forum. You can make the same changes via 'Forums & Moderators' -> 'Forum Permissions' as well.

nydk 06-10-2004 04:52 PM

Quote:

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

But you can only bet values of integers also..

i set up an event and the user i was on had like $3.50... i could only bet 1, 2, or 3

is this how its supposed to be?

tjdrico 06-10-2004 05:35 PM

Quote:

Originally Posted by nydk
But you can only bet values of integers also..

i set up an event and the user i was on had like $3.50... i could only bet 1, 2, or 3

is this how its supposed to be?

Yes. It was designed to use its own vCash or integer points originally. uCash came later but it only made sense in the original version to bet with whole points. Everything's geared around integers, and most points systems are integer based.

LoOnEyToOnZ 06-11-2004 02:42 AM

Quote:

Originally Posted by tjdrico
Please check the contents of 'includes/functions_vbookie.php', in particular the vbookie_do_charity() function, and make sure that the first line of it says:

PHP Code:

global $DB_site$vboptions$vbookiesettings

If it does, then please report back, and tell me what the values of uttpoints_pointtable and uttpoints_pointsfield are in your uTT Store settings.

Hello tjdrico

I will help immotive answer some questions since he is too busy and cant check here too often.

Yes, the global $DB_site, $vboptions, $vbookiesettings; is there under the vbookie_do_charity() function .

May i know where can i find out the utt store settings ? There are too many instances of uttpoints_pointtable and uttpoints_pointsfield in 'includes/functions_vbookie.php' .

tjdrico 06-11-2004 06:27 AM

Quote:

Originally Posted by LoOnEyToOnZ
May i know where can i find out the utt store settings ?

In your AdminCP, under "uTT Store Hack", click on "uTT Point System Settings". The first two entries on that page are the pointstable and pointsfield settings.

For example, mine say 'user' and 'uttpoints'.

If they are correctly set, are you sure that your uTT Store hack is correctly installed? Is it working as expected in other instances?

immotive 06-11-2004 03:01 PM

Thanks for your hint, i made some mistake in my global.php

Quote:

Originally Posted by tjdrico
Please check the contents of 'includes/functions_vbookie.php', in particular the vbookie_do_charity() function, and make sure that the first line of it says:

PHP Code:

global $DB_site$vboptions$vbookiesettings

If it does, then please report back, and tell me what the values of uttpoints_pointtable and uttpoints_pointsfield are in your uTT Store settings.


LoOnEyToOnZ 06-12-2004 11:47 AM

Another question - Is the tax a compulsary amount to have ? Cause i had noticed that quite a few items, by default come with a tax amount. Is it okay if we get rid of all the taxes ?

Thanks

MrNase 06-12-2004 11:56 AM

you must be insane... how shall i translate that? dozens of templates, many phrases and some english text left in the file :(

LoOnEyToOnZ 06-12-2004 12:44 PM

Quote:

Originally Posted by MrNase
you must be insane... how shall i translate that? dozens of templates, many phrases and some english text left in the file :(

Are you talking to me ? Kindly use a better tone towards me or anyone else

Shall i rephrase as "is it possible to use a 0 value inside the AdminCP Action Manager" ?

MrNase 06-12-2004 02:24 PM

ops sorry, i forgot a ':D' after the '...' :(

installed, translated and running, thank you :)

tjdrico 06-12-2004 03:42 PM

Quote:

Originally Posted by LoOnEyToOnZ
Another question - Is the tax a compulsary amount to have ? Cause i had noticed that quite a few items, by default come with a tax amount. Is it okay if we get rid of all the taxes ?

Thanks

vBookie imposes no taxes.

tjdrico 06-12-2004 03:44 PM

Quote:

Originally Posted by MrNase
you must be insane... how shall i translate that? dozens of templates, many phrases and some english text left in the file :(

Sorry for the bits that aren't in templates or phrases. That was just laziness on my part. I assure you that all the templates and phrases are there for a reason though. =)

Tim Wheatley 06-12-2004 04:13 PM

Can someone please tell me where/how I can hard code the userid of those I want to allow to post events? I don't want to risk the complications of setting up new usergroups, as some of those I want to post events are mods, some registered, etc etc. I don't expect this to be added to the hack, btu the knowledge would be useful to some. :)

tjdrico 06-12-2004 06:19 PM

Quote:

Originally Posted by Tim Wheatley
Can someone please tell me where/how I can hard code the userid of those I want to allow to post events? I don't want to risk the complications of setting up new usergroups, as some of those I want to post events are mods, some registered, etc etc. I don't expect this to be added to the hack, btu the knowledge would be useful to some. :)

There are probably a couple of places you should do this. The first would be in newthread.php

There'll be a section like this:

PHP Code:

    if (!($forumperms CANPOSTVBOOKIEEVENT))
    {
        unset(
$_POST['postvbookieevent']);
    } 

You could change that to something like:

PHP Code:

    if (!$bbuserinfo['userid'] != 126)
    {
        unset(
$_POST['postvbookieevent']);
    } 

Also:

PHP Code:

    if (($forumperms CANPOSTVBOOKIEEVENT) && ($vbookiesettings['active'] != 0))
    {
        
$show['vbookieevent'] = true;
    } 

To:

PHP Code:

    if (($bbuserinfo['userid'] == 126) && ($vbookiesettings['active'] != 0))
    {
        
$show['vbookieevent'] = true;
    } 

That should hide the checkbox for adding a new event from everyone but the allowed user.

Then, in vbookie.php, find the section that starts:

PHP Code:

if ($_REQUEST['do'] == 'newevent'

Then, below that, find the lines:

PHP Code:

    if (!($forumperms CANVIEW) OR !($forumperms CANPOSTNEW) OR !($forumperms CANPOSTVBOOKIEEVENT))
    {
        
print_no_permission();
    } 

Change that to:

PHP Code:

    if (!($forumperms CANVIEW) OR !($forumperms CANPOSTNEW) OR !($bbuserinfo['userid'] == 126))
    {
        
print_no_permission();
    } 

There will be a similar change to make in the section that starts:

PHP Code:

if ($_POST['do'] == 'postevent'

Just search on 'CANPOSTVBOOKIEEVENT' to find the two locations.

I think that'd be enough, but it's just from my head and not tested in any way.

stuc 06-12-2004 07:15 PM

I keep getting the error

Parse error: parse error in /usr/local/psa/home/vhosts/forestforum.co.uk/httpdocs/forum/includes/init.php on line 516
Parsing functions.php Time before: 1087071117.6956 Time after: 1087071117.7328 Time taken: 0.037165880203247
--------------------------------------------------------------------------------
Processing sessions.php Time before: 1087071117.7334

which relates to this section

Code:

'stylecache',
'arcadesettings',
// +++ vBookie
'vbookiesettings'
// --- vBookie
), $specialtemplates);

                $datastoretemp = $DB_site->query("
                        SELECT title, data
                        FROM " . TABLE_PREFIX . "datastore
                        WHERE title IN ('" . implode("', '", $specialtemplates)) . "')
                ");

Any ideas?

tjdrico 06-12-2004 07:23 PM

I think the problem is this line:

PHP Code:

WHERE title IN ('" . implode("''", $specialtemplates)) . "'

Maybe you've edited it for some other hack, but I think it should be:

PHP Code:

WHERE title IN ('" . implode("''", $specialtemplates) . "'

i.e. you've ended up with an extra ) in there.

stuc 06-12-2004 07:28 PM

excellent that sorted it - no idea how i missed that! :o

excellent hack by the way i'm sure it will become an essential part of my forum.

(clicked install)

BarHopper 06-12-2004 09:36 PM

I need this hack!! I attempted it, but i messed up on msot of the file eidts,

Is anyone interested doing the file edits for me? Just the include ones? I'll pay

Mr. Brian 06-12-2004 11:18 PM

Oops.. Didn't expect to get this..

Quote:

Parse error: parse error in /home/soccerwi/public_html/forums/vbookie.php on line 728
Any ideal whats went wrong?

tjdrico 06-13-2004 06:37 AM

Quote:

Originally Posted by BarHopper
I need this hack!! I attempted it, but i messed up on msot of the file eidts,

Is anyone interested doing the file edits for me? Just the include ones? I'll pay

I don't have a lot of time to respond right now, but PM me and we can sort it out.

tjdrico 06-13-2004 06:39 AM

Quote:

Originally Posted by Matthew Lam
Oops.. Didn't expect to get this..



Any ideal whats went wrong?

Did you edit the script in any way? Try re-uploading the original script. No one else has reported a parse error, so I'm assuming it's a mistake you've made. Which version of the file did you download? Are you sure it extracted OK and uploaded without errors? vbookie.php in version 1.0.3 should be 58,966 bytes according to my PC.

MrNase 06-13-2004 10:19 AM

Is there a chance to allow commas? The odds for France beating England are 1.90 to 1 but vbookie changes that to 2 :(

kall 06-13-2004 11:34 AM

Quote:

Originally Posted by MrNase
Is there a chance to allow commas? The odds for France beating England are 1.90 to 1 but vbookie changes that to 2 :(

Just make the odds 190 to 100...

tjdrico 06-13-2004 11:50 AM

Quote:

Originally Posted by kall
Just make the odds 190 to 100...

Or 19/10. =)

MrNase 06-13-2004 12:00 PM

hey cool, i'll do so. thank you :)

LoOnEyToOnZ 06-13-2004 02:57 PM

tjdrico does the back work like when people place a bet the money is subtracted from them first, then later when the event is settled, the money is kept or the odds will be paid out ?

also, if i create the events, will the money be deducted from me or the system ?

Mr. Brian 06-13-2004 05:27 PM

Quote:

Originally Posted by tjdrico
Did you edit the script in any way? Try re-uploading the original script. No one else has reported a parse error, so I'm assuming it's a mistake you've made. Which version of the file did you download? Are you sure it extracted OK and uploaded without errors? vbookie.php in version 1.0.3 should be 58,966 bytes according to my PC.

Seem like I've to create an event before proceeding any step further. And yes, I did, and now the problem are sloved! :D


Thanks for your reply anyway. :)

tjdrico 06-13-2004 10:09 PM

Quote:

Originally Posted by LoOnEyToOnZ
tjdrico does the back work like when people place a bet the money is subtracted from them first, then later when the event is settled, the money is kept or the odds will be paid out ?

also, if i create the events, will the money be deducted from me or the system ?

If I place a bet on an event, the stake is immediately deducted from me. That might mean I lose 50 uTT points, or 50 Petz points or 50 reputation etc.

When the bet is settled, if I lost I get nothing back. If I won, I get my winnings, plus the stake returned as well.

All bets are settled using an infinate supply of system points/money. I did think about making it so that there was a "system pot" or the administrator/event owner being liable, but it didn't seem to be as much fun as people would have to concentrate too hard on a) their odds and b) limiting the number of bets they accepted so all wins could be covered.

msimplay 06-14-2004 09:53 AM

absolutely Fantastic hack great work

i would make a suggestion tho adding events to threads that don't already have them
like the add poll button on the forum drop down :)

tjdrico 06-14-2004 10:02 AM

Quote:

Originally Posted by msimplay
absolutely Fantastic hack great work

i would make a suggestion tho adding events to threads that don't already have them
like the add poll button on the forum drop down :)

Yep, fair point. I didn't actually realise one could add a poll to a thread like that until very recently when I stumbled upon it my accident. I have a few things I want to do for an update to vBookie, and I dare say this will be one of them.

msimplay 06-14-2004 10:35 AM

i hope the updates easy to install hehe :p

Alan Ang 06-14-2004 03:39 PM

hi tjdrico,

i think your betting system is great!

i have a some features for the next version that i would like to suggest:

1. admin able to assign credits to individual members. (i.e. members with higher donations to forum can get higher starting vCash, it also allows players who are bankrupt to come back into the game with a new donation.)
2. members are able to set up separate wagers with fellow members, subjected to credit limit bought/assigned by admin. win or loss are deducted from one another.
3. when members bet with one another (i.e. this allows members to side bet with each other, and to deduct directly from current top winners.), a portion of the proceeds goes to the admin.
4. members have varied credit limits when betting, limit to be set by admin.
5. admin able to set a limit to the total bets received.
6. admin to have a panel that lists the full details of all bets as well as summarized reports.
7. admin to be able to stop accepting bets in realtime, in order to adjust odds.
8. admin to be able to set formula for calculation of odds for automatic tabulation.
9. members able to have a results panel to list their current bets, past bets and total profit/loss.

i feel that with these features, it makes for a more realistic betting system and it allows an avenue for forums to start its subscriptions for members. in turn, forums can work with businesses to sponsor prizes for the person who finally makes the most vCash at the end of the events/season.

is this possible? or is it too hard to be realised?

tjdrico 06-14-2004 05:26 PM

Hi Alan, I've read your post and will respond properly later when I've a bit more time. Most, if not all of the things are fairly straight forward. Really it comes down to whether I can be bothered. ;) I'll give a better reply later.

tjdrico 06-14-2004 07:24 PM

Quote:

Originally Posted by Alan Ang
1. admin able to assign credits to individual members. (i.e. members with higher donations to forum can get higher starting vCash, it also allows players who are bankrupt to come back into the game with a new donation.)

I addressed this previously, saying that there are many store/points hacks already available that offer this sort of thing. I don't really have plans to incorporate it into vBookie but you're not the first to ask, and if I get more requests for the same thing I'll probably do it.

However, there is already a mechanism for players to "get back into the game" - there's a "charity mode" whereby anyone on less than 25 credits gets set to 25 when a new event is added.


Quote:

Originally Posted by Alan Ang
2. members are able to set up separate wagers with fellow members, subjected to credit limit bought/assigned by admin. win or loss are deducted from one another.

I like the idea, but it doesn't really fit into the current framework. It'd require some sort of challenge/response mechanism to be built in. That's not particularly difficult, but it's a sizeable addition. Like I say, I do like the idea though, so I'll consider doing it.


Quote:

Originally Posted by Alan Ang
3. when members bet with one another (i.e. this allows members to side bet with each other, and to deduct directly from current top winners.), a portion of the proceeds goes to the admin.

Not entirely sure what you mean here by "deduct directly from the top winners.


Quote:

Originally Posted by Alan Ang
4. members have varied credit limits when betting, limit to be set by admin.

This was actually in my original plan, but I decided not to bother since it's virtual "cash" and there's an unlimited supply as far as settling goes.


Quote:

Originally Posted by Alan Ang
5. admin able to set a limit to the total bets received.

Again, since there's an unlimited settlement pot, there's really no need to limit the number or size of bets that may be placed.


Quote:

Originally Posted by Alan Ang
6. admin to have a panel that lists the full details of all bets as well as summarized reports.

9. members able to have a results panel to list their current bets, past bets and total profit/loss.

Better reporting is certainly something that's relatively simple to add.


Quote:

Originally Posted by Alan Ang
7. admin to be able to stop accepting bets in realtime, in order to adjust odds.

You can close an event at any point to do this, just by changing the appropriate time. Do you mean a one-click button to do the job?


Quote:

Originally Posted by Alan Ang
8. admin to be able to set formula for calculation of odds for automatic tabulation.

I'm not sure what you're getting at here.


Quote:

Originally Posted by Alan Ang
is this possible? or is it too hard to be realised?

None of it is particularly difficult. All I need is the motivation to do it. =) I'll look to release an update with some enhancements in the next week or two.

Fanboys Suck 06-14-2004 07:34 PM

I can't add events but at the top of the vbookie settings I see this error:

Warning: Invalid argument supplied for foreach() in .../includes/functions.php on line 2871

I didn't even edit line 2871. Any ideas?

tjdrico 06-14-2004 07:45 PM

You may not have edited line 2871, but it may still tell you where the problem lies as you'll be able to see what the invalid argument is. Line 2871 of my functions.php is

PHP Code:

if ($forumpwd == md5($password)) 

so obviously I can't compare mine with yours. I'm guessing that yours is one of

PHP Code:

foreach ($parents AS $fid)
foreach (
$_FIELDNAMES AS $field => $bitvalue

They are both in that area, anyway. The latter one might make sense, and could suggest that you didn't make all the vBookie installation changes correctly. First of all, go through all the changes and compare them against the changes you actually made. People usually find that they inadvetently missed an edit.

Rushty 06-15-2004 11:13 AM

Excellent hack, but im having one problem that I can figure.

Im useing the Petz money system, and everyone can place bets o.k. (and its deducted from there money) but when it comes to payout it dosent give anyone there winnings, but does seem to give it to me (defaulting to userid 1 which is my id?) any ideas?

tjdrico 06-15-2004 11:22 AM

Quote:

Originally Posted by Rushty
Excellent hack, but im having one problem that I can figure.

Im useing the Petz money system, and everyone can place bets o.k. (and its deducted from there money) but when it comes to payout it dosent give anyone there winnings, but does seem to give it to me (defaulting to userid 1 which is my id?) any ideas?

Thanks for the bug report. There's an error in includes/functions_vbookie.php, in the function 'vbookie_give_user_cash()'.

You can correct it very simply yourself:

Find:
PHP Code:

$q "UPDATE " TABLE_PREFIX "user SET money=money+$amount WHERE userid=$bbuserinfo[userid]"

Replace that with:

PHP Code:

$q "UPDATE " TABLE_PREFIX "user SET money=money+$amount WHERE userid=$userid"

My apologies for the oversight.


All times are GMT. The time now is 05:55 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.02543 seconds
  • Memory Usage 1,900KB
  • 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
  • (1)bbcode_code_printable
  • (17)bbcode_php_printable
  • (30)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