1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting Custom Userfields to show in Members area:

Discussion in 'Styling and Customization Questions' started by CritiKiL, Mar 11, 2013.

  1. CritiKiL

    CritiKiL Active Member

    I would like for this code to show under a members name 'if the custom userfield is filled out:

    Code:
    <table><tr><td>
    <xen:if is="{$user.customFields.psnlive}"><a href="http://us.playstation.com/playstation/psn/visit/profiles/{$user.customFields.psnlive}" target="_new"><img src="/community/game_images/psnlive.png" width="25px" height="25px" /></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.xboxlive}"><a href="http://live.xbox.com/en-US/Profile?Gamertag={$user.customFields.xboxlive}" target="_new"/><img src="/community/game_images/xboxlive.png" width="25px" height="25px"></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.pclive}"><a href="http://steamcommunity.com/id/{$user.customFields.pclive}" target="_new"/><img src="/community/game_images/pclive.png" width="25px" height="25px"></a>
    </xen:if>
    </td></tr></table>
    It works under a members name in the message_user_info template but it won't work in the Registered Members / XenStaff areas under a members name. Can someone show me how to fix this code so that it works?

    It it setup so that if one of 3 custom userfields are filled, an icon will display to show info has been filled out in that field. Here is how it looks in the message_user_info area (the PSN, XBL and PC icon circles):

    membersconsoles1.PNG

    And this is where I want it to also show (under the members name):

    membersconsoles.PNG
     
    erich37 likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    CritiKiL likes this.
  3. CritiKiL

    CritiKiL Active Member

  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Review the instructions again. For XenStaff there are two red blocks. I suspect you missed the first one.
     
    CritiKiL likes this.
  5. CritiKiL

    CritiKiL Active Member

    I seem to be missing any 'second red code' in that block?:
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes, there are two red pieces in the file edit you quoted.
     
    CritiKiL likes this.
  7. CritiKiL

    CritiKiL Active Member

    Ha! My apologies Jake ;-) I see it now...
     
  8. CritiKiL

    CritiKiL Active Member

    It works! But only on the XenStaff page, and I can live with that ;-).
     
  9. CritiKiL

    CritiKiL Active Member

    One more question about this: How do I get them to show 'also' under everyones Sig - If possible?
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Sig where?
     
  11. CritiKiL

    CritiKiL Active Member

    Under the forum signatures:

    xenforosig.PNG

    Using same code, but it doesn't show up when I place it under the signatures. I would like them to show there, just for the mobile template because that template has no sidebars:
    Code:
    <table><tr><td>
    &nbsp;&nbsp;<xen:if is="{$user.customFields.psnlive}"><a href="http://us.playstation.com/playstation/psn/visit/profiles/{$user.customFields.psnlive}" target="_new"><img src="/community/game_images/psnlive.png" width="25px" height="25px" /></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.xboxlive}"><a href="http://live.xbox.com/en-US/Profile?Gamertag={$user.customFields.xboxlive}" target="_new"/><img src="/community/game_images/xboxlive.png" width="25px" height="25px"></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.pclive}"><a href="http://steamcommunity.com/id/{$user.customFields.pclive}" target="_new"/><img src="/community/game_images/pclive.png" width="25px" height="25px"></a>
    </xen:if>
    </td></tr></table>
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Signatures show in user profiles, posts, and conversations.
     
  13. CritiKiL

    CritiKiL Active Member

    No I mean tgat I want the custom user field info to show under the sigs...
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I wanted a specific location since sigs show in more than one area. But I believe the custom fields are prepared in all areas where sigs are used, so {$user.customFields.field_id} should work.
     
  15. CritiKiL

    CritiKiL Active Member

    For some reason this code does not work under the sigs (in the Posts and Convo's areas):
    Code:
    <table><tr><td>
    &nbsp;&nbsp;<xen:if is="{$user.customFields.psnlive}"><a href="http://us.playstation.com/playstation/psn/visit/profiles/{$user.customFields.psnlive}" target="_new"><img src="/community/game_images/psnlive.png" width="25px" height="25px" /></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.xboxlive}"><a href="http://live.xbox.com/en-US/Profile?Gamertag={$user.customFields.xboxlive}" target="_new"/><img src="/community/game_images/xboxlive.png" width="25px" height="25px"></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.pclive}"><a href="http://steamcommunity.com/id/{$user.customFields.pclive}" target="_new"/><img src="/community/game_images/pclive.png" width="25px" height="25px"></a>
    </xen:if>
    </td></tr></table>
    The code now works in the places you have helped me with in this post, but that same table doesn't work under the sigs for some reason. Something is missing, that would make the table in this code show.
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Which template? For example, in the message template you would use {$message.customFields.field_id}
     
    CritiKiL likes this.
  17. CritiKiL

    CritiKiL Active Member

    Ok now I'm confused. in the message template I want this code to show the images 'if' the custom user field condition is satisfied, for each user:
    Code:
    <table><tr><td>
    &nbsp;&nbsp;<xen:if is="{$user.customFields.psnlive}"><a href="http://us.playstation.com/playstation/psn/visit/profiles/{$user.customFields.psnlive}" target="_new"><img src="/community/game_images/psnlive.png" width="25px" height="25px" /></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.xboxlive}"><a href="http://live.xbox.com/en-US/Profile?Gamertag={$user.customFields.xboxlive}" target="_new"/><img src="/community/game_images/xboxlive.png" width="25px" height="25px"></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.pclive}"><a href="http://steamcommunity.com/id/{$user.customFields.pclive}" target="_new"/><img src="/community/game_images/pclive.png" width="25px" height="25px"></a>
    </xen:if>
    </td></tr></table>
    But in cases where the images should be showing (xen:if is=true) they DO show, but just not under the signatures in the message template. The code above works everywhere else I have the it posted [ex: shows in the message_user_info area, and NOW shows in the Xenstaff area (thanks to your earlier edit suggestions in this thread)]. It just doesn't show in the message area where I'd like for it to show, under the signature ;-)
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Please post the entire template.
     
  19. CritiKiL

    CritiKiL Active Member

    My current message template w/custom usersfield code:
    Code:
    <xen:require css="message.css" />
    <xen:require css="bb_code.css" />
     
     
     
     
     
     
     
     
     
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
     
    <xen:include template="message_user_info">
    <xen:map from="$message" to="$user" />
    </xen:include>
     
    <div class="messageInfo primaryContent">
    <xen:if is="{$message.isNew}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
     
    <xen:if hascontent="true">
    <ul class="messageNotices">
    <xen:contentcheck>
    <xen:hook name="message_notices" params="{xen:array 'message={$message}'}">
    <xen:if is="{$message.warning_message}">
    <li class="warningNotice"><span class="icon Tooltip" title="{xen:phrase warning}" data-tipclass="iconTip flipped"></span>{$message.warning_message}</li>
    </xen:if>
    <xen:if is="{$message.isDeleted}">
    <li class="deletedNotice"><span class="icon Tooltip" title="{xen:phrase deleted}" data-tipclass="iconTip flipped"></span>{xen:phrase this_message_has_been_removed_from_public_view}</li>
    <xen:elseif is="{$message.isModerated}" />
    <li class="moderatedNotice"><span class="icon Tooltip" title="{xen:phrase awaiting_moderation}" data-tipclass="iconTip flipped"></span>{xen:phrase this_message_is_awaiting_moderator_approval_and_is_invisible_to_normal}</li>
    </xen:if>
    <xen:if is="{$message.isIgnored}">
    <li>{xen:phrase you_are_ignoring_content_by_this_member} <a href="javascript:" class="jsOnly DisplayIgnoredContent">{xen:phrase show_ignored_content}</a></li>
    </xen:if>
    </xen:hook>
    </xen:contentcheck>
    </ul>
    </xen:if>
     
    <xen:hook name="message_content" params="{xen:array 'message={$message}'}">
    <div class="messageContent">
    <article>
    <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
    <xen:include template="ad_message_body" />
    {xen:raw $message.messageHtml}
    </blockquote>
    </article>
     
    {xen:raw $messageContentAfterTemplate}
    </div>
    </xen:hook>
     
     
     
     
     
     
     
     
    <xen:if is="{$visitor.content_show_signature} && {$message.signature}">
    <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
     
     
    <center><br>
     
    <xen:include template="StatsBar_manual">
    <xen:map from="$message" to="$user" />
    </xen:include>
     
     
     
     
    <xen:include template="bdmedal_message_medals">
                <xen:map from="$message" to="$user" />
            </xen:include>
     
     
     
     
     
    <table><tr><td>
    <xen:if is="{$user.customFields.psnlive}"><a href="http://us.playstation.com/playstation/psn/visit/profiles/{$user.customFields.psnlive}" target="_new"><img src="/community/game_images/psnlive.png" width="25px" height="25px" /></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.xboxlive}"><a href="http://live.xbox.com/en-US/Profile?Gamertag={$user.customFields.xboxlive}" target="_new"/><img src="/community/game_images/xboxlive.png" width="25px" height="25px"></a>
    </xen:if></td><td>
    <xen:if is="{$user.customFields.pclive}"><a href="http://steamcommunity.com/id/{$user.customFields.pclive}" target="_new"/><img src="/community/game_images/pclive.png" width="25px" height="25px"></a>
    </xen:if>
    </td></tr></table>
     
     
     
     
     
     
    </center>
     
     
     
     
     
     
     
    </xen:if>
     
     
     
     
     
     
     
     
    {xen:raw $messageAfterTemplate}
     
    <div id="likes-{$messageId}"><xen:if is="{$message.likes}"><xen:include template="likes_summary" /></xen:if></div>
    </div>
     
     
     
     
     
    <xen:include template="ad_message_below" />
     
    </li>
     
  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You are still using {$user.customFields.pclive}. You need to use {$message.customFields.pclive}. The same goes for the other fields.
     
    CritiKiL likes this.

Share This Page