diff -Nurbx '*.conf*' -x '*CVS*' gjukebox.puck/scripts/ChangeLog gjukebox.puck.v2/scripts/ChangeLog
--- gjukebox.puck/scripts/ChangeLog	2003-02-12 21:48:37.000000000 +1300
+++ gjukebox.puck.v2/scripts/ChangeLog	2003-06-13 15:57:15.000000000 +1200
@@ -1,3 +1,17 @@
+2003-05-13  Andrew Ruthven  <andrew@cyclops.etc.gen.nz>
+
+	* getnextmp3.pl: Wow, lot's of places where user is queried from the
+	the DB when it should be username.
+
+2003-05-06  Andrew Ruthven  <andrew@cyclops.etc.gen.nz>
+
+	* getpictures.pl: Dunno, about the author of this script, but my
+	terminal windows at 80 characters wide.  Make the help screen conform
+	to this.
+	The temporary directores are created with a mask of 666, directories
+	work better if they have the execute bit set.  Let's make this 777.
+	Although for the security minded folks 755 or 700 is better.
+
 2003-02-12  Andrew Ruthven  <andrew@cyclops.etc.gen.nz>
 
 	* playit.pl: I finally got tired of needing to restart playit.pl
diff -Nurbx '*.conf*' -x '*CVS*' gjukebox.puck/scripts/getnextmp3.pl gjukebox.puck.v2/scripts/getnextmp3.pl
--- gjukebox.puck/scripts/getnextmp3.pl	2003-02-12 09:19:36.000000000 +1300
+++ gjukebox.puck.v2/scripts/getnextmp3.pl	2003-06-13 15:02:03.000000000 +1200
@@ -227,29 +227,29 @@
       if ($orguser) {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(ifnull(d.enable,0)*ifnull(d.pri,1)),sum(u.toplist)+a.toplist ".
                            "as toplist,sum(ifnull(d.enable,0)*ifnull(d.pri,1)/c.size) from songs a left join uservoting u on a.id = u.songid ".
-                           "left right join loggedinusers l on u.user=l.user join groupmember b on a.id = b.songid ".
-                           "left join groups c on b.groupid = c.id left join groupsetting d on c.id = d.groupid and d.user $queue ".
-                           "$volidsel and and (u.user=l.user or isnull(u.user)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
+                           "left right join loggedinusers l on u.username=l.username join groupmember b on a.id = b.songid ".
+                           "left join groups c on b.groupid = c.id left join groupsetting d on c.id = d.groupid and d.username $queue ".
+                           "$volidsel and and (u.username=l.username or isnull(u.username)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
           || die "Failed to prepare select query 2.1 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       } else {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(c.enable*c.pri),sum(u.toplist)+a.toplist as toplist,sum(c.enable*c.pri/c.size) ".
-                           "from songs a left join uservoting u on a.id = u.songid right join loggedinusers l on u.user=l.user ".
+                           "from songs a left join uservoting u on a.id = u.songid right join loggedinusers l on u.username=l.username ".
                            "left join groupmember b on a.id = b.songid left join groups c on b.groupid = c.id ".
-                           "$volidsel and (u.user=l.user or isnull(u.user)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
+                           "$volidsel and (u.username=l.username or isnull(u.username)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
           || die "Failed to prepare select query 2.2 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       }
     } else {
       if ($orguser) {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(ifnull(c.enable,0)*ifnull(c.pri,1)),sum(u.toplist)+a.toplist as toplist ".
-                           "from songs a left join left join uservoting u on a.id = u.songid right join loggedinusers l on u.user=l.user groupmember b on a.id = b.songid ".
-                           "left join groupsetting c on b.groupid = c.groupid and c.user $queue ".
-                           "$volidsel and (u.user=l.user or isnull(u.user))  group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
+                           "from songs a left join left join uservoting u on a.id = u.songid right join loggedinusers l on u.username=l.username groupmember b on a.id = b.songid ".
+                           "left join groupsetting c on b.groupid = c.groupid and c.username $queue ".
+                           "$volidsel and (u.username=l.username or isnull(u.username))  group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
           || die "Failed to prepare select query 2.3 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       } else {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(c.enable*c.pri),sum(u.toplist)+a.toplist as toplist ".
-                           "from songs a left join uservoting u on a.id = u.songid right join loggedinusers l on u.user=l.user ".
+                           "from songs a left join uservoting u on a.id = u.songid right join loggedinusers l on u.username=l.username ".
                            "left join groupmember b on a.id = b.songid left join groups c on b.groupid = c.id ".
-                           "$volidsel and (u.user=l.user or isnull(u.user)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
+                           "$volidsel and (u.username=l.username or isnull(u.username)) group by a.id, a.lastplayed, a.artist having toplist >= 0 order by a.artist")
           || die "Failed to prepare select query 2.4 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       }
     }
