The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Points in Memberlist

3 posters

Go down

Solved Points in Memberlist

Post by xiyi October 31st 2024, 12:28 pm

Technical Details


Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Opera/Chrome
Screenshot of problem : -removed-
Who the problem concerns : All members
When the problem appeared : From start
Forum link : -removed-

Description of problem

Hi,

I am trying to get the points to be visible within the memberlist for all filters, not only when it is sorted by points. Considering there's a point system in place, I struggle to understand why this can't be turned on by default.

When using the code in the link below, I can get it to work, but as soon as I remove the tables within the memberlist, the code stops functioning once again. I assume the problem is somewhere within the Selector, but I cannot find the solution.

https://help.forumotion.com/t162610-points-in-memberlist?highlight=memberlist+points

Is there a way to get this to work within a custom memberlist? Thanks in advance!

Please keep in mind that this whole layout is still very much a WIP.


Last edited by xiyi on October 31st 2024, 2:13 pm; edited 1 time in total
xiyi
xiyi
New Member

Posts : 2
Reputation : 1
Language : NL

Back to top Go down

Solved Re: Points in Memberlist

Post by Niko October 31st 2024, 12:52 pm

Coucou,

in the past I wrote this code, maybe you can give it a try Wink

Code:

$(function() {
    $('.forumbg.forumbg-table th.name').after('<th class="points">Points</th>');
    $('.forumbg.forumbg-table table#memberlist tbody tr').each(function() {
 
        var element = $(this);
        var user = $(this).find('td.avatar-mini a');
        var user_link = user.attr('href');
        var user_id = user_link.match(/\d+/g);
        $(this).find('td.avatar-mini').after('<td class="points_memberlist" uid="' + user_id + '"></td>');
 
        $.ajax({
            url: user_link,
            type: 'GET',
            success: function(data) {
                var user_points = $(data).find('dl#field_id-13 dd').text();
                $('.points_memberlist[uid="' + user_id + '"]').html(user_points);
            }
 
        });
    });
});

Before:

After:
Niko
Niko
Helper
Helper

Male Posts : 3328
Reputation : 256
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

TonnyKamper likes this post

Back to top Go down

Solved Re: Points in Memberlist

Post by xiyi October 31st 2024, 1:50 pm

Thank you so much! With this I finally got it to work. Points in Memberlist 1f60d
xiyi
xiyi
New Member

Posts : 2
Reputation : 1
Language : NL

Niko likes this post

Back to top Go down

Solved Re: Points in Memberlist

Post by Ape October 31st 2024, 4:31 pm

Thank you @Niko for your help.

Hello @xiyi welcome to the English support forum. Shake
Problem solved & topic archived.
Please read our forum rules: ESF General Rules


Points in Memberlist Left1212Points in Memberlist Center11Points in Memberlist Right112
Points in Memberlist Ape_b110
Points in Memberlist Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19470
Reputation : 2013
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Niko likes this post

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum