X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=perl%2FSesse%2Fpr0n%2FIndex.pm;h=a00cadf8e23dba933ab70d1869f2ee81a2350353;hb=312aab3d35a5472261ade2926fa7fb75a303e798;hp=5a635d4c190aac8a5fff7e9fc3a05c1ae4aa25b8;hpb=6b6a6afa90a6be24ae430324ec5ca7fd83f4fe93;p=pr0n diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 5a635d4..a00cadf 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -206,12 +206,13 @@ sub handler { my $toclose = 0; my $lastupl = ""; + my $img_num = $start; # Print out all thumbnails if ($rot == 1) { $r->print("
\n"); $r->print(" \n"); - + while (my $ref = $q->fetchrow_hashref()) { my $imgsz = ""; my $takenby = $ref->{'takenby'}; @@ -222,6 +223,7 @@ sub handler { if ($takenby ne $lastupl) { $lastupl = $takenby; Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl }); + print_fullscreen_fromhere($r, $event, \%settings, \%defsettings, $img_num); } if ($ref->{'width'} != -1 && $ref->{'height'} != -1) { my $width = $ref->{'width'}; @@ -248,13 +250,15 @@ sub handler { $ref->{'id'} . "-270\" />\n"); $r->print("        " . "     Del {'id'} . "\" />

\n"); + + ++$img_num; } $r->print(" \n"); $r->print("
\n"); } elsif ($sel == 1) { $r->print("
\n"); $r->print(" \n"); - + while (my $ref = $q->fetchrow_hashref()) { my $imgsz = ""; my $takenby = $ref->{'takenby'}; @@ -265,6 +269,7 @@ sub handler { if ($takenby ne $lastupl) { $lastupl = $takenby; Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl }); + print_fullscreen_fromhere($r, $event, \%settings, \%defsettings, $img_num); } if ($ref->{'width'} != -1 && $ref->{'height'} != -1) { my $width = $ref->{'width'}; @@ -287,6 +292,8 @@ sub handler { $r->print("

\"\"$imgsz\n"); $r->print(" {'id'} . "\"$selected />

\n"); + + ++$img_num; } $r->print(" \n"); $r->print("
\n"); @@ -302,6 +309,7 @@ sub handler { $r->print("

\n\n") if ($lastupl ne ""); $lastupl = $takenby; Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl }); + print_fullscreen_fromhere($r, $event, \%settings, \%defsettings, $img_num); $r->print("

\n"); } if ($ref->{'width'} != -1 && $ref->{'height'} != -1) { @@ -321,6 +329,8 @@ sub handler { } $r->print(" \"\"$imgsz\n"); + + ++$img_num; } $r->print("

\n"); } @@ -568,6 +578,20 @@ sub print_fullscreen { Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings); $r->print("

\n"); } + +sub print_fullscreen_fromhere { + my ($r, $event, $settings, $defsettings, $start) = @_; + + chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen-fromhere')); + + my %newsettings = %$settings; + $newsettings{'fullscreen'} = 1; + $newsettings{'start'} = $start; + + $r->print("

"); + Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings); + $r->print("

\n"); +} 1;