@@ -259,7 +259,7 @@
       if ($orguser) {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(ifnull(d.enable,0)*ifnull(d.pri,1)),a.toplist,sum(ifnull(d.enable,0)*ifnull(d.pri,1)/c.size) ".
                            "from songs a left join groupmember b on a.id = b.songid ".
-                           "left join groups c on b.groupid = c.id left join groupsetting d on c.id = d.groupid and d.user $queue ".
+                           "left join groups c on b.groupid = c.id left join groupsetting d on c.id = d.groupid and d.username $queue ".
                            "$volidsel and toplist >= 0 group by a.id, a.lastplayed, a.toplist, a.artist order by a.artist")
           || die "Failed to prepare select query 2.5 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       } else {
@@ -273,7 +273,7 @@
       if ($orguser) {
         $sel=$dbh->prepare("select a.id," . db_epoch('a.lastplayed', 'a_lastplayed') . ",sum(ifnull(c.enable,0)*ifnull(c.pri,1)),a.toplist ".
                            "from songs a left join groupmember b on a.id = b.songid ".
-                           "left join groupsetting c on b.groupid = c.groupid and c.user $queue ".
+                           "left join groupsetting c on b.groupid = c.groupid and c.username $queue ".
                            "$volidsel and toplist >= 0 group by a.id, a.lastplayed, a.toplist, a.artist order by a.artist")
           || die "Failed to prepare select query 2.7 in getnextmp3.pl, emptyqueue: $DBI::errstr\n";
       } else {
@@ -307,7 +307,7 @@
 
 if ($ARGV[0] eq "peek") {
   my $sth=$dbh->prepare("select queue.queueid,queue.id,songs.file,songs.difvol,songs.length,songs.format,a.mounted,a.id,a.flags from queue left join songs on queue.id = songs.id ".
-                        "left join volumes a on a.id = songs.volid where pri = 0 and queue.user $queue and (a.id is null || (length(a.mounted)>0 && (a.flags&2)=2)) order by pri,queueid limit 1");
+                        "left join volumes a on a.id = songs.volid where pri = 0 and queue.username $queue and (a.id is null || (length(a.mounted)>0 && (a.flags&2)=2)) order by pri,queueid limit 1");
   $sth->execute;
   my ($queueid,$id,$file,$difvol,$length,$format,$mounted,$volid,$volflags)=$sth->fetchrow_array;
   if (defined $id) {
diff -Nurbx '*.conf*' -x '*CVS*' gjukebox.puck/scripts/getpictures.pl gjukebox.puck.v2/scripts/getpictures.pl
--- gjukebox.puck/scripts/getpictures.pl	2003-01-21 21:22:59.000000000 +1300
+++ gjukebox.puck.v2/scripts/getpictures.pl	2003-06-06 15:08:06.000000000 +1200
@@ -85,27 +85,38 @@
 
     $0 {options}
 
-    Walks the albums and attempts to find cover art for each entry. Search is done on CDNow or Google. Cover art is placed
-    into a directory tree with each Album having an entry. Multiple images may be returned for each album since the search is
-    rarely distinct. The most likely image is set in the database. The other returned images can be selected in the Albums
-    page in the Jukebox. The program generates a lot of temporary files in /tmp/cover_art_cache. These can be useful if the
-    script is run multiple times, so delete them when you\'re happy with the results.
+    Walks the albums and attempts to find cover art for each entry. Search is
+    done on CDNow or Google. Cover art is placed into a directory tree with
+    each Album having an entry. Multiple images may be returned for each album
+    since the search is rarely distinct. The most likely image is set in the
+    database. The other returned images can be selected in the Albums page in
+    the Jukebox. The program generates a lot of temporary files in
+    /tmp/cover_art_cache. These can be useful if the script is run multiple
+    times, so delete them when you\'re happy with the results.
 
 Options:
   --h|help                Display this message.
   --g|google              Search Google instead of CDNow.
-  --m|maximages={number}  Max number of returned images per album. Default is 5 for CDNow and 20 for Google.
+  --m|maximages={number}  Max number of returned images per album. Default is
+			  5 for CDNow and 20 for Google.
   --v|verbose             Increase verbosity.
-  --d|delete              Delete everything in the image directory for an album before lookup. Useful for development.
+  --d|delete              Delete everything in the image directory for an album
+			  before lookup. Useful for development.
   --n|nothing             Do nothing - dry run.
-  --p|path                Base path for images. Should be inside webserver docroot. Default is $SITE/cover_art/
-  --j|jukebox             Used internally when being called from Jukebox. Command line args are different.
+  --p|path                Base path for images. Should be inside webserver
+			  docroot. Default is $SITE/cover_art/
+  --j|jukebox             Used internally when being called from Jukebox.
+			  Command line args are different.
   --i|id                  Update just this Album id.
-  --f|file                Set above Album id to this file. Does size conversion, copies it into tree. Updates DB.
-  --r|rename              Name of file to be used when placed into tree for above option.
+  --f|file                Set above Album id to this file. Does size
+			  conversion, copies it into tree. Updates DB.
+  --r|rename              Name of file to be used when placed into tree for
+			  above option.
   --s|search              Use this string for google search
-  --returnpath            Given an id ( -i ) returns the path based on Artist / Album name. Called from Jukebox
-  --cleanup               For each Album with images inside 'cover_art' directory, cleans up redundant images
+  --returnpath            Given an id ( -i ) returns the path based on
+			  Artist / Album name. Called from Jukebox
+  --cleanup               For each Album with images inside 'cover_art'
+			  directory, cleans up redundant images
 
 __EOT__
     exit 2;
@@ -200,8 +211,8 @@
 if($cleanup) {
     system ("rm -r $cachedir") if ($cachedir =~ m%^/tmp/%);
 } else {
-    mkdir($cachedir,0666);
-    mkdir($webcache,0666);
+    mkdir($cachedir,0777);
+    mkdir($webcache,0777);
 }
 
 my $orgspc="a-zA-Z0-9";
@@ -1143,7 +1154,7 @@
 	    }
 
 	    # now cache it.
-	    mkpath ( dirname ( $cachedir.$cache ),0,0666);
+	    mkpath ( dirname ( $cachedir.$cache ),0,0777);
 
 	    if( $width < $imageresizebelow || $width > $imageresizeabove ||
 			    $height < $imageresizebelow || $height > $imageresizeabove ) {
@@ -1188,7 +1199,7 @@
 	    }
 
 	    # now cache it.
-	    mkpath ( dirname ( $cachedir.$cache ),0,0666);
+	    mkpath ( dirname ( $cachedir.$cache ),0,0777);
 
 	    if( $width < $imageresizebelow || $width > $imageresizeabove ||
 			    $height < $imageresizebelow || $height > $imageresizeabove ) {
diff -Nurbx '*.conf*' -x '*CVS*' gjukebox.puck/www/ChangeLog gjukebox.puck.v2/www/ChangeLog
--- gjukebox.puck/www/ChangeLog	2003-02-06 20:18:57.000000000 +1300
+++ gjukebox.puck.v2/www/ChangeLog	2003-06-05 16:54:09.000000000 +1200
@@ -1,3 +1,7 @@
+2003-06-05  Andrew Ruthven  <andrew@cyclops.etc.gen.nz>
+	* programs.php: Data should be contained within single quotes when
+        talking SQL.
+
 2003-02-06  Andrew Ruthven  <andrew@cyclops.etc.gen.nz>
 
 	* action.php, program.php, right.php, tracks.php:
diff -Nurbx '*.conf*' -x '*CVS*' gjukebox.puck/www/program.php gjukebox.puck.v2/www/program.php
--- gjukebox.puck/www/program.php	2003-02-06 20:12:19.000000000 +1300
+++ gjukebox.puck.v2/www/program.php	2003-06-05 16:52:53.000000000 +1200
@@ -317,7 +317,7 @@
 }
 
 if ($CHANGECOVER&&$VIEW&&$EDIT) {	# JBM entry point if the user clicks a new cover image in the admin for an album
-    $conn->execute("update programs set cover = \"$CHANGECOVER\" where id = $VIEW");
+    $conn->execute("update programs set cover = '$CHANGECOVER' where id = $VIEW");
 }
 
 if ($DELETECOVER&&$VIEW&&$EDIT) {	# JBM entry point for remove cover ( not from filesystem )
