Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

User fields...

Asked Modified Viewed 4,107 times
N
Ninos
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
asked
Member

Okay, so I read digitanium's post on how to add user fields. Everything seems to be perfect, except when 'save' is clicked on edit profile, none of the additional field's information is saved?
Must be a database error? (I've checked and the extra tables definitely exist)

As well as this, how would I put them under a custom category?
For example, the categories are 'Contact Information', 'Options', 'Miscellantious' etc...
I want one saying 'Martial Arts'

thanks :)
Edited by Ninos on 25-06-2008 18:56,
0 replies

9 posts

W
Wooya
W
Wooya 10
PHP-Fusion DEV Team
It's not a bug, it's undocumented feature...
  • Senior Member, joined since
  • Contributed 205 posts on the community forums.
  • Started 11 threads in the forums
answered
Senior Member

If you made some own custom user fields then post your code here. Then we can see what's wrong (if it is)...
0 replies
N
Ninos
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
answered
Member

Okay. I added 4 fields overall.
They're all the same except from minor changes (local files, database strings etc..)
so here is the code for one

user_ma1_include.php
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }

if ($profile_method == "input") {
// Create the input field for registration and edit profile
echo "<tr>\n";
echo "<td class='tbl'>".$locale['uf_ma1'].":</td>\n";
echo "<td class='tbl'><input type='text' name='user_ma1' value='".(isset($user_data['user_ma1']) ? $user_data['user_ma1'] : "")."' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
echo "</tr>\n";
} elseif ($profile_method == "display") {
// Create the display for the user profile
if ($user_data['user_ma1']) {
echo "<tr>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['uf_ma1']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_ma1']."</td>\n";
echo "</tr>\n";
}
} elseif ($profile_method == "validate_insert") {
// Validate the insert data field & value for our field
$db_fields .= ", user_ma1";
$db_values .= ", '".(isset($_POST['user_ma1']) ? stripinput(trim($_POST['user_ma1'])) : "")."'";
} elseif ($profile_method == "validate_update") {
// Validate the update data value for our field
$db_values .= ", user_skype='".(isset($_POST['user_ma1']) ? stripinput(trim($_POST['user_ma1'])) : "")."'";
}
?>


user_ma1_include_var.php
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }

// Field display name
$user_field_name = "When Started?";
// Field Description
$user_field_desc = "";
// The name of the database field used to ADD or DROP
$user_field_dbname = "user_ma1";
// The group the field appears under; 1 = Contact, 2 = Information, 3 = Options and 4 = Statistics
$user_field_group = 2;
// The database properties used when <span style='background-color:yellow;font-weight:bold;padding-left:2px;padding-right:2px'>ADDing</span> the above field
$user_field_dbinfo = "VARCHAR(50) NOT NULL DEFAULT ''";
?>

0 replies
N
Ninos
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
answered
Member

hate to double post, but any help?
this is kind of urgent.

[REWARD MAY BE GIVEN]
Edited by Ninos on 25-06-2008 23:07,
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Culprit

$db_values .= ", [color=#ff0000]user_skype[/color]='".(isset($_POST['user_ma1']) ? stripinput(trim($_POST['user_ma1'])) : "")."'";
0 replies
N
Ninos
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
answered
Member

Yayyy thanks! I'm so gonna donate to this project now :D

Also, how would I make the categorie thing?
0 replies
L
lundz
L
lundz 10
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 2 threads in the forums
answered
Junior Member

Quote

Digitanium wrote:
Culprit

$db_values .= ", [color=#ff0000]user_skype[/color]='".(isset($_POST['user_ma1']) ? stripinput(trim($_POST['user_ma1'])) : "")."'";



where will the code be?
0 replies
J
Josso
J
Josso 10
–––
Without faith, nothing is possible. With it, nothing is impossible
  • Senior Member, joined since
  • Contributed 309 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

The user_skype, in the code below, should have been changed to user_ma1 ;)
} elseif ($profile_method == "validate_update") {
// Validate the update data value for our field
$db_values .= ", user_skype='".(isset($_POST['user_ma1']) ? stripinput(trim($_POST['user_ma1'])) : "")."'";
}
?>
0 replies
N
Ninos
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
answered
Member

Yeah thanks Digitanium fixed it as you can see, but thanks anyway :)
You don't know by any chance how to make it in its own category? (Instead of under Options, Conatct Information, Statistics etc...I want it to be under, for example, 'Martial Art's)
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Thats something i'm plannin for 7.01, no time to do it now.
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 9 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
W
W
Wooya 10
PHP-Fusion DEV Team
It's not a bug, it's undocumented feature...
  • Senior Member, joined since
  • Contributed 205 posts on the community forums.
  • Started 11 threads in the forums
J
J
Josso 10
–––
Without faith, nothing is possible. With it, nothing is impossible
  • Senior Member, joined since
  • Contributed 309 posts on the community forums.
  • Started 1 thread in the forums
N
N
Ninos 10
  • Member, joined since
  • Contributed 58 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
L
L
lundz 10
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 2 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet