Move image-specific methods to Image-class
[lhc/web/wiklou.git] / includes / RecentChange.php
index f2138e1..fb385bc 100644 (file)
@@ -1,4 +1,4 @@
-<?
+<?php
 # Utility class for creating new RC entries
 
 define( "RC_EDIT", 0);
@@ -21,6 +21,7 @@ mAttributes:
        rc_this_oldid   old_id associated with this entry (or zero)
        rc_last_oldid   old_id associated with the entry before this one (or zero)
        rc_bot          is bot, hidden
+       rc_new          obsolete, use rc_type==RC_NEW
 
 mExtra:
        prefixedDBkey   prefixed db key, used by external app via msg queue
@@ -125,8 +126,12 @@ class RecentChange
        
        # Makes an entry in the database corresponding to an edit
        /*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, 
-               $oldId, $lastTimestamp ) 
+               $oldId, $lastTimestamp, $bot = "default" ) 
        {
+               if ( $bot == "default " ) {
+                       $bot = $user->isBot();
+               }
+
                $rc = new RecentChange;
                $rc->mAttribs = array(
                        'rc_timestamp'  => $timestamp,
@@ -141,9 +146,10 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => $oldId,
-                       'rc_bot'        => $user->isBot() ? 1 : 0,
+                       'rc_bot'        => $bot ? 1 : 0,
                        'rc_moved_to_ns'        => 0,
-                       'rc_moved_to_title'     => ''
+                       'rc_moved_to_title'     => '',
+                       'rc_new'        => 0 # obsolete
                );
                
                $rc->mExtra =  array(
@@ -155,8 +161,11 @@ class RecentChange
        
        # Makes an entry in the database corresponding to page creation
        # Note: the title object must be loaded with the new id using resetArticleID()
-       /*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment )
+       /*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default" )
        {
+               if ( $bot == "default" ) {
+                       $bot = $user->isBot();
+               }
                $rc = new RecentChange;
                $rc->mAttribs = array(
                        'rc_timestamp'  => $timestamp,
@@ -171,9 +180,10 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isBot() ? 1 : 0,
+                       'rc_bot'        => $bot ? 1 : 0,
                        'rc_moved_to_ns'        => 0,
-                       'rc_moved_to_title'     => ''
+                       'rc_moved_to_title'     => '',
+                       'rc_new'        => 1 # obsolete
                );
                
                $rc->mExtra =  array(
@@ -202,7 +212,8 @@ class RecentChange
                        'rc_last_oldid' => 0,
                        'rc_bot'        => $user->isBot() ? 1 : 0,
                        'rc_moved_to_ns'        => $newTitle->getNamespace(),
-                       'rc_moved_to_title'     => $newTitle->getDBkey()
+                       'rc_moved_to_title'     => $newTitle->getDBkey(),
+                       'rc_new'        => 0 # obsolete
                );
                
                $rc->mExtra = array(
@@ -233,7 +244,8 @@ class RecentChange
                        'rc_last_oldid' => 0,
                        'rc_bot'        => 0,
                        'rc_moved_to_ns'        => 0,
-                       'rc_moved_to_title'     => ''
+                       'rc_moved_to_title'     => '',
+                       'rc_new'        => 0 # obsolete
                );
                $rc->mExtra =  array(
                        'prefixedDBkey' => $title->getPrefixedDBkey(),
@@ -267,7 +279,8 @@ class RecentChange
                        'rc_last_oldid' => 0,
                        'rc_bot'        => 0,
                        'rc_moved_to_ns'        => 0,
-                       'rc_moved_to_title'     => ''
+                       'rc_moved_to_title'     => '',
+                       'rc_new' => $row->cur_is_new # obsolete
                );
 
                $this->mExtra = array();