X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FIndex.pm;h=329aaed3cf02d3f0ce7bd13aa2c855856a144f3d;hp=00709aa352a24fbce73821966816a9acf97fe46c;hb=b1d9d41ab12d664d6fb97d86963a94dbda63e60a;hpb=5862afca102bc7ed2993602ae78b3a0331869ff4 diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 00709aa..329aaed 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -3,63 +3,87 @@ use strict; use warnings; use Sesse::pr0n::Common qw(error dberror); -use Apache2::Request; use POSIX; sub handler { my $r = shift; - my $apr = Apache2::Request->new($r); my $dbh = Sesse::pr0n::Common::get_dbh(); - # Find the event - $r->uri =~ m#^/([a-zA-Z0-9-]+)/?$# - or error($r, "Could not extract event"); - my $event = $1; + my ($event, $abspath, $datesort); + if ($r->path_info =~ /^\/\+all\/?/) { + $event = '+all'; + $abspath = 1; + + $datesort = 'DESC NULLS LAST'; + } else { + # Find the event + $r->path_info =~ /^\/([a-zA-Z0-9-]+)\/?$/ + or return error($r, "Could not extract event"); + $event = $1; + $abspath = 0; + $datesort = 'ASC NULLS LAST'; + } # Fix common error: pr0n.sesse.net/event -> pr0n.sesse.net/event/ - if ($r->uri !~ m#/$#) { - $r->headers_out->{'location'} = "/$event/"; - return Apache2::Const::REDIRECT; + if ($r->path_info !~ /\/$/) { + my $res = Plack::Response->new(301); + $res->header('Location' => $r->path_info . "/"); + return $res; } # Internal? (Ugly?) - if ($r->get_server_name =~ /internal/ || $r->get_server_name =~ /skoyen\.bilder\.knatten\.com/) { + if (Sesse::pr0n::Common::get_server_name($r) =~ /internal/ || + Sesse::pr0n::Common::get_server_name($r) =~ /skoyen\.bilder\.knatten\.com/ || + Sesse::pr0n::Common::get_server_name($r) =~ /lia\.heimdal\.org/) { my $user = Sesse::pr0n::Common::check_access($r); - if (!defined($user)) { - return Apache2::Const::OK; - } + return Sesse::pr0n::Common::generate_401($r) if (!defined($user)); } # Read the appropriate settings from the query string into the settings hash my %defsettings = ( - thumbxres => 80, - thumbyres => 64, - xres => undef, - yres => undef, + thumbxres => 320, + thumbyres => 256, + xres => -1, + yres => -1, start => 1, - num => -1, + num => 250, all => 1, - infobox => 1, rot => 0, sel => 0, fullscreen => 0, + model => undef, + lens => undef, + author => undef ); - # Reduce the front page load when in overload mode. - if (Sesse::pr0n::Overload::is_in_overload($r)) { - $defsettings{'num'} = 100; + my $where; + if ($event eq '+all') { + $where = ''; + } else { + $where = ' AND event=' . $dbh->quote($event); } - + + # Any NEF files => default to processing + my $ref = $dbh->selectrow_hashref("SELECT * FROM images WHERE vhost=? $where AND ( LOWER(filename) LIKE '%.nef' OR LOWER(filename) LIKE '%.cr2' ) LIMIT 1", + undef, Sesse::pr0n::Common::get_server_name($r)) + and $defsettings{'xres'} = $defsettings{'yres'} = undef; + my %settings = %defsettings; - for my $s qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen) { - my $val = $apr->param($s); + for my $s (qw(thumbxres thumbyres xres yres start num all rot sel fullscreen model lens author)) { + my $val = $r->param($s); if (defined($val) && $val =~ /^(\d+)$/) { $settings{$s} = $val; } - if (($s eq "num" || $s eq "xres" || $s eq "yres") && defined($val) && $val == -1) { + if ($s eq "num" && defined($val) && $val == -1) { $settings{$s} = $val; } + if (($s eq "xres" || $s eq "yres") && defined($val) && ($val == -1 || $val == -2)) { + $settings{$s} = $val; + } + if (($s eq "model" || $s eq "lens" || $s eq "author") && defined($val)) { + $settings{$s} = Sesse::pr0n::Common::pretty_unescape($val); + } } my $thumbxres = $settings{'thumbxres'}; @@ -69,204 +93,301 @@ sub handler { my $start = $settings{'start'}; my $num = $settings{'num'}; my $all = $settings{'all'}; - my $infobox = $settings{'infobox'} ? '' : 'nobox/'; my $rot = $settings{'rot'}; my $sel = $settings{'sel'}; + my $model = $settings{'model'}; + my $lens = $settings{'lens'}; + my $author = $settings{'author'}; + + # Construct SQL for this filter + if ($all == 0) { + $where .= ' AND selected=\'t\''; + } + if (defined($model) && defined($lens)) { + my $mq = $dbh->quote($model); + my $lq = $dbh->quote($lens); + + if ($model eq '') { + # no defined model + $where .= " AND model IS NULL"; + } else { + $where .= " AND model=$mq"; + } + + if ($lens eq '') { + # no defined lens + $where .= " AND lens IS NULL"; + } else { + $where .= " AND lens=$lq"; + } + } + if (defined($author)) { + my $aq = $dbh->quote($author); + + $where .= " AND takenby=$aq"; + } if (defined($num) && $num == -1) { $num = undef; } - my $ref = $dbh->selectrow_hashref('SELECT * FROM events WHERE id=? AND vhost=?', - undef, $event, $r->get_server_name) - or error($r, "Could not find event $event", 404, "File not found"); + my ($date, $name); + + if ($event eq '+all') { + $ref = $dbh->selectrow_hashref("SELECT EXTRACT(EPOCH FROM MAX(last_update)) AS last_update FROM last_picture_cache WHERE vhost=?", + undef, Sesse::pr0n::Common::get_server_name($r)) + or return error($r, "Could not list events", 404, "File not found"); + $date = undef; + $name = Sesse::pr0n::Templates::fetch_template($r, 'all-event-title'); + Sesse::pr0n::Common::set_last_modified($r, $ref->{'last_update'}); + } else { + $ref = $dbh->selectrow_hashref("SELECT name,date,EXTRACT(EPOCH FROM last_update) AS last_update FROM events NATURAL JOIN last_picture_cache WHERE vhost=? AND event=?", + undef, Sesse::pr0n::Common::get_server_name($r), $event) + or return error($r, "Could not find event $event", 404, "File not found"); - my $name = $ref->{'name'}; - my $date = $ref->{'date'}; + $date = HTML::Entities::encode_entities($ref->{'date'}); + $name = HTML::Entities::encode_entities($ref->{'name'}); + Sesse::pr0n::Common::set_last_modified($r, $ref->{'last_update'}); + } + + # # If the client can use cache, do so + # if ((my $rc = $r->meets_conditions) != Apache2::Const::OK) { + # return $rc; + # } # Count the number of selected images. - $ref = $dbh->selectrow_hashref("SELECT COUNT(*) AS num_selected FROM images WHERE event=? AND selected=\'t\'", undef, $event); + $ref = $dbh->selectrow_hashref("SELECT COUNT(*) AS num_selected FROM images WHERE vhost=? $where AND selected=\'t\'", undef, Sesse::pr0n::Common::get_server_name($r)); my $num_selected = $ref->{'num_selected'}; # Find all images related to this event. - my $q; - my $where = ($all == 0) ? ' AND selected=\'t\'' : ''; + my $limit = (defined($start) && defined($num) && !$settings{'fullscreen'}) ? (" LIMIT $num OFFSET " . ($start-1)) : ""; - if (defined($start) && defined($num) && !$settings{'fullscreen'}) { - $q = $dbh->prepare("SELECT *, (date - INTERVAL '6 hours')::date AS day FROM images WHERE event=? $where ORDER BY (date - INTERVAL '6 hours')::date,takenby,date,filename LIMIT $num OFFSET " . ($start-1)) - or dberror($r, "prepare()"); - } else { - $q = $dbh->prepare("SELECT *, (date - INTERVAL '6 hours')::date AS day FROM images WHERE event=? $where ORDER BY (date - INTERVAL '6 hours')::date,takenby,date,filename") - or dberror($r, "prepare()"); - } - $q->execute($event) - or dberror($r, "image enumeration"); + my $q = $dbh->prepare("SELECT *, (date - INTERVAL '6 hours')::date AS day FROM images WHERE vhost=? $where ORDER BY (date - INTERVAL '6 hours')::date $datesort,takenby,date,filename $limit") + or return dberror($r, "prepare()"); + $q->execute(Sesse::pr0n::Common::get_server_name($r)) + or return dberror($r, "image enumeration"); # Print the page itself + my $res = Plack::Response->new(200); + my $io = IO::String->new; if ($settings{'fullscreen'}) { - $r->content_type("text/html; charset=utf-8"); - Sesse::pr0n::Templates::print_template($r, "fullscreen-header", { title => "$name [$event]" }); + $res->content_type("text/html; charset=utf-8"); + + Sesse::pr0n::Templates::print_template($r, $io, "fullscreen-header", { title => "$name [$event]" }); + + my @files = (); while (my $ref = $q->fetchrow_hashref()) { - $r->print(" \"" . $ref->{'filename'} . "\",\n"); + my $width = defined($ref->{'width'}) ? $ref->{'width'} : -1; + my $height = defined($ref->{'height'}) ? $ref->{'height'} : -1; + push @files, [ $ref->{'event'}, $ref->{'filename'}, $width, $height ]; + } + + for my $i (0..$#files) { + my $line = sprintf " [ \"%s\", \"%s\", %d, %d ]", @{$files[$i]}; + $line .= "," unless ($i == $#files); + $io->print($line . "\n"); } my %settings_no_fullscreen = %settings; $settings_no_fullscreen{'fullscreen'} = 0; - my $returnurl = "http://" . $r->get_server_name . "/" . $event . "/" . + my $returnurl = "http://" . Sesse::pr0n::Common::get_server_name($r) . "/" . $event . "/" . Sesse::pr0n::Common::get_query_string(\%settings_no_fullscreen, \%defsettings); - + # *whistle* $returnurl =~ s/&/&/g; - Sesse::pr0n::Templates::print_template($r, "fullscreen-footer", { - vhost => $r->get_server_name, - event => $event, - start => $settings{'start'} - 1, + Sesse::pr0n::Templates::print_template($r, $io, "fullscreen-footer", { returnurl => $returnurl, - sel => $settings{'sel'}, + start => $settings{'start'} - 1, + sel => $settings{'sel'} }); } else { - Sesse::pr0n::Common::header($r, "$name [$event]"); - Sesse::pr0n::Templates::print_template($r, "date", { date => $date }); + Sesse::pr0n::Common::header($r, $io, "$name [$event]"); + if (defined($date)) { + Sesse::pr0n::Templates::print_template($r, $io, "date", { date => $date }); + } if (Sesse::pr0n::Overload::is_in_overload($r)) { - Sesse::pr0n::Templates::print_template($r, "overloadmode"); + Sesse::pr0n::Templates::print_template($r, $io, "overloadmode"); } - print_thumbsize($r, $event, \%settings, \%defsettings); - print_viewres($r, $event, \%settings, \%defsettings); - print_pagelimit($r, $event, \%settings, \%defsettings); - print_infobox($r, $event, \%settings, \%defsettings); - print_nextprev($r, $event, \%settings, \%defsettings); - print_selected($r, $event, \%settings, \%defsettings) if ($num_selected > 0); - print_fullscreen($r, $event, \%settings, \%defsettings); + print_selected($r, $io, $event, \%settings, \%defsettings) if ($num_selected > 0); + print_fullscreen($r, $io, $event, \%settings, \%defsettings); + print_nextprev($r, $io, $event, $where, \%settings, \%defsettings); + + if (1 || $event ne '+all') { + # Find the equipment used + my $eq = $dbh->prepare(" + SELECT + model, + lens, + COUNT(*) AS num + FROM images + WHERE vhost=? $where + GROUP BY 1,2 + ORDER BY 1,2") + or die "Couldn't prepare to find equipment: $!"; + $eq->execute(Sesse::pr0n::Common::get_server_name($r)) + or die "Couldn't find equipment: $!"; + + my @equipment = (); + my %cameras_seen = (); + while (my $ref = $eq->fetchrow_hashref) { + if (!defined($ref->{'lens'}) && exists($cameras_seen{$ref->{'model'}})) { + # + # Some compact cameras seem to add lens info sometimes and not at other + # times; if we have seen a camera with at least one specific lens earlier, + # just combine entries without a lens with the previous one. + # + $equipment[$#equipment]->{'num'} += $ref->{'num'}; + next; + } + push @equipment, $ref; + $cameras_seen{$ref->{'model'}} = 1; + } + $eq->finish; + + if (scalar @equipment > 0) { + Sesse::pr0n::Templates::print_template($r, $io, "equipment-start"); + for my $e (@equipment) { + my $eqspec = $e->{'model'}; + $eqspec .= ', ' . $e->{'lens'} if (defined($e->{'lens'})); + $eqspec = HTML::Entities::encode_entities($eqspec); + + my %newsettings = %settings; + + my $action; + if (defined($model) && defined($lens)) { + chomp ($action = Sesse::pr0n::Templates::fetch_template($r, "unfilter")); + $newsettings{'model'} = undef; + $newsettings{'lens'} = undef; + $newsettings{'start'} = 1; + } else { + chomp ($action = Sesse::pr0n::Templates::fetch_template($r, "filter")); + $newsettings{'model'} = $e->{'model'}; + $newsettings{'lens'} = defined($e->{'lens'}) ? $e->{'lens'} : ''; + $newsettings{'start'} = 1; + } + + my $url = "/$event/" . Sesse::pr0n::Common::get_query_string(\%newsettings, \%defsettings); + + # This isn't correct for all languages. Fix if we ever need to care. :-) + if ($e->{'num'} == 1) { + Sesse::pr0n::Templates::print_template($r, $io, "equipment-item-singular", { eqspec => $eqspec, filterurl => $url, action => $action }); + } else { + Sesse::pr0n::Templates::print_template($r, $io, "equipment-item", { eqspec => $eqspec, num => $e->{'num'}, filterurl => $url, action => $action }); + } + } + Sesse::pr0n::Templates::print_template($r, $io, "equipment-end"); + } + } my $toclose = 0; my $lastupl = ""; + my $img_num = (defined($start) && defined($num)) ? $start : 1; # Print out all thumbnails if ($rot == 1) { - $r->print("
\n"); - } elsif ($sel == 1) { - $r->print(" \n"); - } else { - while (my $ref = $q->fetchrow_hashref()) { - my $imgsz = ""; - my $takenby = $ref->{'takenby'}; - if (defined($ref->{'day'})) { - $takenby .= ", " . $ref->{'day'}; + if ($rot != 1) { + $io->print("\n"); } + } - if ($takenby ne $lastupl) { - $r->print("
\n\n") if ($lastupl ne ""); - $lastupl = $takenby; - Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl }); - $r->print("\n");
- }
- if ($ref->{'width'} != -1 && $ref->{'height'} != -1) {
- my $width = $ref->{'width'};
- my $height = $ref->{'height'};
-
- ($width, $height) = Sesse::pr0n::Common::scale_aspect($width, $height, $thumbxres, $thumbyres);
- $imgsz = " width=\"$width\" height=\"$height\"";
- }
+ if (defined($ref->{'width'}) && defined($ref->{'height'})) {
+ my $width = $ref->{'width'};
+ my $height = $ref->{'height'};
+
+ ($width, $height) = Sesse::pr0n::Common::scale_aspect($width, $height, $thumbxres, $thumbyres);
+ $imgsz = " width=\"$width\" height=\"$height\"";
+ }
- my $filename = $ref->{'filename'};
- my $uri = $infobox . $filename;
- if (defined($xres) && defined($yres) && $xres != -1) {
- $uri = "${xres}x$yres/$infobox$filename";
- } elsif (defined($xres) && $xres == -1) {
- $uri = "original/$infobox$filename";
- }
-
- $r->print(" \n");
+ my $filename = $ref->{'filename'};
+ my $uri = $filename;
+ if (defined($xres) && defined($yres) && $xres != -1 && $xres != -2) {
+ $uri = "${xres}x$yres/$filename";
+ } elsif (defined($xres) && $xres == -1) {
+ $uri = "original/$filename";
+ }
+
+ my $prefix = "";
+ if ($abspath) {
+ $prefix = "/" . $ref->{'event'} . "/";
+ }
+
+ if ($rot == 1) {
+ $io->print("
"); + } else { + $io->print(" "); } - $r->print("
\n"); + $io->print("$title:\n"); + $io->print("
$title:\n"); for my $a (@$alternatives) { my $text; @@ -304,103 +425,22 @@ sub print_changes { $newsettings{$var2} = $v2; } - $r->print(" "); + $io->print(" "); # Check if these settings are current (print only label) if (eq_with_undef($settings->{$var1}, $newsettings{$var1}) && eq_with_undef($settings->{$var2}, $newsettings{$var2})) { - $r->print($text); + $io->print($text); } else { - Sesse::pr0n::Common::print_link($r, $text, "/$event/", \%newsettings, $defsettings); + Sesse::pr0n::Common::print_link($io, $text, "/$event/", \%newsettings, $defsettings); } - $r->print("\n"); + $io->print("\n"); } - $r->print("
\n"); -} - -sub print_thumbsize { - my ($r, $event, $settings, $defsettings) = @_; - my @alternatives = qw(80x64 120x96 160x128 240x192 320x256); - - print_changes($r, $event, 'thumbsize', $settings, $defsettings, - 'thumbxres', 'thumbyres', \@alternatives); -} -sub print_viewres { - my ($r, $event, $settings, $defsettings) = @_; - my @alternatives = qw(320x256 512x384 640x480 800x600 1024x768 1280x960); - chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'viewres-unlimited')); - chomp (my $original = Sesse::pr0n::Templates::fetch_template($r, 'viewres-original')); - push @alternatives, [ $unlimited, undef, undef ]; - push @alternatives, [ $original, -1, -1 ]; - - print_changes($r, $event, 'viewres', $settings, $defsettings, - 'xres', 'yres', \@alternatives); -} - -sub print_pagelimit { - my ($r, $event, $settings, $defsettings) = @_; - - my $title = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage'); - chomp $title; - $r->print("$title:\n"); - - # Get choices - chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage-unlimited')); - my @alternatives = qw(10 50 100 500); - push @alternatives, $unlimited; - - for my $num (@alternatives) { - my %newsettings = %$settings; - - if ($num !~ /^\d+$/) { # unlimited - $newsettings{'num'} = -1; - } else { - $newsettings{'num'} = $num; - } - - $r->print(" "); - if (eq_with_undef($settings->{'num'}, $newsettings{'num'})) { - $r->print($num); - } else { - Sesse::pr0n::Common::print_link($r, $num, "/$event/", \%newsettings, $defsettings); - } - $r->print("\n"); - } - $r->print("
\n"); -} - -sub print_infobox { - my ($r, $event, $settings, $defsettings) = @_; - - chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'infobox')); - chomp (my $on = Sesse::pr0n::Templates::fetch_template($r, 'infobox-on')); - chomp (my $off = Sesse::pr0n::Templates::fetch_template($r, 'infobox-off')); - - $r->print("$title:\n"); - - my %newsettings = %$settings; - - if ($settings->{'infobox'} == 1) { - $r->print($on); - } else { - $newsettings{'infobox'} = 1; - Sesse::pr0n::Common::print_link($r, $on, "/$event/", \%newsettings, $defsettings); - } - - $r->print(' '); - - if ($settings->{'infobox'} == 0) { - $r->print($off); - } else { - $newsettings{'infobox'} = 0; - Sesse::pr0n::Common::print_link($r, $off, "/$event/", \%newsettings, $defsettings); - } - - $r->print('
'); + $io->print(" \n"); } sub print_nextprev { - my ($r, $event, $settings, $defsettings) = @_; + my ($r, $io, $event, $where, $settings, $defsettings) = @_; my $start = $settings->{'start'}; my $num = $settings->{'num'}; my $dbh = Sesse::pr0n::Common::get_dbh(); @@ -409,9 +449,9 @@ sub print_nextprev { return unless (defined($start) && defined($num)); # determine total number - my $ref = $dbh->selectrow_hashref('SELECT count(*) AS num_images FROM images WHERE event=?', - undef, $event) - or dberror($r, "image enumeration"); + my $ref = $dbh->selectrow_hashref("SELECT count(*) AS num_images FROM images WHERE vhost=? $where", + undef, Sesse::pr0n::Common::get_server_name($r)) + or return dberror($r, "image enumeration"); my $num_images = $ref->{'num_images'}; return if ($start == 1 && $start + $num >= $num_images); @@ -421,7 +461,7 @@ sub print_nextprev { $end = $num_images; } - $r->print("\n"); + $io->print("
\n"); # Previous if ($start > 1) { @@ -437,12 +477,13 @@ sub print_nextprev { my %newsettings = %$settings; $newsettings{'start'} = $newstart; chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'prevpage')); - Sesse::pr0n::Common::print_link($r, "$title ($newstart-$newend)\n", "/$event/", \%newsettings, $defsettings); + chomp (my $accesskey = Sesse::pr0n::Templates::fetch_template($r, 'prevaccesskey')); + Sesse::pr0n::Common::print_link($io, "$title ($newstart-$newend)\n", "/$event/", \%newsettings, $defsettings, $accesskey); } # This chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'thispage')); - $r->print(" $title ($start-$end)\n"); + $io->print(" $title ($start-$end)\n"); # Next if ($end < $num_images) { @@ -455,53 +496,68 @@ sub print_nextprev { my %newsettings = %$settings; $newsettings{'start'} = $newstart; chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'nextpage')); - Sesse::pr0n::Common::print_link($r, "$title ($newstart-$newend)", "/$event/", \%newsettings, $defsettings); + chomp (my $accesskey = Sesse::pr0n::Templates::fetch_template($r, 'nextaccesskey')); + Sesse::pr0n::Common::print_link($io, "$title ($newstart-$newend)", "/$event/", \%newsettings, $defsettings, $accesskey); } - $r->print("
\n"); + $io->print(" \n"); } sub print_selected { - my ($r, $event, $settings, $defsettings) = @_; + my ($r, $io, $event, $settings, $defsettings) = @_; chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'show')); chomp (my $all = Sesse::pr0n::Templates::fetch_template($r, 'show-all')); chomp (my $sel = Sesse::pr0n::Templates::fetch_template($r, 'show-selected')); - $r->print("$title:\n"); + $io->print("
$title:\n"); my %newsettings = %$settings; if ($settings->{'all'} == 0) { - $r->print($sel); + $io->print($sel); } else { $newsettings{'all'} = 0; - Sesse::pr0n::Common::print_link($r, $sel, "/$event/", \%newsettings, $defsettings); + Sesse::pr0n::Common::print_link($io, $sel, "/$event/", \%newsettings, $defsettings); } - $r->print(' '); + $io->print(' '); if ($settings->{'all'} == 1) { - $r->print($all); + $io->print($all); } else { $newsettings{'all'} = 1; - Sesse::pr0n::Common::print_link($r, $all, "/$event/", \%newsettings, $defsettings); + Sesse::pr0n::Common::print_link($io, $all, "/$event/", \%newsettings, $defsettings); } - $r->print('
'); + $io->print(''); } sub print_fullscreen { - my ($r, $event, $settings, $defsettings) = @_; + my ($r, $io, $event, $settings, $defsettings) = @_; chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen')); my %newsettings = %$settings; $newsettings{'fullscreen'} = 1; - $r->print(""); - Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings); - $r->print("
\n"); + $io->print(""); + Sesse::pr0n::Common::print_link($io, $title, "/$event/", \%newsettings, $defsettings); + $io->print("
\n"); +} + +sub print_fullscreen_fromhere { + my ($r, $io, $event, $settings, $defsettings, $start) = @_; + + chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen-fromhere')); + + my %newsettings = %$settings; + $newsettings{'fullscreen'} = 1; + $newsettings{'start'} = $start; + + $io->print(" "); + Sesse::pr0n::Common::print_link($io, $title, "/$event/", \%newsettings, $defsettings); + $io->print("\n"); } 1;