2 *OldBrowseResolvedPage
= *BrowseResolvedPage
;
3 *BrowseResolvedPage
= *NewBrowseResolvedPage
;
5 sub NewBrowseResolvedPage
{
7 my ($class, $new, $title) = ResolveId
($id);
8 if ($class eq 'near' && not GetParam
('rcclusteronly', 0)) {
9 print $q->redirect({-uri
=>$NearSite{$title} . $new});
11 OldBrowseResolvedPage
($id);
15 *OldResolveId
= *ResolveId
;
16 *ResolveId
= *NewResolveId
;
20 my %NearLinksUsed = ();
24 GetSiteUrl
(); # make sure %InterSite is set
26 foreach my $site (keys %InterSite) {
27 open(F
, $DataDir . '/' . $site) or next;
30 foreach (split(/\n/, $data)) {
31 if (not $NearPage{$_}) {
33 $NearSite{$_} = $site;
42 my @result = OldResolveId
($id);
43 return @result if $result[1];
46 $NearLinksUsed{$NearPage{$id}} = 1 ;
47 return ('near', $NearPage{$id}, $NearSite{$id});
51 my $MyFootnoteCounter = 0;
55 if ((-f GetLockedPageFile
($OpenPageName))
56 and (/\G(\<form.*?\<\/form\
>)/sgc
)) {
57 return UnquoteHtml
($1);
58 } elsif (/\G(Page alias: $LinkPattern)\n/gc
59 or /\G(PageAlias: $FreeLinkPattern)\n/gc) {
61 print GetPageLink
('PageAlias', 'Page alias')
62 . ': ' . GetPermanentAnchor
($2);
63 } elsif (m/\G(\[\[\[(.*?)\]\]\])/gcs) {
65 push(@MyFootnotes,$2);
67 print $q->a({-href
=>'#'.$MyFootnoteCounter,
68 -name
=>'f'.$MyFootnoteCounter,
72 } elsif (m/\G!\+\+\+/gc) {
74 } elsif (m/\Gportrait:$UrlPattern/gc) {
75 return $q->img({-src
=>$1, -alt
=>T
("Portrait"), -class=>'portrait'});
76 } elsif (m/\GMy\s+subscribed\s+pages:\s*((?:(?:$LinkPattern|\[\[$FreeLinkPattern\]\]),\s*)+)categories:\s*((?:(?:$LinkPattern|\[\[$FreeLinkPattern\]\]),\s*)*(?:$LinkPattern|\[\[$FreeLinkPattern\]\]))/gc) {
77 return Subscribe
($1, $4);
78 } elsif (m/\GMy\s+subscribed\s+pages:\s*((?:(?:$LinkPattern|\[\[$FreeLinkPattern\]\]),\s*)*(?:$LinkPattern|\[\[$FreeLinkPattern\]\]))/gc) {
79 return Subscribe
($1, '');
80 } elsif (m/\GMy\s+subscribed\s+categories:\s*((?:(?:$LinkPattern|\[\[$FreeLinkPattern\]\]),\s*)*(?:$LinkPattern|\[\[$FreeLinkPattern\]\]))/gc) {
81 return Subscribe
('', $1);
87 my ($pages, $categories) = @_;
90 if (/\[\[$FreeLinkPattern\]\]/) {
95 } split(/\s*,\s*/, $pages);
97 if (/\[\[$FreeLinkPattern\]\]/) {
102 } split(/\s*,\s*/, $categories);
104 $regexp .= '^(' . join('|', @pageslist) . ")\$" if @pageslist;
105 $regexp .= '|' if @pageslist and @catlist;
106 $regexp .= '(' . join('|', @catlist) . ')' if @catlist;
108 my $html = 'My subscribed ';
109 return $html unless @pageslist or @catlist;
110 $html .= 'pages: ' . join(', ', map { s/_/ /g; $_; } @pageslist)
112 $html .= ', ' if @pageslist and @catlist;
113 $html .= 'categories: ' . join(', ', map { s/_/ /g; $_; } @catlist)
115 return ScriptLink
('action=rc;rcfilteronly=' . $regexp, $html);
118 *OldPrintFooter
= *PrintFooter
;
119 *PrintFooter
= *NewPrintFooter
;
124 if ($MyFootnoteCounter) {
125 for (my $i = 1; $i <= $MyFootnoteCounter; $i++) {
126 $html .= '<br>' if $html;
127 $html .= $q->a({-name
=>$i,
129 $i . '.' ) . ' ' . shift @MyFootnotes;
131 print $q->div({-class=>'footnotes'},
132 $q->hr(), $q->p(T
('Footnotes:')), $q->p($html));
134 OldPrintFooter
(@params);
141 if ($NearPage{$id}) {
142 print $q->div({-class=>'sister'}, $q->hr(),
143 $q->p(T
('The same page on other sites:'), $q->br(),
144 $q->a({-href
=>GetSiteUrl
($NearSite{$id}) . $id,
145 -title
=>$NearSite{$id} . ':' . $id},
146 $q->img({-src
=>'/community/'
147 . $NearSite{$id} . '.png',
148 -alt
=>T
('SisterSite:') . ' '
149 . $NearSite{$id} . ':' . $id}))));
151 if (%NearLinksUsed) {
152 print $q->div({-class=>'near'}, $q->p(GetPageLink
(T
('EditNearLinks')) . ':',
153 join(' ', map { GetEditLink
($_, $_); } keys %NearLinksUsed)));
155 if (GetParam
('debug', 0)) {
156 print $q->div({-class=>'debug'}, $q->hr(),