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)
-   -   vB Stocks 1.0.0 for vB 3.0.3 (https://vborg.vbsupport.ru/showthread.php?t=71445)

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

Quote:

Originally Posted by rajc007
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

Quote:

Originally Posted by AN-net
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

Quote:

Originally Posted by interfx
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:
Code:

fetch_template('stocks_templatename')
I changed it to:
Code:

fetch_template('adv_portal_stocks_templatename')
and also changed the first few lines of code in the stocks.php file that read:
Code:

$globaltemplates= array(
        'STOCKS',
        'stocks_quotebits',
        'stocks_getquote'
);

to:

Code:

$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:

Code:

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

interfx 02-25-2005 10:21 PM

Quote:

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

PHP Code:

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

Quote:

Originally Posted by Madacc
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

Quote:

Originally Posted by Danny.VBT
@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

Quote:

Originally Posted by Danny.VBT
@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

Quote:

Originally Posted by fiber1
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

Quote:

Originally Posted by interfx
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 Code:

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

Quote:

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

HHU 10-10-2005 06:13 PM

Would Be Nice To See This Ported With Ability To Buy Stocks With Ucash

Carl Anderson 10-10-2005 06:35 PM

Quote:

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

HHU 10-22-2005 03:54 PM

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.


All times are GMT. The time now is 07:40 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.01519 seconds
  • Memory Usage 1,881KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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