Index: trunk/phpwiki/fpw/wikiUser.php |
— | — | @@ -52,10 +52,12 @@ |
53 | 53 | |
54 | 54 | # Creates a style sheet for the page from the skin & link style options |
55 | 55 | function styleSheet( $action = "view" ) { |
| 56 | + global $namespaceBackground ; |
56 | 57 | $ret = "<style type=\"text/css\"><!--\n"; |
57 | 58 | $ret .= "body { "; |
58 | 59 | $textcolor = $this->options[text]; |
59 | 60 | $bgcolor = $this->options[background]; |
| 61 | + if ( $namespaceBackground != "" ) $bgcolor = $namespaceBackground ; |
60 | 62 | if ( $textcolor == "" ) |
61 | 63 | $textcolor = "black"; # For un-coloring links. Should be "inherit" but Netscape 4.x messes it up |
62 | 64 | else |
Index: trunk/phpwiki/fpw/basicFunctions.php |
— | — | @@ -71,12 +71,13 @@ |
72 | 72 | # Called when editing/saving a page |
73 | 73 | function edit ( $title ) { |
74 | 74 | global $EditBox , $SaveButton , $PreviewButton , $MinorEdit , $FromEditForm , $wikiIPblocked ; |
75 | | - global $user , $CommentBox , $vpage , $EditTime , $wikiDescribePage , $wikiUser ; |
| 75 | + global $user , $CommentBox , $vpage , $EditTime , $wikiDescribePage , $wikiUser , $namespaceBackground , $wikiNamespaceBackground ; |
76 | 76 | global $wikiCannotEditPage , $wikiEditConflictMessage , $wikiPreviewAppend , $wikiEditHelp , $wikiRecodeInput ; |
77 | 77 | global $wikiSummary , $wikiMinorEdit , $wikiCopyrightNotice , $wikiSave , $wikiPreview , $wikiDontSaveChanges ; |
78 | 78 | $npage = new WikiPage ; |
79 | 79 | $npage->title = $title ; |
80 | 80 | $npage->makeAll () ; |
| 81 | + if ( $npage->namespace ) $namespaceBackground = $wikiNamespaceBackground[strtolower($npage->namespace)] ; |
81 | 82 | $ret = "" ; |
82 | 83 | if ( !$vpage->canEdit() ) return $wikiCannotEditPage ; |
83 | 84 | if ( $EditTime == "" ) $EditTime = date ( "YmdHis" ) ; # Stored for edit conflict detection |
— | — | @@ -210,7 +211,7 @@ |
211 | 212 | } |
212 | 213 | |
213 | 214 | function view ( $title ) { |
214 | | - global $FromEditForm , $action ; |
| 215 | + global $FromEditForm , $action , $namespaceBackground , $wikiNamespaceBackground ; |
215 | 216 | global $vpage , $wikiDescribePage ; |
216 | 217 | if ( $FromEditForm ) { |
217 | 218 | $s = doEdit ( $title ) ; |
— | — | @@ -222,6 +223,7 @@ |
223 | 224 | } |
224 | 225 | $vpage = new WikiPage ; |
225 | 226 | $vpage->load ( $title ) ; |
| 227 | + if ( $vpage->namespace ) $namespaceBackground = $wikiNamespaceBackground[strtolower($vpage->namespace)] ; |
226 | 228 | if ( $vpage->contents == $wikiDescribePage ) { |
227 | 229 | $action = "edit" ; |
228 | 230 | return doEdit ( $title ) ; |
Index: trunk/phpwiki/fpw/wikiTextEn.php |
— | — | @@ -20,6 +20,16 @@ |
21 | 21 | $wikiRecentChangesText = "Track the most recent changes to Wikipedia on this page. [[Welcome, newcomers]]! Please have a look at these pages: [[Wikipedia FAQ]], [[Wikipedia policy]] (especially [[naming conventions]] and [[neutral point of view]]), and [[most common Wikipedia faux pas]].<br>If you want to see the Wikipedia succeed, it's very important that you don't add material restricted by others' [[copyright]]s. The legal liability could really hurt the project, so please don't do it.<br>See also the [http://meta.wikipedia.com/wiki.phtml?title=special:RecentChanges recent meta discussion]" ; |
22 | 22 | $wikiMetaDescription = "$1... Read more here at wikipedia, the free encyclopedia!" ; |
23 | 23 | |
| 24 | +# Namespace backgrounds |
| 25 | +$wikiNamespaceBackground = array () ; |
| 26 | +$wikiNamespaceBackground["talk"] = "#CCCCCC" ; |
| 27 | +$wikiNamespaceBackground["user_talk"] = $wikiNamespaceBackground["talk"] ; |
| 28 | +$wikiNamespaceBackground["wikipedia_talk"] = $wikiNamespaceBackground["talk"] ; |
| 29 | +$wikiNamespaceBackground["user"] = "#CCFFFF" ; |
| 30 | +$wikiNamespaceBackground["wikipedia"] = "#CCFFCC" ; |
| 31 | +$wikiNamespaceBackground["log"] = "#FFCCCC" ; |
| 32 | +$wikiNamespaceBackground["special"] = "#FFCC66" ; |
| 33 | + |
24 | 34 | # Used in header/footer |
25 | 35 | $wikiMainPageTitle = "Wikipedia : The free encyclopedia" ; # This is the title that is displayed on the main page |
26 | 36 | $wikiArticleSubtitle = "From Wikipedia, the free encyclopedia." ; |
Index: trunk/phpwiki/fpw/wiki.phtml |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | # Main program |
50 | 50 | global $action , $title , $pageTitle ; |
51 | 51 | global $user , $search , $expiration ; |
52 | | - global $THESCRIPT ; |
| 52 | + global $THESCRIPT , $namespaceBackground , $wikiNamespaceBackground ; |
53 | 53 | |
54 | 54 | global $metaDescription , $metaKeywords , $wikiCharset ; # For meta tags in the HTML code |
55 | 55 | $expiration = time()+31536000 ; # Cookies set will expire in one year from now |
— | — | @@ -96,6 +96,8 @@ |
97 | 97 | $action = strtolower ( trim ( $action ) ) ; |
98 | 98 | $title = urldecode ( $title ) ; |
99 | 99 | |
| 100 | + if ( strtolower ( substr ( $title , 0 , 8 ) ) == "special:" ) $namespaceBackground = $wikiNamespaceBackground["special"] ; |
| 101 | + |
100 | 102 | # Do what is asked |
101 | 103 | if ( isset ( $search ) ) { |
102 | 104 | include_once ( "./special_dosearch.php" ) ; |