#!/usr/bin/perl # # If you want to use this code with my consent, then you must include # this message: # This code was made for my website and my private use # I do not consider it stable or finnished. It still has # bugs and may need some changing to work in your configuration. # Use at your own risk. # C. 2003, 2004, 2005. Jason Kenney. use CGI qw(:standard); #---------------------- # Initialize variables # These variables will be changed when # the site moves # Mostly the files come as such... # vars: These are for simple text for intro sections and # for my links. # files: They are my files separated by where in the site menu # they will be listed. #---------------------- $var = "var=\"on\""; $webdir = ") { #------------------------ # Flash takes variable strings with no spaces # instead a '+' denotes a whitespace # And it also doesnt like newlines so I put # A
instead #-------------------- tr/ /+/; s/\n/
/; $var = $var . $_; } } else { #----------------------- # A cosmetic cleanup # This code changes the filename to be displayed # without the extension # Then puts the extension # inside a pair of (). # Just makes it look better #--------------------- $_ = $file; tr/./:/; ($_, $ext) = split(/:/,$_); #-------------- # Again change spaces to '+' # And it embeds the file name (with ext)inside a html link # and then concatonates it to var #----------------------------- tr/ /+/; $x = $webdir . $dir . "/" . $file . "\">" . $_ . "+(" . $ext . ")

+"; $var = $var . "
" . $x; #With the other
you have double spacing. } } #So that each link is on a separate line $var = $var . "
"; } #--------------------------- # This is for static text that # just gets loaded for certain sections #-------------------------- @vars = `ls $vardir`; while(@vars) { $name = pop(@vars); chomp($name); $file = $vardir . $name; open(FH, $file); $var = $var . "&" . $name . "="; while() { tr/ /+/; s/\n/
/; $var = $var . $_; } close(FH); } #------------ #Little section to get blogging in flash #It doesnt always work right, for whatever #reason. I'm working on it, but hey this code # is forcing the blogging script to do something # very unatuaral. Display blogs in flash. #------------------- $y = `blosxom.cgi`; #Find the number of chars before
$x = index($y, "
"); #Get rid of the heading code. substr($y, 0, $x) = "
"; $_ = $y; tr/ /+/; s/\n/
/; $var = $var . "&blog=" . $_; #--------- # Saves it to the # flash file actionscript # loads #----------- open(FH,">loadir.txt"); print FH $var; close(FH); #----------- #This loads the html file and prints it out #----------- print header(); $file = "../flash/base.html"; open(FH, $file); while() { print $_; }