summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbucky2/bin/move-file38
-rwxr-xr-xbucky2/bin/rename-file44
-rwxr-xr-xcgi-bin/details115
-rw-r--r--cgi-bin/localbucky.pm.tmpl2
-rwxr-xr-xcgi-bin/profile2
-rw-r--r--docs/css/bogart.css6
-rw-r--r--fortune/titles10
7 files changed, 178 insertions, 39 deletions
diff --git a/bucky2/bin/move-file b/bucky2/bin/move-file
index bd6dc48..7bfec85 100755
--- a/bucky2/bin/move-file
+++ b/bucky2/bin/move-file
@@ -4,15 +4,37 @@ use lib "../lib";
use Bucky;
if (scalar(@ARGV) < 2) {
- print "usage: move-file thread-id comment-id\n";
+ print "usage: move-file thread-id file-ids\n";
exit(1);
}
-my $bucky = new Bucky;
-$bucky->db->update_by_id('file', {
- "id" => $ARGV[1],
- "record" => {
- "thread" => $ARGV[0]
- }
-});
+our $bucky = new Bucky;
+our $thread_id = $ARGV[0];
+
+for (my $i = 1; $i < scalar(@ARGV); $i++) {
+ move_file($ARGV[$i]);
+}
+
+sub move_file {
+ my $file_id = shift;
+
+ my $files = $bucky->db->select('file', { id => $file_id });
+ my $file = $files->[0];
+
+ my $path = $ENV{"HOME"} . "/bucky/data/";
+
+ print "moving " . $file->{'filename'} . "\n";
+
+ system("/bin/mkdir", "-p", $path . $thread_id);
+ system("/bin/mkdir", "-p", $path . $thread_id . "/.thumb");
+ system("/bin/mv", $path . $file->{'thread'} . "/" . $file->{'filename'}, $path . $thread_id);
+
+ $bucky->db->update_by_id('file', {
+ "id" => $file_id,
+ "record" => {
+ "thread" => $thread_id
+ }
+ });
+}
+
diff --git a/bucky2/bin/rename-file b/bucky2/bin/rename-file
new file mode 100755
index 0000000..a060b1a
--- /dev/null
+++ b/bucky2/bin/rename-file
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+use strict;
+use lib "../lib";
+use Bucky;
+
+if (scalar(@ARGV) < 2) {
+ print "usage: move-file file-id filename\n";
+ exit(1);
+}
+
+our $bucky = new Bucky;
+our $file_id = $ARGV[0];
+our $filename = $ARGV[1];
+
+rename_file($file_id, $filename);
+
+sub rename_file {
+ my ($file_id, $filename) = @_;
+
+ my $files = $bucky->db->select('file', { id => $file_id });
+ my $file = $files->[0];
+
+ my $path = $ENV{"HOME"} . "/bucky/data/";
+
+ print $path . $file->{'thread'} . "/" . $filename . "\n";
+ if (-e $path . $file->{'thread'} . "/" . $filename) {
+ print "file exists!\n";
+ return
+ }
+ print "renaming " . $file->{'filename'} . " => " . $filename . "\n";
+
+ system("/bin/mv",
+ $path . $file->{'thread'} . "/" . $file->{'filename'},
+ $path . $file->{'thread'} . "/" . $filename);
+
+ $bucky->db->update_by_id('file', {
+ "id" => $file_id,
+ "record" => {
+ "filename" => $filename
+ }
+ });
+}
+
+
diff --git a/cgi-bin/details b/cgi-bin/details
index 35b34c7..dc245cf 100755
--- a/cgi-bin/details
+++ b/cgi-bin/details
@@ -147,32 +147,32 @@ sub details_view
}
if (@$files > $many_jpgs)
{
- if (find_mp3($files))
- {
- my $z_playlist = "/cgi-bin/bucky/playlist/$t->{id}";
- my $z_autoplay = "false";
- if (check_key($USER->{boxes}, "autoplay"))
- { $z_autoplay = "true"; }
- print <<__PLAYLIST__;
- <div id='mp3player'>LOADING MP3 PLAYER ...</div>
-
-<script type="text/javascript" src="/js/swfobject1.js"></script>
-<script type="text/javascript">
- var s2 = new SWFObject("/mediaplayer.swf", "playlist", "392", "200", "7");
- s2.addVariable("file","$z_playlist");
- s2.addVariable("shuffle","false");
- s2.addVariable("backcolor","0xEEEEEE");
- s2.addVariable("frontcolor","0x111111");
- s2.addVariable("lightcolor","0x444444");
- s2.addVariable("displayheight","0");
- s2.addVariable("width","392");
- s2.addVariable("height","200");
- s2.addVariable("volume","50");
- s2.addVariable("autostart","$z_autoplay");
- s2.write("mp3player");
-</script>
-__PLAYLIST__
- }
+# if (find_mp3($files))
+# {
+# my $z_playlist = "/cgi-bin/bucky/playlist/$t->{id}";
+# my $z_autoplay = "false";
+# if (check_key($USER->{boxes}, "autoplay"))
+# { $z_autoplay = "true"; }
+# print <<__PLAYLIST__;
+# <div id='mp3player'>LOADING MP3 PLAYER ...</div>
+#
+#<script type="text/javascript" src="/js/swfobject1.js"></script>
+#<script type="text/javascript">
+# var s2 = new SWFObject("/mediaplayer.swf", "playlist", "392", "200", "7");
+# s2.addVariable("file","$z_playlist");
+# s2.addVariable("shuffle","false");
+# s2.addVariable("backcolor","0xEEEEEE");
+# s2.addVariable("frontcolor","0x111111");
+# s2.addVariable("lightcolor","0x444444");
+# s2.addVariable("displayheight","0");
+# s2.addVariable("width","392");
+# s2.addVariable("height","200");
+# s2.addVariable("volume","50");
+# s2.addVariable("autostart","$z_autoplay");
+# s2.write("mp3player");
+#</script>
+#__PLAYLIST__
+# }
if (check_key($t->{display}, "nfl")) # no file list
{ ; }
elsif (check_key($t->{display}, "ffl")) # full file list
@@ -193,6 +193,69 @@ __PLAYLIST__
print "</td>";
print qq(</tr></table></center>);
+ print <<__PLAYER__;
+<script>
+(function(){
+
+var links = document.querySelectorAll("a")
+var audio, music = [], current_index = -1, typing = false
+var comment = document.querySelector("#comment")
+Array.prototype.slice.apply(links).forEach(function(url){
+ if (! url.href.match(/(mp3|wav|ogg)/)) return
+ var index = music.length
+ music.push(url)
+ url.addEventListener("click", function(e){ e.preventDefault(); play(index) })
+})
+if (music.length) {
+ audio = document.createElement("audio")
+ audio.setAttribute("controls", true)
+ audio.addEventListener("ended", next)
+ audio.src = music[0]
+ var table = document.querySelector(".main")
+ table.parentNode.insertBefore(audio, table)
+ document.body.addEventListener("keydown", keydown)
+ comment.addEventListener("focus", focusTextBox)
+ comment.addEventListener("blur", blurTextBox)
+}
+function play(index){
+ current_index = (index + music.length) % music.length
+ audio.src = music[current_index].href
+ audio.play()
+ var playing = document.querySelector(".playing")
+ if (playing) playing.classList.remove("playing")
+ music[current_index].classList.add("playing")
+}
+function prev(){
+ play(current_index - 1)
+}
+function next(){
+ play(current_index + 1)
+}
+function toggle(){
+ if (audio.paused) audio.play()
+ else audio.pause()
+}
+function keydown(e){
+ if (typing) return
+ switch (e.keyCode) {
+ case 37: // left
+ prev()
+ break;
+ case 39: // right
+ next()
+ break;
+ case 32: // spacebar
+ e.preventDefault()
+ toggle()
+ break;
+ }
+}
+function focusTextBox (){ typing = true }
+function blurTextBox (){ typing = false }
+
+})()
+</script>
+__PLAYER__
}
sub find_mp3
diff --git a/cgi-bin/localbucky.pm.tmpl b/cgi-bin/localbucky.pm.tmpl
index 143c192..69a617a 100644
--- a/cgi-bin/localbucky.pm.tmpl
+++ b/cgi-bin/localbucky.pm.tmpl
@@ -9,7 +9,7 @@ our $BUCKY_NAME = 'king of sf';
our $BUCKY_SHORT_NAME = 'kingofsf';
our $BUCKY_COOKIE_DOMAIN = 'kingofsf.com';
-our $BUCKY_ADMINISTRATOR = 'marc';
+our $BUCKY_ADMINISTRATOR = 'jules';
our $BUCKY_DEFAULT_BOXES = " welcome bPod radio postform hootbox photostream ";
our $BUCKY_DEFAULT_KEYWORD = 'NONE'; # default should be 'NONE'
our $BUCKY_TIMEZONE_OFFSET = 8; # correct your server's offset from GMT
diff --git a/cgi-bin/profile b/cgi-bin/profile
index 93dc089..3342f0c 100755
--- a/cgi-bin/profile
+++ b/cgi-bin/profile
@@ -44,7 +44,7 @@ sub main
}
elsif ($input->{username} eq "system")
{
- $input->{username} = "marc";
+ $input->{username} = "jules";
header("profile for $input->{username}");
}
elsif (get_uid($input->{username}) == -1)
diff --git a/docs/css/bogart.css b/docs/css/bogart.css
index 491f793..563b34c 100644
--- a/docs/css/bogart.css
+++ b/docs/css/bogart.css
@@ -299,3 +299,9 @@ pre,tt,code
width: 310px;
}
+a.playing {
+ font-weight: bold;
+}
+a.playing:before {
+ content: '> ';
+}
diff --git a/fortune/titles b/fortune/titles
index 1dfc421..4c17138 100644
--- a/fortune/titles
+++ b/fortune/titles
@@ -338,7 +338,7 @@ let me get the door for you, bucky
bucky doffs his cap to you
bucky ties your shoelaces together
something on your mind, bucky?
-a little bucky in the chest of drawers
+bucky sleeping in the chest of drawers
whoa! bucky, are you getting all this?
bucky takes in the yard situation
bucky stays home and pulls weeds
@@ -379,7 +379,6 @@ bucky's final paroxysm
bucky on two gelcaps
bucky is transforming
bucky making it happen
-bucky's berry store
bucky dines out
bucky throws down
bucky begs the question
@@ -388,7 +387,7 @@ bucky orders the best thing
bucky will have double
bucky demands satisfaction
bucky's dream comes alive
-bucky's midday reverie
+bucky's afternoon reverie
call 555-bcky
calling bucky to account
bucky goes slo-mo
@@ -398,3 +397,8 @@ bucky reveals the answer
bucky and the dream deferred
bucky intends to say more
blushing bucky bends backward
+bucky pulls up the traps
+bucky casts the line
+bucky leaps from the high rock
+bucky crisps up some smores
+bucky cracks open a lobster tail