#56284
09/22/2003 1:42 PM
|
Joined: Nov 2001
Posts: 96
Member
|
Member
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.
|
|
|
#56285
09/22/2003 4:15 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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 <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
|
|
|
#56286
09/22/2003 6:25 PM
|
Joined: Nov 2001
Posts: 96
Member
|
Member
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.
|
|
|
#56287
09/22/2003 6:55 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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
|
|
|
#56288
09/22/2003 7:41 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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: 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: # 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: $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
|
|
|
#56289
09/23/2003 12:58 PM
|
Joined: Nov 2001
Posts: 96
Member
|
Member
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.
|
|
|
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.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|