vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - Stock Trader for vBulletin (https://vborg.vbsupport.ru/showthread.php?t=135084)

zethon 01-06-2007 05:45 PM

Quote:

Originally Posted by Carl Anderson (Post 1151978)
Would be nice if this had its own money system I can't seem to get icash to work with it... a simple way to just give money to users as it is I won't use this... can't seem to get it to work.

Nice hack though...

I think giving this hack its own money system kinda defeats the purpose of the hack. It's not a money-system hack, it's a hack to use money systems.

And from reading the iCash documentation, it looks like this should work just fine. All you have to do is set the "Money Row" option in this hack's settings to "money" (which is the row that iCash uses).

Carl Anderson 01-06-2007 09:28 PM

Quote:

Originally Posted by zethon (Post 1152074)
I think giving this hack its own money system kinda defeats the purpose of the hack. It's not a money-system hack, it's a hack to use money systems.

And from reading the iCash documentation, it looks like this should work just fine. All you have to do is set the "Money Row" option in this hack's settings to "money" (which is the row that iCash uses).


I will say this one more time and hope this makes sense....

I set the money row to money in stock trader - this is how I can tell for sure that I am doing that right. If i set it to anything else but money it does not show up in "cash on hand" in your stock trader - so I am setting it right! what I and my users get is this error when we go to purchase stocks..

Fatal error: Field money is not defined in $validfields in class vb_datamanager_user in /includes/class_dm.php on line 485

I have set it to money from the start and I keep getting told to set it to money?


My suggestion to be able to just add the amount from your hack and not have to install a money system too I think is a good one. I looked at vbux and it adds all kinds of extra crap that I don't want. So I attempted using icash as it looked simple and it is not working.... does anyone have this working using icash? Are there other choices than vbux that are simple like icash and do not add other things?

zethon 01-07-2007 01:39 AM

Quote:

Originally Posted by Carl Anderson (Post 1152203)
I will say this one more time and hope this makes sense....

I set the money row to money in stock trader - this is how I can tell for sure that I am doing that right. If i set it to anything else but money it does not show up in "cash on hand" in your stock trader - so I am setting it right! what I and my users get is this error when we go to purchase stocks..

Fatal error: Field money is not defined in $validfields in class vb_datamanager_user in /includes/class_dm.php on line 485

I have set it to money from the start and I keep getting told to set it to money?

I would have to look at your board to see what the problem is, but it sounds to me like you're still misconfigured. Especially since other people are having no problems like yours.

The error you're seeing is what happens when vBulletin or a plugin try to set a value to a field in a data object that doesn't exist. In other words, the money field that the plugin is using DOES NOT EXIST. This is not an error in the plugin, but a misconfiguration. If you want to IM me and have me take a look at your board, I'll be more than happy to do so.

Quote:

Originally Posted by Carl Anderson (Post 1152203)
My suggestion to be able to just add the amount from your hack and not have to install a money system too I think is a good one. I looked at vbux and it adds all kinds of extra crap that I don't want. So I attempted using icash as it looked simple and it is not working.... does anyone have this working using icash? Are there other choices than vbux that are simple like icash and do not add other things?

You can do what I do on my board and use reputation, which doesn't require any money addon of any kind since it's built into vBulletin.

Carl Anderson 01-07-2007 06:05 AM

Well I just installed vbbux and your hack works with that? So the author of icash or your stock trader hack are not compatible or I may have a hack or something that conflicts with your two hacks installed..

Hope someone else gives icash a try and then we know if it is my setup or a conflict between your hacks..

Nice job by the way and Thx

I will use this now that it works with vbux - I just hate all the additional suff that comes with that money system...

kcmandava 01-07-2007 10:35 AM

Will install soon. Might wait for the beta to finish.

DannyMilner 01-07-2007 10:48 AM

Good idea, I really like it! Nice work

zethon 01-07-2007 02:37 PM

Quote:

Originally Posted by Carl Anderson (Post 1152422)
Well I just installed vbbux and your hack works with that? So the author of icash or your stock trader hack are not compatible or I may have a hack or something that conflicts with your two hacks installed..

I'm really curious to know what the problem is now. Hmm.. when I have some time I'll set up a test board and install iCash to see if I can figure out the problem.

zethon 01-07-2007 02:45 PM

Wait a minute, I just noticed that iCash is written for vBulletin 3.5.X. This Stock Trader plugin is written for 3.6.X.

Carl, are you running 3.5.X? If so, that's probably why you couldn't get this plugin to work with iCash.

TwinsForMe 01-07-2007 03:10 PM

I'm running 3.6.4, with the most recent version of ICash (3.6 compatible) and I am getting the same error when trying to make a purchase. My money is defined as money, as per instructions.

Fatal error: Field money is not defined in $validfields in class vb_datamanager_user in /includes/class_dm.php on line 485

I use a prefix on my table. Could that be the error?

Blaine0002 01-07-2007 03:25 PM

Quote:

Originally Posted by zethon (Post 1152657)
Wait a minute, I just noticed that iCash is written for vBulletin 3.5.X. This Stock Trader plugin is written for 3.6.X.

Carl, are you running 3.5.X? If so, that's probably why you couldn't get this plugin to work with iCash.

ICash works for 3.6.X, but if your modification is not backwards compatable with 3.5.X that would probably be the problem :-/

Blaine0002 01-07-2007 03:38 PM

Try this... Open vbtrade.php
find:
PHP Code:

            $userdata =& datamanager_init('user'$vbulletinERRTYPE_STANDARD);
            
$userdata->set_existing($vbulletin->userinfo);
            
$userdata->set($moneyrow,($vbulletin->userinfo[$moneyrow] + $total_offer));
            
$userdata->save(); 

Replace with:
PHP Code:

$db->query("update " TABLE_PREFIX "user set {$vbulletin->options['vbst_moneyrow']}={$vbulletin->options['vbst_moneyrow']}+'{$total_offer}' where userid='{$vbulletin->userinfo['userid']}'"); 


find:
PHP Code:

            $userdata =& datamanager_init('user'$vbulletinERRTYPE_STANDARD);
            
$userdata->set_existing($vbulletin->userinfo);
            
$userdata->set($moneyrow,($vbulletin->userinfo[$moneyrow] - $totalcost_fc));
            
$userdata->save(); 

Replace with:
PHP Code:

$db->query("update " TABLE_PREFIX "user set {$vbulletin->options['vbst_moneyrow']}={$vbulletin->options['vbst_moneyrow']}-'{$totalcost_fc}' where userid='{$vbulletin->userinfo['userid']}'"); 


Hope this works for you..

TwinsForMe 01-07-2007 03:42 PM

That new file did the trick.

Thanks. :)

