function wfGetSiteNotice() { global $wgUser, $wgSiteNotice; $fname = 'wfGetSiteNotice'; wfProfileIn( $fname ); $siteNotice = ''; if( wfRunHooks( 'SiteNoticeBefore', array( &$siteNotice ) ) ) { if( is_object( $wgUser ) && $wgUser->isLoggedIn() ) { $siteNotice = wfGetCachedNotice( 'sitenotice' ); $siteNotice = !$siteNotice ? $wgSiteNotice : $siteNotice; } else { $anonNotice = wfGetCachedNotice( 'anonnotice' ); if( !$anonNotice ) { $siteNotice = wfGetCachedNotice( 'sitenotice' ); $siteNotice = !$siteNotice ? $wgSiteNotice : $siteNotice; } else { $siteNotice = $anonNotice; } } } wfRunHooks( 'SiteNoticeAfter', array( &$siteNotice ) ); wfProfileOut( $fname ); return $siteNotice; }