PDA

View Full Version : User Profile as User Titles


doctiar
02-24-2004, 08:49 PM
Is there any Mods that can take custom profile fields and replace the default User Titles?

AN example would be you create a user profile field for Occupations. Once a user registers with your forum and selects the Occupation listed, it would appear alongside his avatar in place of the default titles, Junior Member, Member etc..

I know that Admins can give them selves custom titles in their CP's, but automation of this for every registered user, would be awesome!

THanks.

Andreas
02-24-2004, 08:52 PM
Hmm ... you can just allow your normal usergroup to have custom titles (Usergroup Manager, Edit, General Permissions, Can Use Custom Title = Yes)

doctiar
02-24-2004, 09:48 PM
Thats true, but If I do that and allow say regular members to have access to add a custom title, I'm sure I will get alot of jokers out there putting in fake descriptions. I don't want to have to administrate it. If a user selects it once in their CP under their profile it would just appear in all of there posts. Thats what I want.

Andreas
02-24-2004, 10:21 PM
Hmm. Then you could do the following:

1) Create a new custom profile file (select) with all the titles you want to have, set it to required, profile
2) In profile.php FIND

else
{
$customtitle = $bbuserinfo['customtitle'];
$customtext = $bbuserinfo['usertitle'];
}
}
else
{
$customtitle = $bbuserinfo['customtitle'];
$customtext = $bbuserinfo['usertitle'];
}


REPLACE that with

else
{
$customtitle = $bbuserinfo['customtitle'];
$customtext = $bbuserinfo['usertitle'];
}
}
else
{
$customtitle = 2;
preg_match("/fieldx = '(.*)'/", $userfields, $matches);
$customtext = $matches[1];
}


Where fieldx is the name of your new profile field. Then the users can select the title in User CP.

doctiar
02-25-2004, 12:30 PM
I think you are on to Something KirbyDE. I put in your code and it now shows the add custom title bar in the CP for a basic user. I set the fieldx to field7 which is the custom profile field that I want to use. But when I post it still displays Junior Member.

Should not the matches[1] return the value of the selected profile field?

I still don't want to give regular users the ability to create there own custom titles. Just make the selection box = the name of the custom profile.

If that makes sense.

Andreas
02-25-2004, 12:45 PM
Hmm, does work just fine on my testboard.

Which version do you use?
Did you save the profile?

doctiar
02-25-2004, 01:21 PM
Ya I saved the profile.php

I'm using VB3 RC3.

Perhaps I could PM you and you could take a look at my board or I could view your test board to make sure we on the same page with this.

Thanks!