Carl Anderson 01-07-2007 04:37 PM

Quote:

Originally Posted by Blaine0002 (Post 1152680)
ICash works for 3.6.X, but if your modification is not backwards compatable with 3.5.X that would probably be the problem :-/

Hi I am using the latest 3.6.4? It looks like you found a fix for it.....

Blaine0002 01-07-2007 04:39 PM

Quote:

Originally Posted by Carl Anderson (Post 1152741)
Hi I am using the latest 3.6.4?

Did you preform the edit i posted above?

Lionel 01-07-2007 05:06 PM

a member discovered a major bug.

Try purchasing some stocks and for amount of shares put in -500 (negative). That will increase your points amount. In one case, the guy who had 2900 points ended with 10 billions!!!!!!

TwinsForMe 01-07-2007 06:23 PM

I also added this ticker:

http://www.tufat.com/s_led_ticker_applets.htm

Carl Anderson 01-07-2007 06:28 PM

Quote:

Originally Posted by Blaine0002 (Post 1152742)
Did you preform the edit i posted above?

No I will use vbux now that I have started a investment contest and gave them all vbux.. When this contest is over I will uninstall vbux and use icash..

Quote:

Originally Posted by Lionel (Post 1152749)
a member discovered a major bug.

Try purchasing some stocks and for amount of shares put in -500 (negative). That will increase your points amount. In one case, the guy who had 2900 points ended with 10 billions!!!!!!

