4 # These are the INTERNAL names, which get mapped
5 # directly to class names. For display purposes, the
6 # Language class has internationalized names
8 /* private */ $wgValidSkinNames = array(
9 "Standard", "Nostalgia", "CologneBlue"
12 class RecentChangesClass
{
13 var $secureName , $displayName , $link , $namespace ;
14 var $oldid , $diffid , $timestamp , $curlink , $lastlink , $usertalklink , $versionlink ;
15 var $usercomment , $userlink ;
16 var $isminor , $isnew , $watched , $islog ;
21 /* private */ var $lastdate, $lastline;
23 var $rc_cache ; # Cache for Enhanced Recent Changes
24 var $rccc ; # Recent Changes Cache Counter for visibility toggle
31 function getSkinNames()
33 global $wgValidSkinNames;
34 return $wgValidSkinNames;
37 function getStylesheet()
39 return "wikistandard.css";
44 global $wgOut, $wgUser;
46 if ( $wgOut->isQuickbarSupressed() ) { return 0; }
47 $q = $wgUser->getOption( "quickbar" );
48 if ( "" == $q ) { $q = 0; }
54 global $wgOut, $wgStyleSheetPath;
55 wfProfileIn( "Skin::initPage" );
57 $wgOut->addLink( "shortcut icon", "", "/favicon.ico" );
58 if ( $wgOut->isPrintable() ) { $ss = "wikiprintable.css"; }
59 else { $ss = $this->getStylesheet(); }
60 $wgOut->addLink( "stylesheet", "", "{$wgStyleSheetPath}/{$ss}" );
64 function getHeadScripts() {
65 global $wgStyleSheetPath;
66 $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
70 function getUserStyles()
72 $s = "<style type='text/css' media='screen'><!--\n";
73 $s .= $this->doGetUserStyles();
74 $s .= "//--></style>\n";
78 function doGetUserStyles()
83 if ( 1 == $wgUser->getOption( "underline" ) ) {
84 $s .= "a.stub, a.new, a.internal, a.external { " .
85 "text-decoration: underline; }\n";
87 $s .= "a.stub, a.new, a.internal, a.external { " .
88 "text-decoration: none; }\n";
90 if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
91 $s .= "a.new { color: #CC2200; }\n" .
92 "#quickbar a.new { color: CC2200; }\n";
94 if ( 1 == $wgUser->getOption( "justify" ) ) {
95 $s .= "#article { text-align: justify; }\n";
100 function getBodyOptions()
102 global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
104 if ( 0 != $wgTitle->getNamespace() ) {
105 $a = array( "bgcolor" => "#FFFFDD" );
107 else $a = array( "bgcolor" => "#FFFFFF" );
108 if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
110 (!$wgTitle->isProtected() ||
$wgUser->isSysop())
113 $n = $wgTitle->getPrefixedURL();
114 $t = wfMsg( "editthispage" );
116 if ( $redirect ) { $red = "&redirect={$redirect}"; }
117 if ( $oldid && ! isset( $diff ) ) {
118 $oid = "&oldid={$oldid}";
120 $s = wfLocalUrlE($n,"action=edit{$oid}{$red}");
121 $s = "document.location = \"" .$s ."\";";
122 $a +
= array ("ondblclick" => $s);
125 if($action=="edit") { # set focus in edit box
126 $a +
= array("onLoad"=>"document.editform.wpTextbox1.focus()");
131 function getExternalLinkAttributes( $link, $text )
133 global $wgUser, $wgOut, $wgLang;
135 $link = urldecode( $link );
136 $link = $wgLang->checkTitleEncoding( $link );
137 $link = str_replace( "_", " ", $link );
138 $link = wfEscapeHTML( $link );
140 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
141 else { $r = " class='external'"; }
143 if ( 1 == $wgUser->getOption( "hover" ) ) {
144 $r .= " title=\"{$link}\"";
149 function getInternalLinkAttributes( $link, $text, $broken = false )
151 global $wgUser, $wgOut;
153 $link = urldecode( $link );
154 $link = str_replace( "_", " ", $link );
155 $link = wfEscapeHTML( $link );
157 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
158 else if ( $broken == "stub" ) { $r = " class='stub'"; }
159 else if ( $broken == "yes" ) { $r = " class='new'"; }
160 else { $r = " class='internal'"; }
162 if ( 1 == $wgUser->getOption( "hover" ) ) {
163 $r .= " title=\"{$link}\"";
174 # This will be called immediately after the <body> tag. Split into
175 # two functions to make it easier to subclass.
177 function beforeContent()
179 global $wgUser, $wgOut;
181 if ( $wgOut->isPrintable() ) {
182 $s = $this->pageTitle() . $this->pageSubtitle() . "\n";
183 $s .= "\n<div class='bodytext'>";
186 return $this->doBeforeContent();
189 function doBeforeContent()
191 global $wgUser, $wgOut, $wgTitle;
192 wfProfileIn( "Skin::doBeforeContent" );
195 $qb = $this->qbSetting();
197 if( $langlinks = $this->otherLanguages() ) {
203 $borderhack = "class='top'";
206 $s .= "\n<div id='content'>\n<div id='topbar'>" .
207 "<table width='98%' border=0 cellspacing=0><tr>";
210 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
211 $this->logoText() . "</td>";
212 } else if ( 1 == $qb ||
3 == $qb ) { # Left
213 $s .= $this->getQuickbarCompensator( $rows );
215 $s .= "<td {$borderhack} align=left valign=top>";
217 $s .= $this->topLinks() ;
218 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
220 $s .= "</td>\n<td {$borderhack} valign=top align=right nowrap>";
221 $s .= $this->nameAndLogin();
222 $s .= "\n<br>" . $this->searchForm() . "</td>";
225 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
228 if ( 2 == $qb ) { # Right
229 $s .= $this->getQuickbarCompensator( $rows );
231 $s .= "</tr></table>\n</div>\n";
232 $s .= "\n<div id='article'>";
234 $s .= $this->pageTitle();
235 $s .= $this->pageSubtitle() . "\n<p>";
240 function getQuickbarCompensator( $rows = 1 )
242 return "<td width='152' rowspan='{$rows}'> </td>";
245 # This gets called immediately before the </body> tag.
247 function afterContent()
249 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
251 if ( $wgOut->isPrintable() ) {
254 $u = $wgServer . $HTTP_SERVER_VARS['REQUEST_URI'];
255 $u = preg_replace( "/[?&]printable=yes/", "", $u );
256 $rf = str_replace( "$1", $u, wfMsg( "retrievedfrom" ) );
258 if ( $wgOut->isArticle() ) {
259 $lm = "<br>" . $this->lastModified();
262 $s .= "<p><em>{$rf}{$lm}</em>\n";
265 return $this->doAfterContent();
268 function doAfterContent()
270 global $wgUser, $wgOut;
271 wfProfileIn( "Skin::doAfterContent" );
273 $s = "\n</div><br clear=all>\n";
275 $s .= "\n<div id='footer'>";
276 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
278 $qb = $this->qbSetting();
279 if ( 1 == $qb ||
3 == $qb ) { # Left
280 $s .= $this->getQuickbarCompensator();
282 $s .= "<td class='bottom' align=left valign=top>";
284 $s .= $this->bottomLinks();
285 $s .= "\n<br>" . $this->mainPageLink()
286 . " | " . $this->aboutLink()
287 . " | " . $this->specialLink( "recentchanges" )
288 . " | " . $this->searchForm()
289 . "<br>" . $this->pageStats();
292 if ( 2 == $qb ) { # Right
293 $s .= $this->getQuickbarCompensator();
295 $s .= "</tr></table>\n</div>\n</div>\n";
297 if ( 0 != $qb ) { $s .= $this->quickBar(); }
302 function pageTitleLinks()
304 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
306 $s = $this->printableLink();
308 if ( $wgOut->isArticle() ) {
309 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
310 $name = $wgTitle->getDBkey();
311 $link = wfEscapeHTML( wfImageUrl( $name ) );
312 $style = $this->getInternalLinkAttributes( $link, $name );
313 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
316 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
317 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
318 wfMsg( "currentrev" ) );
321 if ( $wgUser->getNewtalk() ) {
322 # do not show "You have new messages" text when we are viewing our
325 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
326 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
327 $n =$wgUser->getName();
328 $tl = $this->makeKnownLink( $wgLang->getNsText(
329 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
330 wfMsg("newmessageslink") );
331 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
337 function printableLink()
339 global $wgOut, $wgTitle, $oldid, $action;
341 if ( "history" == $action ) { $q = "action=history&"; }
344 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
345 WfMsg( "printableversion" ), "{$q}printable=yes" );
351 global $wgOut, $wgTitle;
353 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
357 function pageSubtitle()
359 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
361 $sub = $wgOut->getSubtitle();
362 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
363 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
364 $ptext=$wgTitle->getPrefixedText();
365 if(preg_match("/\//",$ptext)) {
366 $sub.="</p><p class='subpages'>";
367 $links=explode("/",$ptext);
370 foreach($links as $link) {
372 if ($c<count($links)) {
374 $getlink=$this->makeLink($growinglink,$link);
375 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
388 $s = "<p class='subtitle'>{$sub}\n";
392 function nameAndLogin()
394 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
396 $li = $wgLang->specialPage( "Userlogin" );
397 $lo = $wgLang->specialPage( "Userlogout" );
400 if ( 0 == $wgUser->getID() ) {
401 if( $wgShowIPinHeader ) {
402 $n = getenv( "REMOTE_ADDR" );
404 $tl = $this->makeKnownLink( $wgLang->getNsText(
405 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
406 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
408 $s .= $n . " (".$tl.")";
410 $s .= wfMsg("notloggedin");
413 $rt = $wgTitle->getPrefixedURL();
414 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
416 } else { $q = "returnto={$rt}"; }
418 $s .= "\n<br>" . $this->makeKnownLink( $li,
419 wfMsg( "login" ), $q );
421 $n = $wgUser->getName();
422 $rt = $wgTitle->getPrefixedURL();
423 $tl = $this->makeKnownLink( $wgLang->getNsText(
424 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
425 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
429 $s .= $this->makeKnownLink( $wgLang->getNsText(
430 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
431 $this->makeKnownLink( $lo, wfMsg( "logout" ),
432 "returnto={$rt}" ) . " | " .
433 $this->specialLink( "preferences" );
435 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
441 function searchForm()
445 $s = "<form name='search' class='inline' method=get action=\""
446 . wfLocalUrl( "" ) . "\">"
447 . "<input type=text name=\"search\" size=19 value=\""
448 . htmlspecialchars(substr($search,0,256)) . "\">\n"
449 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
450 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
460 $s = $this->mainPageLink() . $sep
461 . $this->specialLink( "recentchanges" );
463 if ( $wgOut->isArticle() ) {
464 $s .= $sep . $this->editThisPage()
465 . $sep . $this->historyLink();
467 $s .= $sep . $this->specialPagesList();
472 function bottomLinks()
474 global $wgOut, $wgUser, $wgTitle;
478 if ( $wgOut->isArticle() ) {
479 $s .= "<strong>" . $this->editThisPage() . "</strong>";
480 if ( 0 != $wgUser->getID() ) {
481 $s .= $sep . $this->watchThisPage();
483 $s .= $sep . $this->talkLink()
484 . $sep . $this->historyLink()
485 . $sep . $this->whatLinksHere()
486 . $sep . $this->watchPageLinksLink();
488 if ( $wgTitle->getNamespace() == Namespace::getUser()
489 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
492 $id=User
::idFromName($wgTitle->getText());
493 $ip=User
::isIP($wgTitle->getText());
495 if($id ||
$ip) { # both anons and non-anons have contri list
496 $s .= $sep . $this->userContribsLink();
498 if ( 0 != $wgUser->getID() ) { # show only to signed in users
499 if($id) { # can only email non-anons
500 $s .= $sep . $this->emailUserLink();
504 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
505 $s .= "\n<br>" . $this->deleteThisPage() .
506 $sep . $this->protectThisPage() .
507 $sep . $this->moveThisPage();
509 $s .= "<br>\n" . $this->otherLanguages();
516 global $wgOut, $wgLang, $wgArticle;
517 global $oldid, $diff, $wgDisableCounters;
519 if ( ! $wgOut->isArticle() ) { return ""; }
520 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
521 if ( 0 == $wgArticle->getID() ) { return ""; }
523 if ( $wgDisableCounters ) {
526 $count = $wgArticle->getCount();
527 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
529 $s .= $this->lastModified();
530 $s .= " " . wfMsg( "gnunote" );
531 return "<span id='pagestats'>{$s}</span>";
534 function lastModified()
536 global $wgLang, $wgArticle;
538 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
539 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
543 function logoText( $align = "" )
545 if ( "" != $align ) { $a = " align='{$align}'"; }
548 $mp = wfMsg( "mainpage" );
549 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
550 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
556 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
558 wfProfileIn( "Skin::quickBar" );
560 $s = "\n<div id='quickbar'>";
561 $s .= "\n" . $this->logoText() . "\n<hr>";
564 $s .= $this->mainPageLink()
565 . $sep . $this->specialLink( "recentchanges" )
566 . $sep . $this->specialLink( "randompage" );
567 if ($wgUser->getID()) {
568 $s.= $sep . $this->specialLink( "watchlist" ) ;
569 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
570 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
573 // only show watchlist link if logged in
574 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
576 $articleExists = $wgTitle->getArticleId();
577 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
579 if($wgOut->isArticle()) {
580 $s .= "<strong>" . $this->editThisPage() . "</strong>";
581 } else { # backlink to the article in edit or history mode
583 if($articleExists){ # no backlink if no article
584 $tns=$wgTitle->getNamespace();
587 $text = wfMsg("articlepage");
590 $text = wfMsg("viewtalkpage");
593 $text = wfMsg("userpage");
596 $text = wfMsg("viewtalkpage");
599 $text = wfMsg("wikipediapage");
602 $text = wfMsg("viewtalkpage");
605 $text = wfMsg("imagepage");
608 $text = wfMsg("viewtalkpage");
611 $text= wfMsg("articlepage");
614 $link = $wgTitle->getText();
615 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
616 $link = $nstext . ":" . $link ;
618 $s .= $this->makeLink($link, $text );
619 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
620 # we just throw in a "New page" text to tell the user that he's in edit mode,
621 # and to avoid messing with the separator that is prepended to the next item
622 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
628 watching could cause problems in edit mode:
629 if user edits article, then loads "watch this article" in background and then saves
630 article with "Watch this article" checkbox disabled, the article is transparently
631 unwatched. Therefore we do not show the "Watch this page" link in edit mode
633 if ( 0 != $wgUser->getID() && $articleExists) {
634 if($action!="edit" && $action!="history" &&
635 $action != "submit" )
636 {$s .= $sep . $this->watchThisPage(); }
637 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
639 if ( $wgUser->isSysop() and $articleExists ) {
640 $s .= $sep . $this->deleteThisPage() .
641 $sep . $this->protectThisPage();
643 $s .= $sep . $this->talkLink();
644 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
645 $s.=$sep . $this->whatLinksHere();
647 if($wgOut->isArticle()) {
648 $s .= $sep . $this->watchPageLinksLink();
651 if ( Namespace::getUser() == $wgTitle->getNamespace()
652 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
655 $id=User
::idFromName($wgTitle->getText());
656 $ip=User
::isIP($wgTitle->getText());
659 $s .= $sep . $this->userContribsLink();
661 if ( 0 != $wgUser->getID() ) {
662 if($id) { # can only email real users
663 $s .= $sep . $this->emailUserLink();
670 if ( 0 != $wgUser->getID() ) {
671 $s .= $this->specialLink( "upload" ) . $sep;
673 $s .= $this->specialLink( "specialpages" )
674 . $sep . $this->bugReportsLink();
681 function specialPagesList()
683 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
686 $validSP = $wgLang->getValidSpecialPages();
688 foreach ( $validSP as $name => $desc ) {
689 if ( "" == $desc ) { continue; }
692 if ( $wgUser->isSysop() )
694 $sysopSP = $wgLang->getSysopSpecialPages();
696 foreach ( $sysopSP as $name => $desc ) {
697 if ( "" == $desc ) { continue; }
701 if ( $wgUser->isDeveloper() )
703 $devSP = $wgLang->getDeveloperSpecialPages();
705 foreach ( $devSP as $name => $desc ) {
706 if ( "" == $desc ) { continue; }
711 $sp = wfMsg( "specialpages" );
712 $spp = $wgLang->specialPage( "Specialpages" );
714 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
715 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
716 $s .= "<select name=\"wpDropdown\">\n";
717 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
719 foreach ( $a as $name => $desc ) {
720 $p = $wgLang->specialPage( $name );
721 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
724 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
729 function mainPageLink()
731 $mp = wfMsg( "mainpage" );
732 $s = $this->makeKnownLink( $mp, $mp );
736 function copyrightLink()
738 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
739 wfMsg( "copyrightpagename" ) );
745 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
746 wfMsg( "aboutwikipedia" ) );
750 function editThisPage()
752 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
754 if ( ! $wgOut->isArticle() ||
$diff ) {
755 $s = wfMsg( "protectedpage" );
756 } else if ( $wgTitle->userCanEdit() ) {
757 $n = $wgTitle->getPrefixedText();
758 $t = wfMsg( "editthispage" );
761 if ( $redirect ) { $red = "&redirect={$redirect}"; }
762 if ( $oldid && ! isset( $diff ) ) {
763 $oid = "&oldid={$oldid}";
765 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
767 $s = wfMsg( "protectedpage" );
772 function deleteThisPage()
774 global $wgUser, $wgOut, $wgTitle, $diff;
776 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
777 $n = $wgTitle->getPrefixedText();
778 $t = wfMsg( "deletethispage" );
780 $s = $this->makeKnownLink( $n, $t, "action=delete" );
782 $s = wfMsg( "error" );
787 function protectThisPage()
789 global $wgUser, $wgOut, $wgTitle, $diff;
791 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
792 $n = $wgTitle->getPrefixedText();
794 if ( $wgTitle->isProtected() ) {
795 $t = wfMsg( "unprotectthispage" );
796 $q = "action=unprotect";
798 $t = wfMsg( "protectthispage" );
799 $q = "action=protect";
801 $s = $this->makeKnownLink( $n, $t, $q );
803 $s = wfMsg( "error" );
808 function watchThisPage()
810 global $wgUser, $wgOut, $wgTitle, $diff;
812 if ( $wgOut->isArticle() && ( ! $diff ) ) {
813 $n = $wgTitle->getPrefixedText();
815 if ( $wgTitle->userIsWatching() ) {
816 $t = wfMsg( "unwatchthispage" );
817 $q = "action=unwatch";
819 $t = wfMsg( "watchthispage" );
822 $s = $this->makeKnownLink( $n, $t, $q );
824 $s = wfMsg( "notanarticle" );
829 function moveThisPage()
831 global $wgTitle, $wgLang;
833 if ( $wgTitle->userCanEdit() ) {
834 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
835 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
836 } // no message if page is protected - would be redundant
840 function historyLink()
844 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
845 wfMsg( "history" ), "action=history" );
849 function whatLinksHere()
851 global $wgTitle, $wgLang;
853 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
854 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
858 function userContribsLink()
860 global $wgTitle, $wgLang;
862 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
863 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
867 function emailUserLink()
869 global $wgTitle, $wgLang;
871 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
872 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
876 function watchPageLinksLink()
878 global $wgOut, $wgTitle, $wgLang;
880 if ( ! $wgOut->isArticle() ) {
881 $s = "(" . wfMsg( "notanarticle" ) . ")";
883 $s = $this->makeKnownLink( $wgLang->specialPage(
884 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
885 "target=" . $wgTitle->getPrefixedURL() );
890 function otherLanguages()
892 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
894 $a = $wgOut->getLanguageLinks();
895 if ( 0 == count( $a ) ) {
896 if ( !$wgUseNewInterlanguage ) return "";
897 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
898 if ( $ns != 0 AND $ns != 1 ) return "" ;
900 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
901 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
902 wfMsg( "intl" ) , $x );
905 if ( !$wgUseNewInterlanguage ) {
906 $s = wfMsg( "otherlanguages" ) . ": ";
908 global $wgLanguageCode ;
909 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
910 $x .= "&xl=".$wgLanguageCode ;
911 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
912 wfMsg( "otherlanguages" ) , $x ) . ": " ;
916 foreach( $a as $l ) {
917 if ( ! $first ) { $s .= " | "; }
920 $nt = Title
::newFromText( $l );
921 $url = $nt->getFullURL();
922 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
924 if ( "" == $text ) { $text = $l; }
925 $style = $this->getExternalLinkAttributes( $l, $text );
926 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
931 function bugReportsLink()
933 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
934 wfMsg( "bugreports" ) );
941 $t1 = Title
::newFromText( date( "F j" ) );
942 $t2 = Title
::newFromText( date( "Y" ) );
944 $wgLinkCache->suspend();
945 $id = $t1->getArticleID();
946 $wgLinkCache->resume();
949 $s = $this->makeBrokenLink( $t1->getText() );
951 $s = $this->makeKnownLink( $t1->getText() );
955 $wgLinkCache->suspend();
956 $id = $t2->getArticleID();
957 $wgLinkCache->resume();
960 $s .= $this->makeBrokenLink( $t2->getText() );
962 $s .= $this->makeKnownLink( $t2->getText() );
969 global $wgLang, $wgTitle, $wgLinkCache;
971 $tns = $wgTitle->getNamespace();
972 if ( -1 == $tns ) { return ""; }
974 $pn = $wgTitle->getText();
975 $tp = wfMsg( "talkpage" );
976 if ( Namespace::isTalk( $tns ) ) {
977 $lns = Namespace::getSubject( $tns );
980 $text = wfMsg("articlepage");
983 $text = wfMsg("userpage");
986 $text = wfMsg("wikipediapage");
989 $text = wfMsg("imagepage");
992 $text= wfMsg("articlepage");
996 $lns = Namespace::getTalk( $tns );
999 $n = $wgLang->getNsText( $lns );
1000 if ( "" == $n ) { $link = $pn; }
1001 else { $link = "{$n}:{$pn}"; }
1003 $wgLinkCache->suspend();
1004 $s = $this->makeLink( $link, $text );
1005 $wgLinkCache->resume();
1010 # After all the page content is transformed into HTML, it makes
1011 # a final pass through here for things like table backgrounds.
1013 function transformContent( $text )
1018 # Note: This function MUST call getArticleID() on the link,
1019 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1021 function makeLink( $title, $text= "", $query = "", $trail = "" )
1023 global $wgOut, $wgUser;
1025 $nt = Title
::newFromText( $title );
1027 if ( $nt->isExternal() ) {
1028 $u = $nt->getFullURL();
1029 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1030 $style = $this->getExternalLinkAttributes( $link, $text );
1033 if ( "" != $trail ) {
1034 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1039 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1041 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1042 return $this->makeKnownLink( $title, $text, $query, $trail );
1044 if ( ( -1 == $nt->getNamespace() ) ||
1045 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1046 return $this->makeKnownLink( $title, $text, $query, $trail );
1048 $aid = $nt->getArticleID() ;
1050 return $this->makeBrokenLink( $title, $text, $query, $trail );
1052 $threshold = $wgUser->getOption("stubthreshold") ;
1053 if ( $threshold > 0 ) {
1054 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1056 if ( wfNumRows( $res ) > 0 ) {
1057 $s = wfFetchObject( $res );
1059 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1060 $size = $threshold*2 ; # Really big
1061 wfFreeResult( $res );
1062 } else $size = $threshold*2 ; # Really big
1065 if ( $size < $threshold )
1066 return $this->makeStubLink( $title, $text, $query, $trail );
1067 return $this->makeKnownLink( $title, $text, $query, $trail );
1071 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1073 global $wgOut, $wgTitle;
1075 $nt = Title
::newFromText( $title );
1076 $link = $nt->getPrefixedURL();
1078 if ( "" == $link ) {
1080 if ( "" == $text ) { $text = $nt->getFragment(); }
1082 $u = wfLocalUrlE( $link, $query );
1084 if ( "" != $nt->getFragment() ) {
1085 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1087 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1088 $style = $this->getInternalLinkAttributes( $link, $text );
1091 if ( "" != $trail ) {
1092 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1097 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1101 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1103 global $wgOut, $wgUser;
1105 $nt = Title
::newFromText( $title );
1106 $link = $nt->getPrefixedURL();
1108 if ( "" == $query ) { $q = "action=edit"; }
1109 else { $q = "action=edit&{$query}"; }
1110 $u = wfLocalUrlE( $link, $q );
1112 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1113 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1116 if ( "" != $trail ) {
1117 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1122 if ( $wgOut->isPrintable() ||
1123 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1124 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1126 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1131 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1133 global $wgOut, $wgUser;
1135 $nt = Title
::newFromText( $title );
1136 $link = $nt->getPrefixedURL();
1138 $u = wfLocalUrlE( $link, $query );
1140 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1141 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1144 if ( "" != $trail ) {
1145 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1150 if ( $wgOut->isPrintable() ||
1151 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1152 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1154 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1159 function fnamePart( $url )
1161 $basename = strrchr( $url, "/" );
1162 if ( false === $basename ) { $basename = $url; }
1163 else { $basename = substr( $basename, 1 ); }
1164 return wfEscapeHTML( $basename );
1167 function makeImage( $url, $alt = "" )
1171 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1172 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1176 function makeImageLink( $name, $url, $alt = "" )
1178 global $wgOut, $wgTitle, $wgLang;
1180 $nt = Title
::newFromText( $wgLang->getNsText(
1181 Namespace::getImage() ) . ":{$name}" );
1182 $link = $nt->getPrefixedURL();
1183 if ( "" == $alt ) { $alt = $name; }
1185 $u = wfLocalUrlE( $link );
1186 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1187 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1191 function makeMediaLink( $name, $url, $alt = "" )
1193 global $wgOut, $wgTitle;
1195 if ( "" == $alt ) { $alt = $name; }
1196 $u = wfEscapeHTML( $url );
1197 $s = "<a href=\"{$u}\" class='media' title=\"{$alt}\">{$alt}</a>";
1201 function specialLink( $name, $key = "" )
1205 if ( "" == $key ) { $key = strtolower( $name ); }
1206 $pn = $wgLang->ucfirst( $name );
1207 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1211 # Called by history lists and recent changes
1214 function beginRecentChangesList()
1216 $rc_cache = array() ;
1218 $this->lastdate
= "";
1222 function beginHistoryList()
1224 $this->lastdate
= $this->lastline
= "";
1225 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1229 function beginImageHistoryList()
1231 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1232 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1236 function endRecentChangesList()
1238 $s = $this->recentChangesBlock() ;
1243 function endHistoryList()
1245 $last = wfMsg( "last" );
1247 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1252 function endImageHistoryList()
1258 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1262 $artname = Title
::makeName( $ns, $ttl );
1263 $last = wfMsg( "last" );
1264 $cur = wfMsg( "cur" );
1265 $cr = wfMsg( "currentrev" );
1267 if ( $oid && $this->lastline
) {
1268 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1269 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1273 $dt = $wgLang->timeanddate( $ts, true );
1275 if ( $oid ) { $q = "oldid={$oid}"; }
1277 $link = $this->makeKnownLink( $artname, $dt, $q );
1280 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1281 $ut, "target=" . $ut );
1282 } else { $ul = $this->makeLink( $wgLang->getNsText(
1283 Namespace::getUser() ) . ":{$ut}", $ut ); }
1287 $curlink = $this->makeKnownLink( $artname, $cur,
1288 "diff=0&oldid={$oid}" );
1292 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1294 $M = wfMsg( "minoreditletter" );
1295 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1296 $s .= " {$link} . . {$ul}";
1298 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1301 $this->lastline
= $s;
1305 function recentChangesBlockLine ( $y ) {
1306 global $wgUploadPath ;
1308 $M = wfMsg( "minoreditletter" );
1309 $N = wfMsg( "newpageletter" );
1311 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1313 if ( $y->isnew
) $r .= $N ;
1314 else $r .= " " ;
1315 if ( $y->isminor
) $r .= $M ;
1316 else $r .= " " ;
1317 $r .= " ".$y->timestamp
." " ;
1320 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1326 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1328 $r .= ") . . ".$y->userlink
;
1329 $r .= $y->usertalklink
;
1330 if ( $y->usercomment
!= "" )
1331 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1336 function recentChangesBlockGroup ( $y ) {
1337 global $wgUploadPath ;
1340 $M = wfMsg( "minoreditletter" );
1341 $N = wfMsg( "newpageletter" );
1343 $userlinks = array () ;
1344 foreach ( $y AS $x ) {
1345 $oldid = $x->diffid
;
1346 if ( $x->isnew
) $isnew = true ;
1348 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1352 krsort ( $userlinks ) ;
1353 asort ( $userlinks ) ;
1355 $u = array_keys ( $userlinks ) ;
1356 foreach ( $u as $x ) {
1358 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1359 array_push ( $users , $z ) ;
1361 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1364 $e = array_shift ( $e ) ;
1367 $rci = "RCI{$this->rccc}" ;
1368 $rcl = "RCL{$this->rccc}" ;
1369 $rcm = "RCM{$this->rccc}" ;
1370 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1371 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1372 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1378 if ( $isnew ) $r .= $N ;
1379 else $r .= " " ;
1380 $r .= " " ; # Minor
1381 $r .= " ".$e->timestamp
." " ;
1385 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1389 $r .= " (".count($y)." " ;
1390 if ( $isnew ) $r .= wfMsg("changes");
1391 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1393 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1401 $r .= "<div id='{$rci}' style='display:none'>" ;
1402 foreach ( $y AS $x )
1404 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1405 $r .= "<tt> " ;
1406 if ( $x->isnew
) $r .= $N ;
1407 else $r .= " " ;
1408 if ( $x->isminor
) $r .= $M ;
1409 else $r .= " " ;
1413 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1414 if ( $x->islog
) $link = $x->timestamp
;
1415 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1416 $link = "<tt>{$link}</tt>" ;
1423 $r .= $x->lastlink
;
1424 $r .= ") . . ".$x->userlink
;
1425 $r .= $x->usertalklink
;
1426 if ( $x->usercomment
!= "" )
1427 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1436 function recentChangesBlock ()
1438 global $wgUploadPath ;
1439 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1440 $k = array_keys ( $this->rc_cache
) ;
1441 foreach ( $k AS $x )
1443 $y = $this->rc_cache
[$x] ;
1444 if ( count ( $y ) < 2 ) {
1445 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1447 $r .= $this->recentChangesBlockGroup ( $y ) ;
1451 return "<div align=left>{$r}</div>" ;
1454 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1457 $usenew = $wgUser->getOption( "usenewrc" );
1459 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1461 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1465 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1467 global $wgTitle, $wgLang, $wgUser;
1469 $d = $wgLang->date( $ts, true);
1471 if ( $d != $this->lastdate
) {
1472 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1473 $s .= "<h4>{$d}</h4>\n<ul>";
1474 $this->lastdate
= $d;
1476 $h = $wgLang->time( $ts, true );
1477 $t = Title
::makeName( $ns, $ttl );
1478 $clink = $this->makeKnownLink( $t , "" );
1479 $nt = Title
::newFromText( $t );
1482 $clink = "<strong>{$clink}</strong>";
1484 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1485 if ( $isnew ||
$nt->isLog() ) {
1486 $dlink = wfMsg( "diff" );
1488 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1489 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1492 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1493 $ut, "target=" . $ut );
1494 } else { $ul = $this->makeLink( $wgLang->getNsText(
1495 Namespace::getUser() ) . ":{$ut}", $ut ); }
1497 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1498 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1499 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1500 $cr = wfMsg( "currentrev" );
1502 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1503 $M = wfMsg( "minoreditletter" );
1504 $N = wfMsg( "newpageletter" );
1505 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1506 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1507 $s .= " {$clink}; {$h} . . {$ul}";
1510 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1511 $blink = $this->makeKnownLink( $wgLang->specialPage(
1512 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1518 $utl = "({$utl} | {$blink})";
1522 if ( "" != $c && "*" != $c ) {
1523 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1530 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1532 global $wgTitle, $wgLang, $wgUser;
1534 $rc = new RecentChangesClass
;
1536 $d = $wgLang->date( $ts, true);
1539 if ( $d != $this->lastdate
) {
1540 $ret = $this->recentChangesBlock () ;
1541 $this->rc_cache
= array() ;
1542 $ret .= "<h4>{$d}</h4>\n";
1543 $this->lastdate
= $d;
1545 $h = $wgLang->time( $ts, true );
1546 $t = Title
::makeName( $ns, $ttl );
1547 $clink = $this->makeKnownLink( $t, "" ) ;
1548 if ( $oldid == 0 ) $c2link = $clink ;
1549 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1550 $nt = Title
::newFromText( $t );
1552 $rc->timestamp
= $h ;
1553 $rc->oldid
= $oldid ;
1554 $rc->diffid
= $diffid ;
1555 $rc->watched
= $watched ;
1556 $rc->isnew
= $isnew ;
1557 $rc->isminor
= $isminor ;
1558 $rc->secureName
= $t ;
1559 $rc->displayName
= $nt ;
1560 $rc->link
= $clink ;
1561 $rc->usercomment
= $c ;
1562 $rc->islog
= $nt->isLog() ;
1564 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1565 $dlink = wfMsg( "cur" );
1567 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1568 "diff=0&oldid={$oldid}" );
1571 if ( $diffid == 0 ||
$nt->isLog() ) {
1572 $plink = wfMsg( "last" );
1574 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1575 "diff={$oldid}&oldid={$diffid}" );
1579 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1580 $ut, "target=" . $ut );
1581 } else { $ul = $this->makeLink( $wgLang->getNsText(
1582 Namespace::getUser() ) . ":{$ut}", $ut ); }
1584 $rc->userlink
= $ul ;
1585 $rc->lastlink
= $plink ;
1586 $rc->curlink
= $dlink ;
1588 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1589 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1590 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1592 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1593 $blink = $this->makeKnownLink( $wgLang->specialPage(
1594 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1595 $rc->usertalklink
= " ({$utl} | {$blink})";
1597 $rc->usertalklink
=" ({$utl})";
1600 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1601 array_push ( $this->rc_cache
[$t] , $rc ) ;
1606 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1608 global $wgUser, $wgLang, $wgTitle;
1610 $dt = $wgLang->timeanddate( $ts, true );
1611 $del = wfMsg( "deleteimg" );
1612 $cur = wfMsg( "cur" );
1615 $url = wfImageUrl( $img );
1617 if ( $wgUser->isSysop() ) {
1618 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1620 $style = $this->getInternalLinkAttributes( $link, $del );
1622 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1627 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1628 if( $wgUser->getID() != 0 ) {
1629 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1630 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1631 urlencode( $img ) );
1632 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1633 $del, "action=delete&oldimage=" . urlencode( $img ) );
1635 # Having live active links for non-logged in users
1636 # means that bots and spiders crawling our site can
1637 # inadvertently change content. Baaaad idea.
1638 $rlink = wfMsg( "revertimg" );
1642 if ( 0 == $u ) { $ul = $ut; }
1643 else { $ul = $this->makeLink( $wgLang->getNsText(
1644 Namespace::getUser() ) . ":{$ut}", $ut ); }
1646 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1647 $style = $this->getInternalLinkAttributes( $url, $dt );
1649 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1650 . " . . {$ul} ({$nb})";
1652 if ( "" != $c && "*" != $c ) {
1653 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1660 include_once( "SkinStandard.php" );
1661 include_once( "SkinNostalgia.php" );
1662 include_once( "SkinCologneBlue.php" );