r89286 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89285‎ | r89286 | r89287 >
Date:20:52, 1 June 2011
Author:kaldari
Status:ok
Tags:
Comment:
add static method for looking up campaign name
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -1295,6 +1295,20 @@
12961296 }
12971297 }
12981298
 1299+ /*
 1300+ * Lookup the name of a campaign based on the campaign ID
 1301+ */
 1302+ public static function getNoticeName( $noticeId ) {
 1303+ $dbr = wfGetDB( DB_SLAVE );
 1304+ if ( is_numeric( $noticeId ) ) {
 1305+ $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_id' => $noticeId ) );
 1306+ if ( $row ) {
 1307+ return $row->not_name;
 1308+ }
 1309+ }
 1310+ return null;
 1311+ }
 1312+
12991313 function getNoticeProjects( $noticeName ) {
13001314 $dbr = wfGetDB( DB_SLAVE );
13011315 $eNoticeName = htmlspecialchars( $noticeName );

Status & tagging log