|
";
print "\n";
print "
\n";
if ($rating{$form{'kind'}} eq '') {
print "
Мы проводим анализ популярности в четырех номинациях: - аудиоальбомы (компакт-диски, кассеты, mp3-альбомы)
- записи (прослушивание отдельных песен)
- тексты песен
- авторы
Оценивается частота обращений к соответствующему ресурсу - просмотр описания альбома, прослушивание mp3, запрос любой информации по автору из каталога.
Рейтинг оценивается в звёздах. Позиции сортируются по убыванию рейтинга, а для имеющих одинаковый рейтинг - по алфавиту.
Из рейтинга альбомов по ссылке можно перейти к описанию альбома,
из рейтинга записей - к прослушиванию записи или к описанию альбома, из которого она взята,
из рейтинга текстов - к тексту песни.
Наконец, из рейтинга авторов ссылки ведут к выборкам (по данному автору)
из каталогов
| | - | аудиоальбомов, |
| | - | фотоальбомов, |
| | - | событий (афиша), |
| | - | текстов, |
| | - | статей, |
| | - | mp3-записей |
";
}
$r_old = 0;
if ($form{'kind'} eq 'Disk') {
open(DISKS,$c_path."/albums.brd");
while ($line = ) {
($id, $media, $artist, $title, $year, $firm, $studio, $producer, $sound_engineer, $designer, $photo, $back, $Back, $annotation, $price, $price_doll, $opt, $id_disk, $tracks)=split(/#/,$line);
$disks{$id}{'title'} = $title;
$disks{$id}{'artist'} = $artist;
$media =~ tr/[A-ZМмСс]/[a-zmmcc]/;
$disks{$id}{'media'} = $media;
}
close(DISKS);
my ($cnt_path) = "$root/counters/disk-counters.brd";
$n_disk = 0;
if (open CNT, "<$cnt_path") {
$max=0;
$n_call = 0;
while () {
($id, $cnt) = split /#/;
$id =~ s/ //g;
$cnt{$id} = $cnt;
$max = $cnt if ($cnt > $max);
$n_disk++;
$n_call += $cnt;
}
close CNT;
@ids = sort {($cnt{$b} <=> $cnt{$a}) || $disks{$a}{'title'} cmp $disks{$b}{'title'}} keys %cnt;
print "
Рейтинг".($pwd ? " ($n_call)" : '')."
| Альбом
|
";
$p = $form{'p'} ? $form{'p'} : 1;
if (exists($form{'id'})) {
$pos = -1;
for ($i = 0; $i < @ids; $i++) {
if ($ids[$i] == $form{'id'}) {
$pos = $i;
last;
}
}
if ($pos > 0) {
$p = int($pos - $page_size/2) + 1;
$p = @ids - $pagesize if ($p > @ids - $pagesize);
$p = 1 if ($p < 1);
}
}
$n_pages = int($n_disk / $page_size) + 1;
$k = 0;
$l = 0;
$cnt_old = $max+1;
foreach $id (sort {($cnt{$b} <=> $cnt{$a}) || $disks{$a}{'title'} cmp $disks{$b}{'title'}} keys %cnt) {
$kk = $k+1 if ($cnt{$id} != $cnt_old);
$cnt_old = $cnt{$id};
if (++$k >= $p) {
if ($l++ < $page_size) {
$rr = ($kk == $r_old) ? " " : ($kk.($pwd ? " (".($cnt{$id}+0).")" : ''));
$r_old = $kk;
$r = int(($cnt{$id} / $max * 10 + 1) * 0.999999);
$r = int(log($cnt{$id}) / log($max) * 10) + 1;
$cv = $root.$cv_path."tn_f".$id.".jpg";
$cvr = (-e $cv) ? "" : '';
print "$rr | ".show_rating($r)." | ";
print "" if ($pos > 0 && $id == $form{'id'});
print "$disks{$id}{'title'} (".GetMidName($disks{$id}{'artist'}).")";
print "" if ($pos > 0 && $id == $form{'id'});
print " | $cvr | \n";
$td = ($td eq "") ? " BGCOLOR=#F5F5F5" : '';
}
}
}
print " \n";
rating_footer($n_disk);
}
}
if ($form{'kind'} eq 'Track') {
open(TRACKS, "$c_path/tracks.brd");
while ($line = ) {
# NN.TT Исполнитель Первая строчка Название Посвящение Слова Музыка Перевод Текст Выверен Аккорды Запись Время Написана Записана Оригинал Прототип
($id, $singer, $first_line, $t_title, $honor, $word, $music, $trans, $text, $sign, $accord,$mp3, $time, $date_wr, $date_rec, $orig, $proto, $article, $occ, $photo, $url_href)=split(/#/,$line);
$disks{$id}{'title'} = $t_title eq '' ? $first_line : $t_title;
if ($word eq $music && $word eq $singer) {
$artist = GetMidName($word);
}
elsif ($word eq $music) {
$artist = GetMidName($word).", исп. ".GetMidName($singer);
}
elsif ($word eq $singer) {
$artist = GetMidName($singer).", муз. ".GetMidName($music);
}
elsif ($music eq $singer) {
$artist = GetMidName($singer).", сл. ".GetMidName($word);
}
else {
$artist = GetMidName($singer).", муз. ".GetMidName($music).", сл. ".GetMidName($word);
}
$disks{$id}{'artist'} = $artist;
}
close(TRACKS);
my ($cnt_path) = "$root/counters/mp3-counters.brd";
$n_disk = 0;
if (open CNT, "<$cnt_path") {
$max=0;
$n_call = 0;
while () {
($id, $cnt) = split /#/;
$id =~ s/ //g;
$cnt{$id} = $cnt;
$max = $cnt if ($cnt > $max);
$n_disk++;
$n_call += $cnt;
}
close CNT;
print "
Рейтинг".($pwd ? " ($n_call)" : '')."
| Запись
|
";
open(DISKS,$c_path."/albums.brd");
while () {
($id, $media) = split /#/;
$media =~ tr/[A-ZМмСс]/[a-zmmcc]/;
$media{$id} = $media;
}
close(DISKS);
$n_pages = int($n_disk / $page_size) + 1;
$p = $form{'p'} ? $form{'p'} : 1;
$k = 0;
$l = 0;
$cnt_old = $max+1;
foreach $id (sort {($cnt{$b} <=> $cnt{$a}) || $disks{$a}{'title'} cmp $disks{$b}{'title'}} keys %cnt) {
$kk = $k+1 if ($cnt{$id} != $cnt_old);
$cnt_old = $cnt{$id};
if (++$k >= $p) {
if ($l++ < $page_size) {
$rr = ($kk == $r_old) ? " " : ($kk.($pwd ? " (".($cnt{$id}+0).")" : ''));
$r_old = $kk;
$r = int(($cnt{$id} / $max * 10 + 1) * 0.999999);
$r = int(log($cnt{$id}) / log($max) * 10) + 1;
($disk) = split /\./, $id;
$cv = $root.$cv_path."tn_f$disk.jpg";
$cvr = (-e $cv) ? "" : '';
print "$rr | ".show_rating($r)." | $disks{$id}{'title'} ($disks{$id}{'artist'}) | $cvr | | \n";
$td = ($td eq "") ? " BGCOLOR=#F5F5F5" : '';
}
}
}
print " \n";
rating_footer($n_disk);
}
}
if ($form{'kind'} eq 'Text') {
open(LISTS, "$c_path/list.brd");
while ($line = ) {
# ID Автор Название Первая Строчка Посвящение Тип Фото Ссылка Звук Событие Статья Лист
($l_id, $l_author, $l_title, $l_firstline, $l_dedicated, $l_kind, $l_photo, $l_url, $l_sound, $l_occ, $l_art, $l_list)=split(/#/,$line);
$disks{$l_id}{'title'} = "$l_title ($l_firstline)";
$disks{$l_id}{'artist'} = GetMidName($l_author);
}
close(LISTS);
my ($cnt_path) = "$root/counters/text-counters.brd";
$n_disk = 0;
if (open CNT, "<$cnt_path") {
$max=0;
$n_call = 0;
while () {
($id, $cnt) = split /#/;
$id =~ s/ //g;
$cnt{$id} = $cnt;
$max = $cnt if ($cnt > $max);
$n_disk++;
$n_call += $cnt;
}
close CNT;
print "
Рейтинг".($pwd ? " ($n_call)" : '')."
| Текст
|
";
$n_pages = int($n_disk / $page_size) + 1;
$p = $form{'p'} ? $form{'p'} : 1;
$k = 0;
$l = 0;
$cnt_old = $max+1;
foreach $id (sort {($cnt{$b} <=> $cnt{$a}) || $disks{$a}{'title'} cmp $disks{$b}{'title'}} keys %cnt) {
$kk = $k+1 if ($cnt{$id} != $cnt_old);
$cnt_old = $cnt{$id};
if (++$k >= $p) {
if ($l++ < $page_size) {
$r = int(($cnt{$id} / $max * 10 + 1) * 0.999999);
$r = int(log($cnt{$id}) / (log($max)+.00001) * 10) + 1;
$rr = ($kk == $r_old) ? " " : ($kk.($pwd ? " (".($cnt{$id}+0).")" : ''));
$r_old = $kk;
($d, $t) = split /\./, $id;
$t = $t+0;
for ($i = 0; $i < 5; $i++) {
$id = "$d.$t";
if ($disks{$id}{'artist'} ne '') {
print "$rr | ".show_rating($r)." | $disks{$id}{'artist'} - $disks{$id}{'title'} | | \n";
$td = ($td eq "") ? " BGCOLOR=#F5F5F5" : '';
last;
}
$t = "0$t";
}
}
}
}
print " \n";
rating_footer($n_disk);
}
}
if ($form{'kind'} eq 'Author') {
my ($cnt_path) = "$root/counters/author-counters.brd";
$n_disk = 0;
if (open CNT, "<$cnt_path") {
$max=0;
$n_call = 0;
while () {
($id, $cnt) = split /#/;
$cnt{$id} += $cnt;
$max = $cnt{$id} if ($cnt{$id} > $max);
$n_disk++;
$n_call += $cnt{$id};
}
close CNT;
print "
Рейтинг".($pwd ? " ($n_call)" : '')."
| Авторы / исполнители
|
";
$n_pages = int($n_disk / $page_size) + 1;
$p = $form{'p'} ? $form{'p'} : 1;
$k = 0;
$l = 0;
$cnt_old = $max+1;
foreach $id (sort {($cnt{$b} <=> $cnt{$a}) || ($a cmp $b)} keys %cnt) {
if ($id ne '' && $id !~ /^\?/ && length($id) > 2) {
$kk = $k+1 if ($cnt{$id} != $cnt_old);
$cnt_old = $cnt{$id};
if (++$k >= $p) {
if ($l++ < $page_size) {
$query_name = $id;
$r = int(($cnt{$id} / $max * 10 + 1) * 0.999999);
$r = int(log($cnt{$id}) / (log($max)+.00001) * 10) + 1;
$rr = ($kk == $r_old) ? " " : ($kk.($pwd ? " (".($cnt{$id}+0).")" : ''));
$r_old = $kk;
print "$rr | ".show_rating($r)." | ".GetMidName($id)." | ";
print "";
$noresult = ' ';
open(AFISHA, "$c_path/photos.brd");
while ($line=) {
if ( $line =~ /\Q$query_name\E/i) {
$noresult = "";
last; } }
close(AFISHA);
print "$noresult";
$noresult = ' ';
open(AFISHA, "$c_path/afisha.brd");
while ($line=) {
if ( $line =~ /\Q$query_name\E/i) {
$noresult = "";
last; } }
close(AFISHA);
print "$noresult";
$noresult = ' ';
open(AFISHA, "$c_path/list.brd");
while ($line=) {
if ( $line =~ /\Q$query_name\E/i) {
$noresult = "";
last; } }
close(AFISHA);
print "$noresult";
$noresult = ' ';
open(AFISHA, "$c_path/article.brd");
while ($line=) {
if ( $line =~ /\Q$query_name\E/i) {
$noresult = "";
last; } }
close(AFISHA);
print "$noresult";
$noresult = ' ';
open(AFISHA, "$c_path/tracks.brd");
while ($line=) {
if ( $line =~ /\Q$query_name\E/i) {
$noresult = "";
last; } }
close(AFISHA);
print "$noresult";
print " | | | | | | \n";
$td = ($td eq "") ? " BGCOLOR=#F5F5F5" : '';
}
}
}
}
print " \n";
rating_footer($n_disk);
}
}
print "
|