This needs to get fixed right away IMO

Blaine0002 01-07-2007 10:06 PM

try this, i simply added a check where each preview was and it puts an error if the stocks entered was less than 1

Lionel 01-07-2007 10:40 PM

Quote:

Originally Posted by Blaine0002 (Post 1152895)
try this, i simply added a check where each preview was and it puts an error if the stocks entered was less than 1

was that the only change?

PHP Code:

  if ($shares 1){
     eval(
standard_error(fetch_error('invalid_shares')));
  } 


Blaine0002 01-07-2007 11:25 PM

no i also stuck one in there when you sell stocks, OH! and i also added the phrase to the XML file.

Tulsa 01-07-2007 11:30 PM

Quote:

Originally Posted by Blaine0002 (Post 1152895)
try this, i simply added a check where each preview was and it puts an error if the stocks entered was less than 1

I hope you only intended us to upload the vbtrader.php file, as that is what I did and entered a negative amount and it trapped the error! :cool:

Blaine0002 01-07-2007 11:36 PM

glad it worked for you! :D

Lionel 01-07-2007 11:37 PM

Quote:

Originally Posted by Blaine0002 (Post 1153059)
no i also stuck one in there when you sell stocks, OH! and i also added the phrase to the XML file.

All fixed. Thanks for that. Now, if someone could do a vbadvanced module that will

1-display the major indice to all

2-a register to play message

3-click here to play for registered non participant

4-A list of participant stocks (5 or more) plus a link to their full portfolio.

That will be super cool

zethon 01-08-2007 01:48 AM

Quote:

Originally Posted by Blaine0002 (Post 1152695)
Try this... Open vbtrade.php
find:
PHP Code:

            $userdata =& datamanager_init('user'$vbulletinERRTYPE_STANDARD);
            
$userdata->set_existing($vbulletin->userinfo);
            
$userdata->set($moneyrow,($vbulletin->userinfo[$moneyrow] + $total_offer));
            
$userdata->save(); 

Replace with:
PHP Code:

$db->query("update " TABLE_PREFIX "user set {$vbulletin->options['vbst_moneyrow']}={$vbulletin->options['vbst_moneyrow']}+'{$total_offer}' where userid='{$vbulletin->userinfo['userid']}'"); 


find:
PHP Code:

            $userdata =& datamanager_init('user'$vbulletinERRTYPE_STANDARD);
            
$userdata->set_existing($vbulletin->userinfo);
            
$userdata->set($moneyrow,($vbulletin->userinfo[$moneyrow] - $totalcost_fc));
            
$userdata->save(); 

Replace with:
PHP Code:

$db->query("update " TABLE_PREFIX "user set {$vbulletin->options['vbst_moneyrow']}={$vbulletin->options['vbst_moneyrow']}-'{$totalcost_fc}' where userid='{$vbulletin->userinfo['userid']}'"); 


Hope this works for you..

I wonder why using the User DataManager object broke it. I will go ahead and use the SQL queries instead since that seems to fix this plguin with iCash.

Quote:

Originally Posted by Lionel (Post 1152749)
a member discovered a major bug.

Try purchasing some stocks and for amount of shares put in -500 (negative). That will increase your points amount. In one case, the guy who had 2900 points ended with 10 billions!!!!!!

Good catch! I will implement the fix that Blaine posted.

zethon 01-08-2007 02:13 AM

All updates have been added to the distribution, and I've bumped up the version number.

Thanks to Blaine0002 for finding the fix to get this to work with iCash!

Blaine0002 01-08-2007 02:44 AM

glad to help!

TomJames 01-08-2007 03:40 AM

This is awesome! Great work
*clicks install*

Carl Anderson 01-09-2007 12:29 PM

Great hack and I got it working fine using vbux at last.. I had already started a contest using vbux and when it is over I will uninstall it and switch to icash...

Here is your list of future features..

