#!/usr/bin/perl ### Copyright © 2001 By: U-L-T-R-A@webtv.net ### $Root = "/usr/home/web/p/psytunez/"; ## Set Page Variables ## $text = '#ffffff'; ## Body text color $bg = '#202020'; ## Body bgcolor $back = 'links/transporter/bg.jpg'; ## Background URL $textboxText = '#bda73a'; ## Changes textbox text & cursor colors $textboxBg = '#171726'; ## Changes textbox bgcolors $buttonText = '#eeeeee'; ## Changes button text colors $menuText = '#000060'; ## Changes drop menu text colors $button = 'file://rom/borders/buttonborder7.bif'; ## Changes button borders ## Enter Supporting File Paths ## $fmURL = "3dit0r14.cgi"; $addlink = 'links/transporter/addlink.cgi'; $addnews = 'links/transporter/addnews.cgi'; $news = &load("/usr/home/web/p/psytunez/links/transporter/news.txt"); $links = &load("/usr/home/web/p/psytunez/links/transporter/links.txt"); # # # # # # # # Do Not Edit Below This Line # # # # # # # # $title = qq~   * Transporter Ready *~; $led_on = "links/transporter/on.gif"; $led_off = "links/transporter/off.gif"; $indicator1 = 'file://rom/borders/greenLED.bif'; $indicator2 = 'file://rom/borders/redLED.bif'; use CGI::Carp (fatalsToBrowser); use LWP::Simple; use CGI qw(:cgi); $in = new CGI; print $in->header('text/html'); $rename = $in->param('rename'); $fileURL = $in->param('fileURL'); $directory = $in->param('directory'); $ls = `ls -R $Root`; @pairs = split(/\n/,$ls); foreach $pair (@pairs) { if ($pair =~ /$Root/) { $pair =~ s#$Root/?(.)#$1#; chop($pair); push(@Dirs, $pair); } } $dir = "$directory/"; $dirA = "$dir"; $dirB = "$dir"; $cookie_script = qq~~; $login_form = qq~
~; if($fileURL) { if (!$directory) { $dirA = ""; $dirB = "Root"; } $grab = get "$fileURL"; open(file,">$dirA$rename"); print file "$grab"; close(file); print qq~             " Done! " $cookie_script
Personal File Transporter
$login_form

Done!

$fileURL

Was Transported To Directory:

$dirB

And Was Renamed To:

$rename

<noembed> <noframes> </body> </html>~; } else { print qq~<html> <killbanner> <head><title>$title</title> $cookie_script <script language="javascript"> // Script Copyright 2000 / 2001 By U-L-T-R-A\@webtv.net function Drop() { if (tog == "on") { tog = "off"; document.form.fileURL.value = ""; document.Image1.src = "$led_off"; } else { tog = "on"; document.form.fileURL.value = document.form.lastURL.value; document.Image1.src = "$led_on"; } } function On1() { document.Image1.src = "$led_on"; } function Off1() { if (document.form.fileURL.value == "") { document.Image1.src = "$led_off"; } else { document.Image1.src = "$led_on"; } } function On2() { document.Image2.src = "$led_on"; } function Off2() { if (document.form.directory.value == "") { document.Image2.src = "$led_off"; } else { document.Image2.src = "$led_on"; } } function On3() { document.Image3.src = "$led_on"; } function Off3() { if (document.form.rename.value == "") { document.Image3.src = "$led_off"; } else { document.Image3.src = "$led_on"; } } function makeHistoryOptions() { x = history.length; while (x > 0) { histURL = history[x] histID = histURL.substring(0,4); if (histID == "http") { document.write("<option value="+histURL+">"+histURL) } if (histID == "news") { document.write("<option value="+histURL+">"+histURL) } x--; } } function spell() { var word = prompt("Enter a word",""); if (!word) { alert('Aborted') return false } else { document.web.va.value = ""+word+""; document.web.submit(); } } function mail() { var to = prompt("To:",""); if (!to) { alert('Aborted') return false; } var sub = prompt("Subject:",""); if (!sub) { alert('Aborted') return false; } var msg = prompt("Message:",""); if (!msg) { alert('Aborted') return false; } else { document.mail.action="mailto:"+to+"?no_signature=true&subject="+sub+""; document.mail.Message.value=""+msg+""; document.mail.submit(); } } </script> <style type="text/css"> #window1{position:absolute;visibility:hidden;top:100px;left:97px;z-index:1;} </style> <style type="text/css"> #window2{position:absolute;visibility:hidden;top:132px;left:97px;z-index:1;} </style> </head> <body onLoad="LoadEmUp();" background="$back" bgcolor="$bg" text="$text" fontsize=medium link=#ffffff vlink=#dddddd vspace=1 hspace=3> <div id=window1> <table> <tr><td> <form name=recents> <select id=win1 text=000070 width=400 onChange="document.form.fileURL.value=document.recents.win1.value; document.form.lastURL.value=document.recents.win1.value; document.form.directory.focus(); On1(); Off1();" onblur="document.window1.style.visibility='hidden'"> <option>Transport Or Source From Your Recents List <script> makeHistoryOptions(); </script> </select> </form> </table></div> <div id=window2> <table> <tr><td> <form name=menu> <select id=win2 text=#000070 autoactivate onChange="document.form.directory.value=document.menu.win2.value; document.form.rename.focus(); On2(); Off2();" onblur="document.window2.style.visibility='hidden'" width=400> <option selected>Choose A Directory To Transport File To <option value="">*Root~; foreach $Dir (sort @Dirs) { print qq~<option value="$Dir">$Dir\n~; } print qq~</select></form> </table></div> <center> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr><td align=center colspan=3> <font size=6 effect=emboss> <b>Personal File Transporter</b> </font> <spacer type=vertical size=6> </td></tr><tr><td align=center> $login_form </table> <spacer type=vertical size=8> <table border=1 width=100%> <tr><td width=90> <form method=POST name=form> <input name="action" type=hidden value="go"> <font size=2> <b>Last URL:</b></font> </td><td> <input name=lastURL type=text bgcolor=$textboxBg text=$textboxText cursor=$textboxText value=" WEBTV JAVASCRIPT BUG!!  RELOAD 5 TIMES!! " width=100% nohighlight autoactivate> <script> document.form.lastURL.value=history.previous; </script> </td><td width=45 align=center bgcolor=#444444> <input type=checkbox name=tog offimage="file://rom/images/SwitchOff.gif" onimage="file://rom/images/SwitchOn.gif" onClick="Drop();"> </td></tr><tr><td> <font size=2> <b>File URL:</b></font> </td><td> <input name=fileURL type=text bgcolor=$textboxBg text=$textboxText cursor=$textboxText size=42 autoactivate onfocus=On1(); onblur=Off1(); width=100% nohighlight> </td><td align=center bgcolor=#444444 href="javascript:document.all.window1.style.visibility='visible';document.all['win1'].focus();"> <Img src=$led_off name=Image1 height=13 width=13> </td></tr><tr><td> <font size=2> <b>Directory:</b></font> </td><td> <input name=directory type=text bgcolor=$textboxBg text=$textboxText nohighlight cursor=$textboxText size=42 width=100% autoactivate onfocus="document.window1.style.visibility='hidden'; On2();" onblur=Off2(); onChange=setCookie("directory",this.value);> </td><td align=center bgcolor=#444444 href="javascript:document.all.window2.style.visibility='visible';document.all['win2'].focus();"> <Img src=$led_off name=Image2 height=13 width=13> </td></tr><tr><td> <font size=2> <b>New name:</b></font> </td><td> <input name=rename type=text bgcolor=$textboxBg text=$textboxText cursor=$textboxText size=42 width=100% autoactivate nohighlight onfocus="document.window2.style.visibility='hidden'; On3();" onblur=Off3();> </td><td align=center bgcolor=#444444> <Img src=$led_off name=Image3 height=13 width=13> </td></tr><tr><td align=center colspan=3> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr><td width=33% align=center> <input type=submit value="Transport File" indicator=$indicator2 checked=on borderimage=$button text=$buttonText width=180> </form> </td><td width=33% align=center> <form name=source action=http://wtv-zone.com/experthtml/wtv-zone/ method=POST onSubmit="document.source.url.value = document.form.lastURL.value"> <input type=hidden name=url> <input type=submit value="Expert's Source" indicator=$indicator2 checked=on borderimage=$button text=$buttonText width=180> </form> </td><td width=33% align=right> <form name=source2 action=http://ultra1.hypermart.net/cgi-bin/source_all.cgi method=POST onSubmit="document.source2.view.value = document.form.lastURL.value"> <input type=hidden name=view> <input type=submit value="The Source All" indicator=$indicator2 checked=on borderimage=$button text=$buttonText width=180> </form> </table> </td></tr><tr><td align=center colspan=3> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr><td align=right width=33%> <form> <select onclick="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)" text=$menuText width=182> <option>*Newsgroups <option value=$addnews>*Add A Newsgroup <option value="javascript:history.go(-0)">*Reload to view added link <option> $news </select> </form> </td><td align=right width=33%> <form name=trans action=http://ultra1.hypermart.net/toolz/trans.cgi onSubmit="document.trans.url.value = document.form.lastURL.value" method=post> <input type=hidden name=url> <input type=submit value="Transload It" indicator=$indicator2 checked=on borderimage=$button text=$buttonText width=182> </form> </td><td align=right width=33%> <form> <select width=182 text=$menuText onclick="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)"> <option>*Favorite LInks <option value=$addlink>*Add A Link <option value="javascript:history.go(-0)">*Reload to view added link <option> $links </select> </form> </table> </td></tr><tr><td widht=100% align=center colspan=3> <table width=100% boder=0 cellpadding=0 cellspacing=0> <tr><td align=center> <form action=http://ultra1.hypermart.net/toolz/rate.html method=get> <input type=submit text=$buttonText value=Modem width=110 indicator=$indicator2 checked=on borderimage=$button> </form> </td><td align=center> <form action=http://ultra1.hypermart.net/logins/home.html method=get> <input type=submit text=$buttonText value=Logins width=110 indicator=$indicator2 checked=on borderimage=$button> </form> </td><td align=center> <form action=http://developer.webtv.net/status_board/stat.html method=get> <input type=submit text=$buttonText value=Status width=110 indicator=$indicator2 checked=on borderimage=$button> </form> </td><td align=center> <form name=web action="http://www.m-w.com/cgi-bin/dictionary" method=post onSubmit="return spell();"> <input type=hidden name=book value=Dictionary> <input type=hidden name=va> <input type=submit text=$buttonText value=Spelling width=110 indicator=$indicator2 checked=on borderimage=$button> </form> </td><td align=center> <form name="mail" method="post" onsubmit="return mail()"> <input name="Message" type="hidden"> <input type=submit text=$buttonText value="Mail To" width=110 indicator=$indicator2 checked=on borderimage=$button> </form> </table> </table> <p> <font size=4 effect=emboss> Copyright © 2001 By: <a href=http://odin.prohosting.com/ultra01/index.cgi> <i>U-L-T-R-A</i> </a></font> </center> <noframes> <noembed> <noframes> </body> </html>~; exit; } sub load { my ($path) = @_; open(FILE, $path) or return "Error has occured at $path!"; @lines=<FILE>; close(FILE); $source=join("", @lines); return($source); }