Lock the number of pictures per page at 250.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 18:08:26 +0000 (19:08 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 19 Nov 2015 18:08:26 +0000 (19:08 +0100)
perl/Sesse/pr0n/Index.pm

index cd1338631b08e7ce48dc7658416db768a888ded6..5082486e996056142860ae70a0ec9410ef63e268 100644 (file)
@@ -69,11 +69,6 @@ sub handler {
                undef, Sesse::pr0n::Common::get_server_name($r))
                and $defsettings{'xres'} = $defsettings{'yres'} = undef;
        
                undef, Sesse::pr0n::Common::get_server_name($r))
                and $defsettings{'xres'} = $defsettings{'yres'} = undef;
        
-       # Reduce the front page load when in overload mode.
-       if (Sesse::pr0n::Overload::is_in_overload($r)) {
-               $defsettings{'num'} = 100;
-       }
-               
        my %settings = %defsettings;
 
        for my $s (qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen model lens author)) {
        my %settings = %defsettings;
 
        for my $s (qw(thumbxres thumbyres xres yres start num all infobox rot sel fullscreen model lens author)) {
@@ -221,7 +216,6 @@ sub handler {
                }
 
                print_viewres($r, $io, $event, \%settings, \%defsettings);
                }
 
                print_viewres($r, $io, $event, \%settings, \%defsettings);
-               print_pagelimit($r, $io, $event, \%settings, \%defsettings);
                print_infobox($r, $io, $event, \%settings, \%defsettings);
                print_selected($r, $io, $event, \%settings, \%defsettings) if ($num_selected > 0);
                print_fullscreen($r, $io, $event, \%settings, \%defsettings);
                print_infobox($r, $io, $event, \%settings, \%defsettings);
                print_selected($r, $io, $event, \%settings, \%defsettings) if ($num_selected > 0);
                print_fullscreen($r, $io, $event, \%settings, \%defsettings);
@@ -462,38 +456,6 @@ sub print_viewres {
                      'xres', 'yres', \@alternatives);
 }
 
                      'xres', 'yres', \@alternatives);
 }
 
-sub print_pagelimit {
-       my ($r, $io, $event, $settings, $defsettings) = @_;
-       
-       my $title = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage');
-       chomp $title;
-       $io->print("    <p>$title:\n");
-       
-       # Get choices
-       chomp (my $unlimited = Sesse::pr0n::Templates::fetch_template($r, 'imgsperpage-unlimited'));
-       my @alternatives = qw(10 50 100 250 500);
-       push @alternatives, $unlimited;
-       
-       for my $num (@alternatives) {
-               my %newsettings = %$settings;
-
-               if ($num !~ /^\d+$/) { # unlimited
-                       $newsettings{'num'} = -1;
-               } else {
-                       $newsettings{'num'} = $num;
-               }
-
-               $io->print("      ");
-               if (eq_with_undef($settings->{'num'}, $newsettings{'num'})) {
-                       $io->print($num);
-               } else {
-                       Sesse::pr0n::Common::print_link($io, $num, "/$event/", \%newsettings, $defsettings);
-               }
-               $io->print("\n");
-       }
-       $io->print("    </p>\n");
-}
-
 sub print_infobox {
        my ($r, $io, $event, $settings, $defsettings) = @_;
 
 sub print_infobox {
        my ($r, $io, $event, $settings, $defsettings) = @_;