git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e5db8f3
)
word: apply subselection before shuffle
author
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 20 Oct 2020 20:36:23 +0000
(22:36 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 20 Oct 2020 20:49:11 +0000
(22:49 +0200)
word.plp
patch
|
blob
|
history
diff --git
a/word.plp
b/word.plp
index 2c16a24a71282d5433c3327223ad76f190ad9c6a..050ad90f626ddb79390343a57ba4b29a9bcc3096 100644
(file)
--- a/
word.plp
+++ b/
word.plp
@@
-93,7
+93,18
@@
sub printimgs {
say '<section class="gallery">';
if (exists $get{q}) {
say '<section class="gallery">';
if (exists $get{q}) {
- my @rows = map {@$_} values %{$table}; # flatten categories
+ my @rows;
+ if ($Request) {
+ my @query = $Request;
+ while (@query) {
+ push @rows, grep { (split /:/)[1] <= $limit } @query;
+ s/:.*// for @query;
+ @query = map {$_ ? @{$_} : ()} @{$table}{@query};
+ }
+ }
+ else {
+ @rows = map {ref ? @$_ : $_} values %{$table}; # flatten categories
+ }
@rows = sort { rand <=> .5 } @rows;
$table = {};
printimgs(@rows);
@rows = sort { rand <=> .5 } @rows;
$table = {};
printimgs(@rows);