URL Address Masking

Forum
Last Post
Threads / Messages

GeneticAlpha

Loving Mysidia!
Member
Joined
May 24, 2020
Messages
287
Points
18
Age
31
Location
Tennessee
Mysidian Dollar
13,377
Is there a way to mask the URL in the address bar for pages? For example, the username that shows up in the address bar, can we hide that part being displayed and have it display something else, but it function all the same, just users don't see the real address URL?

We're essentially wanting to hide usernames being seen on site, and this is an area that's escaping us. The PM area we have displaying the nickname in the url, but for some reason can't get the profile to display it, it's displaying the user's username.
 
Last edited:
Hmm I am not quite sure what you want to do here. Can you maybe show me a screenshot, and explain what you want to display there instead of what you see from the page now? :unsure:
 
Sure! See in the address bar where it shows GeneticAlpha? GeneticAlpha is my account's username, we're wanting to hide everyone's usernames from the public eye. We'd like for it to show the nickname that belongs to the user instead(which for this account is Micolai). So, instead of GeneticAlpha username, it needs to display the nickname.

Essentially, what we've done is made it where usernames are private information, to try and give a little bit of extra account security.

We've already changed usernames from being seen everywhere else, PMs, Search, Trades, Member list, Online list, etc. But for some reason, we couldn't figure out this area haha. It's the only one eluding us.

Even just showing ID would be better than username. So either way.

1623106888156.png
 
Last edited:
I see, so you want to display the user's nickname rather than username? It can be done, though will be a little tricky and you need to use join queries(since I believe, the nickname field is not on the adopts_users table, but a different one).
 
It would be easier yes, but user ID is supposed to be used as identifiers for the script internally, rather than for display purpose. After all, its a number that does not tell anything about the user him/herself.

The issue with nickname is that, unlike user ID and username, its not guaranteed to be unique. This means that you may have multiple users with the same nickname, and the script will not stop this from happening. If you want to use nickname as identifier, you may want to make it a unique field at first. Otherwise, consider using join queries to fetch both user ID and nickname at the same time.
 
Hmm.. could we change the script to where the URL uses uid instead of Username? Those are unique to each member, so couldn't that work? And if so, where do we go to change that?
 
Mys v1.3.6 will allow both IDs and Usernames to be used in the URL for user profile page. The criterion is simple, its a user ID if its an integer(1, 2, 3, etc), otherwise its considered username.
 
Do you know off-hand which file we would modify to change the script so it supplies the UID instead of username for profiles?
 
Do you know off-hand which file we would modify to change the script so it supplies the UID instead of username for profiles?

You need to edit classes/class_userprofile.php, which has the display information for each tab content of the user profile page.
 
Ahh Okay. Could I by chance trouble you to tell me what part exactly to change where it'll change the username to a uid for the URL? (Right now it shows /profile/view/USERNAME and I want it /profile/view/UID) I have been looking at it for about an hour and tried different things and can't seem to get it to work :/ and thank you so much for your time and explaining things!
 
@GeneticAlpha You can already put user ID in the URL, and the variable $mysidia->input->post("user") becomes your user ID rather than username. You may want to edit /classes/class_userprofile.php to display something other than the user ID in the document though.
 
@GeneticAlpha You can already put user ID in the URL, and the variable $mysidia->input->post("user") becomes your user ID rather than username. You may want to edit /classes/class_userprofile.php to display something other than the user ID in the document though.
Thanks so much for your help! I was very confused still to be honest haha, but I managed to get it to hide just the username part by putting this in my page's code!
1623625907419.png
<script>
history.replaceState(null, document.title, './')
</script>
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top