Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Propaganda Tile Browser

by Anonymous Monk
on Apr 14, 2000 at 05:14 UTC ( #7577=sourcecode: print w/ replies, xml ) Need Help??

Category: HTML Generator
Author/Contact Info Bowie J. Poag <poag@u.arizona.edu>
Description: This perl script (when deployed and executed in a directory containing images) will generate a nice HTML front-end for viewing the images remotely.

For an example of this script's output, have a look here.


This script contains HTML tags which make it difficult to display here.
#!/usr/bin/perl
#
# usage: mkbrowse <list of images>
#
# creates an indexed browsable thingy with links to tiled pages
#

@files = @ARGV;


for ($x = 0; $x < $#files + 1; $x++) {
        print STDOUT $files[$x], ".html\n";
        open(F, ">" . $files[$x] . ".html") || die("$!");
        select(F);

        if ($x > 0) {
                $prev_file = $files[$x - 1] . ".html";
                $prev = "<A HREF=../Vol11/catalog.html>&lt; &lt; PREVI
+OUS VOLUME</A>";
        } else {
                $prev = "<FONT COLOR=#808080>&lt; &lt; PREVIOUS VOLUME
+</FONT>";
        }

        if ($x < $#files) {
                $next_file = $files[$x + 1] . ".html";
                $next = "<A HREF=../Vol12/catalog.html>NEXT VOLUME &gt
+; &gt;</A>";
        } else {
                $next = "<FONT COLOR=#808080>NEXT VOLUME &gt; &gt;</FO
+NT>";
        }

        print <<EOM
<HTML>
<HEAD><TITLE>Propaganda: $files[$x]</TITLE></HEAD>

<BODY BGCOLOR="#B28E1C" TEXT="#000000" LINK="#222200" VLINK="#926E00">
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0>
<TR>
  <TD ALIGN=LEFT WIDTH=25%>$prev</TD>
  <TD ALIGN=CENTER WIDTH=50%><FONT SIZE=+1
FACE="helvetica,arial">Volume 12: NO SYMPATHY FOR REDMOND 2<br><FONT S
+IZE=+2>$files[$x]<br><FONT SIZE=0></FONT></TD>
  <TD ALIGN=RIGHT WIDTH=25%>$next</TD>
</TR>
</TABLE>

<P><TABLE BORDER=0 CELLPADDING=8 CELLSPACING=4>
<TR>
<TD VALIGN=TOP BGCOLOR="#B28E1C"><FONT FACE=HELVETICA,ARIAL SIZE=3>
EOM
        ;
        
        foreach $pic (@files) {
                print "<A HREF=$pic.html>$pic</A>";
                if ($pic eq $files[$x]) {
         print "<B><BLINK>&lt;</BLINK>&lt;</B>";
                }
                print "<BR>\n";
        }

print <<EOM
</TD><TD VALIGN=TOP WIDTH=100% BGCOLOR="#000000" BACKGROUND=$files[$x]
+>
<A HREF="$files[$x].tile.html"><b><font color="#cccccc" size=-1>Full-S
+creen</font></b> 
</A>
</TD></TABLE>

<P>
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0>
<TR>
  <TD ALIGN=LEFT WIDTH=33%><A HREF=$prev_file>PREVIOUS IMAGE</A></TD>
 <TD ALIGN=CENTER WIDTH=33%><A HREF="$files[$x]"><b>DOWNLOAD THIS IMAG
+E</b></A></TD>
<TD ALIGN=RIGHT WIDTH=33%><A HREF=$next_file>NEXT IMAGE</A></TD>
</TR>
</TABLE>
<HR NOSHADE SIZE=1>
<FONT SIZE=-2>This image is Copyleft &copy; 1998,1999 Bowie J. Poag / 
+PROPAGANDA  
 See the file <A HREF="COPYING">COPYING</A> 
        for details. Tile browser provided by Zachary Beane 
</BODY>
</HTML>
EOM
        ;
        close(F);
        open(T, ">" . $files[$x] . ".tile.html") || die("$!");
        print T <<EOM
<HEAD><TITLE>Propaganda: Tile Example</TITLE></HEAD>
<BODY BACKGROUND=$files[$x]>
<TABLE BORDER=0 BGCOLOR="#FFFFFF" CELLPADDING=5 CELLSPACING=0>
<TR><TD><FONT SIZE=-1 FACE="helvetica,arial"><A
HREF="$files[$x].html">Purty, Aint it! Click here to go back..</A></FO
+NT></TD></TR></TABLE>
EOM
        ;
        close(T);
}




Here's a link to fresh copy: Click Here

Comment on Propaganda Tile Browser
Download Code
RE: Propaganda Tile Browser
by turnstep (Parson) on Apr 14, 2000 at 07:17 UTC

    All you have to do is surround your script with <CODE> tags:

    This HTML is <STRONG>safe</STRONG>

Back to Code Catacombs

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://7577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2014-10-02 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls