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.
Sign In
Not a member yet? Click here to register.

External user fields

Tried to add custom user fields category in V9.03.50.
When selecting a table from the dropdownlist an errro occured:

Table \'douwe_V9.users\' doesn\'t exist

Te fieldname should be douwe_V9-users, and not douwe_V9.users.

This is going wrong for every table.

Also there is a message displaying:

User field page can be extended to read other database on view.

But How can this be done?

And in V8 the fieldname for new category is truncated to 2 charakters, so cannot be used there.

edit: For V8.0.40 it is in /administration/user_field_cats.php, around line 130:

 echo "<input type='text' name='cat_db' value='".$cat_db."' maxlength='2' class='textbox' style='width:240px;' />\n";
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td class='tbl' width='1%' style='white-space:nowrap'><label for='cat_index'>".$locale['428'].":</label></td>\n";
 echo "<td class='tbl'>\n";
 echo "<input type='text' name='cat_index' value='".$cat_index."' maxlength='2' class='textbox' style='width:240px;' />\n";
 echo "</tr>\n<tr>\n";
 echo "<td class='tbl' width='1%' style='white-space:nowrap'><label for='cat_class'>".$locale['425'].":</label></td>\n";
 echo "<td class='tbl'>\n";
 echo "<input type='text' name='cat_class' value='".$cat_class."' maxlength='2' class='textbox' style='width:240px;' />\n";
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td class='tbl' width='1%' style='white-space:nowrap'><label for='cat_order'>".$locale['421'].":</label></td>\n"

length should be 20 or something in stead of 2
yeah we´ll set to 100 just incase, https://github.com/php-fusion/PHP-Fusion/commit/b6c9c09c5acf3cc555c55346add647f80a152231
Chan or Rob worked with them fields, I am not sure. See if they can give some more info about it.
1. Please change - to _ in your PHPMyAdmin, it's a limitation in the installer itself. I found v7 couldn't handle it either.

When we coded 9 during beta, the installer specifically converted - to _ using str_replace() and there forward, we just "assumed" that everything in the DB will be in underscore and not hyphens. We have not adapted to using hypens yet. So please change.

Also, @RobiNNN found out that $chars = ["abcdefghijklmnpqrstuvwxyz", "123456789"]; letters in the prefix should be lowercase because some versions of MySQL do not accept uppercase letters (confirmed on MySQL 8)

If you have any uppercase in table name, please lowercase them all.

2. For external infusions. How it works is that - if you do set up a new category as a new page like this -


You can access its table data, for the image above, i am trying to set up a new page that reads into 'addondb' table. In addondb table, the addon submitter column name is called addon_author_id. So, I'll just add that data in user_id column. This way, the system will do a join.

WHERE addon_author_id = user_id corresponding to your &lookup={user_id}, hence that both userdata and addon data is available on that page. But the limitations is that you can only get 1 row from each table. So joining it with DB_FORUM_POSTS will not work as intended. The system is built to accept custom script that designed as for "profile" purposes only. (ie. 1 row each)

You could do a user field module, and bind it to a new page. And use that user field module to do all the SQL internally and render itself. That is the recommended solution now.
Chan attached the following image:
Thanks for you explaination, but I guess you missed something:

The tablename is douwe_V9-users, not douwe_V9.users.
So NOT the hyphen is wrong, but the period is wrong. This cannot because of the str_replace() of the installer.
And this is not about the installer, but data I entered myself in the user field section.

For the userfields, if I understand well, In your screenshot, I should enter in the "primary table user column:" the value of "addon_author_id" And this is then linked to the column user_id of table Users. But in this case, we assume the ID of the same user is the same in both tables, but this will never be the case if the "addon_author_id" is in an external system.

Furthermore the question how to bind a user field to a new page? The only option you have is specifying an number as page in an userfield
Thread Information
4 posts
125 times
Last Post
Last updated on 2 months ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, Chan, douwe_yntema