From f5cb40d21c1dc35799a21f736d7d7cada2fda737 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Wed, 16 Jul 2025 17:17:50 +0200 Subject: [PATCH] [post-instead-of-get] Change More... link in RcHtml --- modules/post-instead-of-get.pl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/modules/post-instead-of-get.pl b/modules/post-instead-of-get.pl index 0ea8d989..15cb256b 100644 --- a/modules/post-instead-of-get.pl +++ b/modules/post-instead-of-get.pl @@ -18,7 +18,7 @@ use v5.10; AddModuleDescription('post-instead-of-get.pl', 'POST instead of GET extension'); -our ($q, $LastUpdate, @RcDays, $RcDefault, $ShowRollbacks, $ShowAll, $ShowEdits, %Languages); +our ($q, $Now, $LastUpdate, @RcDays, $RcDefault, $ShowRollbacks, $ShowAll, $ShowEdits, %Languages); # You should install nosearch.pl, too. @@ -53,7 +53,35 @@ sub PostNewRcHeader { return $html; } +# Change the More... link + +*PostOldRcHtml=*RcHtml; +*RcHtml=*PostNewRcHtml; + +sub PostNewRcHtml { + my $html = PostOldRcHtml(@_); + # Based on RcPreviousAction + my $form = GetFormStart(undef, 'post', 'more'); + my $interval = GetParam('days', $RcDefault) * 86400; + # use delta between from and upto, or use days, whichever is available + my $to = GetParam('from', GetParam('upto', $Now - $interval)); + my $from = $to - (GetParam('upto') ? GetParam('upto') - GetParam('from') : $interval); + $form .= $q->input({-type=>'hidden', -name=>'action', -value=>'rc'}); + $form .= $q->input({-type=>'hidden', -name=>'from', -value=>$from}); + $form .= $q->input({-type=>'hidden', -name=>'upto', -value=>$to}); + # Based on RcOtherParameters + foreach (qw(days page diff full all showedit rollback rcidonly rcuseronly rchostonly rcclusteronly rcfilteronly match lang followup)) { + my $val = GetParam($_, ''); + $form .= $q->input({-type=>'hidden', -name=>$_, -value=>$val}) if $val; + } + $form .= $q->submit('more', T('More...')); + $form .= $q->end_form(); + $html =~ s/

.*?<\/p>//; + return $html . $form; +} + # Change Recent Changes filter form to represent all options. + *PostOldGetFilterForm=*GetFilterForm; *GetFilterForm=*PostNewGetFilterForm;