Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Lost moderator display and ranks
Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jul 16, 2012 - 5:00 am

I've mapped WP roles to SF ranks and part of that is Contributors become Moderators. Last week I added a new Contributor, but the Moderator role did not work and the rank was not displayed under their gravatar. Somehow, while trying to fix that I lost all moderators from the info panel that shows who's online, moderators, admins, etc.
moderators-memberships.pngImage Enlargermoderators-missing.pngImage Enlargeruser-mapping-settings.pngImage Enlargerwrong-rank-displayed.pngImage Enlarger

Also if you look on the Members Info screenshot you'll notice there is a bug - it display's a % before "Back to all Members".

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 16, 2012 - 8:32 am

Thanks for the bug info on the label. I will get that fixed up.

And talking of bugs ! I am afraid that is probably the reason for your lost moderators and one of the primary reasons we are aiming to push put a 5.1.2 update a little earlier than we had originally planned.

Apart from membership of a moderator designated User Group for the sake of performance and to save some complex SQL queries, we also identify a Moderator by a column in the sfmembers table. In fact a column called 'moderator' which will be set to a 1 for all those so designated. I am not sure what the bug actually was but I DO know that the effect was for this column to be reset to zero. And for this I apologise. It is fixed up in the forthcoming 5.1.2 which we plan - all being well - to release at the end of this week.

The bug itself is an easy fix and the code changes are available here: http://websvn.simple-press.com.....%5D=/@8706

i will need to ask Steve if there is a trick to getting them all back in one go - I suspect you may be able to do that but as I say - need to check. They can be out back to 1's manually of course in the table.

Again - our apologies.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:17 am

Ah ha. Thought I was going crazy!
The link didn't copy/paste well - seems there are some invalid characters, at least they appear that way.

So what's the code for the cool new breadcrumb? laugh

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 16, 2012 - 9:31 pm

in simple-press/sp-api/sp-api-users.php, find routine sp_update_member_moderator_flag() and replace it with this code:

function sp_update_member_moderator_flag($userid) {
    $ugs = sp_get_user_memberships($userid);
    if ($ugs) {
        foreach ($ugs as $ug) {
            $mod = spdb_table(SFUSERGROUPS, "usergroup_id={$ug['usergroup_id']}", 'usergroup_is_moderator');
            if ($mod) {
                sp_update_member_item($userid, 'moderator', 1);

                # see if our forum moderator list changed
                sp_update_forum_moderators();
                return;
            }
        }
    }

    # not a moderator if we get here
    sp_update_member_item($userid, 'moderator', 0);
    
}

as to the breadcrumbs, not just a small piece of code... 😉  some fancy css, a filter and some images...

BrandonC did the work for us here, so you might want to contact him... or search for the thread where he walked another user through how to set it up...

Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jul 17, 2012 - 12:12 am

Code is updated. Do I need to do anything else (manually reassign, etc)?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 17, 2012 - 4:28 am

I suspect you are going to have to manually put the '1's back in the moderator column of the sfmembers table.

Or - remove the users from the Moderators user group and then re-assign them...

I really do apologise for this. Looks like an area we need to get some more rugged checking in and rebuild code.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jul 17, 2012 - 5:48 am

No problem at all. I mean you've created one of the best forum software available and the amount of support the 3 of you provide is incredible.

OK, code updated. Members removed from/added to Moderator group, however the moderator rank badges do not display. They did before the problem happened and moderators added after the problem had a member rank badge displayed - now nothing.

The fix also did not populate the Moderator list in the stats.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 17, 2012 - 5:57 am

Thanks!

The stats are cached and should update hourly (I believe). So watch for that. if it doesn't update we can force it.

Now tell me about the badges... Is this a User Groiup based badge or a Special Rank badge? And if a Special Rank badge are all the designated members assigned in the Ranks admin panel?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jul 17, 2012 - 6:28 am

It's a special rank and 8 of the 10 appear to have made it, which would leave the 2 who were added after the problem started as missing. Let me try to add them manually... That worked.
I'll hold off for an hour, or so, and see if the stats update.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 17, 2012 - 6:42 am

Assuming you are running on SP 5.1.1 then you could go to the forum admin > Toolbox > CRON Inspector - and then in the Run CRON input box at the bottom enter sph_stats_cron and run it on demand...

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 639
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17342
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10116
Posts: 79581