namespace GBAtemp\ListUsers\BBCode; class Custom { public static function renderListUsers( array $tagChildren, $tagOption, $tagName, array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer ) { // Parse group IDs from the BBCode parameters $groupIDs = explode(",", $tagOption); // Initialize the Finder for XF:User entity $finder = \XF::finder('XF:User'); // Construct the condition to find users with the specified group IDs $inSet = $finder->expression("FIND_IN_SET(?, secondary_group_ids)", $groupIDs); // Set the condition for the finder to retrieve users with the specified group IDs $finder->where($inSet); // Fetch users matching the condition $users = $finder->fetch(); // Initialize an array to store user details $userDetails = []; // Loop through each user foreach ($users as $user) { // Start building user details $userDetail = '
'; // Open a div for user details // Get the avatar and username link $avatarAndUsername = self::getUserAvatarAndUsername($user); // Append the avatar and username link to the user details $userDetail .= $avatarAndUsername; $userDetail .= '
'; // Close the div for user details // Add user details to the array $userDetails[] = $userDetail; } // Concatenate user details with commas $userListHTML = '
' . implode('', $userDetails) . '
'; // Return the HTML return $userListHTML; } protected static function getUserAvatarAndUsername($user) { $templater = \XF::app()->templater(); // Render the avatar and username link using XenForo's templating system $avatarAndUsernameHtml = $templater->fn('avatar', ['user' => $user, 'size' => 's']); $avatarAndUsernameHtml .= '' . htmlspecialchars($user->username) . ''; // Return the HTML for the avatar and username link return $avatarAndUsernameHtml; } }

[OFFICIAL] altariaism religion thread

DRAGONBALLVINTAGE

The GBATemp Hacker
Member
Joined
Jun 27, 2017
Messages
734
Trophies
0
Location
The Ruins of GBATemp (3DSTemp.net)
XP
2,009
Country
United States
b21.png
 
  • Like
Reactions: jimmyj

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/FdYTKAVSsXY?si=9E-2AU0JN-4hRZi3