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 # For some odd PHP bug, this function can't be part of a class
13 function getCategories ()
15 global $wgOut , $wgTitle , $wgUseCategoryMagic , $wgUser ;
16 if ( !isset ( $wgUseCategoryMagic ) ||
!$wgUseCategoryMagic ) return "" ;
17 if ( count ( $wgOut->mCategoryLinks
) == 0 ) return "" ;
18 if ( !$wgOut->isArticle() ) return "" ;
19 $sk = $wgUser->getSkin() ;
22 $s .= $sk->makeKnownLink ( "Special:Categories" , "Categories" , "article=".$wgTitle->getDBkey() ) ;
23 $t = implode ( " | " , $wgOut->mCategoryLinks
) ;
24 if ( $t != "" ) $s .= " : " ;
30 class RecentChangesClass
{
31 var $secureName , $displayName , $link , $namespace ;
32 var $oldid , $diffid , $timestamp , $curlink , $lastlink , $usertalklink , $versionlink ;
33 var $usercomment , $userlink ;
34 var $isminor , $isnew , $watched , $islog ;
39 /* private */ var $lastdate, $lastline;
41 var $rc_cache ; # Cache for Enhanced Recent Changes
42 var $rccc ; # Recent Changes Cache Counter for visibility toggle
49 function getSkinNames()
51 global $wgValidSkinNames;
52 return $wgValidSkinNames;
55 function getStylesheet()
57 return "wikistandard.css";
62 global $wgOut, $wgUser;
64 if ( $wgOut->isQuickbarSupressed() ) { return 0; }
65 $q = $wgUser->getOption( "quickbar" );
66 if ( "" == $q ) { $q = 0; }
72 global $wgOut, $wgStyleSheetPath;
73 wfProfileIn( "Skin::initPage" );
75 $wgOut->addLink( "shortcut icon", "", "/favicon.ico" );
76 if ( $wgOut->isPrintable() ) { $ss = "wikiprintable.css"; }
77 else { $ss = $this->getStylesheet(); }
78 $wgOut->addLink( "stylesheet", "", "{$wgStyleSheetPath}/{$ss}" );
82 function getHeadScripts() {
83 global $wgStyleSheetPath;
84 $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
88 function getUserStyles()
90 $s = "<style type='text/css' media='screen'><!--\n";
91 $s .= $this->doGetUserStyles();
92 $s .= "//--></style>\n";
96 function doGetUserStyles()
101 if ( 1 == $wgUser->getOption( "underline" ) ) {
102 # Don't override browser settings
105 $s .= "a.stub, a.new, a.internal, a.external { " .
106 "text-decoration: none; }\n";
108 if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
109 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
111 if ( 1 == $wgUser->getOption( "justify" ) ) {
112 $s .= "#article { text-align: justify; }\n";
117 function getBodyOptions()
119 global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
121 if ( 0 != $wgTitle->getNamespace() ) {
122 $a = array( "bgcolor" => "#FFFFDD" );
124 else $a = array( "bgcolor" => "#FFFFFF" );
125 if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
127 (!$wgTitle->isProtected() ||
$wgUser->isSysop())
130 $n = $wgTitle->getPrefixedURL();
131 $t = wfMsg( "editthispage" );
133 if ( $redirect ) { $red = "&redirect={$redirect}"; }
134 if ( $oldid && ! isset( $diff ) ) {
135 $oid = "&oldid={$oldid}";
137 $s = wfLocalUrlE($n,"action=edit{$oid}{$red}");
138 $s = "document.location = \"" .$s ."\";";
139 $a +
= array ("ondblclick" => $s);
142 if($action=="edit") { # set focus in edit box
143 $foc = "document.editform.wpTextbox1.focus()";
145 $a['onload'] .= ";$foc";
153 function getExternalLinkAttributes( $link, $text )
155 global $wgUser, $wgOut, $wgLang;
157 $link = urldecode( $link );
158 $link = $wgLang->checkTitleEncoding( $link );
159 $link = str_replace( "_", " ", $link );
160 $link = wfEscapeHTML( $link );
162 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
163 else { $r = " class='external'"; }
165 if ( 1 == $wgUser->getOption( "hover" ) ) {
166 $r .= " title=\"{$link}\"";
171 function getInternalLinkAttributes( $link, $text, $broken = false )
173 global $wgUser, $wgOut;
175 $link = urldecode( $link );
176 $link = str_replace( "_", " ", $link );
177 $link = wfEscapeHTML( $link );
179 if ( $wgOut->isPrintable() ) { $r = " class='printable'"; }
180 else if ( $broken == "stub" ) { $r = " class='stub'"; }
181 else if ( $broken == "yes" ) { $r = " class='new'"; }
182 else { $r = " class='internal'"; }
184 if ( 1 == $wgUser->getOption( "hover" ) ) {
185 $r .= " title=\"{$link}\"";
196 # This will be called immediately after the <body> tag. Split into
197 # two functions to make it easier to subclass.
199 function beforeContent()
201 global $wgUser, $wgOut;
203 if ( $wgOut->isPrintable() ) {
204 $s = $this->pageTitle() . $this->pageSubtitle() . "\n";
205 $s .= "\n<div class='bodytext'>";
208 return $this->doBeforeContent();
211 function doBeforeContent()
213 global $wgUser, $wgOut, $wgTitle, $wgLang;
214 wfProfileIn( "Skin::doBeforeContent" );
217 $qb = $this->qbSetting();
219 if( $langlinks = $this->otherLanguages() ) {
225 $borderhack = "class='top'";
228 $s .= "\n<div id='content'>\n<div id='topbar'>" .
229 "<table width='98%' border=0 cellspacing=0><tr>";
232 $left = ($qb == 1 ||
$qb == 3);
233 if($wgLang->isRTL()) $left = !$left;
236 $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>" .
237 $this->logoText() . "</td>";
239 $s .= $this->getQuickbarCompensator( $rows );
241 $l = $wgLang->isRTL() ?
"right" : "left";
242 $s .= "<td {$borderhack} align='$l' valign='top'>";
244 $s .= $this->topLinks() ;
245 $s .= "<p class='subtitle'>" . $this->pageTitleLinks();
247 $r = $wgLang->isRTL() ?
"left" : "right";
248 $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap>";
249 $s .= $this->nameAndLogin();
250 $s .= "\n<br>" . $this->searchForm() . "</td>";
253 $s .= "</tr>\n<tr><td class='top' colspan=\"2\">$langlinks</td>";
256 if ( $shove && !$left ) { # Right
257 $s .= $this->getQuickbarCompensator( $rows );
259 $s .= "</tr></table>\n</div>\n";
260 $s .= "\n<div id='article'>";
262 $s .= $this->pageTitle();
263 $s .= $this->pageSubtitle() ;
264 $s .= getCategories(); // For some odd reason, zhis can't be a function of the object
270 function getQuickbarCompensator( $rows = 1 )
272 return "<td width='152' rowspan='{$rows}'> </td>";
275 # This gets called immediately before the </body> tag.
277 function afterContent()
279 global $wgUser, $wgOut, $wgServer, $HTTP_SERVER_VARS;
281 if ( $wgOut->isPrintable() ) {
284 $u = $wgServer . $HTTP_SERVER_VARS['REQUEST_URI'];
285 $u = preg_replace( "/[?&]printable=yes/", "", $u );
286 $rf = str_replace( "$1", $u, wfMsg( "retrievedfrom" ) );
288 if ( $wgOut->isArticle() ) {
289 $lm = "<br>" . $this->lastModified();
292 $s .= "<p><em>{$rf}{$lm}</em>\n";
295 return $this->doAfterContent();
298 function doAfterContent()
300 global $wgUser, $wgOut, $wgLang;
301 wfProfileIn( "Skin::doAfterContent" );
303 $s = "\n</div><br clear=all>\n";
305 $s .= "\n<div id='footer'>";
306 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
308 $qb = $this->qbSetting();
310 $left = ($qb == 1 ||
$qb == 3);
311 if($wgLang->isRTL()) $left = !$left;
313 if ( $shove && $left ) { # Left
314 $s .= $this->getQuickbarCompensator();
316 $l = $wgLang->isRTL() ?
"right" : "left";
317 $s .= "<td class='bottom' align='$l' valign='top'>";
319 $s .= $this->bottomLinks();
320 $s .= "\n<br>" . $this->mainPageLink()
321 . " | " . $this->aboutLink()
322 . " | " . $this->specialLink( "recentchanges" )
323 . " | " . $this->searchForm()
324 . "<br>" . $this->pageStats();
327 if ( $shove && !$left ) { # Right
328 $s .= $this->getQuickbarCompensator();
330 $s .= "</tr></table>\n</div>\n</div>\n";
332 if ( 0 != $qb ) { $s .= $this->quickBar(); }
337 function pageTitleLinks()
339 global $wgOut, $wgTitle, $oldid, $action, $diff, $wgUser, $wgLang;
341 $s = $this->printableLink();
343 if ( $wgOut->isArticle() ) {
344 if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
345 $name = $wgTitle->getDBkey();
346 $link = wfEscapeHTML( wfImageUrl( $name ) );
347 $style = $this->getInternalLinkAttributes( $link, $name );
348 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
351 if ( "history" == $action ||
isset( $diff ) ||
isset( $oldid ) ) {
352 $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(),
353 wfMsg( "currentrev" ) );
356 if ( $wgUser->getNewtalk() ) {
357 # do not show "You have new messages" text when we are viewing our
360 if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
361 $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
362 $n =$wgUser->getName();
363 $tl = $this->makeKnownLink( $wgLang->getNsText(
364 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
365 wfMsg("newmessageslink") );
366 $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
372 function printableLink()
374 global $wgOut, $wgTitle, $oldid, $action;
376 if ( "history" == $action ) { $q = "action=history&"; }
379 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
380 WfMsg( "printableversion" ), "{$q}printable=yes" );
386 global $wgOut, $wgTitle;
388 $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
392 function pageSubtitle()
394 global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
396 $sub = $wgOut->getSubtitle();
397 if ( "" == $sub ) { $sub = wfMsg( "fromwikipedia" ); }
398 if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
399 $ptext=$wgTitle->getPrefixedText();
400 if(preg_match("/\//",$ptext)) {
401 $sub.="</p><p class='subpages'>";
402 $links=explode("/",$ptext);
405 foreach($links as $link) {
407 if ($c<count($links)) {
409 $getlink=$this->makeLink($growinglink,$link);
410 if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
423 $s = "<p class='subtitle'>{$sub}\n";
427 function nameAndLogin()
429 global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader;
431 $li = $wgLang->specialPage( "Userlogin" );
432 $lo = $wgLang->specialPage( "Userlogout" );
435 if ( 0 == $wgUser->getID() ) {
436 if( $wgShowIPinHeader ) {
437 $n = getenv( "REMOTE_ADDR" );
439 $tl = $this->makeKnownLink( $wgLang->getNsText(
440 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
441 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
443 $s .= $n . " (".$tl.")";
445 $s .= wfMsg("notloggedin");
448 $rt = $wgTitle->getPrefixedURL();
449 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
451 } else { $q = "returnto={$rt}"; }
453 $s .= "\n<br>" . $this->makeKnownLink( $li,
454 wfMsg( "login" ), $q );
456 $n = $wgUser->getName();
457 $rt = $wgTitle->getPrefixedURL();
458 $tl = $this->makeKnownLink( $wgLang->getNsText(
459 Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
460 $wgLang->getNsText( Namespace::getTalk( 0 ) ) );
464 $s .= $this->makeKnownLink( $wgLang->getNsText(
465 Namespace::getUser() ) . ":{$n}", $n ) . "{$tl}<br>" .
466 $this->makeKnownLink( $lo, wfMsg( "logout" ),
467 "returnto={$rt}" ) . " | " .
468 $this->specialLink( "preferences" );
470 $s .= " | " . $this->makeKnownLink( wfMsg( "helppage" ),
476 function searchForm()
480 $s = "<form name='search' class='inline' method=get action=\""
481 . wfLocalUrl( "" ) . "\">"
482 . "<input type=text name=\"search\" size=19 value=\""
483 . htmlspecialchars(substr($search,0,256)) . "\">\n"
484 . "<input type=submit name=\"go\" value=\"" . wfMsg ("go") . "\"> "
485 . "<input type=submit value=\"" . wfMsg ("search") . "\"></form>";
495 $s = $this->mainPageLink() . $sep
496 . $this->specialLink( "recentchanges" );
498 if ( $wgOut->isArticle() ) {
499 $s .= $sep . $this->editThisPage()
500 . $sep . $this->historyLink();
502 $s .= $sep . $this->specialPagesList();
507 function bottomLinks()
509 global $wgOut, $wgUser, $wgTitle;
513 if ( $wgOut->isArticle() ) {
514 $s .= "<strong>" . $this->editThisPage() . "</strong>";
515 if ( 0 != $wgUser->getID() ) {
516 $s .= $sep . $this->watchThisPage();
518 $s .= $sep . $this->talkLink()
519 . $sep . $this->historyLink()
520 . $sep . $this->whatLinksHere()
521 . $sep . $this->watchPageLinksLink();
523 if ( $wgTitle->getNamespace() == Namespace::getUser()
524 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
527 $id=User
::idFromName($wgTitle->getText());
528 $ip=User
::isIP($wgTitle->getText());
530 if($id ||
$ip) { # both anons and non-anons have contri list
531 $s .= $sep . $this->userContribsLink();
533 if ( 0 != $wgUser->getID() ) { # show only to signed in users
534 if($id) { # can only email non-anons
535 $s .= $sep . $this->emailUserLink();
539 if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
540 $s .= "\n<br>" . $this->deleteThisPage() .
541 $sep . $this->protectThisPage() .
542 $sep . $this->moveThisPage();
544 $s .= "<br>\n" . $this->otherLanguages();
551 global $wgOut, $wgLang, $wgArticle;
552 global $oldid, $diff, $wgDisableCounters;
554 if ( ! $wgOut->isArticle() ) { return ""; }
555 if ( isset( $oldid ) ||
isset( $diff ) ) { return ""; }
556 if ( 0 == $wgArticle->getID() ) { return ""; }
558 if ( $wgDisableCounters ) {
561 $count = $wgArticle->getCount();
562 $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
564 $s .= $this->lastModified();
565 $s .= " " . wfMsg( "gnunote" );
566 return "<span id='pagestats'>{$s}</span>";
569 function lastModified()
571 global $wgLang, $wgArticle;
573 $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
574 $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
578 function logoText( $align = "" )
580 if ( "" != $align ) { $a = " align='{$align}'"; }
583 $mp = wfMsg( "mainpage" );
584 $s = "<a href=\"" . wfLocalUrlE( $mp ) . "\"><img{$a} border=0 src=\""
585 . $this->getLogo() . "\" alt=\"" . "[{$mp}]\"></a>";
591 global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
593 wfProfileIn( "Skin::quickBar" );
595 $s = "\n<div id='quickbar'>";
596 $s .= "\n" . $this->logoText() . "\n<hr>";
599 $s .= $this->mainPageLink()
600 . $sep . $this->specialLink( "recentchanges" )
601 . $sep . $this->specialLink( "randompage" );
602 if ($wgUser->getID()) {
603 $s.= $sep . $this->specialLink( "watchlist" ) ;
604 $s .= $sep .$this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
605 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) );
608 // only show watchlist link if logged in
609 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
611 $articleExists = $wgTitle->getArticleId();
612 if ( $wgOut->isArticle() ||
$action =="edit" ||
$action =="history" ||
$wpPreview) {
614 if($wgOut->isArticle()) {
615 $s .= "<strong>" . $this->editThisPage() . "</strong>";
616 } else { # backlink to the article in edit or history mode
618 if($articleExists){ # no backlink if no article
619 $tns=$wgTitle->getNamespace();
622 $text = wfMsg("articlepage");
625 $text = wfMsg("viewtalkpage");
628 $text = wfMsg("userpage");
631 $text = wfMsg("viewtalkpage");
634 $text = wfMsg("wikipediapage");
637 $text = wfMsg("viewtalkpage");
640 $text = wfMsg("imagepage");
643 $text = wfMsg("viewtalkpage");
646 $text= wfMsg("articlepage");
649 $link = $wgTitle->getText();
650 if ($nstext = $wgLang->getNsText($tns) ) { # add namespace if necessary
651 $link = $nstext . ":" . $link ;
653 $s .= $this->makeLink($link, $text );
654 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
655 # we just throw in a "New page" text to tell the user that he's in edit mode,
656 # and to avoid messing with the separator that is prepended to the next item
657 $s .= "<strong>" . wfMsg("newpage") . "</strong>";
663 watching could cause problems in edit mode:
664 if user edits article, then loads "watch this article" in background and then saves
665 article with "Watch this article" checkbox disabled, the article is transparently
666 unwatched. Therefore we do not show the "Watch this page" link in edit mode
668 if ( 0 != $wgUser->getID() && $articleExists) {
669 if($action!="edit" && $action!="history" &&
670 $action != "submit" )
671 {$s .= $sep . $this->watchThisPage(); }
672 if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage();
674 if ( $wgUser->isSysop() and $articleExists ) {
675 $s .= $sep . $this->deleteThisPage() .
676 $sep . $this->protectThisPage();
678 $s .= $sep . $this->talkLink();
679 if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();}
680 $s.=$sep . $this->whatLinksHere();
682 if($wgOut->isArticle()) {
683 $s .= $sep . $this->watchPageLinksLink();
686 if ( Namespace::getUser() == $wgTitle->getNamespace()
687 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
690 $id=User
::idFromName($wgTitle->getText());
691 $ip=User
::isIP($wgTitle->getText());
694 $s .= $sep . $this->userContribsLink();
696 if ( 0 != $wgUser->getID() ) {
697 if($id) { # can only email real users
698 $s .= $sep . $this->emailUserLink();
705 if ( 0 != $wgUser->getID() ) {
706 $s .= $this->specialLink( "upload" ) . $sep;
708 $s .= $this->specialLink( "specialpages" )
709 . $sep . $this->bugReportsLink();
716 function specialPagesList()
718 global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
721 $validSP = $wgLang->getValidSpecialPages();
723 foreach ( $validSP as $name => $desc ) {
724 if ( "" == $desc ) { continue; }
727 if ( $wgUser->isSysop() )
729 $sysopSP = $wgLang->getSysopSpecialPages();
731 foreach ( $sysopSP as $name => $desc ) {
732 if ( "" == $desc ) { continue; }
736 if ( $wgUser->isDeveloper() )
738 $devSP = $wgLang->getDeveloperSpecialPages();
740 foreach ( $devSP as $name => $desc ) {
741 if ( "" == $desc ) { continue; }
746 $sp = wfMsg( "specialpages" );
747 $spp = $wgLang->specialPage( "Specialpages" );
749 $s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
750 "action=\"{$wgServer}{$wgRedirectScript}\">\n";
751 $s .= "<select name=\"wpDropdown\">\n";
752 $s .= "<option value=\"{$spp}\">{$sp}</option>\n";
754 foreach ( $a as $name => $desc ) {
755 $p = $wgLang->specialPage( $name );
756 $s .= "<option value=\"{$p}\">{$desc}</option>\n";
759 $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
764 function mainPageLink()
766 $mp = wfMsg( "mainpage" );
767 $s = $this->makeKnownLink( $mp, $mp );
771 function copyrightLink()
773 $s = $this->makeKnownLink( wfMsg( "copyrightpage" ),
774 wfMsg( "copyrightpagename" ) );
780 $s = $this->makeKnownLink( wfMsg( "aboutpage" ),
781 wfMsg( "aboutwikipedia" ) );
785 function editThisPage()
787 global $wgOut, $wgTitle, $oldid, $redirect, $diff;
789 if ( ! $wgOut->isArticle() ||
$diff ) {
790 $s = wfMsg( "protectedpage" );
791 } else if ( $wgTitle->userCanEdit() ) {
792 $n = $wgTitle->getPrefixedText();
793 $t = wfMsg( "editthispage" );
796 if ( $redirect ) { $red = "&redirect={$redirect}"; }
797 if ( $oldid && ! isset( $diff ) ) {
798 $oid = "&oldid={$oldid}";
800 $s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
802 $s = wfMsg( "protectedpage" );
807 function deleteThisPage()
809 global $wgUser, $wgOut, $wgTitle, $diff;
811 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
812 $n = $wgTitle->getPrefixedText();
813 $t = wfMsg( "deletethispage" );
815 $s = $this->makeKnownLink( $n, $t, "action=delete" );
817 $s = wfMsg( "error" );
822 function protectThisPage()
824 global $wgUser, $wgOut, $wgTitle, $diff;
826 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
827 $n = $wgTitle->getPrefixedText();
829 if ( $wgTitle->isProtected() ) {
830 $t = wfMsg( "unprotectthispage" );
831 $q = "action=unprotect";
833 $t = wfMsg( "protectthispage" );
834 $q = "action=protect";
836 $s = $this->makeKnownLink( $n, $t, $q );
838 $s = wfMsg( "error" );
843 function watchThisPage()
845 global $wgUser, $wgOut, $wgTitle, $diff;
847 if ( $wgOut->isArticle() && ( ! $diff ) ) {
848 $n = $wgTitle->getPrefixedText();
850 if ( $wgTitle->userIsWatching() ) {
851 $t = wfMsg( "unwatchthispage" );
852 $q = "action=unwatch";
854 $t = wfMsg( "watchthispage" );
857 $s = $this->makeKnownLink( $n, $t, $q );
859 $s = wfMsg( "notanarticle" );
864 function moveThisPage()
866 global $wgTitle, $wgLang;
868 if ( $wgTitle->userCanEdit() ) {
869 $s = $this->makeKnownLink( $wgLang->specialPage( "Movepage" ),
870 wfMsg( "movethispage" ), "target=" . $wgTitle->getPrefixedURL() );
871 } // no message if page is protected - would be redundant
875 function historyLink()
879 $s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
880 wfMsg( "history" ), "action=history" );
884 function whatLinksHere()
886 global $wgTitle, $wgLang;
888 $s = $this->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ),
889 wfMsg( "whatlinkshere" ), "target=" . $wgTitle->getPrefixedURL() );
893 function userContribsLink()
895 global $wgTitle, $wgLang;
897 $s = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
898 wfMsg( "contributions" ), "target=" . $wgTitle->getURL() );
902 function emailUserLink()
904 global $wgTitle, $wgLang;
906 $s = $this->makeKnownLink( $wgLang->specialPage( "Emailuser" ),
907 wfMsg( "emailuser" ), "target=" . $wgTitle->getURL() );
911 function watchPageLinksLink()
913 global $wgOut, $wgTitle, $wgLang;
915 if ( ! $wgOut->isArticle() ) {
916 $s = "(" . wfMsg( "notanarticle" ) . ")";
918 $s = $this->makeKnownLink( $wgLang->specialPage(
919 "Recentchangeslinked" ), wfMsg( "recentchangeslinked" ),
920 "target=" . $wgTitle->getPrefixedURL() );
925 function otherLanguages()
927 global $wgOut, $wgLang, $wgTitle , $wgUseNewInterlanguage ;
929 $a = $wgOut->getLanguageLinks();
930 if ( 0 == count( $a ) ) {
931 if ( !$wgUseNewInterlanguage ) return "";
932 $ns = $wgLang->getNsIndex ( $wgTitle->getNamespace () ) ;
933 if ( $ns != 0 AND $ns != 1 ) return "" ;
935 $x = "mode=addlink&xt=".$wgTitle->getDBkey() ;
936 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
937 wfMsg( "intl" ) , $x );
940 if ( !$wgUseNewInterlanguage ) {
941 $s = wfMsg( "otherlanguages" ) . ": ";
943 global $wgLanguageCode ;
944 $x = "mode=zoom&xt=".$wgTitle->getDBkey() ;
945 $x .= "&xl=".$wgLanguageCode ;
946 $s = $this->makeKnownLink( $wgLang->specialPage( "Intl" ),
947 wfMsg( "otherlanguages" ) , $x ) . ": " ;
951 foreach( $a as $l ) {
952 if ( ! $first ) { $s .= " | "; }
955 $nt = Title
::newFromText( $l );
956 $url = $nt->getFullURL();
957 $text = $wgLang->getLanguageName( $nt->getInterwiki() );
959 if ( "" == $text ) { $text = $l; }
960 $style = $this->getExternalLinkAttributes( $l, $text );
961 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
966 function bugReportsLink()
968 $s = $this->makeKnownLink( wfMsg( "bugreportspage" ),
969 wfMsg( "bugreports" ) );
976 $t1 = Title
::newFromText( gmdate( "F j" ) );
977 $t2 = Title
::newFromText( gmdate( "Y" ) );
979 $wgLinkCache->suspend();
980 $id = $t1->getArticleID();
981 $wgLinkCache->resume();
984 $s = $this->makeBrokenLink( $t1->getText() );
986 $s = $this->makeKnownLink( $t1->getText() );
990 $wgLinkCache->suspend();
991 $id = $t2->getArticleID();
992 $wgLinkCache->resume();
995 $s .= $this->makeBrokenLink( $t2->getText() );
997 $s .= $this->makeKnownLink( $t2->getText() );
1004 global $wgLang, $wgTitle, $wgLinkCache;
1006 $tns = $wgTitle->getNamespace();
1007 if ( -1 == $tns ) { return ""; }
1009 $pn = $wgTitle->getText();
1010 $tp = wfMsg( "talkpage" );
1011 if ( Namespace::isTalk( $tns ) ) {
1012 $lns = Namespace::getSubject( $tns );
1015 $text = wfMsg("articlepage");
1018 $text = wfMsg("userpage");
1021 $text = wfMsg("wikipediapage");
1024 $text = wfMsg("imagepage");
1027 $text= wfMsg("articlepage");
1031 $lns = Namespace::getTalk( $tns );
1034 $n = $wgLang->getNsText( $lns );
1035 if ( "" == $n ) { $link = $pn; }
1036 else { $link = "{$n}:{$pn}"; }
1038 $wgLinkCache->suspend();
1039 $s = $this->makeLink( $link, $text );
1040 $wgLinkCache->resume();
1045 # After all the page content is transformed into HTML, it makes
1046 # a final pass through here for things like table backgrounds.
1048 function transformContent( $text )
1053 # Note: This function MUST call getArticleID() on the link,
1054 # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
1056 function makeLink( $title, $text= "", $query = "", $trail = "" )
1058 global $wgOut, $wgUser;
1060 $nt = Title
::newFromText( $title );
1062 if ( $nt->isExternal() ) {
1063 $u = $nt->getFullURL();
1064 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1065 $style = $this->getExternalLinkAttributes( $link, $text );
1068 if ( "" != $trail ) {
1069 if ( preg_match( "/^([a-z]+)(.*)$$/sD", $trail, $m ) ) {
1074 return "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1076 if ( 0 == $nt->getNamespace() && "" == $nt->getText() ) {
1077 return $this->makeKnownLink( $title, $text, $query, $trail );
1079 if ( ( -1 == $nt->getNamespace() ) ||
1080 ( Namespace::getImage() == $nt->getNamespace() ) ) {
1081 return $this->makeKnownLink( $title, $text, $query, $trail );
1083 $aid = $nt->getArticleID() ;
1085 return $this->makeBrokenLink( $title, $text, $query, $trail );
1087 $threshold = $wgUser->getOption("stubthreshold") ;
1088 if ( $threshold > 0 ) {
1089 $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ;
1091 if ( wfNumRows( $res ) > 0 ) {
1092 $s = wfFetchObject( $res );
1094 if ( $s->cur_is_redirect
OR $s->cur_namespace
!= 0 )
1095 $size = $threshold*2 ; # Really big
1096 wfFreeResult( $res );
1097 } else $size = $threshold*2 ; # Really big
1100 if ( $size < $threshold )
1101 return $this->makeStubLink( $title, $text, $query, $trail );
1102 return $this->makeKnownLink( $title, $text, $query, $trail );
1106 function makeKnownLink( $title, $text = "", $query = "", $trail = "" )
1108 global $wgOut, $wgTitle;
1110 $nt = Title
::newFromText( $title );
1111 $link = $nt->getPrefixedURL();
1113 if ( "" == $link ) {
1115 if ( "" == $text ) { $text = $nt->getFragment(); }
1117 $u = wfLocalUrlE( $link, $query );
1119 if ( "" != $nt->getFragment() ) {
1120 $u .= "#" . wfEscapeHTML( $nt->getFragment() );
1122 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1123 $style = $this->getInternalLinkAttributes( $link, $text );
1126 if ( "" != $trail ) {
1127 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1132 $r = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1136 function makeBrokenLink( $title, $text = "", $query = "", $trail = "" )
1138 global $wgOut, $wgUser;
1140 $nt = Title
::newFromText( $title );
1141 $link = $nt->getPrefixedURL();
1143 if ( "" == $query ) { $q = "action=edit"; }
1144 else { $q = "action=edit&{$query}"; }
1145 $u = wfLocalUrlE( $link, $q );
1147 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1148 $style = $this->getInternalLinkAttributes( $link, $text, "yes" );
1151 if ( "" != $trail ) {
1152 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1157 if ( $wgOut->isPrintable() ||
1158 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1159 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1161 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>?</a>{$trail}";
1166 function makeStubLink( $title, $text = "", $query = "", $trail = "" )
1168 global $wgOut, $wgUser;
1170 $nt = Title
::newFromText( $title );
1171 $link = $nt->getPrefixedURL();
1173 $u = wfLocalUrlE( $link, $query );
1175 if ( "" == $text ) { $text = $nt->getPrefixedText(); }
1176 $style = $this->getInternalLinkAttributes( $link, $text, "stub" );
1179 if ( "" != $trail ) {
1180 if ( preg_match( wfMsg("linktrail"), $trail, $m ) ) {
1185 if ( $wgOut->isPrintable() ||
1186 ( 1 == $wgUser->getOption( "highlightbroken" ) ) ) {
1187 $s = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>{$trail}";
1189 $s = "{$text}{$inside}<a href=\"{$u}\"{$style}>!</a>{$trail}";
1194 function fnamePart( $url )
1196 $basename = strrchr( $url, "/" );
1197 if ( false === $basename ) { $basename = $url; }
1198 else { $basename = substr( $basename, 1 ); }
1199 return wfEscapeHTML( $basename );
1202 function makeImage( $url, $alt = "" )
1206 if ( "" == $alt ) { $alt = $this->fnamePart( $url ); }
1207 $s = "<img src=\"{$url}\" alt=\"{$alt}\">";
1211 function makeImageLink( $name, $url, $alt = "" )
1213 global $wgOut, $wgTitle, $wgLang;
1215 $nt = Title
::newFromText( $wgLang->getNsText(
1216 Namespace::getImage() ) . ":{$name}" );
1217 $link = $nt->getPrefixedURL();
1218 if ( "" == $alt ) { $alt = $name; }
1220 $u = wfLocalUrlE( $link );
1221 $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
1222 "<img border=0 src=\"{$url}\" alt=\"{$alt}\"></a>";
1226 function makeMediaLink( $name, $url, $alt = "" )
1228 global $wgOut, $wgTitle;
1230 if ( "" == $alt ) { $alt = $name; }
1231 $u = wfEscapeHTML( $url );
1232 $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
1236 function specialLink( $name, $key = "" )
1240 if ( "" == $key ) { $key = strtolower( $name ); }
1241 $pn = $wgLang->ucfirst( $name );
1242 return $this->makeKnownLink( $wgLang->specialPage( $pn ),
1246 # Called by history lists and recent changes
1249 function beginRecentChangesList()
1251 $rc_cache = array() ;
1253 $this->lastdate
= "";
1257 function beginHistoryList()
1259 $this->lastdate
= $this->lastline
= "";
1260 $s = "\n<p>" . wfMsg( "histlegend" ) . "\n<ul>";
1264 function beginImageHistoryList()
1266 $s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
1267 "<p>" . wfMsg( "imghistlegend" ) . "\n<ul>";
1271 function endRecentChangesList()
1273 $s = $this->recentChangesBlock() ;
1278 function endHistoryList()
1280 $last = wfMsg( "last" );
1282 $s = preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline
);
1287 function endImageHistoryList()
1293 function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor )
1297 $artname = Title
::makeName( $ns, $ttl );
1298 $last = wfMsg( "last" );
1299 $cur = wfMsg( "cur" );
1300 $cr = wfMsg( "currentrev" );
1302 if ( $oid && $this->lastline
) {
1303 $ret = preg_replace( "/!OLDID!([0-9]+)!/", $this->makeKnownLink(
1304 $artname, $last, "diff=\\1&oldid={$oid}" ), $this->lastline
);
1308 $dt = $wgLang->timeanddate( $ts, true );
1310 if ( $oid ) { $q = "oldid={$oid}"; }
1312 $link = $this->makeKnownLink( $artname, $dt, $q );
1315 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1316 $ut, "target=" . $ut );
1317 } else { $ul = $this->makeLink( $wgLang->getNsText(
1318 Namespace::getUser() ) . ":{$ut}", $ut ); }
1322 $curlink = $this->makeKnownLink( $artname, $cur,
1323 "diff=0&oldid={$oid}" );
1327 $s .= "({$curlink}) (!OLDID!{$oid}!) . .";
1329 $M = wfMsg( "minoreditletter" );
1330 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1331 $s .= " {$link} . . {$ul}";
1333 if ( "" != $c && "*" != $c ) { $s .= " <em>(" . wfEscapeHTML($c) . ")</em>"; }
1336 $this->lastline
= $s;
1340 function recentChangesBlockLine ( $y ) {
1341 global $wgUploadPath ;
1343 $M = wfMsg( "minoreditletter" );
1344 $N = wfMsg( "newpageletter" );
1346 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>" ;
1348 if ( $y->isnew
) $r .= $N ;
1349 else $r .= " " ;
1350 if ( $y->isminor
) $r .= $M ;
1351 else $r .= " " ;
1352 $r .= " ".$y->timestamp
." " ;
1355 if ( $y->watched
) $link = "<strong>{$link}</strong>" ;
1361 $r .= $this->makeKnownLink( $y->secureName
, wfMsg( "hist" ), "action=history" );
1363 $r .= ") . . ".$y->userlink
;
1364 $r .= $y->usertalklink
;
1365 if ( $y->usercomment
!= "" )
1366 $r .= " <em>(".wfEscapeHTML($y->usercomment
).")</em>" ;
1371 function recentChangesBlockGroup ( $y ) {
1372 global $wgUploadPath ;
1375 $M = wfMsg( "minoreditletter" );
1376 $N = wfMsg( "newpageletter" );
1378 $userlinks = array () ;
1379 foreach ( $y AS $x ) {
1380 $oldid = $x->diffid
;
1381 if ( $x->isnew
) $isnew = true ;
1383 if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
1387 krsort ( $userlinks ) ;
1388 asort ( $userlinks ) ;
1390 $u = array_keys ( $userlinks ) ;
1391 foreach ( $u as $x ) {
1393 if ( $userlinks[$x] > 1 ) $z .= " ({$userlinks[$x]}×)" ;
1394 array_push ( $users , $z ) ;
1396 $users = " <font size='-1'>[".implode("; ",$users)."]</font>" ;
1399 $e = array_shift ( $e ) ;
1402 $rci = "RCI{$this->rccc}" ;
1403 $rcl = "RCL{$this->rccc}" ;
1404 $rcm = "RCM{$this->rccc}" ;
1405 $tl = "<a href='javascript:toggleVisibility(\"{$rci}\",\"{$rcm}\",\"{$rcl}\")'>" ;
1406 $tl .= "<span id='{$rcm}'><img src='{$wgUploadPath}/Arr_r.png' width=12 height=12 border=0></span>" ;
1407 $tl .= "<span id='{$rcl}' style='display:none'><img src='{$wgUploadPath}/Arr_d.png' width=12 height=12 border=0></span>" ;
1413 if ( $isnew ) $r .= $N ;
1414 else $r .= " " ;
1415 $r .= " " ; # Minor
1416 $r .= " ".$e->timestamp
." " ;
1420 if ( $e->watched
) $link = "<strong>{$link}</strong>" ;
1424 $r .= " (".count($y)." " ;
1425 if ( $isnew ) $r .= wfMsg("changes");
1426 else $r .= $this->makeKnownLink( $e->secureName
, wfMsg("changes") , "diff=0&oldid=".$oldid ) ;
1428 $r .= $this->makeKnownLink( $e->secureName
, wfMsg( "history" ), "action=history" );
1436 $r .= "<div id='{$rci}' style='display:none'>" ;
1437 foreach ( $y AS $x )
1439 $r .= "<img src='{$wgUploadPath}/Arr_.png' width=12 height=12 border=0>";
1440 $r .= "<tt> " ;
1441 if ( $x->isnew
) $r .= $N ;
1442 else $r .= " " ;
1443 if ( $x->isminor
) $r .= $M ;
1444 else $r .= " " ;
1448 if ( $x->oldid
!= 0 ) $o = "oldid=".$x->oldid
;
1449 if ( $x->islog
) $link = $x->timestamp
;
1450 else $link = $this->makeKnownLink( $x->secureName
, $x->timestamp
, $o ) ;
1451 $link = "<tt>{$link}</tt>" ;
1458 $r .= $x->lastlink
;
1459 $r .= ") . . ".$x->userlink
;
1460 $r .= $x->usertalklink
;
1461 if ( $x->usercomment
!= "" )
1462 $r .= " <em>(".wfEscapeHTML($x->usercomment
).")</em>" ;
1471 function recentChangesBlock ()
1473 global $wgUploadPath ;
1474 if ( count ( $this->rc_cache
) == 0 ) return "" ;
1475 $k = array_keys ( $this->rc_cache
) ;
1476 foreach ( $k AS $x )
1478 $y = $this->rc_cache
[$x] ;
1479 if ( count ( $y ) < 2 ) {
1480 $r .= $this->recentChangesBlockLine ( array_shift ( $y ) ) ;
1482 $r .= $this->recentChangesBlockGroup ( $y ) ;
1486 return "<div align=left>{$r}</div>" ;
1489 function recentChangesLine( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1492 $usenew = $wgUser->getOption( "usenewrc" );
1494 $r = $this->recentChangesLineNew ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1496 $r = $this->recentChangesLineOld ( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched , $oldid , $diffid ) ;
1500 function recentChangesLineOld( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0, $diffid = 0 )
1502 global $wgTitle, $wgLang, $wgUser;
1504 $d = $wgLang->date( $ts, true);
1506 if ( $d != $this->lastdate
) {
1507 if ( "" != $this->lastdate
) { $s .= "</ul>\n"; }
1508 $s .= "<h4>{$d}</h4>\n<ul>";
1509 $this->lastdate
= $d;
1511 $h = $wgLang->time( $ts, true );
1512 $t = Title
::makeName( $ns, $ttl );
1513 $clink = $this->makeKnownLink( $t , "" );
1514 $nt = Title
::newFromText( $t );
1517 $clink = "<strong>{$clink}</strong>";
1519 $hlink = $this->makeKnownLink( $t, wfMsg( "hist" ), "action=history" );
1520 if ( $isnew ||
$nt->isLog() ) {
1521 $dlink = wfMsg( "diff" );
1523 $dlink = $this->makeKnownLink( $t, wfMsg( "diff" ),
1524 "diff={$oldid}&oldid={$diffid}" ); # Finagle's law
1527 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1528 $ut, "target=" . $ut );
1529 } else { $ul = $this->makeLink( $wgLang->getNsText(
1530 Namespace::getUser() ) . ":{$ut}", $ut ); }
1532 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1533 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1534 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1535 $cr = wfMsg( "currentrev" );
1537 $s .= "<li> ({$dlink}) ({$hlink}) . .";
1538 $M = wfMsg( "minoreditletter" );
1539 $N = wfMsg( "newpageletter" );
1540 if ( $isminor ) { $s .= " <strong>{$M}</strong>"; }
1541 if ( $isnew ) { $s .= "<strong>{$N}</strong>"; }
1542 $s .= " {$clink}; {$h} . . {$ul}";
1545 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1546 $blink = $this->makeKnownLink( $wgLang->specialPage(
1547 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1553 $utl = "({$utl} | {$blink})";
1557 if ( "" != $c && "*" != $c ) {
1558 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1565 function recentChangesLineNew( $ts, $u, $ut, $ns, $ttl, $c, $isminor, $isnew, $watched = false, $oldid = 0 , $diffid = 0 )
1567 global $wgTitle, $wgLang, $wgUser;
1569 $rc = new RecentChangesClass
;
1571 $d = $wgLang->date( $ts, true);
1574 if ( $d != $this->lastdate
) {
1575 $ret = $this->recentChangesBlock () ;
1576 $this->rc_cache
= array() ;
1577 $ret .= "<h4>{$d}</h4>\n";
1578 $this->lastdate
= $d;
1580 $h = $wgLang->time( $ts, true );
1581 $t = Title
::makeName( $ns, $ttl );
1582 $clink = $this->makeKnownLink( $t, "" ) ;
1583 if ( $oldid == 0 ) $c2link = $clink ;
1584 else $c2link = $this->makeKnownLink( $t, "" , "oldid={$oldid}" );
1585 $nt = Title
::newFromText( $t );
1587 $rc->timestamp
= $h ;
1588 $rc->oldid
= $oldid ;
1589 $rc->diffid
= $diffid ;
1590 $rc->watched
= $watched ;
1591 $rc->isnew
= $isnew ;
1592 $rc->isminor
= $isminor ;
1593 $rc->secureName
= $t ;
1594 $rc->displayName
= $nt ;
1595 $rc->link
= $clink ;
1596 $rc->usercomment
= $c ;
1597 $rc->islog
= $nt->isLog() ;
1599 if ( ( $isnew && $oldid == 0 ) ||
$nt->isLog() ) {
1600 $dlink = wfMsg( "cur" );
1602 $dlink = $this->makeKnownLink( $t, wfMsg( "cur" ),
1603 "diff=0&oldid={$oldid}" );
1606 if ( $diffid == 0 ||
$nt->isLog() ) {
1607 $plink = wfMsg( "last" );
1609 $plink = $this->makeKnownLink( $t, wfMsg( "last" ),
1610 "diff={$oldid}&oldid={$diffid}" );
1614 $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
1615 $ut, "target=" . $ut );
1616 } else { $ul = $this->makeLink( $wgLang->getNsText(
1617 Namespace::getUser() ) . ":{$ut}", $ut ); }
1619 $rc->userlink
= $ul ;
1620 $rc->lastlink
= $plink ;
1621 $rc->curlink
= $dlink ;
1623 $utns=$wgLang->getNsText(Namespace::getTalk(Namespace::getUser()));
1624 $talkname=$wgLang->getNsText(Namespace::getTalk(0)); # use the shorter name
1625 $utl= $this->makeLink($utns . ":{$ut}", $talkname );
1627 if ( ( 0 == $u ) && $wgUser->isSysop() ) {
1628 $blink = $this->makeKnownLink( $wgLang->specialPage(
1629 "Blockip" ), wfMsg( "blocklink" ), "ip={$ut}" );
1630 $rc->usertalklink
= " ({$utl} | {$blink})";
1632 $rc->usertalklink
=" ({$utl})";
1635 if ( !isset ( $this->rc_cache
[$t] ) ) $this->rc_cache
[$t] = array() ;
1636 array_push ( $this->rc_cache
[$t] , $rc ) ;
1641 function imageHistoryLine( $iscur, $ts, $img, $u, $ut, $size, $c )
1643 global $wgUser, $wgLang, $wgTitle;
1645 $dt = $wgLang->timeanddate( $ts, true );
1646 $del = wfMsg( "deleteimg" );
1647 $cur = wfMsg( "cur" );
1650 $url = wfImageUrl( $img );
1652 if ( $wgUser->isSysop() ) {
1653 $link = wfLocalUrlE( "", "image=" . $wgTitle->getURL() .
1655 $style = $this->getInternalLinkAttributes( $link, $del );
1657 $dlink = "<a href=\"{$link}\"{$style}>{$del}</a>";
1662 $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
1663 if( $wgUser->getID() != 0 ) {
1664 $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1665 wfMsg( "revertimg" ), "action=revert&oldimage=" .
1666 urlencode( $img ) );
1667 $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
1668 $del, "action=delete&oldimage=" . urlencode( $img ) );
1670 # Having live active links for non-logged in users
1671 # means that bots and spiders crawling our site can
1672 # inadvertently change content. Baaaad idea.
1673 $rlink = wfMsg( "revertimg" );
1677 if ( 0 == $u ) { $ul = $ut; }
1678 else { $ul = $this->makeLink( $wgLang->getNsText(
1679 Namespace::getUser() ) . ":{$ut}", $ut ); }
1681 $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
1682 $style = $this->getInternalLinkAttributes( $url, $dt );
1684 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
1685 . " . . {$ul} ({$nb})";
1687 if ( "" != $c && "*" != $c ) {
1688 $s .= " <em>(" . wfEscapeHTML( $c ) . ")</em>";
1694 function tocIndent($level) {
1696 while($level-->0) $rv.="<div style=\"margin-left:2em;\">\n";
1701 function tocUnindent($level) {
1702 while($level-->0) $rv.="</div>\n";
1706 // parameter level defines if we are on an indentation level
1707 function tocLine($anchor,$tocline,$level) {
1711 return "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n";
1714 return "<div style=\"margin-bottom:0px;\">\n".
1715 "<A CLASS=\"internal\" HREF=\"#".$anchor."\">".$tocline."</A><BR>\n".
1721 function tocTable($toc) {
1723 /* does not auto-expand, use table for now
1725 <div><div style=\"border-width:1px;background-color:#f3f3ff;border-color:#8888aa;border-style:solid;padding:1em;padding-bottom:1em;\">
1726 <b>".wfMsg("toc")."</b><P>
1730 "<table border=\"0\" bgcolor=\"#8888aa\" cellpadding=\"0\" cellspacing=\"1\"><tr><td>\n" .
1731 "<table border=\"0\" bgcolor=\"#f3f3ff\" CELLPADDING=5><tr><td>\n".
1732 "<b>".wfMsg("toc")."</b>" .
1733 " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" .
1734 "</td></tr><tr id='tocinside'><td>\n".
1735 $toc."</td></tr></table></td></tr></table><P>\n";
1738 function editSectionLink($section) {
1740 global $wgTitle,$wgUser,$oldid;
1741 if($wgTitle->isProtected() && !$wgUser->isSysop()) return "";
1742 if($oldid) return "";
1743 $editurl="§ion={$section}";
1744 $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
1745 return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
1750 include_once( "SkinStandard.php" );
1751 include_once( "SkinNostalgia.php" );
1752 include_once( "SkinCologneBlue.php" );