diff options
Diffstat (limited to 'lib/boxes.pm')
| -rw-r--r-- | lib/boxes.pm | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/lib/boxes.pm b/lib/boxes.pm new file mode 100644 index 0000000..8c29644 --- /dev/null +++ b/lib/boxes.pm @@ -0,0 +1,165 @@ +# infoboxes!!!!!!!!!!!! + +our $BPOD_COLOR_UI_GRADIENT_1 = "0xF8F8D7"; +our $BPOD_COLOR_UI_GRADIENT_2 = "0xF0F0E6"; +our $BPOD_COLOR_UI_STROKE = "0x000000"; + +my $DEBUG_FORM_STRING = $DEBUG ? qq(<input type="hidden" name="debug" value="1">) : ''; + +use RGB; + +sub alerts + { + my $newmsg = count_new_messages($USER->{username}); + if ($newmsg > 0) + { + my $s = courtesy_s($newmsg); + alert_box("$BUCKY/inbox", "You have $newmsg new message$s!"); + } + } + +sub alert_box + { + my ($url, $msg) = @_; + print qq(<div class="message" style="background-color: #ff6666; font-family: georgia, garamond, serif;">\n); + print qq(<br><a href="$url" style="font-family: georgia, garamond, serif; color: #000;"><b><u>); + print $msg; + print qq(</b></u></a><br><br>); + print qq(</div>\n); + } + +sub welcome_box + { + my ($files, $size) = count_user_files($USER->{username}); + print qq(<div class="message">\n); + print qq(<b><big>$BUCKY_LOGIN_WELCOME</big></b><br>\n); + print qq(<small>you are using ),hushsize($size,2),qq( in $files files</small>); + print qq(</div>\n); + } +sub search_box + { + print <<__SEARCH__; +<div class="message"> +<table width=100% border=0 cellpadding=0 cellspacing=0 style="margin: 0px;"> +<form action="$BUCKY/2/search" method="get" enctype="multipart/form-data"> +$DEBUG_FORM_STRING +<tr><td height=$AVATAR_MED_WIDTH> +<table width=100% cellpadding=0 cellspacing=0 border=0> +<tr><td style="text-align: center; vertical-align: middle;"> +<input name="q" value="" maxlength=1024 style="font-size: 10px; font-family: Trebuchet MS, Helvetica, Arial, sans-serif; + color: #140A0A; border: 1px #140A0A solid; padding: 1px; margin: 0px 0px 0px 0px; width: 100%;"> +</td> +<td style="text-align: center; vertical-align: middle;"> +<input type="submit" value="SEARCH" class="clicky" style="margin: 0px 0px 0px 0px;"> +</td></tr></table> +</td></tr></table> +</div> +</form> +__SEARCH__ + } +sub bPod_box + { + my ($color) = @_; + $color = get_color_from_time() || "plain"; + $color = $COLORS{$color} if exists $COLORS{$color}; + my $rgb = RGB->new($color); + $rgb->perturb([4,4,8]); + my $gradient1 = $rgb->hex(); + $rgb->add(nighttime_quotient()); + my $background = $rgb->hex(); + $gradient1 =~ s/^\#/0x/; + $BPOD_COLOR_UI_GRADIENT_1 = $gradient1; # "0xF8F8D7"; + print <<bPod; + +<!-- bPod --> +<div style="padding-left: 1px;" id = "bPod"></div><center> +<script type="text/javascript" src="/js/swfobject.js"></script> +<script type="text/javascript"> + // <![CDATA[ + var so = new SWFObject ("/bPod.swf", "bPod", 215, 210, 8, "$background" ); + so.addParam ("scale", "noscale"); +bPod + print qq! so.addVariable("activeUser", "$USER->{username}" );\n! if ($USER != -1); + print qq! so.addVariable("uiGradient1", "$BPOD_COLOR_UI_GRADIENT_1" );\n!; + print qq! so.addVariable("uiGradient2", "$BPOD_COLOR_UI_GRADIENT_2" );\n!; + print qq! so.addVariable("uiStroke", "$BPOD_COLOR_UI_STROKE" );\n!; + + print qq! so.addVariable("keywords", "$BPOD_URL_SERVICES_KEYWORDS" );\n!; + print qq! so.addVariable("files", "$BPOD_URL_SERVICES_FILES" );\n!; + print qq! so.addVariable("threads", "$BPOD_URL_SERVICES_THREADS" );\n!; + print qq! so.addVariable("singleFilePath", "$BPOD_URL_PREAMBLE_FILES" );\n!; + print qq! so.addVariable("singleThreadPath", "$BPOD_URL_DETAILS" );\n!; + print <<bPod; + so.write("bPod"); + // ]]> +</script> +<!-- end bPod --> +bPod + } + +sub radio_box + { + my $radio = get_radio_info(); + + if ($radio == -1) + { + #return; + print qq!<div class="message">\n!; + print qq[<small><b>RADIO: GOING DARK</b><br>\n]; + print qq!<a href="http://radiofreehanoi.com/HOWTO">click here for broadcast instructions</a>\n</small>!; + print qq!</div>\n!; + } + else + { + print qq!<div class="message">\n!; + print qq!<b>$radio->{station}</b><br>\n!; + print qq!<small>$radio->{nowplaying}</small><br>\n!; + print qq!<a href="$radio->{tunein}"><small>$radio->{tunein}</small></a>\n!; + print qq!</div>\n!; + } + } + +sub hoot_box + { + my $hoot = uc( get_random_line("hoots") ); +print qq(<div align="left"); + print qq(<div class="message2">\n); + print qq(<form action="$BUCKY/comment" method="post" enctype="multipart/form-data">); + print qq(<input type=hidden name="debug" value=1">\n) if ($DEBUG); +print qq(<table width=100% border=0 cellpadding=3 cellspacing=0 style="margin: 0px;">); + print <<END; +<tr><td colspan=2 height=$AVATAR_MED_WIDTH> +<input type="hidden" name="id" value="1"> + +<table width=100% cellpadding=0 cellspacing=0 border=0> +<tr> +<td style="text-align: center; vertical-align: middle;"> +<input name="comment" value="" maxlength=1024 style="font-size: 10px; font-family: Trebuchet MS, Helvetica, Arial, sans-serif; + color: #140A0A; border: 1px #140A0A solid; padding: 1px; margin: 0px 0px 0px 0px; width: 100%;"> +</td> +<td style="text-align: center; vertical-align: middle;"> +<input type="submit" value="$hoot" class="clicky" style="margin: 0px 5px 0px 5px;"> +</td></tr></table> +</form> +</td></tr> +<!-- PRINTING COMMENTS --> +END + # <hr color="$BUCKY_COLOR_HR"> + my $comments = get_comments(1, 15); + sideshow_comments({ comments => $comments, thread => -1, keyword => -1, noreply => 1, hootbox => 1, order => "asc", shorturl => 1 }); +print "</table>"; +print <<__DUH__; +<br><big>~>{ <a href="$BUCKY/details/1">GLIMPSE THE PAST</a> }<~</big> +__DUH__ + print qq!</div>!; + } +sub svn_box + { + use lib "../../bucky2/lib"; + use Bucky::SVN; + my $svn = new Bucky::SVN; + print $svn->query_list; + } + +1; + |
