http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89286

Revision: 89286
Author:   kaldari
Date:     2011-06-01 20:52:02 +0000 (Wed, 01 Jun 2011)
Log Message:
-----------
add static method for looking up campaign name

Modified Paths:
--------------
    trunk/extensions/CentralNotice/SpecialCentralNotice.php

Modified: trunk/extensions/CentralNotice/SpecialCentralNotice.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialCentralNotice.php     2011-06-01 
20:49:33 UTC (rev 89285)
+++ trunk/extensions/CentralNotice/SpecialCentralNotice.php     2011-06-01 
20:52:02 UTC (rev 89286)
@@ -1295,6 +1295,20 @@
                }
        }
        
+       /*
+        * Lookup the name of a campaign based on the campaign ID
+        */
+       public static function getNoticeName( $noticeId ) {
+               $dbr = wfGetDB( DB_SLAVE );
+               if ( is_numeric( $noticeId ) ) {
+                       $row = $dbr->selectRow( 'cn_notices', 'not_name', 
array( 'not_id' => $noticeId ) );
+                       if ( $row ) {
+                               return $row->not_name;
+                       }
+               }
+               return null;
+       }
+       
        function getNoticeProjects( $noticeName ) {
                $dbr = wfGetDB( DB_SLAVE );
                $eNoticeName = htmlspecialchars( $noticeName );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to