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
image premium
Controls ·  Search New posts · Mark unread

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

2023-08-21 16:44:41
Hello I can't find how to add a small image next to the nickname in the premium group ??


Bonjour je ne trouve pas comment ajouter une petite image a coté du pseudo dans le groupe premium ??
2023-08-21 17:30:58
Hi @niki

If I've understood you correctly, you want an "icon" or "picture" next to the username that shows its "group status" like we already have with "donor" stars (or similar)

Have I read correctly?




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
2023-08-21 17:43:43
yes Botanicar an icon for the premium group and thank you for your help  😊
2023-08-21 18:38:11
@niki
in functions.php find


function class_user($name) {


add that part of code


if ($classy["class"] == "4") {
$premium = "<img src='https://cdn1.iconfinder.com/data/icons/awards-trophies/512/medal_award_trophy_premium_win_first_place_11-256.png' width='32' height='32' title='This user is PREMIUM user'>";
}
else {
$premium = "";
}


keep in mind that class 4 corresponds to your premium class of user (or replace 4 with what you have for premium user number)

find


return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");


and change it to


return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."".$premium."</font>");





regards



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
2023-08-21 18:59:48
Merci pour ton aide botanicar je fais les changements demain quand je rentre du travail  😬
2023-08-21 19:00:36
Thanks for your help botanicar I'll make the changes tomorrow when I get home from work.
2023-08-22 08:25:53
my code snippet is different in function.php

             return unesc("<font color='" . $gcolor . "'>" . $name . "" . $star . "" . $warn . "</font>");
}

and change as below, but it doesn't work

       return unesc("<font color='" . $gcolor . "'>" . $name . "" . $star . "" . $warn . "".$premium."</font>");
}





here is the complete code  modify in the function.php file;

#======================================================================#
# Start class_user function
#======================================================================#

if ($classy["class"] == "2") {
$premium = "<img src='https://cdn1.iconfinder.com/data/icons/awards-trophies/512/medal_award_trophy_premium_win_first_place_11-256.png' width='32' height='32' title='This user is PREMIUM user'>";
}
else {
$premium = "";
}


function class_user($name)
{
   global $site_config;
   $a = "SELECT u.class, u.donated, u.warned, g.Color, g.level, u.uploaded, u.downloaded FROM `users` `u` INNER JOIN `groups` `g` ON g.group_id=u.class WHERE username ='" . $name . "'";
   //echo "Query a".$a."<br />";
   $res = SQL_Query_exec($a);
   $classy = @mysqli_fetch_array($res);
   $gcolor = $classy['Color'];
   if ($classy['donated'] > 0) {
       $star = "<img src='" . $site_config['SITEURL'] . "/images/donor.png' alt='fait_un_don' border='0' width='32' height='32'>";
   } else {
       $star = "";
   }
   if ($classy['warned'] == "yes") {
       $warn = " &nbsp;
<img src='" . $site_config['SITEURL'] . "/images/warned.gif' alt='Averti' border='0'>";
   } else {
       $warn = "";
   }
 

       return unesc("<font color='" . $gcolor . "'>" . $name . "" . $star . "" . $warn . "".$premium."</font>");
}

#======================================================================#
# End Start class_user function
#======================================================================#











2023-08-22 08:49:36
Hi @niki

right code is:


#======================================================================#
# Start class_user function
#======================================================================#

function class_user($name)
{
  global $site_config;
  $a = "SELECT u.class, u.donated, u.warned, g.Color, g.level, u.uploaded, u.downloaded FROM `users` `u` INNER JOIN `groups` `g` ON g.group_id=u.class WHERE username ='" . $name . "'";
  //echo "Query a".$a."<br />";
  $res = SQL_Query_exec($a);
  $classy = @mysqli_fetch_array($res);
  $gcolor = $classy['Color'];
  if ($classy['donated'] > 0) {
      $star = "<img src='" . $site_config['SITEURL'] . "/images/donor.png' alt='fait_un_don' border='0' width='32' height='32'>";
  } else {
      $star = "";
  }
  if ($classy['warned'] == "yes") {
      $warn = " &nbsp;
<img src='" . $site_config['SITEURL'] . "/images/warned.gif' alt='Averti' border='0'>";
  } else {
      $warn = "";
  }
//== Premium badge
if ($classy["class"] == "2") {
$premium = "<img src='https://cdn1.iconfinder.com/data/icons/awards-trophies/512/medal_award_trophy_premium_win_first_place_11-256.png' width='32' height='32' title='This user is PREMIUM user'>";
}
else {
$premium = "";
}
//== End of premium badge
      return unesc("<font color='" . $gcolor . "'>" . $name . "" . $star . "" . $warn . "".$premium."</font>");
}

#======================================================================#
# End Start class_user function
#======================================================================#



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
2023-08-22 10:17:03
many thanks botanicar and once again at the top, everything works well now.  👍  😀  😀
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728