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)

subu1 06-08-2004 07:29 PM

oh, i have an error :surprised:

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/virtual/site25/fst/var/www/html/board/vbookie.php on line 16

and if i post a event i have this error

Code:

Datenbankfehler in vBulletin 3.0.0:

Ungueltige SQL-Abfrage: UPDATE  SET =25 WHERE <25
mysql error: You have an error in your SQL syntax near 'SET =25 WHERE <25' at line 1

mysql error number: 1064

Datum: 08.06.2004 22:29:45
Skript: http://www.starlight-board.net/board/vbookie.php
Referer: http://www.starlight-board.net/board/vbookie.php

sorry i need help

tjdrico 06-08-2004 08:16 PM

Quote:

Originally Posted by subu1
oh, i have an error :surprised:

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/virtual/site25/fst/var/www/html/board/vbookie.php on line 16

Just edit vbookie.php and comment out set_time_limit on line 16.

i.e.

Change:

PHP Code:

set_time_limit(0); 

To:

PHP Code:

//set_time_limit(0); 

It's not really required.

Quote:

Originally Posted by subu1
and if i post a event i have this error

Code:

Datenbankfehler in vBulletin 3.0.0:
mysql error: You have an error in your SQL syntax near 'SET =25 WHERE <25' at line 1

sorry i need help

Just update includes/functions_vbookie.php to the latest version. I assume you downloaded it early on, and have 1.0.0.

dniMTheory 06-08-2004 09:04 PM

Found a small bug...or maybe its just me.

If you have the date/time options set to show detailed, vbookie doesnt work well. I had to change my time settings to normal to get my times to show correctly.

tjdrico 06-08-2004 10:08 PM

Quote:

Originally Posted by dniMTheory
Found a small bug...or maybe its just me.

If you have the date/time options set to show detailed, vbookie doesnt work well. I had to change my time settings to normal to get my times to show correctly.

What setting are you talking about? I'm not aware of any "show detailed" settings for time & date. Can you explain for me?

Battle_Ring 06-08-2004 10:13 PM

i have oen event up and it onyl shows up on here under open http://battlering.net/forums/vbookie.php on one of my skins the dragon skin any ideas why??

kall 06-09-2004 06:12 AM

Me too.

Bit of a bugger really, I do like the Detailed settings.

(tjdrico - AdminCP - VBulletin Options - Date and Time Options , shows Start and End times of vbookie events as 1 minute ago.)

tjdrico 06-09-2004 06:34 AM

Quote:

Originally Posted by Battle_Ring
i have oen event up and it onyl shows up on here under open http://battlering.net/forums/vbookie.php on one of my skins the dragon skin any ideas why??

I just checked your templates using your AdminCP (your login you gave me), it it seems that the 'vbookie_main_items_bit' template only got added to the Dragon style, but not Rage etc. I'm not sure why that would be - all the other templates seem to me installed in all the other styles. I've added it to the other templates for you, and the display on vbookie.php now looks correct.

tjdrico 06-09-2004 06:45 AM

Quote:

Originally Posted by kall
Me too.

Bit of a bugger really, I do like the Detailed settings.

(tjdrico - AdminCP - VBulletin Options - Date and Time Options , shows Start and End times of vbookie events as 1 minute ago.)

Ah, I get you. OK, that's because the built-in vbdate() function that I'm using only handles historical dates correctly (3 minutes ago, 4 hours ago). I'll add a new function that can handle future dates (in 3 minutes time, in 4 hours time) and that should sort things out for Detailed view. Should be later today.

kall 06-09-2004 06:50 AM

Quote:

Originally Posted by tjdrico
Ah, I get you. OK, that's because the built-in vbdate() function that I'm using only handles historical dates correctly (3 minutes ago, 4 hours ago). I'll add a new function that can handle future dates (in 3 minutes time, in 4 hours time) and that should sort things out for Detailed view. Should be later today.

Couldn't you just do it like the Polls do?

They keep the normal 'will close on 12 june 2004 at 3:00 PM' style...while the thread's post time is saying '1 minute ago' or '2 weeks ago'.

tjdrico 06-09-2004 06:59 AM

Quote:

Originally Posted by kall
Couldn't you just do it like the Polls do?

They keep the normal 'will close on 12 june 2004 at 3:00 PM' style...while the thread's post time is saying '1 minute ago' or '2 weeks ago'.

Aye, I suppose... but that's not as pretty as saying "This poll will close in 3 minutes' time", and if you use "Detailed" so you can see "3 Minutes Ago" on post times, I don't see why you wouldn't want that same detail.

tjdrico 06-09-2004 07:02 AM

If you want to hack that in for the time being anyway, open showthread.php and...

Find:

PHP Code:

    $eventinfo['openuntil_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_open_until'],true);
    
$eventinfo['payafter_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_pay_after'],true);
    
$eventinfo['openuntil_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_open_until'],true);
    
$eventinfo['payafter_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_pay_after'],true); 

and replace it with:

PHP Code:

    $eventinfo['openuntil_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_open_until']);
    
$eventinfo['payafter_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_pay_after']);
    
$eventinfo['openuntil_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_open_until']);
    
$eventinfo['payafter_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_pay_after']); 

Next, open vbookie.php

Find:

PHP Code:

        exec_switch_bg();
        
$item['created'] = vbdate($vboptions['dateformat'],$item['item_created'],true);
        
$item['openuntil'] = vbdate($vboptions['dateformat'],$item['item_open_until'],true);
        
$item['payafter'] = vbdate($vboptions['dateformat'],$item['item_pay_after'],true);
        eval(
'$betitembits .= "' fetch_template('vbookie_main_items_bit') . '";'); 

and replace it with:

PHP Code:

        exec_switch_bg();
        
$item['created'] = vbdate($vboptions['dateformat'],$item['item_created']);
        
$item['openuntil'] = vbdate($vboptions['dateformat'],$item['item_open_until']);
        
$item['payafter'] = vbdate($vboptions['dateformat'],$item['item_pay_after']);
        eval(
'$betitembits .= "' fetch_template('vbookie_main_items_bit') . '";'); 

Then find:

PHP Code:

    $eventinfo['openuntil_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_open_until'],true);
    
$eventinfo['payafter_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_pay_after'],true);
    
$eventinfo['openuntil_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_open_until'],true);
    
$eventinfo['payafter_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_pay_after'],true); 

and replace that with:

PHP Code:

    $eventinfo['openuntil_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_open_until']);
    
$eventinfo['payafter_date'] = vbdate($vboptions['dateformat'],$eventinfo['item_pay_after']);
    
$eventinfo['openuntil_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_open_until']);
    
$eventinfo['payafter_time'] = vbdate($vboptions['timeformat'],$eventinfo['item_pay_after']); 

That should sort the "1 Minute Ago" problem. These edits will be made to the install set from 1.0.4 onwards.

kall 06-09-2004 07:03 AM

Quote:

Originally Posted by tjdrico
Aye, I suppose... but that's not as pretty as saying "This poll will close in 3 minutes' time", and if you use "Detailed" so you can see "3 Minutes Ago" on post times, I don't see why you wouldn't want that same detail.

How about making that optional? ;)

tjdrico 06-09-2004 07:10 AM

Quote:

Originally Posted by kall
How about making that optional? ;)

Well, it'll be optional to install the update. :D

Battle_Ring 06-09-2004 02:57 PM

COol Thanks for all your help

Pro 06-09-2004 07:31 PM

Quote:

Parsing functions.php Time before: 1086813007.8077 Time after: 1086813007.829 Time taken: 0.021291971206665
--------------------------------------------------------------------------------
Processing sessions.php Time before: 1086813007.8296
i keep getting this in my includes/init.php file... what am i doing wrong?

Pro 06-09-2004 07:36 PM

Quote:

FIND
PHP Code:
'stylecache'
), $specialtemplates);

REPLACE WITH
PHP Code:
'stylecache',
// +++ vBookie
'vbookiesettings'
// --- vBookie
), $specialtemplates);
im not sure how to replace this since this area looks like the following:
Quote:

'stylecache',
'utt_store_act',
'arcadesettings'
), $specialtemplates);
when i try to edit this area i get the errors i listed above...

Please help!

tjdrico 06-09-2004 07:44 PM

Change this:

PHP Code:

'stylecache'
'utt_store_act',
'arcadesettings'
), $specialtemplates); 

To this:

PHP Code:

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

It's important that you add the new comma after 'arcadesettings'.

Pro 06-09-2004 08:53 PM

ok cool... that works! thanks! i still had some more errors - i just had to reverse them... so when i get more (if) i'll be back lol

thanks alot man

tjdrico 06-09-2004 10:06 PM

No probem. Click install if you don't mind - that way I'll be able to alert you to any updates.

Pro 06-09-2004 10:51 PM

Quote:

Originally Posted by tjdrico
No probem. Click install if you don't mind - that way I'll be able to alert you to any updates.

done!

is there anymore info on how to use this? i got everything set up, yada yada... but im trying to figure out how to place bets, etc...

