Corrected the yellowness for bugs between the MagicDay and the bounce date.
[wvapps.git] / nitlog / img.php
blobf261f2b6f115ff1ad78d55d3f4d6a6888b77db6a
1 <!--
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2005 Net Integration Technologies, Inc.
5 * Dave's cheesy webloggy thingy's picture viewer
7 */
8 -->
9 <?php
11 include( "config.inc.php" );
13 function do_sizebutton( $link, $text )
15 global $num;
16 global $when;
17 global $day;
18 global $size;
20 print( '&nbsp;[' );
21 if( $size != $link )
22 print( "<a href=\"img.php?num=$num&when=$when&day=$day&size=$link\">" );
23 print( "$text" );
24 if( $size != $link )
25 print( '</a>' );
26 print( "]&nbsp;\n" );
29 function do_prevnextbutton( $link, $text )
31 global $num;
32 global $when;
33 global $day;
34 global $size;
36 print( '&nbsp;[' );
37 if( $link )
38 print( "<a href=\"img.php?num=$link" .
39 "&when=$when&day=$day&size=$size\">" );
40 print( "$text" );
41 if( $link )
42 print( '</a>' );
43 print( "]&nbsp;\n" );
48 <html>
50 <?php
51 print( "<meta name=Keywords content=\"$name $username NITI NITLog weblog " .
52 "Net Integration\">\n\n" );
55 <style type="text/css">
56 <!--
57 A:link{text-decoration:none; color: #0000f0}
58 A:visited{text-decoration:none; color: #0000f0}
59 A:active{text-decoration: none; color: #0000f0}
60 BODY {
61 font-family: lucida, helvetica, sans-serif;
62 font-size: 12pt;
64 TD, P, UL {
65 font-family: lucida, helvetica, sans-serif;
66 font-size: 12pt;
69 TT {
70 font-family: fixed, lucidatypewriter, courier new;
71 font-size: 12pt;
73 -->
74 </style>
76 <head><title>Image</title></head>
78 <body bgcolor=white>
79 <center>
81 <?php
82 $fname['sm'] = "$when/img_$num"."_sm.jpg";
83 $fname['lg'] = "$when/img_$num"."_lg.jpg";
84 $fname['hg'] = "$when/img_$num.jpg";
86 $havesmall = file_exists( $fname['sm'] );
87 $havebig = file_exists( $fname['lg'] );
88 $havehuge = file_exists( $fname['hg'] );
90 if( !$size )
91 $size = 'sm';
93 if( $size=='sm' && !$havesmall )
94 $size = 'lg';
95 if( $size=='lg' && !$havebig )
96 $size = "hg";
97 if( $size=='hg' && !$havehuge ) {
98 print( "puke\n" );
99 exit;
102 // Grab the caption...
103 // Also determine what prev and next should be, if any...
104 $file = file( "$when/$day" );
105 foreach( $file as $line ) {
106 if( $gotit ) {
107 if( substr( $line, 0, 6 ) === 'thumb ' ) {
108 $next = substr( $line, 6, 4 );
109 break;
110 } else
111 continue;
113 if( substr( $line, 0, 11 ) === "thumb $num " ) {
114 $caption = substr( $line, 11 );
115 $gotit = true;
116 } else if( substr( $line, 0, 6 ) === 'thumb ' ) {
117 $prev = substr( $line, 6, 4 );
121 // Show the caption and the image
122 print( "$caption<br><img border=0 src=\"$fname[$size]\"><br>" );
124 // Print the size buttons
125 if( $havesmall )
126 do_sizebutton( 'sm', 'small' );
127 if( $havebig )
128 do_sizebutton( 'lg', 'big' );
129 if( $havehuge )
130 do_sizebutton( 'hg', 'huge' );
131 print( '<br><br>' );
133 // Print the prev, up, next buttons
134 do_prevnextbutton( $prev, 'prev' );
135 print( "&nbsp;[<a href=\"index.php?m=$when&size=$size#$num\">up</a>]" .
136 '&nbsp;' );
137 do_prevnextbutton( $next, 'next' );
140 </center>
141 </body>
143 </html>