Author Topic: [Code] Stop Users From Adding Their Own Profile To Their Friends List  (Read 961 times)


  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 521
  • Karma: +45/-2
  • Etano Contributor (Skins & Mods)
Avoid users from adding their own profile to their friends and favorite lists.

Open processors > net_adduser.php

Simply add this block of code (i'd suggest around line 37 or 43)

Code: [Select]
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $_SESSION[_LICENSE_KEY_]['user']['user_id']==$input['uid']) {
$topass['message']['text']='You can not add your own profile!';

What does it do?
It checks to see if the logged in users id matches the user the who their trying to add. If it matches then they'll get re-directed to home.php and a notice will inform them that "You can not add your own profile!" (you can change the notice to whatever you want it to say). If the user id does not match then everything will proceed as normal.

But how can they add their self in the first place?
1 - By direct link (simply copy and pasting the add link into a browser changing the users id to their own)

This isn't anything serious but thought it would be helpful