Ever wanted your members to have a friend after signing up similar to what Myspace.com does? Tom is your friend automatically after joining Myspace. Your member profile for the Tom Mod would be a good idea.

This is a fairly simple mod especially for new sites, ones with no members yet, or sites with not too many members yet. This is because after installing this mod only new sign ups/members will automatically have you as a friend. You can still make members already signed up at your site your friend but it requires a few more steps.

After applying this modification any new member that sign's up will automatically have you as their friend.

This is tested on Dolphin 6.1x.

The file we will be editing is yoursite.com/join.php so backup an original copy of join.php to your local PC.

Also be sure to backup your database to your local PC before proceeding with this modification.

Like any Modifications...Do so at your own risk!

Now that you have the backups, open join.php and find:
list( $iMemID, $sStatus ) = $oPC -> createProfile( $aProfile );

Insert this line after it:
$dump = db_res("INSERT INTO FriendList SET 'ID' = '{$iMemID}', 'Profile' = 1, 'Check' = 1");

Updated: 11-27-08 For character adjustment ' to ` changes.
$dump = db_res("INSERT INTO FriendList SET `ID` = '{$iMemID}', `Profile` = 1, `Check` = 1");

The profile number needs to be whatever number your "Tom profile" number is.

This works for new members only!!! Does not alter members that have already joined!!!

**(This means the member with profile 1 will be the friend of the new member) If you are not 1 or if you wish to have another member the default Tom Mod, then you can change the above accordingly.

***If you want the member with profile ID 2 to be everyone's friend after joining, then change the above to reflect this.

You can simply use PhpMyAdmin to check. Open your database with PhpMyAdmin. Find the "Profiles" Table in the list, and click on the "Browse" looks like a piece of paper or window kind of (usually the first).

Then simply find the "NickName" of the person you want to be the Tom Friend Mod and the "ID" will be the number you will want to use in the above example 'Profile' = 1, 'Check' = 1".

Save your changes to join.php and re-upload to your host/server overwriting the original.

Now anyone that joins your site in the future will automatically get you(Profile id 1) as their friend!!

If you want members that have already joined your site prior to applying this mod to have you as a friend you will have to update or query your database.



Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Sponsored Links