OSDN Git Service

BugTrack/2455 new plugin: Backword compatibility: Keep init() bugtrack_2398_6
authorumorigu <umorigu@gmail.com>
Mon, 21 May 2018 20:32:56 +0000 (05:32 +0900)
committerumorigu <umorigu@gmail.com>
Mon, 21 May 2018 20:32:56 +0000 (05:32 +0900)
Some external plugin calls plugin_new_init() directly
and use the messages.
So we need keep this method for the compatibility.

plugin/new.inc.php

index a0a6ef5..c6f701e 100644 (file)
 
 define('PLUGIN_NEW_DATE_FORMAT', '<span class="comment_date">%s</span>');
 
+function plugin_new_init()
+{
+       // Backword compatibility: Keep plugin_new_init() and the messages
+       // Elapsed time => New! message with CSS
+       $messages['_plugin_new_elapses'] = array(
+               60 * 60 * 24 * 1 => ' <span class="new1" title="%s">New!</span>',  // 1day
+               60 * 60 * 24 * 5 => ' <span class="new5" title="%s">New</span>');  // 5days
+       set_plugin_messages($messages);
+}
+
 function plugin_new_inline()
 {
        global $vars;