Browse Source

Fix expiry time issues with front page freeleech

spaghetti 8 years ago
parent
commit
c19fdb2851
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      sections/index/private.php

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

@@ -130,7 +130,7 @@ if (($Freeleeches = $Cache->get_value('shop_freeleech_list')) === false) {
130 130
   $DB->query("
131 131
     SELECT
132 132
       TorrentID,
133
-      GREATEST(NOW(), ExpiryTime),
133
+      UNIX_TIMESTAMP(ExpiryTime),
134 134
       Name,
135 135
       WikiImage
136 136
     FROM shop_freeleeches AS sf
@@ -149,7 +149,7 @@ if (count($Freeleeches)) {
149 149
 <?
150 150
   for ($i = 0; $i < count($Freeleeches); $i++) {
151 151
     list($ID, $ExpiryTime, $Name, $Image) = $Freeleeches[$i];
152
-    $DisplayTime = '('.str_replace(['week','day','hour','min','Just now','s',' '],['w','d','h','m','0m'],time_diff($ExpiryTime, 1, false)).') ';
152
+    $DisplayTime = '('.str_replace(['week','day','hour','min','Just now','s',' '],['w','d','h','m','0m'],time_diff(max($ExpiryTime, time()), 1, false)).') ';
153 153
     $DisplayName = '<a href="torrents.php?torrentid='.$ID.'"';
154 154
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
155 155
       $DisplayName .= " onmouseover=\"getCover(event)\" cover=\"".ImageTools::process($Image)."\" onmouseleave=\"ungetCover(event)\"";

Loading…
Cancel
Save