-
-
Notifications
You must be signed in to change notification settings - Fork 248
/
Sitenotice.php
124 lines (110 loc) · 5.7 KB
/
Sitenotice.php
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
<?php
$wgNoticeProject = 'all';
if ( $wmgSiteNoticeOptOut ) {
// Only show important notices when optout
$wgNoticeProject = 'optout';
}
// Increment this version number whenever you change the site notice
$wgMajorSiteNoticeID = 89;
/**
* 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%;">
<tbody><tr><td style="font-size: 120%; border-left: 4px solid #fc3; background-color: #fef6e7; padding: 10px 15px; color: black;">
<div data-nosnippet style="padding-top:0.3em; padding-bottom:0.1em;">
<div class="floatleft"><img alt="Server migration" src="https://upload.wikimedia.org/wikipedia/commons/d/df/OOjs_UI_icon_check.svg" decoding="async" width="50" height="50"></div>
<div style="font-weight: bold; color: black;">
Planned brief downtime
</div>
<div style="padding-bottom: 15px; font-size: 13pt; color: black;">
There will be emergency maintenance on July 5th, 2024 at 00:00 UTC. This maintenance will likely last until about 00:30 (about 30 minutes), but could last a bit longer. During this time all wikis and other Miraheze services will be completly unavailable. We apologize for the inconvenience.
</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#Migration_to_new_servers">
<span class="oo-ui-iconElement-icon oo-ui-icon-info"></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;
}
//}
*/
// 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;
}
} */
// Meta Tech NS sitenotice
/* if ( $wgDBname === 'metawiki' ) {
$wgHooks['SiteNoticeAfter'][] = 'wfMetaSiteNotice';
function wfMetaSiteNotice( &$siteNotice, $skin ) {
$title = $skin->getTitle();
if ( $title->getNamespace() !== 1600 ) {
return;
}
$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 #fc3; background-color: #fef6e7; 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/9/9e/OOjs_UI_icon_web-progressive.svg" decoding="async" width="35" height="35" style="float: left; margin-right: 10px;">
<div style="font-weight: bold;">Vacancy</div>
SRE is looking for Software Engineers to join our MediaWiki Team to develop code to improve the user experience of Miraheze users, build tools that allow communities to grow, and tools that support our valuable volunteers in managing a dynamic and active global community. If you think this could be you, please do have a look at the <a href="https://meta.miraheze.org/wiki/Miraheze_Vacancies#Software_Engineer_(Developer)_(MediaWiki)">the Vacancies page</a> which includes more information.
</div> <br /> Other vacancies are also available on that page.
</td>
</tr>
<tr>
<td style="height: 10px;"></td>
</tr>
</tbody>
</table>
EOF;
}
} */