inherit
266425
0
Oct 31, 2024 6:26:09 GMT -8
aineevenfall
6
May 2022
aineevenfall
|
Post by aineevenfall on Jul 25, 2024 13:17:03 GMT -8
Forum URL: (private) I was hoping to reference a custom profile field in the shoutbox's individual posts and add it next to each member's username who shouts a message. I will attach an image to showcase what I mean and also what happened with the code I used. This is the code I placed in the Shoutbox Individual Post layout: {foreach $[shoutbox_post.created_by.custom_field]} {if $[shoutbox_post.created_by.custom_field.name] == "Alias"}(by $[shoutbox_post.created_by.custom_field.value]){/if} {/foreach} However, it it does something unexpected. It will show my own "Alias" to me, but it will show no one elses. Likewise, my co-admin can see their own alias but not mine. If someone could help me, that would be amazing. Attachments:
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jul 26, 2024 19:57:38 GMT -8
Forum URL: (private) I was hoping to reference a custom profile field in the shoutbox's individual posts and add it next to each member's username who shouts a message. I will attach an image to showcase what I mean and also what happened with the code I used. This is the code I placed in the Shoutbox Individual Post layout: {foreach $[shoutbox_post.created_by.custom_field]} {if $[shoutbox_post.created_by.custom_field.name] == "Alias"}(by $[shoutbox_post.created_by.custom_field.value]){/if} {/foreach} However, it it does something unexpected. It will show my own "Alias" to me, but it will show no one elses. Likewise, my co-admin can see their own alias but not mine. If someone could help me, that would be amazing. The profile field is only accessible when the profile or mini-profile it feeds data to is available on the page. You as a current_user will have your own data follow you around but you would only see the data for other profiles if that profile or mini-profile is actually available on the page prompting the custom field to make itself available to feed data. Current Code: {foreach $[shoutbox_post.created_by.custom_field]}
{if $[shoutbox_post.created_by.custom_field.name] == "Alias"}
$[shoutbox_post.created_by.custom_field.value]
{/if}
{/foreach}
($[shoutbox_post.created_by]) : $[shoutbox_post.message] Of course there is a member's custom field called Alias and if not filled out it should appear (account) : post and if it is filled out it should appear Alias (account) : post It seems simple enough, but it only shows the alias for the currently logged in player. For example, logged in as user1: Alias (user1) : post (user2) : post (user3) : post but if logged into user2 it shows: (user1) : post Alias (user2) : post (user3) and so on so forth. Is it something with how the profile field is set up? I have the field set up like so: If the mini-profile or profile is not currently on the page, that data is unfortunately unavailable for use on that page (as designed).
|
|
inherit
266425
0
Oct 31, 2024 6:26:09 GMT -8
aineevenfall
6
May 2022
aineevenfall
|
Post by aineevenfall on Jul 29, 2024 4:50:57 GMT -8
Do you know why there is code to reference custom profile fields in the shoutbox area, even though it wasn't meant to be used like it is in the User Profile or Members List? 🤔 Thank you for your reply and help, I appreciate it, even if the news is that I can't do such-and-such. 😆❤️
|
|