Future Features
  • stock ticker marquee for users
  • statistics page (most popular stocks, best performers, etc.)
  • trade stocks with other board users
  • view other users' portfolios
My suggestion is to not have a trade stocks with other users as there is no need to do so - just sell them.

I would like you to consider a top ten list of % gained. Or most money in portfiolio? Something to see to compare and have contests on...

Also a stocks sold (or history) whatever you want to name it so you can view the winners and losers in your portfolio. Maybe at the time of sale it just moves them into another table for storage that can be brought up by a history or sold link?

This hack is great and I love it as people can learn to trade stocks and I run an investing site so I am a bit biased..

Voted it hack of the month.........

Thank you so much!

zethon 01-09-2007 05:44 PM

A few people on my board requested the plugin charge a capital gains tax, instead of a commissions for selling stock. I implemented this as another setting in the add-on's setting page.

Upgrade as normal

soletrader 01-09-2007 05:56 PM

Is there anyway you can create a virtual money system for this hack?

Quantnet 01-10-2007 02:25 AM

Is stock the only underlying asset in this mod ? Can we trade options, futures, forward contracts, etc ?

Thanks

zethon 01-10-2007 02:48 AM

Quote:

Originally Posted by Quantnet.org (Post 1155149)
Is stock the only underlying asset in this mod ? Can we trade options, futures, forward contracts, etc ?

Thanks

I'm not much a finance person at all, I only know the basics about stocks and the stockmarket. To answer your question I will say that anything for which you can get a quote from Yahoo's web-service, you can trade.

You can find out more about the service the plugin uses here: http://www.gummy-stuff.org/Yahoo-data.htm

Quantnet 01-10-2007 04:49 AM

i just installed this and it works as far as I can see. I did the template edit where i add the Stock Trader link on navbar. Where I click this, it just links to User CP, but i have to link directly to vbtrade.php to do the trading.

What is the purpose of Stock Trader navbar ?

Lionel 01-10-2007 01:50 PM

after last update it no longer deduct the points after purchase

mattswanson 01-10-2007 08:07 PM

Ok, here is a question you probably haven't heard before. I run a board for a news site. We have a business publication that runs a contest where readers build hypothetical stock portfolio and they compete against a chimp. Pretty much the finance version of the classic Out Pick... sports contest. Would this system allow for the ability for users to set up their own portfolios, but have them visible to the overall group in some sort of comparative table as well as the ability for the public to view the portfolio distributions? Or is everything pretty well privatized?

Just wondering.

xxxsaint 01-10-2007 09:24 PM

Is there any way to just have it display your total portfolio value in your postbit ??

Quantnet 01-10-2007 09:27 PM

Quote:

Originally Posted by xxxsaint (Post 1155782)
Is there any way to just have it display your total portfolio value in your postbit ??

Second that. Instead of reputation display, can we put the portfolio value there ?

keithsan 01-11-2007 01:49 AM

Installed and clicked

I'm using user reputations which was off. now its on and thats how we're purchasing.

Before I tell my users about it. Is this portfolio private. Ie. no one can see what you bought, its value, etc...???

Was hoping we could check each others portfolios out or at least values.

good hack!

keithsan 01-11-2007 02:15 AM

whoops second question.

I'm trying to use reputation as my money system. but its not working. (reputations are on)

I'm trying to find the "user tabel" point system you reffered to but in my admin cp under users. there is no money or point section?? probably something dumb i'm missing here.

xxxsaint 01-11-2007 02:18 AM

Quote:

Originally Posted by keithsan (Post 1155966)
whoops second question.

I'm trying to use reputation as my money system. but its not working. (reputations are on)

I'm trying to find the "user tabel" point system you reffered to but in my admin cp under users. there is no money or point section?? probably something dumb i'm missing here.


https://vborg.vbsupport.ru/attachmen...8&d=1167441300

does yours look like this ^


All times are GMT. The time now is 12:12 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.01793 seconds
  • Memory Usage 1,874KB
  • 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
  • (9)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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