Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
How to change date and time to uploaded
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2020-04-24 22:48:34
Hi i looked around on the forum could not find any info or i missed it somewhere

I wanted to know how can i change the ADDED column to not show the date and time but rather show uploaded 10 mins ago for instance

[ATTACH type="full"]5472[/ATTACH]
Screenshot_1.png
Screenshot_1.png

Torrent Trader PDO/MVC 2021
Xampp Windows 10 21H1
Apache Version: Apache/2.4.48 (Win64)
Mysql Version: 10.4.20-MariaDB
PHP Version: 8.0.9
2020-04-25 07:56:47
Here m8 shadows did this before look for a time function in the torrenttable function in functions.php
[URL unfurl="true"]https://www.torrenttrader.xyz/index.php?threads/solved-change-timestamp-of-torrents.9776/[/url]
2020-04-25 14:22:03
Pretty nifty. I never thought about this before. Cool shadows. functions.php
            case 'added':
           //    print("<td class='ttable_col$x' align='center'>".date("n-d-Y g:i a", utc_to_tz_time($row['added']))."</td>");
               print("<td class='ttable_col$x' align='center'>".get_elapsed_time(sql_timestamp_to_unix_timestamp($row['added']))."</td>");
           break;

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-04-25 15:45:07
thanks guys was struggling a bit ? lack of experience but i see i did not add the correct code
Torrent Trader PDO/MVC 2021
Xampp Windows 10 21H1
Apache Version: Apache/2.4.48 (Win64)
Mysql Version: 10.4.20-MariaDB
PHP Version: 8.0.9
2020-05-02 03:01:07
This is pretty cool. I didnt create this, just found it and tried it. Try this. Functions.php
add this function
///ELAPSED TIME SINCE TORRENT WAS UPLOADED
function get_time_elapsed($datetime, $full = false)
{
   $now = new DateTime;
   $ago = new DateTime($datetime);
   $diff = $now->diff($ago);
   $diff->w = floor($diff->d / 7);
   $diff->d -= $diff->w * 7;
   $string = array(
       'y' => 'year',
       'm' => 'month',
       'w' => 'week',
       'd' => 'day',
       'h' => 'hour',
       'i' => 'minute',
       's' => 'second',
   );
   foreach ($string as $k => &$v)
   {
       if ($diff->$k)
       {
           $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');
       }
       else
       {
           unset($string[$k]);
    }
   }
   if (!$full) $string = array_slice($string, 0, 1);
   return $string ? implode(', ', $string) . ' ago' : 'just now';
}
///END ELAPSE TIME

find
            case 'added':
               print("<td class='ttable_col$x' align='center'>".date("n-d-Y g:i a", utc_to_tz_time($row['added']))."</td>");
           break;

change to
            case 'added':
           //    print("<td class='ttable_col$x' align='center'>".date("n-d-Y g:i a", utc_to_tz_time($row['added']))."</td>");
               print("<td class='ttable_col$x' align='center'>".get_time_elapsed($row['added'])."</td>");
           break;

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728