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
All forum posts
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / General / General Chat

2021-06-19 06:31:36
Hi guy, i have a feeling i have written about this "wish" before but i can't find it so i will write again.
I need a link for "all forum posts" from each user on the tracker, something similar to what we have in the V4 or PDO version [click on the link to open a list of all forum posts that user has typed].

I tried to do something on my experience but it didn't work out.
I hope it’s not a big wish or too hard for one MOD

Have a nice weekend




www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-06-19 06:34:11
2021-06-19 08:09:35
I can not test but i tried converting for v3 if no one else can help
im sure mod was posted on TT.org for v3  

The links and images wont work but if it loads its a good starting point lets see if the page shows first lol
create userforumpost.php

<?php
require_once("backend/functions.php");
dbconn();
       $id = (int) ($_GET["id"] ?? 0);
       if (!isset($id) || !$id) {
autolink('home', "no id");
       }

$res = SQL_Query_exec("SELECT
           forum_posts.id, topicid, userid, forum_posts.added, body,
           avatar, signature, username, title, class, uploaded, downloaded, privacy, donated
           FROM forum_posts
           LEFT JOIN users
           ON forum_posts.userid = users.id
           WHERE userid = $id ORDER BY forum_posts.userid "); //$limit
$row = mysqli_fetch_assoc($res);
       if (!$row) {
autolink('home', "User has not posted in forum");
       }
       $title = T_("COMMENTSFOR") . "<a href='profile?id=" . $row['userid'] . "'> $row[username]</a>";

stdhead($title);
begin_frame($title);
       while ($row = mysqli_fetch_assoc($res))) {

           $postername = $row["username"];
           if ($postername == "") {
               $postername = T_("DELUSER");
               $title = T_("DELETED_ACCOUNT");
               $avatar = "";
               $usersignature = "";
               $userdownloaded = "";
               $useruploaded = "";
           } else {
               $privacylevel = $row["privacy"];
               $avatar = htmlspecialchars($row["avatar"]);
               $title = format_comment($row["title"]);
               $usersignature = stripslashes(format_comment($row["signature"]));
               $userdownloaded = mksize($row["downloaded"]);
               $useruploaded = mksize($row["uploaded"]);
           }

           if ($row["downloaded"] > 0) {
               $userratio = number_format($row["uploaded"] / $row["downloaded"], 2);
           } else {
               $userratio = "---";
           }

           if (!$avatar) {
               $avatar = "/images/default_avatar.png";
           }

           $commenttext = format_comment($row["body"]);

           $edit = null;
           if ($CURUSER["edit_torrents"] == "yes" || $CURUSER["edit_news"] == "yes" || $CURUSER['id'] == $row['user']) {
               $edit = '[<a href="forums/editpost&postid=' . $row['id'] . '">Edit</a>] ';
           }

           $delete = null;
           if ($CURUSER["delete_torrents"] == "yes" || $CURUSER["delete_news"] == "yes") {
               $delete = '[<a href="forums/deletepost&postid=' . $row['id'] . '&sure=0">Delete</a>] ';
           }

           print('<div><table style="border: 1px solid black" >');
           print('<thead><tr">');
           print('<th align="center" width="150"></th>');
           print('<th align="right">' . $edit . $delete . '[<a href="report/forum?forumid=' . $row['topicid'] . '&forumpost=' . $row['id'] . '">Report</a>] Posted: ' . date("d-m-Y \\a\\t H:i:s", utc_to_tz_time($row["added"])) . '<a id="comment' . $row["id"] . '"></a></th>');
           print('</tr></thead>');
           print('<tr valign="top">');
           if ($CURUSER['edit_users'] == 'no' && $privacylevel == 'strong') {
               print('<td align="left" width="150"><center><a href="profile?id=' . $row['id'] . '"><b>' . $postername . '</b></a><br /><i>' . $title . '</i><br /><img width="80" height="80" src="' . $avatar . '" alt="" /><br /><br />Uploaded: ---<br />Downloaded: ---<br />Ratio: ---<br /><br /><a href="profile?id=' . $row["user"] . '"><img src="themes/default/forums/icon_profile.png" border="" alt="" /></a> <a href='messages/create?id=' . $row["user"] . '"><img src="themes/default/forums/icon_pm.png" border="0" alt="" /></a></center></td>');
           } else {
               print('<td align="left" width="150"><center><a href="profile?id=' . $row['id'] . '"><b>' . $postername . '</b></a><br /><i>' . $title . '</i><br /><img width="80" height="80" src="' . $avatar . '" alt="" /><br /><br />Uploaded: ' . $useruploaded . '<br />Downloaded: ' . $userdownloaded . '<br />Ratio: ' . $userratio . '<br /><br /><a href="profile?id=' . $row["user"] . '"><img src="themes/defualt/forums/icon_profile.png" border="0" alt="" /></a> <a href="/messages/create?id=' . $row["user"] . '"><img src="themes/default/forums/icon_pm.png" border="0" alt="" /></a></center></td>');
           }

           print('<td>' . $commenttext . '<hr />' . $usersignature . '</td>');
           print('</tr>');
           print('</table></div>');
       }
       end_frame();
       stdfoot();


then search YOURSITEURL/userforumpost.php?id=1 ( i assume your id is one )
hopefully we see something then we fix the links
Last edited by M-jay warn on 2021-06-19 08:10:37
2021-06-19 12:20:18
Thanks M-Jay, blank page without errors


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-06-19 18:22:10
Try add this at top under <?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

2021-06-19 20:23:07
Thanks M-Jay, I have some small fixes on it so it works for V2.08 & V2.5 :

<?php
//
//      TorrentTrader v2.x
//      $LastChangedDate: 2021-06-19 22:35:58 +0000 (Sat, 19 Jun 2021) $
//      $LastChangedBy: M-Jay $
//
//      http://www.torrenttrader.uk
//
//


//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);


require_once("backend/functions.php");
dbconn();
$id = (int)$_GET["id"];
      if (!isset($id) || !$id) {
autolink('', "no id");
      }

$res = SQL_Query_exec("SELECT forum_posts.id, topicid, userid, forum_posts.added, body, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM forum_posts LEFT JOIN users ON forum_posts.userid = users.id WHERE userid = $id ORDER BY forum_posts.userid "); //$limit
$row = mysql_fetch_assoc($res);
      if (!$row) {
autolink('', "User has not posted in forum");
      }
      $title = T_("ALLFORUMPOST") . "<a href='account-details.php?id=" . $row['userid'] . "'> $row[username]</a>";

stdhead($title);
begin_frame($title);
      while ($row = mysql_fetch_assoc($res)) {

          $postername = $row["username"];
          if ($postername == "") {
              $postername = T_("DELUSER");
              $title = T_("DELETED_ACCOUNT");
              $avatar = "";
              $usersignature = "";
              $userdownloaded = "";
              $useruploaded = "";
          } else {
              $privacylevel = $row["privacy"];
              $avatar = htmlspecialchars($row["avatar"]);
              $title = format_comment($row["title"]);
              $usersignature = stripslashes(format_comment($row["signature"]));
              $userdownloaded = mksize($row["downloaded"]);
              $useruploaded = mksize($row["uploaded"]);
          }

          if ($row["downloaded"] > 0) {
              $userratio = number_format($row["uploaded"] / $row["downloaded"], 2);
          } else {
              $userratio = "---";
          }

          if (!$avatar) {
              $avatar = "/images/default_avatar.png";
          }

          $commenttext = format_comment($row["body"]);

          $edit = null;
          if ($CURUSER["edit_torrents"] == "yes" || $CURUSER["edit_news"] == "yes" || $CURUSER['id'] == $row['user']) {
              $edit = ' <a href="../forums.php?action=editpost&postid=' . $row['id'] . '" class="button">   Edit</a>  ';
          }

          $delete = null;
          if ($CURUSER["delete_torrents"] == "yes" || $CURUSER["delete_news"] == "yes") {
              $delete = '  <a href="../forums.php?action=deletepost&postid=' . $row['id'] . '&sure=0" class="button">   Delete</a>  ';
          }

          print('<div><table border="0" class="table table-bordered2" width="100" cellpadding="3" cellspacing="3">');
          print('<tr class="b-title">');
          print('<th align="center" width="150"><span class="small" style="color:gold;text-shadow: 1px 1px 1px #000;">Posted: ' . date("d-m-Y \\u\\ H:i:s", utc_to_tz_time($row["added"])) . '<a id="comment' . $row["id"] . '"></a></span></th>');
          print('<th align="right">' . $edit . $delete . '  <a href="../report.php?forumid=' . $row['topicid'] . '&forumpost=' . $row['id'] . '" class="button">    Report</a> </th>');
          print('</tr>');
          print('<tr valign="top">');
          if ($CURUSER['edit_users'] == 'no' && $privacylevel == 'strong') {
              print('<td align="left" width="170"><center><a href="account-details.php?id=' . $row['userid'] . '"><b>' . $postername . '</b></a><br /><i>' . $title . '</i><br /><img width="100" height="100" class="img" src="' . $avatar . '" alt="" /><br /><br /><a href="account-details.php?id=' . $row['userid'] . '"><button type="button" class="button">    Profil</button></a> <a href="mailbox.php?compose&id=' . $row['userid'] . '"  class="button"><i class="far fa-envelope"></i> P.M </a></center></td>');
          } else {
              print('<td align="left" width="170"><center><a href="account-details.php?id=' . $row['userid'] . '"><b>' . $postername . '</b></a><br /><i>' . $title . '</i><br /><img width="100" height="100" class="img" src="' . $avatar . '" alt="" /><br /><br /><a href="account-details.php?id=' . $row['userid'] . '"><button type="button" class="button">    Profil</button></a> <a href="mailbox.php?compose&id=' . $row['userid'] . '"  class="button"><i class="far fa-envelope"></i> P.M </a></center></td>');
          }

          print('<td>' . $commenttext . '<hr />' . $usersignature . '</td>');
          print('</tr>');
          print('</table></div><br />');
      }
      end_frame();
      stdfoot();
?>


Link to implemente is:

<a href="userforumpost.php?id=<?php echo $id ?>"<?php echo number_format($numforumposts); ?> </a>


Regards to all of you guys


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-06-20 19:35:34
2021-06-21 06:51:40
Thanks  :thumb
2021-06-23 16:34:17
<a href="userforumpost.php?id=<?=$id ?>"<?=intval($numforumposts) ?> </a>


number_format() is used for decimals values, what is the output of $numforumposts ? It should be a INT.

It’s safe to use <?= and reduces code.

<?=$a ?> is a shorthand for <?php echo $a; ?> so you also don’t need to add a semi-colon. It’s automatically handled.

It's enabled by default since 5.4 regardless of php.ini settings.
Last edited by STorrents2020 on 2021-06-23 16:35:25
2021-06-23 19:34:54
@STorrents2020 thanks a lot mate, working like a charm ...



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-06-25 17:25:53
Glad to be of help ! :wink
2021-07-04 17:07:16
For some reason the first post in the forum for all users can not be seen in this MOD.

Have not noticed it is carried today when many of my newly registered users have made an introduction (first post in the forum) and it is not visible with this MOD.

Does anyone have a sensible explanation for this phenomenon

If you need a clean copy of the actual userforumpost.php file klicke

here


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-07-24 22:44:56
Bump [Please]


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728