4 class SiteStatsUpdate
{
6 var $mViews, $mEdits, $mGood;
8 function SiteStatsUpdate( $views, $edits, $good )
10 $this->mViews
= $views;
11 $this->mEdits
= $edits;
19 if ( $this->mViews
< 0 ) { $m = "-1"; }
20 else if ( $this->mViews
> 0 ) { $m = "+1"; }
22 array_push( $a, "ss_total_views=(ss_total_views$m)" );
24 if ( $this->mEdits
< 0 ) { $m = "-1"; }
25 else if ( $this->mEdits
> 0 ) { $m = "+1"; }
27 array_push( $a, "ss_total_edits=(ss_total_edits$m)" );
29 if ( $this->mGood
< 0 ) { $m = "-1"; }
30 else if ( $this->mGood
> 0 ) { $m = "+1"; }
32 array_push( $a, "ss_good_articles=(ss_good_articles$m)" );
34 $sql = "UPDATE LOW_PRIORITY site_stats SET " . implode ( ",", $a ) .
36 wfQuery( $sql, "SiteStatsUpdate::doUpdate" );