Pro 06-09-2004 11:22 PM

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

GREAT SYSTEM! THANKS! I'LL TRY TO DONATE SOON! :)

limey 06-10-2004 04:44 AM

Cool hack tjdrico! One of the best. Will install when I can.

nydk 06-10-2004 06:24 AM

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

tjdrico 06-10-2004 06:34 AM

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.

nydk 06-10-2004 06:43 AM

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*

tjdrico 06-10-2004 07:24 AM

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.

deathemperor 06-10-2004 09:58 AM

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 ^^

Okiewan 06-10-2004 12:46 PM

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?

tjdrico 06-10-2004 12:53 PM

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. ;)

Okiewan 06-10-2004 01:22 PM

Excellent hack. HOTM level stuff!

tjdrico 06-10-2004 01:28 PM

Thanks for the kind words.

Click "Install" and spread the gospel according to St Bookmaker to all who will listen (and some that won't). =)

Okiewan 06-10-2004 02:15 PM

will do.
Next question:

Let's say we have a couple of usergroups we allow to make events. Are they able to settle it? Senario: Someone makes an event, expires in 20 minutes. Makes odds 1000/1. Makes "correct" pick. Settles.

Maybe only the Admin can settle? Or if you make the event, you can't win it?

tjdrico 06-10-2004 02:21 PM

Quote:

Originally Posted by Okiewan
Let's say we have a couple of usergroups we allow to make events. Are they able to settle it? Senario: Someone makes an event, expires in 20 minutes. Makes odds 1000/1. Makes "correct" pick. Settles.

Maybe only the Admin can settle? Or if you make the event, you can't win it?

Well, this comes down to trusting the people you allow to set up events. The top winners are shown for any event so it's quite easy to see if anyone's abusing it. I don't think it's any more of a problem than appointing someone as a forum moderator.

There's no need to make it so only admins can settle though. Just set up a "Bookmakers" group that has rights to create and edit events, but not to play them. That should be enough. Of you really want it so that only admins can settle, then make it so only admins can create events in the first place. =)

Okiewan 06-10-2004 02:23 PM

I hear ya... I do have a couple of larger groups (paid subscribers)that I initially wanted to allow to post events... too many to trust, lol.
Thanks for the reply.

tjdrico 06-10-2004 02:31 PM

Quote:

Originally Posted by Okiewan
I hear ya... I do have a couple of larger groups (paid subscribers)that I initially wanted to allow to post events... too many to trust, lol.
Thanks for the reply.

Aye, but if you have a large group, all allowed to post events, then the poor Administrator(s) have a big job keeping on top of them (assuming lots of people set events up). It's just another hassle for admins on top of other things.

I think the idea of not being allowed to bet on your own event(s) is fair enough though. I'll look into adding that as an option for another release. I don't see it being a big job.

Alternatively, just make it so that only your paid subscribers can play, as added value to the forum. =) You never know, it might persuade some people on the edge to decide to pay up after all. Hehe.

Okiewan 06-10-2004 02:41 PM

Quote:

Alternatively, just make it so that only your paid subscribers can play, as added value to the forum. =) You never know, it might persuade some people on the edge to decide to pay up after all. Hehe.
It is so :)

Okiewan 06-10-2004 02:50 PM

Another thing comes to mind...
An easy way for the Admin to deduct vCash?
Reason: Let's say at the end of a month of betting, the member with the most cash can "buy" something.. real stuff, or vStuff :)

tjdrico 06-10-2004 03:03 PM

Quote:

Originally Posted by Okiewan
Another thing comes to mind...
An easy way for the Admin to deduct vCash?
Reason: Let's say at the end of a month of betting, the member with the most cash can "buy" something.. real stuff, or vStuff :)

There are a number of store/points/money hacks floating around that would have that sort of administration built in. Rather than reinventing any wheels, I think it would make more sense to install one of those, and then make a couple of changes to vBookie to use that particular hack's money or points.

immotive 06-10-2004 04:04 PM

i got this error :

Code:

Database error in vBulletin 3.0.0:

Invalid SQL: UPDATE  SET =25 WHERE <25
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 'SET =25 WHERE <25' at line 1

mysql error number: 1064

am i missing something?

immotive 06-10-2004 04:07 PM

i modified according to here

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

events are recorded, but i still got the error.


All times are GMT. The time now is 10:45 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.01958 seconds
  • Memory Usage 1,910KB
  • 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
  • (3)bbcode_code_printable
  • (14)bbcode_php_printable
  • (20)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