Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
I'm making "Custom Field 1" the location where I will store the link to an external database record for the user who registers. I'd like to make it so this field is only visible by the individual user who is logged in, and Administrators. The record it links to has personal data that I don't want visible to the world or other users.

I found the file showprofile.tpl and deleted {$CUSTOM_FIELD_1} near the end of the script to prevent it from displaying as a temporary work around. Can somebody tell me what the code is so I can replace this:

{$CUSTOM_FIELD_1}
{$CUSTOM_FIELD_2}
{$CUSTOM_FIELD_3}
{$CUSTOM_FIELD_4}


with code that has this logic:

if (Administrator #or# Log in ID = Profile ID being viewed)
{$CUSTOM_FIELD_1}
end if
{$CUSTOM_FIELD_2}
{$CUSTOM_FIELD_3}
{$CUSTOM_FIELD_4}


I am not a programmer, but I do understand the logic. I don't know what the correct variable names are, or the proper syntax for conditionals.

Also - other than the showprofile.tpl file, is there anywhere else where anyone except that user or the administrator would have Custom Field 1 visibility? I'd like to modify those files too.

Ideally this could be a longer term UBB Thread change to the control panel so the fields can be checked as "private" or "public"

Thanks,
Bill

Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
I came up with a more elegant scheme and posted it on the UBBDEV forum at this Link

The answer is to modify the /scripts/showprofile.inc.php file with the necessary logic.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 868 guests, and 467 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)