Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
Prior to 6.6, I used the custom fields for adding information for each member. The user didn't have access to change this information, but could view it in their profile. Only I could modify this info and only in the control panel.

To do this with the old CP, I disabled custom fields and then added the display to the user's profile and added the editing function to the CP. It was simple with some template work.

I am having trouble building this into the new 6.6 control panel's profile editing page. I would appreciate any advice on how I might do this.

BTW, the information in these fields are images and I used to have the image displayed next to the field. With the highly structured way things are done now with 6.6, I don't know how I would do this either.


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Sponsored Links
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
why not just go into public_edit_profile.pl and remove any instance of CustomFieldx.

If you mean show the image in the public profile, just do
Code
<img src="$user_profile[19]" alt="-" />
You could change the number to whichever field you wanted to use.

I don't know how to show it in the cp though

Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
As I said, it was easy with the old style of templates. Now, a lot of the HTML is generated and I am unsure how to fit in custom template changes on pages like these.

For example, if you disable custom fields, they aren't displayed at all. Those fields are removed from the list of things to be generated. How do you get it to display without being able to edit? How do you add a simple image statement next to it, when the template is limited to what is setup to be generated?

I fear what used to be a simple template change will now require major effort.


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
I'll have access to my files in a bit, and I'll post the code you need to change

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ok, this will allow you to remove the ability of the members to change the fields.

in public_edit_profile.pl
find:
Code
if (($vars_registration{custom1_field_use} ne 'DEL') && ($vars_registration{customfield1} ne '')) {

if ($vars_registration{custom1_field_use} eq 'REQ') {
$B1 = '<b>';
$B2 = '</b>';
} else {
$B1 = '';
$B2 = '';
}

print <<THISFIELD;

<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$B1$vars_registration{customfield1}$B2:
</font>
</td>
<td>
<input type="text" name="customfield1" value="$user_profile[16]" size="35" maxlength="80" />
</td>
</tr>

THISFIELD

} # end field



if (($vars_registration{custom2_field_use} ne 'DEL') && ($vars_registration{customfield2} ne '')) {

if ($vars_registration{custom2_field_use} eq 'REQ') {
$B1 = '<b>';
$B2 = '</b>';
} else {
$B1 = '';
$B2 = '';
}

print <<THISFIELD;

<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$B1$vars_registration{customfield2}$B2:
</font>
</td>
<td>
<input type="text" name="customfield2" value="$user_profile[17]" size="35" maxlength="80" />
</td>
</tr>

THISFIELD

} # end field



if (($vars_registration{custom3_field_use} ne 'DEL') && ($vars_registration{customfield3} ne '')) {

if ($vars_registration{custom3_field_use} eq 'REQ') {
$B1 = '<b>';
$B2 = '</b>';
} else {
$B1 = '';
$B2 = '';
}

print <<THISFIELD;

<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$B1$vars_registration{customfield3}$B2:
</font>
</td>
<td>
<input type="text" name="customfield3" value="$user_profile[18]" size="35" maxlength="80" />
</td>
</tr>

THISFIELD

} # end field

if (($vars_registration{custom4_field_use} ne 'DEL') && ($vars_registration{customfield4} ne '')) {

if ($vars_registration{custom4_field_use} eq 'REQ') {
$B1 = '<b>';
$B2 = '</b>';
} else {
$B1 = '';
$B2 = '';
}

print <<THISFIELD;

<tr bgcolor="$vars_style{AltColumnColor1}">
<td>
<font size="$vars_style{TextSize}" face="$vars_style{FontFace}">
$B1$vars_registration{customfield4}$B2:
</font>
</td>
<td>
<input type="text" name="customfield4" value="$user_profile[19]" size="35" maxlength="80" />
</td>
</tr>

THISFIELD

} # end field
DELETE IT!

in public_register_form.pl
find:
Code
	# Custom 1
print &GenerateLineHTML($vars_registration{custom1_field_use},
$vars_registration{customfield1}, "", "customfield1", "text", 35, 80, 0);

# Custom 2
print &GenerateLineHTML($vars_registration{custom2_field_use},
$vars_registration{customfield2}, "", "customfield2", "text", 35, 80, 0);

# Custom 3
print &GenerateLineHTML($vars_registration{custom3_field_use},
$vars_registration{customfield3}, "", "customfield3", "text", 35, 80, 0);

# Custom 4
print &GenerateLineHTML($vars_registration{custom4_field_use},
$vars_registration{customfield4}, "", "customfield4", "text", 35, 80, 0);
DELETE IT!

in ubb_profile.cgi
find:
Code
	$user_profile[16] = &CensorCheck($in{customfield1});
$user_profile[17] = &CensorCheck($in{customfield2});
$user_profile[18] = &CensorCheck($in{customfield3});
$user_profile[19] = &CensorCheck($in{customfield4});
DELETE IT! (This removes the ability of a member to edit the html output to allow him to change the value

Now just enable the custom fields in the cp, BUT DO NOT MAKE IT REQUIRED!

It will display in people's profiles like normal, people can't edit it, and you don't even need to touch the CP's code smile

Sponsored Links
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
I had most of that stuff already commented out anyway. I just left the fields disabled (hidden) just in case.

I suppose I could enable those fields to allow me to edit them in the control panel, but I am still left wondering how to add an image statement next to these entries in the new control panel.


"For who would lie idle when the king has returned?"
www.MinasTirith.com

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
isaac
isaac
California
Posts: 1,157
Joined: July 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)