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
  #712  
Old 03-14-2006, 04:44 PM
Railen Railen is offline
 
Join Date: Jan 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BeaLzeBuB
when i change vBookie settings to "yes" under the usergroup permissions, i cant save these. when i rechechk, they're shown as "no".
I can't believe this question. I answered it in the post IMMEDIATELY before yours.
Reply With Quote
  #713  
Old 03-16-2006, 01:12 AM
Adam21 Adam21 is offline
 
Join Date: Apr 2005
Location: In The Network!
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be great if someone could figure this out...

Can the winnings or losses from each event posted be deducted or added acordingly to the event outome,from the member's vCash who posted that event.anyone???
Reply With Quote
  #714  
Old 03-16-2006, 02:19 AM
psybernaut psybernaut is offline
 
Join Date: Sep 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by geo1
It would be great if someone could figure this out...

Can the winnings or losses from each event posted be deducted or added acordingly to the event outome,from the member's vCash who posted that event.anyone???
I modified vbookie to do this with vbBux, it should be fairly easy to do the same thing for vCash. I haven't posted the code because it's a bit of a hack and I was hoping Andreas would add it as a feature for the next update. But he hasn't posted here for ages... does anyone know if he's still supporting this mod?

Anyway, if you're happy to modify php files I can post the code for you.
Reply With Quote
  #715  
Old 03-16-2006, 03:22 AM
Adam21 Adam21 is offline
 
Join Date: Apr 2005
Location: In The Network!
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by psybernaut
I modified vbookie to do this with vbBux, it should be fairly easy to do the same thing for vCash. I haven't posted the code because it's a bit of a hack and I was hoping Andreas would add it as a feature for the next update. But he hasn't posted here for ages... does anyone know if he's still supporting this mod?

Anyway, if you're happy to modify php files I can post the code for you.

great!please do share that piece of of code.thanks alot!:banana:
Reply With Quote
  #716  
Old 03-16-2006, 03:29 AM
EasyTarget EasyTarget is offline
 
Join Date: Nov 2004
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by psybernaut
does anyone know if he's still supporting this mod?
according the the information at the top of the page this hack isn't supported, so I'd guess that's a no.
Reply With Quote
  #717  
Old 03-16-2006, 07:09 AM
psybernaut psybernaut is offline
 
Join Date: Sep 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's the mod to make money bet on vbookie events go to the bookie, and to have any winnings paid out from the bookies money. If the bookie can't afford to pay the winnings, their cash is set to zero. If you're using vbbux, money will be taken from the bank if possible.

Backup your files before making these changes! I've only tested this on my own site (3.5.4), so proceed with caution!

First, open includes/functions_vbookie.php and find:
Code:
?>
Above, add:
Code:
// psybernaut mod
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;
	}
}
Next, open vbookie.php and find:
Code:
				// actually pay the money ;)
				vbookie_give_user_cash($bet['userid'], $amount_to_pay);
Below, add:
Code:
				// psybernaut's mod
				vbookie_take_bookie_cash($threadinfo['postuserid'], $amount_to_pay);
Then find:
Code:
	vbookie_take_user_cash($total_stake);
Below, add:
Code:
	// psybernaut's mod
	vbookie_give_user_cash($threadinfo['postuserid'], $total_stake);
That's it! ...unless you're using vbBux (by setting vbookie to a custom point system and using CMX's hooks), then you need a couple more mods...

Open includes/xml/hooks_bookiehack.xml and find:
Code:
                <hook>vbookie_take_user_cash</hook>
Below, add:
Code:
                <hook>vbookie_take_bookie_cash</hook>
Last of all, you need to add a new plugin to hook into vbBux... Go to Plugin System->Add New Plugin and add a plugin with the following details:

Product: vBulletin
Hook Location: vbookie_take_bookie_cash
Title: vBookie With vbPlaza - Take Bookie Cash
Plugin PHP Code:
Code:
// take the bookies money
$bookie = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=$userid");
if($amount > $bookie['vbbux'])
{
	$amount = $amount - $bookie['vbbux'];
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=0 WHERE userid=$userid");
	if($amount > $bookie['vbbank'])
	{
		$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbank=0 WHERE userid=$userid");
	}
	else
	{
		$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbank=vbbank-$amount WHERE userid=$userid");

	}
}
else
{
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=vbbux-$amount WHERE userid=$userid");
}
That should do the trick! Well, it works for me at least... YMMV

I've made another fix for timezones that are not a round integer (we live in a +9.5 timezone and it caused some issues that needed fixing). I'd be interested in putting out a new release with this fixe in it and the above mod included in a tidier form (eg. admin option to turn it on/off etc). Can anyone point me to some info on how to go about taking over responsibility for this mod, that's assuming Andreas is willing to hand it over of course... I'm not looking to step on toes

EDIT: Updated the vbbux hook to deduct money from the bookie's bank account if they don't have enough cash on hand.
Reply With Quote
  #718  
Old 03-16-2006, 10:32 AM
chairman miaow chairman miaow is offline
 
Join Date: May 2005
Location: Engerland
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent....thanks for this.....when (if) you take this over from Andreas , could you add in a maximum bet feature ?
Reply With Quote
  #719  
Old 03-16-2006, 12:07 PM
Catsgot9's Avatar
Catsgot9 Catsgot9 is offline
 
Join Date: Mar 2006
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will that bookie thing work with vcash too, psybernaut?
I do not know how to install vbux/ucash.. but my vbookie seems to be working with vcash.
I would like to have a promotion, see which bookie can make the most virtual dollars

CatsGot9
Reply With Quote
  #720  
Old 03-16-2006, 12:10 PM
Adam21 Adam21 is offline
 
Join Date: Apr 2005
Location: In The Network!
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*edited
Reply With Quote
  #721  
Old 03-16-2006, 12:33 PM
Catsgot9's Avatar
Catsgot9 Catsgot9 is offline
 
Join Date: Mar 2006
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I deleted a thread that had a bet in it.. now the bet stays there inactive. How can I remove this from vbookie?

CatsGot9
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:16 AM.


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.05189 seconds
  • Memory Usage 2,323KB
  • 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
  • (9)bbcode_code
  • (4)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
  • (5)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