#!/usr/bin/perl require '/plib3/USChartCo.Stubs.pl'; require '/plib3/Web.pl'; my $web = Web->new(session => true); my $stubs = Stubs->new($web); $stubs->requirelogin; #69.211.177.107 my $index = $web->form('file') ? 'no' : 'yes'; my $file = $web->form('file'); #my $file = ""; my $db = "/tradingvideo.txt"; $stubs->printsectionheader('video'); my @videolist; my $flag = 0; open (videos, "<$db"); foreach (){ chomp; push(@videolist,$_); my @video = split /\|/,$_; if($video[4] eq $file){ $vidDate = $video[0]; $vidSubject = $video[1]; $vidMarket = $video[2]; $vidDuration = $video[3]; $vidType = $video[5]; $flag = 1; } } close videos; reverse @videolist; if($flag == 0){ my @firstvideo = split /\|/,$videolist[0]; $file = $firstvideo[4]; $vidDate = $firstvideo[0]; $vidSubject = $firstvideo[1]; $vidMarket = $firstvideo[2]; $vidDuration = $firstvideo[3]; $vidType = $firstvideo[5]; } if($vidType eq 'swf'){ print <<"EOHTML"; Created by Jim Prince for US Charts Online

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

EOHTML }elsif($vidType eq "wmv"){ print <<"EOHTML";
Click the play icon to start the video
EOHTML } print <<"EOHTML";
* To download a video to your desktop, right click the "download" link and click "Save As.."

Date: $vidDate
Subject: $vidSubject
Market: $vidMarket
Duration: $vidDuration
Download this Movie

EOHTML unless($index eq 'no'){ print "
"; print "

Here is this week's free video Trading Lesson. Every Friday evening U.S. Charts Online provides you with a free 5 - 7 minute video trading lesson. To play the video, press the Play button above and enjoy!

"; print "

If you can't view the trading lession, you need the latest Windows Media Player installed on your computer. Download the free Media Player.

"; print "
"; } print <<"EOHTML"; EOHTML open (videos, "<$db"); foreach (){ my @video = split /\|/,$_; &printRow($video[0],$video[1],$video[2],$video[3],$video[4]); } close videos; print "
Video Trading Lesson Archive
Date Subject Market Duration
"; #params: date, subject, market, duration, file sub printRow { my $date = shift; my $subject = shift; my $market = shift; my $duration = shift; my $file = shift; print "\n"; print "$date\n"; print "$subject\n"; print "$market\n"; print "$duration\n"; print "download\n"; print "\n"; } $stubs->printsectionfooter;