Browse Source

Correctly display non-English titles for shop freeleeches

spaghetti 8 years ago
parent
commit
7637aeb8d2
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      sections/index/private.php

+ 6
- 3
sections/index/private.php View File

132
       TorrentID,
132
       TorrentID,
133
       UNIX_TIMESTAMP(ExpiryTime),
133
       UNIX_TIMESTAMP(ExpiryTime),
134
       Name,
134
       Name,
135
+      NameRJ,
136
+      NameJP,
135
       WikiImage
137
       WikiImage
136
     FROM shop_freeleeches AS sf
138
     FROM shop_freeleeches AS sf
137
     LEFT JOIN torrents AS t on sf.TorrentID=t.ID
139
     LEFT JOIN torrents AS t on sf.TorrentID=t.ID
148
       <ul class="stats nobullet">
150
       <ul class="stats nobullet">
149
 <?
151
 <?
150
   for ($i = 0; $i < count($Freeleeches); $i++) {
152
   for ($i = 0; $i < count($Freeleeches); $i++) {
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(max($ExpiryTime, time()), 1, false)).') ';
153
+    list($ID, $ExpiryTime, $Name, $NameRJ, $NameJP, $Image) = $Freeleeches[$i];
154
+    if ($ExpiryTime < time()) { continue; }
155
+    $DisplayTime = '('.str_replace(['week','day','hour','min','Just now','s',' '],['w','d','h','m','0m'],time_diff($ExpiryTime, 1, false)).') ';
153
     $DisplayName = '<a href="torrents.php?torrentid='.$ID.'"';
156
     $DisplayName = '<a href="torrents.php?torrentid='.$ID.'"';
154
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
157
     if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
155
       $DisplayName .= " onmouseover=\"getCover(event)\" cover=\"".ImageTools::process($Image)."\" onmouseleave=\"ungetCover(event)\"";
158
       $DisplayName .= " onmouseover=\"getCover(event)\" cover=\"".ImageTools::process($Image)."\" onmouseleave=\"ungetCover(event)\"";
156
     }
159
     }
157
-    $DisplayName .= '>'.$Name.'</a>';
160
+    $DisplayName .= '>'.($Name?$Name:($NameRJ?$NameRJ:$NameJP)).'</a>';
158
 ?>
161
 ?>
159
         <li>
162
         <li>
160
           <strong class="fl_time"><?=$DisplayTime?></strong>
163
           <strong class="fl_time"><?=$DisplayTime?></strong>

Loading…
Cancel
Save