View Full Version : vB Stocks 1.0.0 for vB 3.0.3
AN-net
11-06-2004, 10:00 PM
vB Stocks 1.0.0
by Antonbomb22(Anthony Scudese)
Compatiability:
Compatiable with 3.0.x(Tested on 3.0.3)
Description:
This hack uses Yahoo Finance (http://finance.yahoo.com)'s external CSV feature. It converts the CSV to a readable array. This allows you to get stock quotes(not realtime but updated daily) for whatever stocks Yahoo Finance provides via stock symbols(Google = GOOG). You can also get quotes on the DowJones. Also this hack allows your users to look up stocks that you may not have already being pulled from Yahoo Finance.
Author(s):
-AN-Net
-joeaic(developed code basis)
Code Based Off Of:
http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=163
Live Demo:
http://www.animationation.net/community/stocks.php
Support:
Any modification to the provided files is not supportable. I also hold the right to deny support to anyone at anytime.
Where to Get Support:
-Official vB Stocks Forum (http://www.animationation.net/community/forumdisplay.php?f=69)
-Aim: Antonbomb22
-Email: antonbomb22@animationation.net
-this thread
Special Thanks To:
Yahoo Finance (http://finance.yahoo.com) for providing the CSV and great service;)
Zip Includes:
-install.txt
-stocks.php
-stocksmanager.php
Guest190829
11-07-2004, 01:49 AM
Great Job AN-NET, keep up the great hacks!
bendigo-tech
11-07-2004, 02:50 AM
I have no use for this but still a very nice hack.
Good work! :)
AN-net
11-07-2004, 03:01 AM
Thanks for the positive feedback:)
Ted S
11-07-2004, 03:14 AM
Very nice hack, quick install (under 10 minutes) and it works great! Hopefully my users will find this as useful as I think it is.
One small suggestion/question... would it be possible to get the company name from Yahoo so a stock shows up Google - GOOG instead of just the ticker symbol? Thanks!
xware
11-07-2004, 04:23 AM
can you make a virtue stock market that users can buy and sell stock by their bbs money?
Amavisca
11-07-2004, 04:45 AM
I dont use this buy , but great work an
BarHopper
11-07-2004, 05:57 AM
I have no use for this but still a very nice hack.
Good work! :)
dito, but very good hack.
AlexanderT
11-07-2004, 12:04 PM
A nice hack, but it should really cache the stock information unless you want to hammer Yahoo.
Your example sites features 13 stocks. With the current implementation, that means every time someone accesses your stock page, your server is hitting Yahoo 13 times. Imagine 20 users accessing your stock page - your server would be hitting Yahoo 260 times. Imagine 200 users accessing your stock page - Yahoo gets hit 2600 times!
AN-net
11-07-2004, 02:35 PM
A nice hack, but it should really cache the stock information unless you want to hammer Yahoo.
Your example sites features 13 stocks. With the current implementation, that means every time someone accesses your stock page, your server is hitting Yahoo 13 times. Imagine 20 users accessing your stock page - your server would be hitting Yahoo 260 times. Imagine 200 users accessing your stock page - Yahoo gets hit 2600 times!
they can handle it lol! anyways maybe ill look into some caching in a future version but i was really just planning on making this a one version script
Lionel
11-07-2004, 03:27 PM
It would have been super to allow members to create their portfolio. Stocks would display per member basis
GamerJunk.net
11-07-2004, 08:30 PM
That's awesome!
AN-net
11-07-2004, 10:25 PM
It would have been super to allow members to create their portfolio. Stocks would display per member basis
possible if i make a second version;)
Lionel
11-08-2004, 03:19 AM
possible if i make a second version;)
will be anxiously waiting... Guys like you, with your skills could knock it down in 2 hours. :smoke:
secret1980
11-08-2004, 09:19 AM
good hack :D
Guest190829
11-08-2004, 09:53 AM
I smell advanced coder!!!
G-khan
11-09-2004, 02:53 AM
possible if i make a second version;)
Please do it..... please please please......
Great hack and I will use it..............
johnnyb
11-09-2004, 08:52 PM
Are these live? Or 20 minute delay?
AN-net
11-10-2004, 02:04 AM
Are these live? Or 20 minute delay?
i believe their daily, it depends when yahoo updates them. check the last updated coulmn on each stock and it will say when yahoo last updated it. for real time info that would require access to yahoo's premium membership...
fiber1
11-10-2004, 03:25 AM
Most of the time Yahoo updates are between 12 and 15 minutes. Any less time than that your site would be getting overkill!
How do I put a link on the vBStocks page to the symbol list in yahoo?
Thanks.
theArchitect
11-10-2004, 08:16 AM
*theArchitect Clicks Install*.
As always impressive work. Keep it up.
Lionel
11-10-2004, 05:38 PM
Whenever it can't connect to Yahoo for whatever reason, it displays an ugly message at the very top, coming from the fopen("http://finance.yahoo. ....
can we put something like if !$yahoo {echo "";}
?
AlexanderT
11-11-2004, 11:49 AM
I am not using the hack, but perhaps if you put a @ in front of 'fopen(...' it should help.
Lionel
11-11-2004, 11:52 AM
Thanks for the tip.
fiber1
11-19-2004, 09:30 PM
Found a small bug on this... If you go to ADMINCP > MANAGE STOCKS and try to edit any symbol other than the first one listed it brings up the first symbol to edit. Thus, no matter which one you try to "EDIT" it always edits the first one.
AN-net
11-19-2004, 10:28 PM
ill look into this:)
G-khan
11-20-2004, 02:13 PM
Great hack Thanks - I installed it................
G-khan
11-22-2004, 11:28 PM
Could you add multiple pages - like say I want one that has some major tech stocks and another on Gold stocks....
I tried putting in about thirty stocks and it really bogs down so if you could add stock sectors...... I know I am asking a lot....
Great hack............
AN-net
11-23-2004, 12:14 AM
i really am busy right now but i might eventually just cache the information in the database eventually thus making the page more optimized and faster;)
Madacc
12-02-2004, 05:13 AM
Perfect for my board.. I did a little manipulation and added the Stock Lookup feature at the top of the page, and the "Stocks To Watch" on my FORUMHOME template.
Check it out www.stocktradingtalk.com
fiber1
12-02-2004, 09:41 AM
Nice mod! Always good to see more competition out there and discusion boards for the market.
AN-net
12-02-2004, 10:17 AM
very nice functionality added;)
AN-net
01-17-2005, 03:01 PM
there is a live demo so need to for screenshots
FASherman
01-18-2005, 12:25 AM
Strictly speaking, the name for this hack is wrong. If this were truely stock oriented, there is a set of minimal information that is absolutely necessary such as 52-week highs and lows, 20-week moving averages, P/E ratios, etc.
This hack should rightly be called vbDailyMarketReport or something to that effect.
AN-net
01-18-2005, 12:55 AM
well I do not involve myself in stocks at all, so i would not really know alot about this information except for those terms you defined. found this code snippet thought it would be a great addon for sites dealing with the market and poof i released it. i had no knowledge of a more technical term and since this is the only hack relating to stocks so far i think it fits it right;)
I like the name and think it's appropriate even if more info might be nice. RE: screenshot, it seems to be practice to put up screenshots, because live sites change (e.g. guests not allowed to see feature, domain change etc..) and screens give a quick and easy look.
AN-net
01-18-2005, 02:20 AM
well currently that is the only info Yahoo offers and i dont know of any other sites that provide CSV OR external source stock information
rajc007
01-27-2005, 04:54 PM
Not sure if I missed something on the install but my stock info is not updating. www.hospitality-forum.com/forums/stocks.php
yoyoyoyo
01-27-2005, 07:23 PM
great hack! I plan on checking it out later. One suggestion that has already been said before: how about an extra text input field where you can indicate the ACTUAL name of the company next to the link?
AN-net
01-27-2005, 08:25 PM
Not sure if I missed something on the install but my stock info is not updating. www.hospitality-forum.com/forums/stocks.php
for some reason it is unable to connect
valentine
01-31-2005, 05:14 PM
Neat hack.
Any idea how it can be integrated with VBAdvanced?
If I put the stocks.php file into the modules folder for VBA, and choose it as a template for a new module called "stocks" it replaces the entire front page of VBA with the stocks.php page - how might I be able to fix this?
interfx
02-02-2005, 02:36 PM
I am also trying to use VBAdvanced also... Any one else make this work?
rajc007
02-02-2005, 03:08 PM
for some reason it is unable to connect
I think I found the problem. My host has the value "allow_url_fopen" set to off. Guess its time to look for a new host.
AN-net
02-02-2005, 04:30 PM
I am also trying to use VBAdvanced also... Any one else make this work?
i would have no clue on how to make it work with vb advanced as i do not use it;)
rinkrat
02-02-2005, 10:19 PM
Yeah, being able to dreate your own portfolio would be the way I would want this. That would be epic!
valentine
02-04-2005, 08:22 AM
Well, this is what I've tried myself to get it to integrate - but dont get too excited as it doesnt work, but you can see my line of thought.
As there seem to be a few of us interested, would anyone else like to have a stab it at? ( assuming that AN-net has no objections to this)
wherever you see this code:
fetch_template('stocks_templatename')
I changed it to:
fetch_template('adv_portal_stocks_templatename')
and also changed the first few lines of code in the stocks.php file that read:
$globaltemplates= array(
'STOCKS',
'stocks_quotebits',
'stocks_getquote'
);
to:
$globaltemplates= array(
'adv_portal_STOCKS',
'adv_portal_stocks_quotebits',
'adv_portal_stocks_getquote'
);
and renamed all the new VBStocks templates so that they match the above template names.
Now, I was pretty sure this would fix it... but it hasn't!
I think it may have something to do with this bit:
require_once('./global.php');
if(empty($_REQUEST['do']))
{
$_REQUEST['do']= "index";
}
if($_REQUEST['do']=="index")
{
But I'm not sure. I'm not a coder, just playing with it to try and fix it to work with VBA.
interfx
02-08-2005, 01:40 AM
Anyone make this work in VBCMPS yet? I'm still trying, but have not figured it out yet...
INterfX
Guest190829
02-25-2005, 08:53 PM
I'm working on a add-on now, my only problem is that it's pulling out only the last stock added via the admic CP, so I was wondering if AN-NET can help me out....
interfx
02-25-2005, 09:02 PM
That is awesome!!! can't wait!!!
Guest190829
02-25-2005, 09:16 PM
The problem has been fixed and I will release this shortly. ;)
Guest190829
02-25-2005, 10:01 PM
I just released it the addon can be found here (https://vborg.vbsupport.ru/showthread.php?t=77044)
interfx
02-25-2005, 10:21 PM
great hack! I plan on checking it out later. One suggestion that has already been said before: how about an extra text input field where you can indicate the ACTUAL name of the company next to the link?
Great add-on... Anyone figure out to add the actual company name yet???
fiber1
02-25-2005, 10:26 PM
That would be great, but not sure if anyone has attempted it or plans too.
Guest190829
02-26-2005, 12:09 AM
Well it all depends if yahoo allows it, since that's where it's extracting the info from.
fiber1
02-27-2005, 02:29 AM
It cannot be retreived from Yahoo, but it could be coded to the point where if you enter a symbol it would be for example:
YHOO one would need to add a field to enter what you wanted to call the company.
YHOO= show Yahoo Inc.
interfx
02-27-2005, 11:26 AM
I saw another java script doing similar things, where the followign is used when you enter the ticker you wish to follow...
yhoo:Yahoo
ge:GE
So when you enter the ticker, it only uses upto the ":" for Yahoo, and then after the ":" for the name in the script...
I have no idea if this would work here, but thoughts I would ask...
Thanks -
InterFX
fiber1
02-28-2005, 02:44 AM
I have a script that does that, but its java and php needs to be done different. Would be nice if AN-net would add some extra features. Will have to wait and see.
interfx
02-28-2005, 09:48 PM
I'm getting a connection refused error on line 15 of stocksmanager.php... Bringin my site to a "crawl"...
Anyone else have this issue?
sim tech
03-03-2005, 05:58 AM
I did a simple template mod to show the link STOCK MARKET in my navbar.
In NAVBAR find:
<td class="vbmenu_control"><a href="calendar.php?$session[sessionurl]">$vbphrase[calendar]</a></td>
AND PLACE BELOW IT:
<td class="vbmenu_control"><a href="stocks.php?$session[sessionurl]">Stock Market</a></td>
But there is still a problem with editing a previously listed stock as mentioned earlier. I also would like to see the stocks automatically listed in alphabetical order... I'll try that next.
.
I'm a PHP newbie - so I am s-l-o-w at things... :ermm:
sim tech
03-04-2005, 02:49 PM
Perfect for my board.. I did a little manipulation and added the Stock Lookup feature at the top of the page, and the "Stocks To Watch" on my FORUMHOME template.
Check it out www.stocktradingtalk.com
Can you please post the mods that you did? I also liked the way you were able to get the current price to show a gain or loss by changing the color.
Joe Blow
03-13-2005, 03:38 AM
Would love to see this hack modified for the Aussie Stock Market with data from Yahoo Australia.
In fact, I will pay money to someone who can modify it for me.
I NEED THIS!
Guest190829
03-13-2005, 05:46 PM
@Joe, I may be able to do this and for free. I just need permission from AN-NET to be able to release it.
@simtech, I just updated my addon for this hack so the font color changes along with the change (negative change = red, postive change = green) you can just copy the template from adv_portal_stockbits and replace it with quote_bits and it should work.
sim tech
03-14-2005, 02:58 AM
@simtech, I just updated my addon for this hack so the font color changes along with the change (negative change = red, postive change = green) you can just copy the template from adv_portal_stockbits and replace it with quote_bits and it should work.
Sweet - that took about 3 seconds to change and did exactly what I wanted!
Thanks!
Joe Blow
03-17-2005, 09:50 AM
@Joe, I may be able to do this and for free. I just need permission from AN-NET to be able to release it.
Well hell man, let me know if you do.
I've bookmarked this thread and will check it every few days or so.
I would really appreciate it if you could!
I run a stock market forum here in Australia and would give anything to be able to incorporate this hack into my site.
:)
robert_2004
03-18-2005, 03:24 PM
i'm in australia also.
i've *LOVE* to see this go full on, showing graphs, highs & lows, current prices, etc.
Then the members could create portfolios, and use fake money to buy and sell (like all those eCash and other mods running around - instead we'd give our users 50,000 per 4 months, to see who could create the highest profit at the end. )
this has HUGE potential - much more fun than the arcade 8)
An-net you should really go hard on this - it's a GREAT idea :) :)
Joe Blow
03-26-2005, 08:55 AM
Seriously I will contribute money to have this done for the Australian stock market.
I have code for a stock quote feature that sources stock data from Yahoo Australia. Unfortunately, I'm not a programmer and can't do much with it.
fiber1
03-26-2005, 07:15 PM
Provide the link for the AU yahoo code and maybe some one can help.
Joe Blow
03-26-2005, 11:25 PM
Provide the link for the AU yahoo code and maybe some one can help.
I'll attach it to this post.
:banana:
sim tech
03-29-2005, 03:07 PM
Great add-on... Anyone figure out to add the actual company name yet???
Would this work? This is what I did, but I'm having problems having it write to the table & then xfer to the template.
I created a field in the stocks table in MySQL called 'comapnyname' and then modded the admin file so that it would write the company name to the table. (see image). It's close but no cigar yet. Do I have to make 'companyname' a global? Also - no data in the table as of yet. Anyone?? Thanx
<?PHP
///////////////////////////////////
//vB Stocks(1.0.0) by Antonbomb22//
//Code Basis by joeaic/////////////
//May not be redisitributed,copied/
//or modifed without permission////
///////////////////////////////////
require_once('./global.php');
if(empty($_REQUEST['do']))
{
$_REQUEST['do']="showstocks";
}
if($_REQUEST['do']=="showstocks")
{
print_cp_header("Stock Manager");
print_table_start();
print_table_header("Manage Stocks", 3);
print_cells_row("stocksymbol", "Stock Status", "stocktitle", "companyname", "Stock Options", 1, '', -1);
$getstocks= $DB_site->query("SELECT stockname,active FROM ".TABLE_PREFIX."stocks");
while($stock= $DB_site->fetch_array($getstocks))
{
if($stock['active']==1)
{
$status= "Active";
}
else
{
$status= "Inactive";
}
print "<tr class=\"".fetch_row_bgclass()."\"><td><a href=\"http://finance.yahoo.com/q?s=".$stock['stockname']."\">".$stock['stockname']."</a></td><td>".$status."</td><td>[<a href=\"stocksmanager.php?do=edit&sym=".$stock['stockname']."\">Edit</a>][<a href=\"stocksmanager.php?do=delete&sym=".$stock['stockname']."\">Delete</a>]</td></tr>";
}
print_table_footer();
}
if($_REQUEST['do']=="edit")
{
$stock= $DB_site->query_first("SELECT stockname, active FROM ".TABLE_PREFIX."stocks");
print_cp_header("Stock Edit: ".$stock['stockname']."'");
print_form_header('stocksmanager', 'update');
construct_hidden_code("origsym", $stock['stockname']);
print_table_header("Stock Edit: ".$stock['stockname']."'");
print_input_row("Stock Symbol:<dfn>example: YHOO, ^DJI, GOOG</dfn>", "stocksymbol", $stock['stockname'], "'");
// ATG stock name mod
print_input_row("Company Name:<dfn>example: Northwest Airlines</dfn>", "companyname", $stock['companyname'], "'");
print_yes_no_row("Stock Active?", "active", $stock['active']);
print_submit_row("Update Stock");
}
if($_POST['do']=="update")
{
globalize($_POST, array(
'stockname' => TEXT,
// ATG *******************************************
'companyname' => TEXT,
'active' => INT,
'origsym' => TEXT
));
$DB_site->query("UPDATE ".TABLE_PREFIX."stocks SET stockname='".addslashes($stocksymbol)."', active=".$active." WHERE stockname='".addslashes($origsym)."'");
// ATG ********************************************
$DB_site->query("UPDATE ".TABLE_PREFIX."stocks SET companyname='".addslashes($companyname). "'");
define('CP_REDIRECT', 'stocksmanager.php?do=showstocks');
print_stop_message('stock_updated_successfully');
}
if($_REQUEST['do']=="delete")
{
$DB_site->query("DELETE FROM ".TABLE_PREFIX."stocks WHERE stockname='".addslashes($sym)."'");
define('CP_REDIRECT', 'stocksmanager.php?do=showstocks');
print_stop_message('stock_deleted_successfully');
}
if($_REQUEST['do']=="add")
{
print_cp_header("Add Stock");
print_form_header('stocksmanager', 'insert');
print_table_header("Add Stock");
print_input_row("Stock Symbol:<dfn>example: YHOO, ^DJI, NWAC</dfn>", "stocksymbol");
// ATG *********************************************
print_input_row("Company Name:<dfn>example: Northwest Airlines</dfn>", "companyname");
print_yes_no_row("Stock Active?", "active", 0);
print_submit_row("Add Stock");
}
if($_POST['do']=="insert")
{
globalize($_POST, array(
'stocksymbol' => TEXT,
'active' => INT
));
$DB_site->query("INSERT INTO ".TABLE_PREFIX."stocks (stockname,active) VALUES ('".addslashes($stocksymbol)."', ".intval($active).")");
define('CP_REDIRECT', 'stocksmanager.php?do=showstocks');
print_stop_message('stock_inserted_successfully');
}
print_cp_footer();
exit;
?>
Marco van Herwaarden
03-29-2005, 04:04 PM
///////////////////////////////////
//vB Stocks(1.0.0) by Antonbomb22//
//Code Basis by joeaic/////////////
//May not be redisitributed,copied/
//or modifed without permission////
///////////////////////////////////
Maybe this is the problem ;)
:D
sim tech
03-30-2005, 04:51 PM
Doh!
scottct1
04-22-2005, 02:25 PM
I love this hack but my users hate it because they can not make their own portfolio.
Please start on version 2.0 :D
Would Be Nice To See This Ported With Ability To Buy Stocks With Ucash
Carl Anderson
10-10-2005, 06:35 PM
Would Be Nice To See This Ported With Ability To Buy Stocks With Ucash
Agreed - a vb3.5 plugin.......
I would pay to have it...........
Can this be shown, only in one specific forum?
I only want to have it displaying in the top of my financial forum...
Thanks... nice hack if I can do that, I'll be installing this
Carl Anderson
11-04-2005, 04:53 AM
Anyone working on this or something like it for 3.5? Will this hack be ported?
Joe Blow
01-10-2006, 03:30 AM
I'm also interested in whether there is a version in the works for 3.5.X...
A great hack that deserves to live on with new versions of vbulletin!
Joe Blow
02-23-2006, 12:51 PM
Will this hack work with vbulletin 3.5.X?
Would love to know if anyone has got it working or if there is a new version planned.
RobAC
04-26-2006, 12:37 PM
Has anyone attempted to port this to vb 3.5.x? This would be an awesome addition to my site.
skullycapone
05-09-2006, 11:09 AM
I would also like to know if this workson 3.5.3
interfx
09-17-2006, 02:44 AM
Anyone ever figure how to make this work on 3.5.4 or 3.6???
It was such an awesome module that I use in VBadvanced... Any other solutions out there???
interfx
11-13-2006, 01:01 AM
It's been a while, anyone ever get this translated to 3.6.x??? It works great, just trying to add this feature on my new site...
Any ideas out there?
scottreeve
11-14-2006, 05:01 AM
Great Hack.
I would also like to see it work for Australian stocks, and for the more recent vB versions.
Keep up the good work.
Cheers,
Scott
interfx
11-15-2006, 02:39 PM
I'm willing to pay $20USD to get this updated to 3.6.x via plugin... Anyone else willing to chip in?
mpage
11-21-2006, 11:28 AM
I've made a similar thing but gets any RSS feed:
see this post (java rss feed ticker), https://vborg.vbsupport.ru/showthread.php?p=1122198#post1122198
interfx
11-25-2006, 07:10 PM
Thanks, I saw that... Really looking for a tabular stock table that can show a portfolio... I have this plugin on a current site running VB3.0.6 and it is great...
Here's what it ideally looks like when it runs...
http://www.oledtoday.com/forums/stocks.php
Anyone else out there interested???
soletrader
12-24-2006, 12:21 PM
I would chip in to see this hack get ported to vb 3.6
interfx
02-18-2007, 10:40 PM
Any other interest out there? I think the basics are in the original code, just needs modifieds to 3.6.x version. Looks like an abandoned code, so maybe a chance for someone to update it...
robert_2004
04-03-2007, 05:57 PM
i'm willing to make it, if people still want it, private msg me.
i'll charge $200 USD per user, for a 6 month licence & updates, and $40USD for the following 6months.
Hopefully, if i get 10 people wanting to pay to have it made, the money should cover all the coding costs.
So if you still want this, you want all the features, plus a heap of extras, send me a PM. i'll start once i have 5 people locked in.
sprintic
09-02-2008, 02:50 PM
I've installed this hack at stockmarketsrteview.com
you can check here
http://www.stockmarketsreview.com/stocks.php?do=retrievestock&sym=goog
but I want to list quotes for defined stocks under the main forum at stockmarketsreview.com. Can you help me with that? I'll pay if needed.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.