UBB.Dev
Posted By: bryan868 2nd custom member title field - 02/19/2004 4:31 AM
I'm looking for a hack that can add a 2nd custom title field under the members name. Unlike the custom user title, this 2nd field would only be edit-able by the admin in the CP.

I want to be able to designate certain members with special text under their name. But at the same time I want regular members to be able to change their custom title.

Right now I have custom titles turned off. I have a request thread where people can ask for a custom title and the admin puts it up manually. The users can't change their own title, and this prevents them from putting "Community Supporter," in their custom title field, a designation I manually put in only for users who donate money to the site.

So basically, I want the members to be able to edit their custom title field. But I want a SECOND field edit-able only by the admin in the CP so I can list certain members as "community supporters."

See what I mean? smile Anyone up the challenge of making this happen?
Posted By: bryan868 Re: 2nd custom member title field - 02/23/2004 1:35 AM
Anyone?
Posted By: Charles Capps Re: 2nd custom member title field - 02/23/2004 2:36 AM
Mmm.

This should be pretty easy in 6.7, which is what I assume you're using? smile
Posted By: bryan868 Re: 2nd custom member title field - 02/25/2004 9:53 AM
Of course. wink
Posted By: ADWOFF Re: 2nd custom member title field - 03/10/2004 9:19 AM
Quote
Originally posted by Charles Capps:

Mmm.

This should be pretty easy in 6.7, which is what I assume you're using? smile
Has anyone given this further thought?

With my 6.5 UBB.classic boards and versions below that, I have used the Custom User Title/Rank hack by Jimbo/Qasic ... and I was kinda resigned to give it up for my upgrade to 6.7 because I just don't know enough about the control panel and the code to figure out how to implement it ...

I also thought, I can still do "ranks" and "titles" with the new version--it'll just take some work on my part.

But then I realized that the Custom Title field overrides the User Titles that would be based on the # of posts one makes.

So my question is this: how difficult would it be to be able to have both? And is there anyone out there who is willing and talented enough to write the mod for it?! You'd have the eternal thanks of my community (and ME!) smile
Posted By: bryan868 Re: 2nd custom member title field - 03/11/2004 1:13 AM
Eh, this isn't totally related to what I'm suggesting. As I don't care about the functionality of the RANK. I just want two custom user title fields, one that can be defined by the members, one that can be defined by me.
Posted By: Charles Capps Re: 2nd custom member title field - 03/11/2004 3:20 AM
The joys of topics that I let slip off the radar...

Totally untested code here, so this might not work perfectly the first time...

cp2_editprofile.pl. Find:

Code
	my @profile = @_;
Add UNDER:

Code
        my $pref_hash = &unflatten_hash($profile[42]);
Find:

Code
		@field_list,
$bday_bits,
Add ABOVE:

Code
	{
type => "text",
title => "Second Title",
value => $pref_hash->{"second_title"},
name => "second_title",
},
Now in cp2_membermanage.cgi, find:

Code
		next if $key eq "title";
next if $key eq "user_notes";
Add UNDER:

Code
		next if $key eq "second_title";
Find:

Code
	# User notes
$profile->[41] = &ConvertReturns($core->{user_notes});
Add UNDER:

Code
	my $prefs_hash = &unflatten_hash($profile->[42]);
$prefs_hash->{"second_title"} = $in{second_title};
$profile->[42] = &flatten_hash($prefs_hash);
Now, to make it show up. ubb_lib_posting.cgi, find:

Code
				$user_status = $user_profile[31];
} # end if
Add BELOW:

Code
			my $prefs_hash = &unflatten_hash($user_profile[42]);
if($prefs_hash->{"second_title"}) {
$user_status = qq~$prefs_hash->{"second_title"}
$user_status~;
} # end if
If you want the second status below the normal status instead of above the normal status, just switch them in the assignment above.

Again, this is totally untested code. Good luck.. smile

Now... having both a custom user title AND a user title based on post count isn't really too hard... just as long as you only really care about it when it's inside a topic... let me know if you really want that, Sue. smile
Posted By: bryan868 Re: 2nd custom member title field - 03/11/2004 6:46 AM
Charles, wow, thank you so much. It works great. I just had to make one change.

Code
	my $prefs_hash = &unflatten_hash($profile->[42])
$prefs_hash->{"second_title"} = $in{second_title};
$profile->[42] = &flatten_hash($prefs_hash);
Add a semicolon after the first line.

Oh and there's one slight, slight problem. I can't seem to use HTML in the field, how can I fix this?
Posted By: ADWOFF Re: 2nd custom member title field - 03/11/2004 7:24 AM
Charles, thanks so much for giving this a shot ... I'd really love it if we could have a custom title that is something my community members request AND a user title based on post count ... if this could be doable, I'd be most appreciative. smile
Posted By: Charles Capps Re: 2nd custom member title field - 03/12/2004 8:54 PM
Ooooh. HTML? No clue. I'll need to actually install this and figure out where things are getting neutralized. smile

Sue... could you post a new topic for that? Don't wanna clutter this one up too much. smile
Posted By: Charles Capps Re: 2nd custom member title field - 03/12/2004 10:25 PM
OKay, the fix.

cp2_membermanage.cgi, find:

Code
		next if $key eq "title";
next if $key eq "user_notes";
Add UNDER:

Code
		next if $key eq "second_title";
Instructions above altered accordingly.
© UBB.Developers