Start implementing the +all option.
[pr0n] / perl / Sesse / pr0n / Index.pm
1 package Sesse::pr0n::Index;
2 use strict;
3 use warnings;
4
5 use Sesse::pr0n::Common qw(error dberror);
6 use Apache2::Request;
7 use POSIX;
8
9 sub handler {
10         my $r = shift;
11         my $apr = Apache2::Request->new($r);
12         my $dbh = Sesse::pr0n::Common::get_dbh();
13
14         my ($event, $abspath, $evselect);
15         if ($r->uri =~ /^\/\+all\/?/) {
16                 $event = '+all';
17                 $abspath = 1;
18                 $evselect = '';
19         } else {
20                 # Find the event
21                 $r->uri =~ /^\/([a-zA-Z0-9-]+)\/?$/
22                         or error($r, "Could not extract event");
23                 $event = $1;
24                 $abspath = 0;
25                 $evselect = 'event=' . $dbh->quote($event) . ' AND ';
26         }
27
28         # Fix common error: pr0n.sesse.net/event -> pr0n.sesse.net/event/
29         if ($r->uri !~ m#/$#) {
30                 $r->headers_out->{'location'} = "/$event/";
31                 return Apache2::Const::REDIRECT;
32         }
33
34         # Internal? (Ugly?) 
35         if ($r->get_server_name =~ /internal/ || $r->get_server_name =~ /skoyen\.bilder\.knatten\.com/ || $r->get_server_name =~ /lia\.heimdal\.org/) {
36                 my $user = Sesse::pr0n::Common::check_access($r);
37                 if (!defined($user)) {
38                         return Apache2::Const::OK;
39                 }
40         }
41
42         # Read the appropriate settings from the query string into the settings hash
43         my %defsettings = (
44                 thumbxres => 80,
45                 thumbyres => 64,
46                 xres => -1,
47                 yres => -1,
48                 start => 1,
49                 num => 100,
50                 all => 1,
51                 infobox => 1,
52                 rot => 0,
53                 sel => 0,
54                 fullscreen => 0,
55         );
56         
57         # Any NEF files => default to processing
58         my $ref = $dbh->selectrow_hashref("SELECT * FROM images WHERE $evselect vhost=? AND LOWER(filename) LIKE '%.nef' LIMIT 1",
59                 undef, $r->get_server_name)
60                 and $defsettings{'xres'} = $defsettings{'yres'} = undef;
61         
62         # Reduce the front page load when in overload mode.
63         if (Sesse::pr0n::Overload::is_in_overload($r)) {
64                 $defsettings{'num'} = 100;
65         }
66                 
67         my %settings = %defsettings;
68
69         for my $s qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen) {
70                 my $val = $apr->param($s);
71                 if (defined($val) && $val =~ /^(\d+)$/) {
72                         $settings{$s} = $val;
73                 }
74                 if (($s eq "num" || $s eq "xres" || $s eq "yres") && defined($val) && $val == -1) {
75                         $settings{$s} = $val;
76                 }
77         }
78
79         my $thumbxres = $settings{'thumbxres'};
80         my $thumbyres = $settings{'thumbyres'};
81         my $xres = $settings{'xres'};
82         my $yres = $settings{'yres'};
83         my $start = $settings{'start'};
84         my $num = $settings{'num'};
85         my $all = $settings{'all'};
86         my $infobox = $settings{'infobox'} ? '' : 'nobox/';
87         my $rot = $settings{'rot'};
88         my $sel = $settings{'sel'};
89
90         if (defined($num) && $num == -1) {
91                 $num = undef;
92         }
93
94         my ($date, $name);
95
96         if ($event eq '+all') {
97                 $ref = $dbh->selectrow_hashref("SELECT EXTRACT(EPOCH FROM MAX(last_update)) AS last_update FROM events WHERE vhost=?",
98                         undef, $r->get_server_name)
99                         or error($r, "Could not list events", 404, "File not found");
100                 $date = undef;
101                 $name = Sesse::pr0n::Templates::fetch_template($r, 'all-event-title');
102                 $r->set_last_modified($ref->{'last_update'});
103         } else {
104                 $ref = $dbh->selectrow_hashref("SELECT name,date,EXTRACT(EPOCH FROM last_update) AS last_update FROM events WHERE $evselect vhost=?",
105                         undef, $r->get_server_name)
106                         or error($r, "Could not find event $event", 404, "File not found");
107
108                 $date = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'date'}));
109                 $name = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'name'}));
110                 $r->set_last_modified($ref->{'last_update'});
111         }
112                                 
113         # If the client can use cache, do so
114         if ((my $rc = $r->meets_conditions) != Apache2::Const::OK) {
115                 return $rc;
116         }
117         
118         # Count the number of selected images.
119         $ref = $dbh->selectrow_hashref("SELECT COUNT(*) AS num_selected FROM images WHERE $evselect vhost=? AND selected=\'t\'", undef, $r->get_server_name);
120         my $num_selected = $ref->{'num_selected'};
121
122         # Find all images related to this event.
123         my $where = ($all == 0) ? ' AND selected=\'t\'' : '';
124         my $limit = (defined($start) && defined($num) && !$settings{'fullscreen'}) ? (" LIMIT $num OFFSET " . ($start-1)) : "";
125
126         my $q = $dbh->prepare("SELECT *, (date - INTERVAL '6 hours')::date AS day FROM images WHERE $evselect vhost=? $where ORDER BY (date - INTERVAL '6 hours')::date,takenby,date,filename $limit")
127                 or dberror($r, "prepare()");
128         $q->execute($r->get_server_name)
129                 or dberror($r, "image enumeration");
130
131         # Print the page itself
132         if ($settings{'fullscreen'}) {
133                 $r->content_type("text/html; charset=utf-8");
134                 Sesse::pr0n::Templates::print_template($r, "fullscreen-header", { title => "$name [$event]" });
135                 while (my $ref = $q->fetchrow_hashref()) {
136                         $r->print("        \"" . $infobox . $ref->{'filename'} . "\",\n");
137                 }
138
139                 my %settings_no_fullscreen = %settings;
140                 $settings_no_fullscreen{'fullscreen'} = 0;
141
142                 my $returnurl = "http://" . $r->get_server_name . "/" . $event . "/" .
143                         Sesse::pr0n::Common::get_query_string(\%settings_no_fullscreen, \%defsettings);
144
145                 # *whistle*
146                 $returnurl =~ s/&/&/g;
147
148                 Sesse::pr0n::Templates::print_template($r, "fullscreen-footer", {
149                         vhost => $r->get_server_name,
150                         event => $event,
151                         start => $settings{'start'} - 1,
152                         returnurl => $returnurl,
153                         sel => $settings{'sel'},
154                 });
155         } else {
156                 Sesse::pr0n::Common::header($r, "$name [$event]");
157                 if (defined($date)) {
158                         Sesse::pr0n::Templates::print_template($r, "date", { date => $date });
159                 }
160
161                 if (Sesse::pr0n::Overload::is_in_overload($r)) {
162                         Sesse::pr0n::Templates::print_template($r, "overloadmode");
163                 }
164
165                 print_thumbsize($r, $event, \%settings, \%defsettings);
166                 print_viewres($r, $event, \%settings, \%defsettings);
167                 print_pagelimit($r, $event, \%settings, \%defsettings);
168                 print_infobox($r, $event, \%settings, \%defsettings);
169                 print_selected($r, $event, \%settings, \%defsettings) if ($num_selected > 0);
170                 print_fullscreen($r, $event, \%settings, \%defsettings);
171                 print_nextprev($r, $event, $evselect, \%settings, \%defsettings);
172         
173                 if ($event ne '+all') {
174                         # Find the equipment used
175                         my $eq = $dbh->prepare("
176                                 SELECT 
177                                         TRIM(model.value) AS model,
178                                         coalesce(TRIM(lens_spec.value), TRIM(lens.value)) AS lens,
179                                         COUNT(*) AS num
180                                 FROM ( SELECT * FROM images WHERE $evselect vhost=? $where ORDER BY (date - INTERVAL '6 hours')::date,takenby,date,filename ) i
181                                         LEFT JOIN exif_info model ON i.id=model.image
182                                         LEFT JOIN ( SELECT * FROM exif_info WHERE tag='Lens' ) lens ON i.id=lens.image
183                                         LEFT JOIN ( SELECT * FROM exif_info WHERE tag='LensSpec') lens_spec ON i.id=lens_spec.image
184                                 WHERE model.tag='Model'
185                                 GROUP BY 1,2
186                                 ORDER BY 1,2")
187                                 or die "Couldn't prepare to find equipment: $!";
188                         $eq->execute($r->get_server_name)
189                                 or die "Couldn't find equipment: $!";
190
191                         my @equipment = ();
192                         my %cameras_seen = ();
193                         while (my $ref = $eq->fetchrow_hashref) {
194                                 if (!defined($ref->{'lens'}) && exists($cameras_seen{$ref->{'model'}})) {
195                                         #
196                                         # Some compact cameras seem to add lens info sometimes and not at other
197                                         # times; if we have seen a camera with at least one specific lens earlier,
198                                         # just combine entries without a lens with the previous one.
199                                         #
200                                         $equipment[$#equipment]->{'num'} += $ref->{'num'};
201                                         next;
202                                 }
203                                 push @equipment, $ref;
204                                 $cameras_seen{$ref->{'model'}} = 1;
205                         }
206                         $eq->finish;
207
208                         if (scalar @equipment > 0) {
209                                 Sesse::pr0n::Templates::print_template($r, "equipment-start");
210                                 for my $e (@equipment) {
211                                         my $eqspec = $e->{'model'};
212                                         $eqspec .= ', ' . $e->{'lens'} if (defined($e->{'lens'}));
213
214                                         # This isn't correct for all languages. Fix if we ever need to care. :-)
215                                         if ($e->{'num'} == 1) {
216                                                 Sesse::pr0n::Templates::print_template($r, "equipment-item-singular", { eqspec => $eqspec });
217                                         } else {
218                                                 Sesse::pr0n::Templates::print_template($r, "equipment-item", { eqspec => $eqspec, num => $e->{'num'} });
219                                         }
220                                 }
221                                 Sesse::pr0n::Templates::print_template($r, "equipment-end");
222                         }
223                 }
224
225                 my $toclose = 0;
226                 my $lastupl = "";
227                 my $img_num = (defined($start) && defined($num)) ? $start : 1;
228                 
229                 # Print out all thumbnails
230                 if ($rot == 1) {
231                         $r->print("    <form method=\"post\" action=\"/rotate\">\n");
232                         $r->print("      <input type=\"hidden\" name=\"event\" value=\"$event\" />\n");
233         
234                         while (my $ref = $q->fetchrow_hashref()) {
235                                 my $imgsz = "";
236                                 my $takenby = $ref->{'takenby'};
237                                 if (defined($ref->{'day'})) {
238                                          $takenby .= ", " . $ref->{'day'};
239                                 }
240
241                                 if ($takenby ne $lastupl) {
242                                         $lastupl = $takenby;
243                                         $r->print("    <h2>");
244                                         Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl });
245                                         print_fullscreen_fromhere($r, $event, \%settings, \%defsettings, $img_num);
246                                         $r->print("</h2>\n");
247                                 }
248                                 if ($ref->{'width'} != -1 && $ref->{'height'} != -1) {
249                                         my $width = $ref->{'width'};
250                                         my $height = $ref->{'height'};
251                                                 
252                                         ($width, $height) = Sesse::pr0n::Common::scale_aspect($width, $height, $thumbxres, $thumbyres);
253                                         $imgsz = " width=\"$width\" height=\"$height\"";
254                                 }
255
256                                 my $filename = $ref->{'filename'};
257                                 my $uri = $infobox . $filename;
258                                 if (defined($xres) && defined($yres) && $xres != -1) {
259                                         $uri = "${xres}x$yres/$infobox$filename";
260                                 } elsif (defined($xres) && $xres == -1) {
261                                         $uri = "original/$infobox$filename";
262                                 }
263
264                                 my $prefix = "";
265                                 if ($abspath) {
266                                         $prefix = "/" . $ref->{'event'} . "/";
267                                 }
268
269                                 $r->print("    <p><a href=\"$prefix$uri\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
270                                 $r->print("      90 <input type=\"checkbox\" name=\"rot-" .
271                                         $ref->{'id'} . "-90\" />\n");
272                                 $r->print("      180 <input type=\"checkbox\" name=\"rot-" .
273                                         $ref->{'id'} . "-180\" />\n");
274                                 $r->print("      270 <input type=\"checkbox\" name=\"rot-" .
275                                         $ref->{'id'} . "-270\" />\n");
276                                 $r->print("      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
277                                         "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Del <input type=\"checkbox\" name=\"del-" . $ref->{'id'} . "\" /></p>\n");
278                         
279                                 ++$img_num;
280                         }
281                         $r->print("      <input type=\"submit\" value=\"Rotate\" />\n");
282                         $r->print("    </form>\n");
283                 } else {
284                         while (my $ref = $q->fetchrow_hashref()) {
285                                 my $imgsz = "";
286                                 my $takenby = $ref->{'takenby'};
287                                 if (defined($ref->{'day'})) {
288                                          $takenby .= ", " . $ref->{'day'};
289                                 }
290
291                                 if ($takenby ne $lastupl) {
292                                         $r->print("    </p>\n\n") if ($lastupl ne "");
293                                         $lastupl = $takenby;
294                                         $r->print("    <h2>");
295                                         Sesse::pr0n::Templates::print_template($r, "submittedby", { author => $lastupl });
296                                         print_fullscreen_fromhere($r, $event, \%settings, \%defsettings, $img_num);
297                                         $r->print("</h2>\n");
298                                         $r->print("    <p class=\"photos\">\n");
299                                 }
300                                 if ($ref->{'width'} != -1 && $ref->{'height'} != -1) {
301                                         my $width = $ref->{'width'};
302                                         my $height = $ref->{'height'};
303                                                 
304                                         ($width, $height) = Sesse::pr0n::Common::scale_aspect($width, $height, $thumbxres, $thumbyres);
305                                         $imgsz = " width=\"$width\" height=\"$height\"";
306                                 }
307
308                                 my $filename = $ref->{'filename'};
309                                 my $uri = $infobox . $filename;
310                                 if (defined($xres) && defined($yres) && $xres != -1) {
311                                         $uri = "${xres}x$yres/$infobox$filename";
312                                 } elsif (defined($xres) && $xres == -1) {
313                                         $uri = "original/$infobox$filename";
314                                 }
315                                 
316                                 my $prefix = "";
317                                 if ($abspath) {
318                                         $prefix = "/" . $ref->{'event'} . "/";
319                                 }
320                                 
321                                 $r->print("      <a href=\"$prefix$uri\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
322                                 
323                                 ++$img_num;
324                         }
325                         $r->print("    </p>\n");
326                 }
327
328                 print_nextprev($r, $event, $evselect, \%settings, \%defsettings);
329                 Sesse::pr0n::Common::footer($r);
330         }
331
332         return Apache2::Const::OK;
333 }
334
335 sub eq_with_undef {
336         my ($a, $b) = @_;
337         
338         return 1 if (!defined($a) && !defined($b));
339         return 0 unless (defined($a) && defined($b));
340         return ($a eq $b);
341 }
342
343 sub print_changes {
344         my ($r, $event, $template, $settings, $defsettings, $var1, $var2, $alternatives) = @_;
345
346         my $title = Sesse::pr0n::Templates::fetch_template($r, $template);
347         chomp $title;
348         $r->print("    <p>$title:\n");
349
350         for my $a (@$alternatives) {
351                 my $text;
352                 my %newsettings = %$settings;
353
354                 if (ref $a) {
355                         my ($v1, $v2);
356                         ($text, $v1, $v2) = @$a;
357                         
358                         $newsettings{$var1} = $v1;
359                         $newsettings{$var2} = $v2;
360                 } else {
361                         $text = $a;
362
363                         # Parse the current alternative
364                         my ($v1, $v2) = split /x/, $a;
365
366                         $newsettings{$var1} = $v1;
367                         $newsettings{$var2} = $v2;
368                 }
369
370                 $r->print("      ");
371
372                 # Check if these settings are current (print only label)
373                 if (eq_with_undef($settings->{$var1}, $newsettings{$var1}) &&
374                     eq_with_undef($settings->{$var2}, $newsettings{$var2})) {
375                         $r->print($text);
376                 } else {
377                         Sesse::pr0n::Common::print_link($r, $text, "/$event/", \%newsettings, $defsettings);
378                 }
379                 $r->print("\n");
380         }
381         $r->print("    </p>\n");
382 }
383
384 sub print_thumbsize {
385         my ($r, $event, $settings, $defsettings) = @_;
386         my @alternatives = qw(80x64 120x96 160x128 240x192 320x256);
387
388         print_changes($r, $event, 'thumbsize', $settings, $defsettings,
389                       'thumbxres', 'thumbyres', \@alternatives);
390 }
391 sub print_viewres {
392         my ($r, $event, $settings, $defsettings) = @_;
393         my @alternatives = qw(320x256 512x384 640x480 800x600 1024x768 1280x960);
394         chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'viewres-unlimited'));
395         chomp (my $original = Sesse::pr0n::Templates::fetch_template($r, 'viewres-original'));
396         push @alternatives, [ $unlimited, undef, undef ];
397         push @alternatives, [ $original, -1, -1 ];
398
399         print_changes($r, $event, 'viewres', $settings, $defsettings,
400                       'xres', 'yres', \@alternatives);
401 }
402
403 sub print_pagelimit {
404         my ($r, $event, $settings, $defsettings) = @_;
405         
406         my $title = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage');
407         chomp $title;
408         $r->print("    <p>$title:\n");
409         
410         # Get choices
411         chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage-unlimited'));
412         my @alternatives = qw(10 50 100 500);
413         push @alternatives, $unlimited;
414         
415         for my $num (@alternatives) {
416                 my %newsettings = %$settings;
417
418                 if ($num !~ /^\d+$/) { # unlimited
419                         $newsettings{'num'} = -1;
420                 } else {
421                         $newsettings{'num'} = $num;
422                 }
423
424                 $r->print("      ");
425                 if (eq_with_undef($settings->{'num'}, $newsettings{'num'})) {
426                         $r->print($num);
427                 } else {
428                         Sesse::pr0n::Common::print_link($r, $num, "/$event/", \%newsettings, $defsettings);
429                 }
430                 $r->print("\n");
431         }
432         $r->print("    </p>\n");
433 }
434
435 sub print_infobox {
436         my ($r, $event, $settings, $defsettings) = @_;
437
438         chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'infobox'));
439         chomp (my $on = Sesse::pr0n::Templates::fetch_template($r, 'infobox-on'));
440         chomp (my $off = Sesse::pr0n::Templates::fetch_template($r, 'infobox-off'));
441
442         $r->print("    <p>$title:\n");
443
444         my %newsettings = %$settings;
445
446         if ($settings->{'infobox'} == 1) {
447                 $r->print($on);
448         } else {
449                 $newsettings{'infobox'} = 1;
450                 Sesse::pr0n::Common::print_link($r, $on, "/$event/", \%newsettings, $defsettings);
451         }
452
453         $r->print(' ');
454
455         if ($settings->{'infobox'} == 0) {
456                 $r->print($off);
457         } else {
458                 $newsettings{'infobox'} = 0;
459                 Sesse::pr0n::Common::print_link($r, $off, "/$event/", \%newsettings, $defsettings);
460         }
461         
462         $r->print('</p>');
463 }
464
465 sub print_nextprev {
466         my ($r, $event, $evselect, $settings, $defsettings) = @_;
467         my $start = $settings->{'start'};
468         my $num = $settings->{'num'};
469         my $all = $settings->{'all'};
470         my $dbh = Sesse::pr0n::Common::get_dbh();
471         my $where = ($all == 0) ? ' AND selected=\'t\'' : '';
472
473         $num = undef if (defined($num) && $num == -1);
474         return unless (defined($start) && defined($num));
475
476         # determine total number
477         my $ref = $dbh->selectrow_hashref("SELECT count(*) AS num_images FROM images WHERE $evselect vhost=? $where",
478                 undef, $r->get_server_name)
479                 or dberror($r, "image enumeration");
480         my $num_images = $ref->{'num_images'};
481
482         return if ($start == 1 && $start + $num >= $num_images);
483
484         my $end = $start + $num - 1;
485         if ($end > $num_images) {
486                 $end = $num_images;
487         }
488
489         $r->print("    <p class=\"nextprev\">\n");
490
491         # Previous
492         if ($start > 1) {
493                 my $newstart = $start - $num;
494                 if ($newstart < 1) {
495                         $newstart = 1;
496                 }
497                 my $newend = $newstart + $num - 1;
498                 if ($newend > $num_images) {
499                         $newend = $num_images;
500                 }
501
502                 my %newsettings = %$settings;
503                 $newsettings{'start'} = $newstart;
504                 chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'prevpage'));
505                 chomp (my $accesskey = Sesse::pr0n::Templates::fetch_template($r, 'prevaccesskey'));
506                 Sesse::pr0n::Common::print_link($r, "$title ($newstart-$newend)\n", "/$event/", \%newsettings, $defsettings, $accesskey);
507         }
508
509         # This
510         chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'thispage'));
511         $r->print("    $title ($start-$end)\n");
512
513         # Next
514         if ($end < $num_images) {
515                 my $newstart = $start + $num;
516                 my $newend = $newstart + $num - 1;
517                 if ($newend > $num_images) {
518                         $newend = $num_images;
519                 }
520                 
521                 my %newsettings = %$settings;
522                 $newsettings{'start'} = $newstart;
523                 chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'nextpage'));
524                 chomp (my $accesskey = Sesse::pr0n::Templates::fetch_template($r, 'nextaccesskey'));
525                 Sesse::pr0n::Common::print_link($r, "$title ($newstart-$newend)", "/$event/", \%newsettings, $defsettings, $accesskey);
526         }
527
528         $r->print("    </p>\n");
529 }
530
531 sub print_selected {
532         my ($r, $event, $settings, $defsettings) = @_;
533
534         chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'show'));
535         chomp (my $all = Sesse::pr0n::Templates::fetch_template($r, 'show-all'));
536         chomp (my $sel = Sesse::pr0n::Templates::fetch_template($r, 'show-selected'));
537
538         $r->print("    <p>$title:\n");
539
540         my %newsettings = %$settings;
541
542         if ($settings->{'all'} == 0) {
543                 $r->print($sel);
544         } else {
545                 $newsettings{'all'} = 0;
546                 Sesse::pr0n::Common::print_link($r, $sel, "/$event/", \%newsettings, $defsettings);
547         }
548
549         $r->print(' ');
550
551         if ($settings->{'all'} == 1) {
552                 $r->print($all);
553         } else {
554                 $newsettings{'all'} = 1;
555                 Sesse::pr0n::Common::print_link($r, $all, "/$event/", \%newsettings, $defsettings);
556         }
557         
558         $r->print('</p>');
559 }
560
561 sub print_fullscreen {
562         my ($r, $event, $settings, $defsettings) = @_;
563
564         chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen'));
565
566         my %newsettings = %$settings;
567         $newsettings{'fullscreen'} = 1;
568
569         $r->print("    <p>");
570         Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings);
571         $r->print("</p>\n");
572 }
573
574 sub print_fullscreen_fromhere {
575         my ($r, $event, $settings, $defsettings, $start) = @_;
576
577         chomp (my $title = Sesse::pr0n::Templates::fetch_template($r, 'fullscreen-fromhere'));
578
579         my %newsettings = %$settings;
580         $newsettings{'fullscreen'} = 1;
581         $newsettings{'start'} = $start;
582
583         $r->print("    <p class=\"fsfromhere\">");
584         Sesse::pr0n::Common::print_link($r, $title, "/$event/", \%newsettings, $defsettings);
585         $r->print("</p>\n");
586 }
587         
588 1;
589
590