Browse Source

Merge branch 'master' of ngxez/Gazelle into master

spaghetti 8 years ago
parent
commit
b2a83a990b

+ 1
- 1
classes/script_start.php View File

158
 
158
 
159
   // $LoggedUser['RatioWatch'] as a bool to disable things for users on Ratio Watch
159
   // $LoggedUser['RatioWatch'] as a bool to disable things for users on Ratio Watch
160
   $LoggedUser['RatioWatch'] = (
160
   $LoggedUser['RatioWatch'] = (
161
-    $LoggedUser['RatioWatchEnds'] != NULL
161
+    !is_null($LoggedUser['RatioWatchEnds'])
162
     && time() < strtotime($LoggedUser['RatioWatchEnds'])
162
     && time() < strtotime($LoggedUser['RatioWatchEnds'])
163
     && ($LoggedUser['BytesDownloaded'] * $LoggedUser['RequiredRatio']) > $LoggedUser['BytesUploaded']
163
     && ($LoggedUser['BytesDownloaded'] * $LoggedUser['RequiredRatio']) > $LoggedUser['BytesUploaded']
164
   );
164
   );

+ 2
- 2
classes/time.class.php View File

5
 
5
 
6
 function time_ago($TimeStamp) {
6
 function time_ago($TimeStamp) {
7
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
7
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
8
-    if ($TimeStamp == NULL) {
8
+    if (is_null($TimeStamp)) {
9
       return false;
9
       return false;
10
     }
10
     }
11
     $TimeStamp = strtotime($TimeStamp);
11
     $TimeStamp = strtotime($TimeStamp);
22
  */
22
  */
23
 function time_diff($TimeStamp, $Levels = 2, $Span = true, $Lowercase = false) {
23
 function time_diff($TimeStamp, $Levels = 2, $Span = true, $Lowercase = false) {
24
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
24
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
25
-    if ($TimeStamp == NULL) {
25
+    if (is_null($TimeStamp)) {
26
       return 'Never';
26
       return 'Never';
27
     }
27
     }
28
     $TimeStamp = strtotime($TimeStamp);
28
     $TimeStamp = strtotime($TimeStamp);

+ 1
- 1
classes/tools.class.php View File

235
       SELECT Warned
235
       SELECT Warned
236
       FROM users_info
236
       FROM users_info
237
       WHERE UserID = $UserID
237
       WHERE UserID = $UserID
238
-        AND Warned != NULL");
238
+        AND Warned IS NOT NULL");
239
     if (G::$DB->has_results()) {
239
     if (G::$DB->has_results()) {
240
       //User was already warned, appending new warning to old.
240
       //User was already warned, appending new warning to old.
241
       list($OldDate) = G::$DB->next_record();
241
       list($OldDate) = G::$DB->next_record();

+ 1
- 1
classes/users.class.php View File

419
       $Str .= Badges::display_badges(Badges::get_displayed_badges($UserID), true);
419
       $Str .= Badges::display_badges(Badges::get_displayed_badges($UserID), true);
420
     }
420
     }
421
 
421
 
422
-    $Str .= ($IsWarned && $UserInfo['Warned'] != NULL) ? '<a href="wiki.php?action=article&amp;id=218"'
422
+    $Str .= ($IsWarned && !is_null($UserInfo['Warned'])) ? '<a href="wiki.php?action=article&amp;id=218"'
423
           . '><img src="'.STATIC_SERVER.'common/symbols/warned.png" alt="Warned" title="Warned'
423
           . '><img src="'.STATIC_SERVER.'common/symbols/warned.png" alt="Warned" title="Warned'
424
           . (G::$LoggedUser['ID'] === $UserID ? ' - Expires ' . date('Y-m-d H:i', strtotime($UserInfo['Warned'])) : '')
424
           . (G::$LoggedUser['ID'] === $UserID ? ' - Expires ' . date('Y-m-d H:i', strtotime($UserInfo['Warned'])) : '')
425
           . '" class="tooltip" /></a>' : '';
425
           . '" class="tooltip" /></a>' : '';

+ 1
- 1
classes/zip.class.php View File

80
 //Handles timestamps
80
 //Handles timestamps
81
 function dostime($TimeStamp = 0) {
81
 function dostime($TimeStamp = 0) {
82
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
82
   if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
83
-    if ($TimeStamp == NULL) {
83
+    if (is_null($TimeStamp)) {
84
       return 'Never';
84
       return 'Never';
85
     }
85
     }
86
     $TimeStamp = strtotime($TimeStamp);
86
     $TimeStamp = strtotime($TimeStamp);

+ 1
- 1
sections/ajax/forum/forum.php View File

140
     $UserInfo = Users::user_info($LastAuthorID);
140
     $UserInfo = Users::user_info($LastAuthorID);
141
     $LastAuthorName = $UserInfo['Username'];
141
     $LastAuthorName = $UserInfo['Username'];
142
     // Bug fix for no last time available
142
     // Bug fix for no last time available
143
-    if ($LastTime == NULL) {
143
+    if (is_null($LastTime)) {
144
       $LastTime = '';
144
       $LastTime = '';
145
     }
145
     }
146
 
146
 

+ 1
- 1
sections/ajax/forum/thread.php View File

261
       'paranoia' => $Paranoia,
261
       'paranoia' => $Paranoia,
262
       'artist' => $Artist === '1',
262
       'artist' => $Artist === '1',
263
       'donor' => $Donor === '1',
263
       'donor' => $Donor === '1',
264
-      'warned' => $Warned !== NULL,
264
+      'warned' => !is_null($Warned),
265
       'avatar' => $Avatar,
265
       'avatar' => $Avatar,
266
       'enabled' => $Enabled === '2' ? false : true,
266
       'enabled' => $Enabled === '2' ? false : true,
267
       'userTitle' => $UserTitle
267
       'userTitle' => $UserTitle

+ 1
- 1
sections/ajax/request.php View File

67
     'authorId'        => (int)$AuthorID,
67
     'authorId'        => (int)$AuthorID,
68
     'name'            => $Username,
68
     'name'            => $Username,
69
     'donor'           => ($Donor == 1),
69
     'donor'           => ($Donor == 1),
70
-    'warned'          => ($Warned != NULL),
70
+    'warned'          => !is_null($Warned),
71
     'enabled'         => ($Enabled == 2 ? false : true),
71
     'enabled'         => ($Enabled == 2 ? false : true),
72
     'class'           => Users::make_class_string($PermissionID),
72
     'class'           => Users::make_class_string($PermissionID),
73
     'addedTime'       => $AddedTime,
73
     'addedTime'       => $AddedTime,

+ 1
- 1
sections/ajax/tcomments.php View File

23
       'authorName' => $Username,
23
       'authorName' => $Username,
24
       'artist' => $Artist == 1,
24
       'artist' => $Artist == 1,
25
       'donor' => $Donor == 1,
25
       'donor' => $Donor == 1,
26
-      'warned' => ($Warned != NULL),
26
+      'warned' => !is_null($Warned),
27
       'avatar' => $Avatar,
27
       'avatar' => $Avatar,
28
       'enabled' => ($Enabled == 2 ? false : true),
28
       'enabled' => ($Enabled == 2 ? false : true),
29
       'userTitle' => $UserTitle
29
       'userTitle' => $UserTitle

+ 2
- 2
sections/ajax/user.php View File

308
 }
308
 }
309
 
309
 
310
 //Bugfix for no access time available
310
 //Bugfix for no access time available
311
-if ($LastAccess == NULL) {
311
+if (is_null($LastAccess)) {
312
   $LastAccess = '';
312
   $LastAccess = '';
313
 }
313
 }
314
 
314
 
342
     'paranoia'      => (int)$ParanoiaLevel,
342
     'paranoia'      => (int)$ParanoiaLevel,
343
     'paranoiaText'  => $ParanoiaLevelText,
343
     'paranoiaText'  => $ParanoiaLevelText,
344
     'donor'         => ($Donor == 1),
344
     'donor'         => ($Donor == 1),
345
-    'warned'        => ($Warned != NULL),
345
+    'warned'        => !is_null($Warned),
346
     'enabled'       => ($Enabled == '1' || $Enabled == '0' || !$Enabled),
346
     'enabled'       => ($Enabled == '1' || $Enabled == '0' || !$Enabled),
347
     'passkey'       => $torrent_pass
347
     'passkey'       => $torrent_pass
348
   ),
348
   ),

+ 1
- 1
sections/ajax/usersearch.php View File

44
     'userId' => (int)$UserID,
44
     'userId' => (int)$UserID,
45
     'username' => $Username,
45
     'username' => $Username,
46
     'donor' => $Donor == 1,
46
     'donor' => $Donor == 1,
47
-    'warned' => ($Warned != NULL),
47
+    'warned' => !is_null($Warned),
48
     'enabled' => ($Enabled == 2 ? false : true),
48
     'enabled' => ($Enabled == 2 ? false : true),
49
     'class' => Users::make_class_string($PermissionID),
49
     'class' => Users::make_class_string($PermissionID),
50
     'avatar' => $Avatar
50
     'avatar' => $Avatar

+ 1
- 1
sections/forums/poll_mod.php View File

39
 }
39
 }
