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)

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 08: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.01620 seconds
  • Memory Usage 1,786KB
  • 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
  • (1)bbcode_php_printable
  • (3)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
  • (10)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