public static function GivePoints($UserID, $Points, $Source = 'Other', $Timestamp = FALSE) {
      if (!$Timestamp)
         $Timestamp = time();
      
      if (is_array($Source)) {
         $CategoryID = GetValue('CategoryID', $Source, 0);
         $Source = $Source[0];
      } else {
         $CategoryID = 0;
      }
      
      if ($CategoryID > 0) {
         $CategoryIDs = array($CategoryID, 0);
      } else {
         $CategoryIDs = array($CategoryID);
      }
      
      foreach ($CategoryIDs as $ID) {
         // Increment source points for the user.
         self::_GivePoints($UserID, $Points, 'a', $Source, $ID);

         // Increment total points for the user.
         self::_GivePoints($UserID, $Points, 'w', 'Total', $ID, $Timestamp);
         self::_GivePoints($UserID, $Points, 'm', 'Total', $ID, $Timestamp);
         self::_GivePoints($UserID, $Points, 'a', 'Total', $ID, $Timestamp);

         // Increment global daily points.
         self::_GivePoints(0, $Points, 'd', 'Total', $ID, $Timestamp);
      }
      
      // Grab the user's total points.
      $Points = Gdn::SQL()->GetWhere('UserPoints', array('UserID' => $UserID, 'SlotType' => 'a', 'Source' => 'Total', 'CategoryID' => 0))->Value('Points');
      
//      Gdn::Controller()->InformMessage('Points: '.$Points);
      Gdn::UserModel()->SetField($UserID, 'Points', $Points);
      
      // Fire a give points event.
      Gdn::UserModel()->EventArguments['UserID'] = $UserID;
      Gdn::UserModel()->EventArguments['CategoryID'] = $CategoryID;
      Gdn::UserModel()->EventArguments['Points'] = $Points;
      Gdn::UserModel()->FireEvent('GivePoints');
   }