40
 
40
 
41
 if (isset($_POST['feature'])) {
41
 if (isset($_POST['feature'])) {
42
-  if (!$Featured || $Featured == NULL) {
42
+  if (!$Featured || is_null($Featured)) {
43
     $Featured = sqltime();
43
     $Featured = sqltime();
44
     $Cache->cache_value('polls_featured',$TopicID,0);
44
     $Cache->cache_value('polls_featured',$TopicID,0);
45
     $DB->query('
45
     $DB->query('

+ 2
- 2
sections/forums/thread.php View File

260
 
260
 
261
 ?>
261
 ?>
262
   <div class="box thin clear">
262
   <div class="box thin clear">
263
-    <div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' [Closed]'; } ?><? if ($Featured && $Featured !== NULL) { echo ' [Featured]'; } ?></strong> <a href="#" onclick="$('#threadpoll').gtoggle(); log_hit(); return false;" class="brackets">View</a></div>
263
+    <div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' [Closed]'; } ?><? if ($Featured && !is_null($Featured)) { echo ' [Featured]'; } ?></strong> <a href="#" onclick="$('#threadpoll').gtoggle(); log_hit(); return false;" class="brackets">View</a></div>
264
     <div class="pad<? if (/*$LastRead !== null || */$ThreadInfo['IsLocked']) { echo ' hidden'; } ?>" id="threadpoll">
264
     <div class="pad<? if (/*$LastRead !== null || */$ThreadInfo['IsLocked']) { echo ' hidden'; } ?>" id="threadpoll">
265
       <p><strong><?=display_str($Question)?></strong></p>
265
       <p><strong><?=display_str($Question)?></strong></p>
266
 <?  if ($UserResponse !== null || $Closed || $ThreadInfo['IsLocked'] || !Forums::check_forumperm($ForumID)) { ?>
266
 <?  if ($UserResponse !== null || $Closed || $ThreadInfo['IsLocked'] || !Forums::check_forumperm($ForumID)) { ?>
383
       </div>
383
       </div>
384
 <?  }
384
 <?  }
385
   if (check_perms('forums_polls_moderate') && !$RevealVoters) {
385
   if (check_perms('forums_polls_moderate') && !$RevealVoters) {
386
-    if (!$Featured || $Featured == NULL) {
386
+    if (!$Featured || is_null($Featured)) {
387
 ?>
387
 ?>
388
       <form class="manage_form" name="poll" action="forums.php" method="post">
388
       <form class="manage_form" name="poll" action="forums.php" method="post">
389
         <input type="hidden" name="action" value="poll_mod" />
389
         <input type="hidden" name="action" value="poll_mod" />

+ 2
- 2
sections/login/index.php View File

68
               m.PassHash = '".db_string(Users::make_sec_hash($_REQUEST['password']))."',
68
               m.PassHash = '".db_string(Users::make_sec_hash($_REQUEST['password']))."',
69
               i.ResetKey = '',
69
               i.ResetKey = '',
70
               m.LastLogin = NOW(),
70
               m.LastLogin = NOW(),
71
-              i.ResetExpires IS NULL
71
+              i.ResetExpires = NULL
72
             WHERE m.ID = '$UserID'
72
             WHERE m.ID = '$UserID'
73
               AND i.UserID = m.ID");
73
               AND i.UserID = m.ID");
74
           $DB->query("
74
           $DB->query("
94
         $DB->query("
94
         $DB->query("
95
           UPDATE users_info
95
           UPDATE users_info
96
           SET ResetKey = '',
96
           SET ResetKey = '',
97
-            ResetExpires IS NULL
97
+            ResetExpires = NULL
98
           WHERE UserID = '$UserID'");
98
           WHERE UserID = '$UserID'");
99
         $_SESSION['reseterr'] = 'The link you were given has expired.'; // Error message to display on form
99
         $_SESSION['reseterr'] = 'The link you were given has expired.'; // Error message to display on form
100
       }
100
       }

+ 1
- 1
sections/requests/take_unfill.php View File

39
   UPDATE requests
39
   UPDATE requests
40
   SET TorrentID = 0,
40
   SET TorrentID = 0,
41
     FillerID = 0,
41
     FillerID = 0,
42
-    TimeFilled IS NULL,
42
+    TimeFilled = NULL,
43
     Visible = 1
43
     Visible = 1
44
   WHERE ID = $RequestID");
44
   WHERE ID = $RequestID");
45
 
45
 

+ 2
- 2
sections/schedule/daily/ratio_watch.php View File

20
   $DB->query("
20
   $DB->query("
21
     UPDATE users_info AS ui
21
     UPDATE users_info AS ui
22
       JOIN users_main AS um ON um.ID = ui.UserID
22
       JOIN users_main AS um ON um.ID = ui.UserID
23
-    SET ui.RatioWatchEnds IS NULL,
23
+    SET ui.RatioWatchEnds = NULL,
24
       ui.RatioWatchDownload = '0',
24
       ui.RatioWatchDownload = '0',
25
       um.can_leech = '1',
25
       um.can_leech = '1',
26
       ui.AdminComment = CONCAT('$sqltime - Leeching re-enabled by adequate ratio.\n\n', ui.AdminComment)
26
       ui.AdminComment = CONCAT('$sqltime - Leeching re-enabled by adequate ratio.\n\n', ui.AdminComment)
53
   $DB->query("
53
   $DB->query("
54
     UPDATE users_info AS ui
54
     UPDATE users_info AS ui
55
       JOIN users_main AS um ON um.ID = ui.UserID
55
       JOIN users_main AS um ON um.ID = ui.UserID
56
-    SET ui.RatioWatchEnds IS NULL,
56
+    SET ui.RatioWatchEnds = NULL,
57
       ui.RatioWatchDownload = '0',
57
       ui.RatioWatchDownload = '0',
58
       um.can_leech = '1'
58
       um.can_leech = '1'
59
     WHERE ui.UserID IN(".implode(',', $OffRatioWatch).')');
59
     WHERE ui.UserID IN(".implode(',', $OffRatioWatch).')');

+ 1
- 1
sections/schedule/hourly/expire_warnings.php View File

13
 
13
 
14
 $DB->query("
14
 $DB->query("
15
   UPDATE users_info
15
   UPDATE users_info
16
-  SET Warned IS NULL
16
+  SET Warned = NULL
17
   WHERE Warned < '$sqltime'");
17
   WHERE Warned < '$sqltime'");
18
 ?>
18
 ?>

+ 1
- 1
sections/store/promotion.php View File

115
 
115
 
116
     }
116
     }
117
 
117
 
118
-    if ($Warned != NULL) {
118
+    if (!is_null($Warned)) {
119
       $Err[] = "You cannot be promoted while warned";
119
       $Err[] = "You cannot be promoted while warned";
120
     }
120
     }
121
 
121
 

+ 2
- 2
sections/torrents/details.php View File

571
             <blockquote>
571
             <blockquote>
572
               Uploaded by <?=Users::format_username($UserID, false, false, false)?> <?=time_diff($TorrentTime);?>
572
               Uploaded by <?=Users::format_username($UserID, false, false, false)?> <?=time_diff($TorrentTime);?>
573
 <?  if ($Seeders == 0) {
573
 <?  if ($Seeders == 0) {
574
-    if ($LastActive != NULL && time() - strtotime($LastActive) >= 1209600) { ?>
574
+    if (!is_null($LastActive) && time() - strtotime($LastActive) >= 1209600) { ?>
575
             <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
575
             <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
576
 <?    } else { ?>
576
 <?    } else { ?>
577
             <br />Last active: <?=time_diff($LastActive); ?>
577
             <br />Last active: <?=time_diff($LastActive); ?>
578
 <?    }
578
 <?    }
579
   }
579
   }
580
 
580
 
581
-  if (($Seeders == 0 && $LastActive != NULL && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
581
+  if (($Seeders == 0 && !is_null($LastActive) && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
582
             <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>" class="brackets">Request re-seed</a>
582
             <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>" class="brackets">Request re-seed</a>
583
 <?  }
583
 <?  }
584
 
584
 

+ 2
- 2
sections/torrents/functions.php View File

416
             <blockquote>
416
             <blockquote>
417
               Uploaded by <?=(Users::format_username($UserID, false, false, false))?> <?=time_diff($TorrentTime);?>
417
               Uploaded by <?=(Users::format_username($UserID, false, false, false))?> <?=time_diff($TorrentTime);?>
418
 <?  if ($Seeders == 0) {
418
 <?  if ($Seeders == 0) {
419
-    if ($LastActive != NULL && time() - strtotime($LastActive) >= 1209600) { ?>
419
+    if (!is_null($LastActive) && time() - strtotime($LastActive) >= 1209600) { ?>
420
                 <br /><strong>Last active: <?=time_diff($LastActive);?></strong>
420
                 <br /><strong>Last active: <?=time_diff($LastActive);?></strong>
421
 <?    } else { ?>
421
 <?    } else { ?>
422
                 <br />Last active: <?=time_diff($LastActive);?>
422
                 <br />Last active: <?=time_diff($LastActive);?>
423
 <?    }
423
 <?    }
424
-    if ($LastActive != NULL && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
424
+    if (!is_null($LastActive) && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
425
                 <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=($TorrentID)?>&amp;groupid=<?=($GroupID)?>" class="brackets">Request re-seed</a>
425
                 <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=($TorrentID)?>&amp;groupid=<?=($GroupID)?>" class="brackets">Request re-seed</a>
426
 <?    }
426
 <?    }
427
   } ?>
427
   } ?>

+ 1
- 1
sections/torrents/reseed.php View File

16
   if (time() - strtotime($LastReseedRequest) < 864000) {
16
   if (time() - strtotime($LastReseedRequest) < 864000) {
17
     error('There was already a re-seed request for this torrent within the past 10 days.');
17
     error('There was already a re-seed request for this torrent within the past 10 days.');
18
   }
18
   }
19
-  if ($LastActive == NULL || time() - strtotime($LastActive) < 345678) {
19
+  if (is_null($LastActive) || time() - strtotime($LastActive) < 345678) {
20
     error(403);
20
     error(403);
21
   }
21
   }
22
 }
22
 }

+ 6
- 6
sections/user/takemoderate.php View File

226
 if ($_POST['ResetRatioWatch'] && check_perms('users_edit_reset_keys')) {
226
 if ($_POST['ResetRatioWatch'] && check_perms('users_edit_reset_keys')) {
227
   $DB->query("
227
   $DB->query("
228
     UPDATE users_info
228
     UPDATE users_info
229
-    SET RatioWatchEnds IS NULL, RatioWatchDownload = '0', RatioWatchTimes = '0'
229
+    SET RatioWatchEnds = NULL, RatioWatchDownload = '0', RatioWatchTimes = '0'
230
     WHERE UserID = '$UserID'");
230
     WHERE UserID = '$UserID'");
231
   $EditSummary[] = 'RatioWatch history reset';
231
   $EditSummary[] = 'RatioWatch history reset';
232
 }
232
 }
486
   $Cache->delete_value("user_badges_".$UserID);
486
   $Cache->delete_value("user_badges_".$UserID);
487
 }
487
 }
488
 
488
 
489
-if ($Warned == 1 && $Cur['Warned'] == NULL && check_perms('users_warn')) {
489
+if ($Warned == 1 && is_null($Cur['Warned']) && check_perms('users_warn')) {
490
   $Weeks = 'week' . ($WarnLength === 1 ? '' : 's');
490
   $Weeks = 'week' . ($WarnLength === 1 ? '' : 's');
491
   Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=".site_url()."wiki.php?action=article&amp;id=218]warned for $WarnLength {$Weeks}[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was:
491
   Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=".site_url()."wiki.php?action=article&amp;id=218]warned for $WarnLength {$Weeks}[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was:
492
 [quote]{$WarnReason}[/quote]");
492
 [quote]{$WarnReason}[/quote]");
498
   $EditSummary[] = db_string($Msg);
498
   $EditSummary[] = db_string($Msg);
499
   $LightUpdates['Warned'] = time_plus(3600 * 24 * 7 * $WarnLength);
499
   $LightUpdates['Warned'] = time_plus(3600 * 24 * 7 * $WarnLength);
500
 
500
 
501
-} elseif ($Warned == 0 && $Cur['Warned'] != NULL && check_perms('users_warn')) {
502
-  $UpdateSet[] = "Warned IS NULL";
501
+} elseif ($Warned == 0 && !is_null($Cur['Warned']) && check_perms('users_warn')) {
502
+  $UpdateSet[] = "Warned = NULL";
503
   $EditSummary[] = 'warning removed';
503
   $EditSummary[] = 'warning removed';
504
   $LightUpdates['Warned'] = NULL;
504
   $LightUpdates['Warned'] = NULL;
505
 
505
 
700
     Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass'], 'visible' => $VisibleTrIP));
700
     Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass'], 'visible' => $VisibleTrIP));
701
 
701
 
702
     if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded'] / $Cur['Downloaded'] >= $Cur['RequiredRatio'])) {
702
     if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded'] / $Cur['Downloaded'] >= $Cur['RequiredRatio'])) {
703
-      $UpdateSet[] = "i.RatioWatchEnds IS NULL";
703
+      $UpdateSet[] = "i.RatioWatchEnds = NULL";
704
       $CanLeech = 1;
704
       $CanLeech = 1;
705
       $UpdateSet[] = "m.can_leech = '1'";
705
       $UpdateSet[] = "m.can_leech = '1'";
706
       $UpdateSet[] = "i.RatioWatchDownload = '0'";
706
       $UpdateSet[] = "i.RatioWatchDownload = '0'";
707
     } else {
707
     } else {
708
       $EnableStr .= ' (Ratio: '.Format::get_ratio_html($Cur['Uploaded'], $Cur['Downloaded'], false).', RR: '.number_format($Cur['RequiredRatio'],2).')';
708
       $EnableStr .= ' (Ratio: '.Format::get_ratio_html($Cur['Uploaded'], $Cur['Downloaded'], false).', RR: '.number_format($Cur['RequiredRatio'],2).')';
709
-      if ($Cur['RatioWatchEnds'] != NULL) {
709
+      if (!is_null($Cur['RatioWatchEnds'])) {
710
         $UpdateSet[] = "i.RatioWatchEnds = NOW()";
710
         $UpdateSet[] = "i.RatioWatchEnds = NOW()";
711
         $UpdateSet[] = "i.RatioWatchDownload = m.Downloaded";
711
         $UpdateSet[] = "i.RatioWatchDownload = m.Downloaded";
712
         $CanLeech = 0;
712
         $CanLeech = 0;

+ 4
- 4
sections/user/user.php View File

375
         <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
375
         <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>><a href="userhistory.php?action=token_history&amp;userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
376
 <?
376
 <?
377
   }
377
   }
378
-  if (($OwnProfile || check_perms('users_mod')) && $Warned != NULL) {
378
+  if (($OwnProfile || check_perms('users_mod')) && !is_null($Warned)) {
379
 ?>
379
 ?>
380
         <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
380
         <li<?=($Override === 2 ? ' class="paranoia_override"' : '')?>>Warning expires in: <?=time_diff((date('Y-m-d H:i', strtotime($Warned))))?></li>
381
 <?  } ?>
381
 <?  } ?>
654
   </div>
654
   </div>
655
   <div class="main_column">
655
   <div class="main_column">
656
 <?
656
 <?
657
-if ($RatioWatchEnds != NULL
657
+if (!is_null($RatioWatchEnds)
658
     && (time() < strtotime($RatioWatchEnds))
658
     && (time() < strtotime($RatioWatchEnds))
659
     && ($Downloaded * $RequiredRatio) > $Uploaded
659
     && ($Downloaded * $RequiredRatio) > $Uploaded
660
     ) {
660
     ) {
1324
       <tr>
1324
       <tr>
1325
         <td class="label">Warned:</td>
1325
         <td class="label">Warned:</td>
1326
         <td>
1326
         <td>
1327
-          <input type="checkbox" name="Warned"<? if ($Warned != NULL) { ?> checked="checked"<? } ?> />
1327
+          <input type="checkbox" name="Warned"<? if (!is_null($Warned)) { ?> checked="checked"<? } ?> />
1328
         </td>
1328
         </td>
1329
       </tr>
1329
       </tr>
1330
-<?    if ($Warned == NULL) { // user is not warned ?>
1330
+<?    if (is_null($Warned)) { // user is not warned ?>
1331
       <tr>
1331
       <tr>
1332
         <td class="label">Expiration:</td>
1332
         <td class="label">Expiration:</td>
1333
         <td>
1333
         <td>

+ 4
- 4
sections/userhistory/email_history2.php View File

114
   $Invite['EndTime'] = $Joined;
114
   $Invite['EndTime'] = $Joined;
115
   $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
115
   $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
116
   $Invite['IP'] = $History[0]['IP'];
116
   $Invite['IP'] = $History[0]['IP'];
117
-  if ($Current['StartTime'] == NULL) {
117
+  if (is_null($Current['StartTime'])) {
118
     $Current['StartTime'] = $Joined;
118
     $Current['StartTime'] = $Joined;
119
   }
119
   }
120
 } else {
120
 } else {
121
   foreach ($History as $Key => $Val) {
121
   foreach ($History as $Key => $Val) {
122
-    if (isset($History[$Key + 1]) && $History[$Key + 1]['Time'] == NULL && $Val['Time'] != NULL) {
122
+    if (isset($History[$Key + 1]) && is_null($History[$Key + 1]['Time']) && is_null($Val['Time'])) {
123
       // Invited email
123
       // Invited email
124
       $Invite['Email'] = $Val['Email'];
124
       $Invite['Email'] = $Val['Email'];
125
       $Invite['EndTime'] = $Joined;
125
       $Invite['EndTime'] = $Joined;
126
       $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
126
       $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
127
       $Invite['IP'] = $Val['IP'];
127
       $Invite['IP'] = $Val['IP'];
128
 
128
 
129
-    } elseif (isset($History[$Key - 1]) && $History[$Key - 1]['Email'] != $Val['Email'] && $Val['Time'] != NULL) {
129
+    } elseif (isset($History[$Key - 1]) && $History[$Key - 1]['Email'] != $Val['Email'] && !is_null($Val['Time'])) {
130
       // Old email
130
       // Old email
131
       $i = 1;
131
       $i = 1;
132
       while ($Val['Email'] == $History[$Key + $i]['Email']) {
132
       while ($Val['Email'] == $History[$Key + $i]['Email']) {
133
         $i++;
133
         $i++;
134
       }
134
       }
135
-      $Old[$Key]['StartTime'] = (isset($History[$Key + $i]) && $History[$Key + $i]['Time'] != NULL) ? $History[$Key + $i]['Time'] : $Joined;
135
+      $Old[$Key]['StartTime'] = (isset($History[$Key + $i]) && !is_null($History[$Key + $i]['Time'])) ? $History[$Key + $i]['Time'] : $Joined;
136
       $Old[$Key]['EndTime'] = $Val['Time'];
136
       $Old[$Key]['EndTime'] = $Val['Time'];
137
       $Old[$Key]['IP'] = $Val['IP'];
137
       $Old[$Key]['IP'] = $Val['IP'];
138
       $Old[$Key]['ElapsedTime'] = date(time() + strtotime($Old[$Key]['EndTime']) - strtotime($Old[$Key]['StartTime']));
138
       $Old[$Key]['ElapsedTime'] = date(time() + strtotime($Old[$Key]['EndTime']) - strtotime($Old[$Key]['StartTime']));

Loading…
Cancel
Save