vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Request - Stock Quotes in Header (https://vborg.vbsupport.ru/showthread.php?t=64950)

scottct1 05-10-2004 12:36 PM

Request - Stock Quotes in Header
 
Hi there,

I have noticed that a few phpBB sites have company stock quotes listed in their headers (check out http://www.xmfan.com and http://www.xm411.com for examples)

I want to do the same thing on my site with vBulletin 3.

Any ideas how I can do this?

I believe they are pulling the info from Yahoo.

Thanks for anyone who can help!

scottct1 05-10-2004 04:27 PM

Ok I have been able to figure it out a little bit...

Here is what I got so far...

If I put the following code in a PHP file the stock quotes will display, but only at the top of the page.

Code:

$fd = fopen ("http://quote.yahoo.com/d/quotes.csv?s=DISH&f=sl1d1t1c1ohgv&e=.csv", "r");
$contents = fread ($fd, 200);
fclose ($fd);
 
$contents = str_replace ("\"", "", $contents);
$contents = explode (",", $contents);
 
echo "<ul><li>DISH Network stock tracker. Most recent trade: <b>\$$contents[1]</b>. ($contents[4]) (Prices delayed up to 20 minutes.)</li>";

Again this code works however the data is displayed at the top of my page.

I would like to be able to take this data and the

Code:

<ul><li>DISH Network stock tracker. Most recent trade: <b>\$$contents[1]</b>. ($contents[4]) (Prices delayed up to 20 minutes.)</li>
and put it into my templates, so the stock is displayed exactly where I want it on the page not at the top of the page. I would like it to go in my header, below my logo and above the Navbar.

Any ideas?

scottct1 05-10-2004 07:06 PM

Can anyone help? I would really like this displayed in my templates and not at the top of my page.

Check out http://www.satelliteguys.us/index.php to see what I mean.

Thanks!

scottct1 05-11-2004 01:22 PM

Can anyone PLEASE help?

ponche 05-11-2004 01:41 PM

Where did you put your additions? Try putting your code where you want the information to be displayed?

-Kevin

scottct1 05-11-2004 03:54 PM

Right now the code is in my index.php file.

The problem with this is no matter where I put the PHP in the file it still displays above the top and above the <html> & <body> when it is displayed to the user.

I want to be able to put this in my header template below my logo.


All times are GMT. The time now is 03:14 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.02554 seconds
  • Memory Usage 1,716KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete