PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
s2pidkaspr wrote:That code actually works, however, it is displaying the current logged in user's status...NOT each comment author's status....
For example, if the member is Gold Member, and i put the functionality on comments, it will display on every single comment of every authors....that's NOT what i'm trying to do. I want it like if the comment author is SILVER MEMBER, it will show on their comment and if the comment author is GOLD it will show them that...even if BOTH authors, post on the same page....
EDIT:
Also, I want the comment author to show their status (Gold, Silver, etc) on their comments, even if the MEMBER or VISITOR is logged out...
$comment_author_access_label = get_user_field('s2member_access_label', $comment_author_id);
$comment_author_access_label = get_user_field('s2member_access_label', ($comment->user_id));
<?php echo $comment_author_access_label = get_user_field('s2member_access_label', ($comment->user_id)); ?>
s2pidkaspr wrote:Wow! It works now Christian. Thanks!
However, that code didn't worked itself, but the idea is.
s2pidkaspr wrote:But just to make it more detailed, i want users to know who is commenting, it may be a staff or just a regular/upgraded member. You get what i mean? So i'm hoping to use "s2member_access_role" instead for that. If ever its not possible to do what i want, then i think i'm going to stick using "s2member_access_label" which works fine to me.
s2pidkaspr wrote:Again, thank you Christian and more power to s2member. Great support!
peeld wrote:That's why I'm asking you - did just that one line of code do the trick for you, or was there more code you had to put elsewhere, like in your s2-hacks file?
<?php echo $comment_author_access_label = get_user_field('s2member_access_label', ($comment->user_id)); ?>
<?php echo get_user_field('s2member_access_label', $comment->user_id); ?>
<?php echo ($comment->user_id == 1 ? 'Administrator' : get_user_field('s2member_access_label', $comment->user_id)); ?>
<?php echo ($comment->user_id == 1 ? 'Administrator' : get_user_field('s2member_access_label', $comment->user_id)); ?>
s2pidkaspr wrote:Now, can you tell me, if how to write and add the code in there if I want another member to be named "Moderator?" and with multiple ID number? Is it possible too?
peeld wrote:Maybe, but I doubt it - It shouldn't matter WHERE you put that code....it does work, in a manner of speaking; it doesn't break my site and it does return a value - it just returns the wrong value (the logged in user's role rather than the original poster's role).
Users browsing this forum: Bing [Bot] and 2 guests