Previous Thread
Next Thread
Print Thread
Rate Thread
#57333 02/18/2004 9:31 PM
Joined: Sep 2000
Posts: 221
Member
Member
Offline
Joined: Sep 2000
Posts: 221
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?


This is the designed behavior.
Sponsored Links
Joined: Sep 2000
Posts: 221
Member
Member
Offline
Joined: Sep 2000
Posts: 221
Anyone?


This is the designed behavior.
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Mmm.

This should be pretty easy in 6.7, which is what I assume you're using? smile


UBB.classic: Love it or hate it, it was mine.
Joined: Sep 2000
Posts: 221
Member
Member
Offline
Joined: Sep 2000
Posts: 221
Of course. wink


This is the designed behavior.
Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Sponsored Links
Joined: Sep 2000
Posts: 221
Member
Member
Offline
Joined: Sep 2000
Posts: 221
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.


This is the designed behavior.
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
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


UBB.classic: Love it or hate it, it was mine.
Joined: Sep 2000
Posts: 221
Member
Member
Offline
Joined: Sep 2000
Posts: 221
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?


This is the designed behavior.
Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
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


UBB.classic: Love it or hate it, it was mine.
Sponsored Links
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
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.classic: Love it or hate it, it was mine.

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)