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

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

2024-06-03 20:54:36
Bonjour

Je viens vous partager ma correction, je ne suis pas parfait, donc faite le moi savoir si besoin.

Amicalement
@Spiritblue
-----------------------

Good morning

I'm here to share my correction with you, I'm not perfect, so let me know if necessary.

Kind regards
@Spiritblue


Search forums.php for this line:
Chercher dans forums.php cette ligne :

$num = 0;
   while ($a = mysqli_fetch_assoc($res)){
   ++$num;
   print("<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='".$site_config['SITEURL']."/account-details.php?id=$a[id]'><b>".class_user($a['username'])."</b></a></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
}


Replace with :
Remplacer par :
// Update Top forum posts by spiritblue 2024
$num = 0;
   while ($a = mysqli_fetch_assoc($res)){
   ++$num;
if ($a['username']) {
   print("<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='".$site_config['SITEURL']."/account-details.php?id=$a[id]'><b>".class_user($a['username'])."</b></a></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
}else{
print("<tr class='table_col2'><td align='center' class='ttable_col1'>$num</td><td class='ttable_col2' style='text-align: justify'><img src='images/inconnu.png' height='34' width='36' alt='Inconnu' title='Inconnu!' border='0'><i><b>Banmni / Inconnu</b></i></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
   }
       }


* I'll give you the image, but you can put something else and don't forget to change the writing in French for English if necessary.

* Je vous remets l'image, mais vous pouvez mettre autre chose et oublié pas de changer l'écrit en français pour anglais si besoin.

Upadate, by djlive for more security

//Update Top forum posts by spiritblue	2024
//Update 2024 for more security by djlive
$num = 0;
while ($a = mysqli_fetch_assoc($res)) {
  ++$num;
  $username = htmlspecialchars($a['username'], ENT_QUOTES, 'UTF-8');
  $userId = (int)$a['id'];
  $userNum = htmlspecialchars($a['num'], ENT_QUOTES, 'UTF-8');
  $siteUrl = htmlspecialchars($site_config['SITEURL'], ENT_QUOTES, 'UTF-8');
  if ($a['username']) {
      echo "<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='{$siteUrl}/account-details.php?id=$userId'><b>" . class_user($username) . "</b></a></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
  } else {
      echo "<tr class='table_col2'><td align='center' class='ttable_col1'>$num</td><td class='ttable_col2' style='text-align: justify'><img src='images/inconnu.png' height='34' width='36' alt='Inconnu' title='Inconnu!' border='0'><i><b>Banmni / Inconnu</b></i></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
  }
}


Inconnu.rar
Download

Last edited by spiritblue on 2024-06-06 21:50:29
2024-06-05 20:41:49
thanks for sharing. I assume this is for users who make forum posts anonymously?
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)
2024-06-05 23:15:03
$num = 0;
while ($a = mysqli_fetch_assoc($res)) {
   ++$num;
   $username = htmlspecialchars($a['username'], ENT_QUOTES, 'UTF-8');
   $userId = (int)$a['id'];
   $userNum = htmlspecialchars($a['num'], ENT_QUOTES, 'UTF-8');
   $siteUrl = htmlspecialchars($site_config['SITEURL'], ENT_QUOTES, 'UTF-8');

   if ($a['username']) {
       echo "<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='{$siteUrl}/account-details.php?id=$userId'><b>" . class_user($username) . "</b></a></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
   } else {
       echo "<tr class='table_col2'><td align='center' class='ttable_col1'>$num</td><td class='ttable_col2' style='text-align: justify'><img src='images/inconnu.png' height='34' width='36' alt='Inconnu' title='Inconnu!' border='0'><i><b>Banmni / Inconnu</b></i></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
   }
}

htmlspecialchars($a['username'], ENT_QUOTES, 'UTF-8'):
Escapes special characters to prevent XSS attacks.
Last edited by djlive on 2024-06-05 23:15:21
2024-06-06 21:40:29
@MicroMonkey....Yes and no, for my part, it was created seen, I deleted a member of the staff and he had positions.

It gave a case with empty username with the numbers of posts made, etc.
Last edited by spiritblue on 2024-06-06 21:40:55
2024-06-06 21:43:07
Thank you very much djlive, well thought out friend!
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728