From bcb73c11262a6de77c9af117390127797629478b Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 7 Apr 2005 14:38:47 +0000 Subject: [PATCH] Various songratings.pl fixes from --pgweb. Patches applied: * sgunderson@bigfoot.com--2005-private/ccbs--pgweb--1.0--patch-29 Fix a bug where challenge would never be shown. * sgunderson@bigfoot.com--2005-private/ccbs--pgweb--1.0--patch-30 Order the song ratings list by title, not internal song number. * sgunderson@bigfoot.com--2005-private/ccbs--pgweb--1.0--patch-31 Show artist names in the song ratings. --- html/songratings.pl | 5 +++-- html/templates/songratings.tmpl | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/html/songratings.pl b/html/songratings.pl index c8be12d..68abcea 100755 --- a/html/songratings.pl +++ b/html/songratings.pl @@ -9,7 +9,7 @@ my $machine = $cgi->param('machine'); my $dbh = ccbs::db_connect(); -my $songs_raw = ccbs::db_fetch_all($dbh, 'SELECT song,title,playmode,difficulty,feetrating FROM songratings NATURAL JOIN songs WHERE machine=? ORDER BY machine,song', $machine); +my $songs_raw = ccbs::db_fetch_all($dbh, 'SELECT song,title,artist,playmode,difficulty,feetrating FROM songratings NATURAL JOIN songs WHERE machine=? ORDER BY LOWER(title)', $machine); my @songs = (); @@ -17,7 +17,7 @@ my $last_song = -1; my $show_challenge = 0; for my $song (@$songs_raw) { if ($song->{'song'} != $last_song) { - push @songs, { song => $song->{'song'}, title => $song->{'title'} }; + push @songs, { song => $song->{'song'}, title => $song->{'title'}, artist => $song->{'artist'} }; } my $key = $song->{'playmode'} . '_' . $song->{'difficulty'}; @@ -30,5 +30,6 @@ for my $song (@$songs_raw) { ccbs::print_header(); ccbs::process_template('songratings.tmpl', 'Sanger', { songs => \@songs, + show_challenge => $show_challenge }); $dbh->disconnect; diff --git a/html/templates/songratings.tmpl b/html/templates/songratings.tmpl index 5297c71..d5a6bd6 100644 --- a/html/templates/songratings.tmpl +++ b/html/templates/songratings.tmpl @@ -3,7 +3,7 @@
- + [% IF show_challenge %] @@ -14,6 +14,7 @@ + @@ -31,6 +32,7 @@ [% FOR s = songs %] + -- 2.39.2
Single Double
SangArtist B S D
[% s.title %][% s.artist %] [% s.single_beginner %] [% s.single_standard %] [% s.single_difficult %]