-
-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy pathSitenotice.php
More file actions
176 lines (162 loc) · 5.92 KB
/
Sitenotice.php
File metadata and controls
176 lines (162 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
$wgNoticeProject = 'all';
if ( $wmgSiteNoticeOptOut ) {
// Only show important notices when optout
$wgNoticeProject = 'optout';
}
// Increment this version number whenever you change the site notice
$wgMajorSiteNoticeID = 93;
/**
* Wrap your sitenotice with <div data-nosnippet>(sitenotice)</div>
* or Google will use the sitenotice for their search result snippet.
*/
// Global SiteNotice
// if ( !$wmgSiteNoticeOptOut ) {
/* $wgHooks['SiteNoticeAfter'][] = 'wfGlobalSiteNotice';
function wfGlobalSiteNotice( &$siteNotice, $skin ) {
$skin->getOutput()->enableOOUI();
$skin->getOutput()->addInlineStyle(
'.mw-dismissable-notice .mw-dismissable-notice-body { margin: unset; }' .
'.skin-cosmos #sitenotice-learnmore-button { margin-left: 50px; }'
);
$siteNotice .= <<<EOF
<table style="width: 100%; font-size: 120%; border-left: 4px solid #fc3; background-color: #d5fdf4; border-left-color: #00af89; padding: 10px 15px; color: black !important;">
<tbody>
<div data-nosnippet style="padding-top:0.3em; padding-bottom:0.1em;">
<tr>
<td rowspan=2><div style="float: left;"><img alt="Server maintenance" src="https://upload.wikimedia.org/wikipedia/commons/e/e1/OOjs_UI_icon_desktop.svg" decoding="async" width="40" height="40"></div></td>
<td>
<div style="font-weight: bold; color: black;">
Server maintenance
</div>
</td>
</tr>
<tr>
<td>
<div style="padding-bottom: 15px; font-size: 13pt; color: black;">
Miraheze will be performing upgrades on cloud servers on March 5, 2026 from 20:00 to March 6 03:00 UTC. During this time Miraheze will be completely unavailable. We apologize for the inconvenience and thank you for your understanding.
</div>
</td>
</tr>
</div>
</tbody>
</table>
EOF;
} */
// }
// Specific wiki SiteNotice
/* if ( $wi->isExtensionActive( 'Graph' ) ) {
$wgHooks['SiteNoticeAfter'][] = 'wfConditionalSiteNotice';
function wfConditionalSiteNotice( &$siteNotice, $skin ) {
$skin->getOutput()->enableOOUI();
$skin->getOutput()->addInlineStyle(
'.mw-dismissable-notice .mw-dismissable-notice-body { margin: unset; }' .
'.skin-cosmos #sitenotice-learnmore-button { margin-left: 50px; }'
);
$siteNotice .= <<<EOF
<table style="width: 100%;">
<tbody><tr><td style="font-size: 120%; border-left: 4px solid #67440F; background-color: #FFF2F6; padding: 10px 15px; color: black;">
<div data-nosnippet style="padding-top:0.3em; padding-bottom:0.1em;">
<div class="floatleft"><img alt="Miraheze Logo" src="https://upload.wikimedia.org/wikipedia/commons/b/b1/Font_Awesome_5_solid_bug.svg" decoding="async" width="50" height="50"></div>
<div style="padding-bottom: 15px; font-size: 13pt; font-weight: bold;">
Graph has been permanently discontinued due to a severe security issue.
</div>
<span id="sitenotice-learnmore-button" class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-iconElement oo-ui-labelElement oo-ui-buttonWidget">
<a class="oo-ui-buttonElement-button" role="button" tabindex="0" href="https://meta.miraheze.org/wiki/Tech:SRE_noticeboard#Graph_disabled">
<span class="oo-ui-iconElement-icon oo-ui-icon-notice"></span>
<span class="oo-ui-labelElement-label">{$skin->msg( 'miraheze-sitenotice-learnmore' )->escaped()}</span>
<span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator"></span>
</a>
</span>
</div>
</td></tr></tbody>
</table>
EOF;
}
} */
/*
// LE Domain sitenotice
$LEWikis = [
"archivesofhavnorwiki",
"anomalyzonewikiwiki",
"baharnawiki",
"baligawiki",
"balloonfightwiki",
"tfoswiki",
"binrayarchiveswiki",
"blackmagicwiki",
"boneswordwiki",
"clinithequewiki",
"decimatedrivewiki",
"echoeswiki",
"ekumenwiki",
"evilgeniuswiki",
"exmormonwiki",
"fairytailwiki",
"corsiwiki",
"fanojowiki",
"farthestfrontierwiki",
"ff8wiki",
"hellowhirledwiki",
"empireinflameswiki",
"iceriawiki",
"wandelenwiki",
"lotrminecraftmodwiki",
"lotrruwiki",
"magistrowiki",
"maxcapacitywiki",
"mockgovernmentswiki",
"occhygienewikiwiki",
"osrwikiwiki",
"partopediawiki",
"pso2ngswiki",
"psychoengineeringwiki",
"raidrushwiki",
"removededmsongswiki",
"richterianwiki",
"rodzinkaplwiki",
"sptwikiwiki",
"thegreatwarwiki",
"transgenderwiki",
"vilexiawiki",
"voecwiki",
"uavolunteerresourceswiki",
"weavefarerswiki",
"wikicawiki",
"momawiki",
"wizardiawiki",
"wonderfuleverydaywiki",
"worldlesswiki",
"yepediawiki",
];
if ( in_array( $wgDBname, $LEWikis, true ) ) {
$wgHooks['SiteNoticeAfter'][] = 'wfLESiteNotice';
function wfLESiteNotice( &$siteNotice, $skin ) {
$title = $skin->getTitle();
$skin->getOutput()->enableOOUI();
$skin->getOutput()->addInlineStyle(
'.mw-dismissable-notice .mw-dismissable-notice-body { margin: unset; }' .
'.skin-cosmos #sitenotice-learnmore-button { margin-left: 50px; }'
);
$siteNotice .= <<<EOF
<table style="width: 100%;">
<tbody>
<tr>
<td style="border-left: 4px solid #000000; background-color: #ea9999; padding: 10px 15px;">
<div style="padding-top: 0.3em; padding-bottom: 0.1em; font-size: 100%;">
<img alt="OOjs UI icon web-progressive" src="https://upload.wikimedia.org/wikipedia/commons/3/3c/OOjs_UI_icon_notice.svg" decoding="async" width="35" height="35" style="float: left; margin-right: 10px;">
<div style="font-weight: bold;">Custom domain</div>
The custom domain for this wiki is currently using our DNS service which is actively being phased out, so that we may route all traffic through Cloudflare. This is an alert that unless the domain owner follows the instructions <a href="https://issue-tracker.miraheze.org/T13309">here,</a> the domain will be removed without further notice, and the wiki will revert to its original miraheze.org subdomain.
</div>
</td>
</tr>
<tr>
<td style="height: 10px;"></td>
</tr>
</tbody>
</table>
EOF;
}
}
unset( $LEWikis );
*/