Forum

User custom fields ...
 
Notifications
Clear all

User custom fields plugin

13 Posts
4 Users
0 Likes
1,180 Views
(@fre2mansur)
Posts: 47
Member
Topic starter
 

Want to get more detail about the user?

User Custom Fields plugin adds support for custom fields for users! Yes, that's right.
It has 7 field types:

  • Text
  • Number
  • Range (single)
  • Range (from-to)
  • Textarea
  • Radio
  • Dropdown
  • Checkbox group
  • Checkbox
  • URL
  • Date

Fields have the following attributes:
required (yes/no)
public (yes/no)
show input at (dashboard, register, both).
options (for radio, dropdown, checkbox group)
min & max (for number and ranges).

You can order fields in admin by dragging them.

-- HELP --
Check the help page for documentation on helpers (for showing field values).

-- TRANSLATION --
.pot translation template is provided. Translate using POedit or similar software.

Download: https://market.osclasscommunity.com/index.php?page=item&id=34 (Direct Download)
Thank you WEBmods, for sharing this useful plugin for our community.

 
Posted : 03/09/2019 10:00 am
(@sechnge)
Posts: 8
Active Member
 

[member=3]WEBmods[/member] - Nice plugin, I've been looking for this for a while (previously had a dirty solution of modifying the core files manually but this is much more manageable!).

I'm currently unable to add fields however getting "Error while adding the field. Please try again.". Am I correct in saying I'll need to modify a file somewhere to get this working? Checked the help tab but didn't mean much to me, sorry (fairly new to OSClass)!

Using the beta version you linked above and I'm using a third party theme if that helps?
https://www.osclasswizards.com/osclasswizards/

 
Posted : 03/12/2019 12:28 pm
Defected
(@dftd)
Posts: 614
Honorable Member Admin
 

[member=99]SECHNGE[/member] Glad you like the plugin!

Enable SQL debugging in your config.php by adding this to it:


define('OSC_DEBUG_DB', 1);
define('OSC_DEBUG_DB_LOG', 1);

Then go oc-content and create queries.log.

After that try to create a field and post here what will be logged in queries.log.

Available for custom Osclass development. www.defected.dev

 
Posted : 03/12/2019 8:42 pm
(@sechnge)
Posts: 8
Active Member
 

Thanks for the reply!  🙂

==================================================
=    Date: December 4, 2019 December 4, 2019    =
=              Total queries: 14                =
=    Total queries time: 0.0089199542999268    =
==================================================

QUERY TIME 0.00073599815368652
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00074982643127441
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00023794174194336
***********************************************
DELETE FROM oc_t_preference
WHERE s_name = 'default_logo'
AND s_section = 'osclasswizards_theme'
--------------------------------------------------
QUERY TIME 0.00067996978759766
***********************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00071620941162109
***********************************************
SHOW COLUMNS FROM oc_t_admin where Field = "b_moderator"
--------------------------------------------------
QUERY TIME 0.00023078918457031
********************************************
SELECT pk_i_id, s_name, s_username, s_password, s_email, s_secret, b_moderator
FROM (oc_t_admin)
WHERE pk_i_id = '1'
--------------------------------------------------
QUERY TIME 0.00028896331787109
***********************************************
SELECT count(*) as total
FROM (oc_t_item_comment c, oc_t_item i)
WHERE c.fk_i_item_id = i.pk_i_id
AND ( c.b_active = 0 OR c.b_enabled = 0 OR c.b_spam = 1 )
--------------------------------------------------
QUERY TIME 0.00027918815612793
**************************************************
SELECT count(*) as total
FROM (oc_t_item i, oc_t_item_stats s)
WHERE i.pk_i_id = s.fk_i_item_id
AND s.i_num_spam > 0 AND i.b_spam = 0
--------------------------------------------------
QUERY TIME 0.00071001052856445
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.0003809928894043
**************************************************
SELECT count(*) as total
FROM (oc_t_item_comment c, oc_t_item i)
WHERE c.fk_i_item_id = i.pk_i_id
AND ( c.b_active = 0 OR c.b_enabled = 0 OR c.b_spam = 1 )
--------------------------------------------------
QUERY TIME 0.00027799606323242
**************************************************
SELECT count(*) as total
FROM (oc_t_item i, oc_t_item_stats s)
WHERE i.pk_i_id = s.fk_i_item_id
AND s.i_num_spam > 0 AND i.b_spam = 0
--------------------------------------------------
QUERY TIME 0.00063514709472656
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.0029969215393066
***********************************************
SELECT MAX(i_order) AS max
FROM (oc_t_user_cf)
--------------------------------------------------
QUERY TIME 0
Error number: 1054
Error description: Unknown column 'i_min' in 'field list'
********************************************
INSERT INTO oc_t_user_cf (s_name, s_slug, s_type, s_options, i_min, i_max, b_enabled, b_public, b_required, e_position, i_order) VALUES ('Test', 'test', 'TEXT', NULL, NULL, NULL, '1', '1', '1', 'REG', 1)
--------------------------------------------------



==================================================
=    Date: December 4, 2019 December 4, 2019    =
=              Total queries: 13                =
=    Total queries time: 0.0064952373504639    =
==================================================

QUERY TIME 0.00075101852416992
***********************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00078392028808594
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00023984909057617
***********************************************
DELETE FROM oc_t_preference
WHERE s_name = 'default_logo'
AND s_section = 'osclasswizards_theme'
--------------------------------------------------
QUERY TIME 0.00071907043457031
***********************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00076603889465332
***********************************************
SHOW COLUMNS FROM oc_t_admin where Field = "b_moderator"
--------------------------------------------------
QUERY TIME 0.00024700164794922
********************************************
SELECT pk_i_id, s_name, s_username, s_password, s_email, s_secret, b_moderator
FROM (oc_t_admin)
WHERE pk_i_id = '1'
--------------------------------------------------
QUERY TIME 0.00029110908508301
***********************************************
SELECT count(*) as total
FROM (oc_t_item_comment c, oc_t_item i)
WHERE c.fk_i_item_id = i.pk_i_id
AND ( c.b_active = 0 OR c.b_enabled = 0 OR c.b_spam = 1 )
--------------------------------------------------
QUERY TIME 0.00030708312988281
**************************************************
SELECT count(*) as total
FROM (oc_t_item i, oc_t_item_stats s)
WHERE i.pk_i_id = s.fk_i_item_id
AND s.i_num_spam > 0 AND i.b_spam = 0
--------------------------------------------------
QUERY TIME 0.00075411796569824
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00030303001403809
**************************************************
SELECT count(*) as total
FROM (oc_t_item_comment c, oc_t_item i)
WHERE c.fk_i_item_id = i.pk_i_id
AND ( c.b_active = 0 OR c.b_enabled = 0 OR c.b_spam = 1 )
--------------------------------------------------
QUERY TIME 0.00028800964355469
**************************************************
SELECT count(*) as total
FROM (oc_t_item i, oc_t_item_stats s)
WHERE i.pk_i_id = s.fk_i_item_id
AND s.i_num_spam > 0 AND i.b_spam = 0
--------------------------------------------------
QUERY TIME 0.0007479190826416
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00029706954956055
**************************************************
SELECT *
FROM (oc_t_locale)
WHERE b_enabled = 1
ORDER BY s_name ASC
--------------------------------------------------



==================================================
=    Date: December 4, 2019 December 4, 2019    =
=                Total queries: 9                =
=    Total queries time: 0.0049097537994385    =
==================================================

QUERY TIME 0.00077509880065918
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00086593627929688
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00026893615722656
***********************************************
DELETE FROM oc_t_preference
WHERE s_name = 'default_logo'
AND s_section = 'osclasswizards_theme'
--------------------------------------------------
QUERY TIME 0.00067901611328125
***********************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------
QUERY TIME 0.00078582763671875
***********************************************
SHOW COLUMNS FROM oc_t_admin where Field = "b_moderator"
--------------------------------------------------
QUERY TIME 0.0002448558807373
********************************************
SELECT pk_i_id, s_name, s_username, s_password, s_email, s_secret, b_moderator
FROM (oc_t_admin)
WHERE pk_i_id = '1'
--------------------------------------------------
QUERY TIME 0.00029397010803223
***********************************************
SELECT count(*) as total
FROM (oc_t_item_comment c, oc_t_item i)
WHERE c.fk_i_item_id = i.pk_i_id
AND ( c.b_active = 0 OR c.b_enabled = 0 OR c.b_spam = 1 )
--------------------------------------------------
QUERY TIME 0.00028395652770996
**************************************************
SELECT count(*) as total
FROM (oc_t_item i, oc_t_item_stats s)
WHERE i.pk_i_id = s.fk_i_item_id
AND s.i_num_spam > 0 AND i.b_spam = 0
--------------------------------------------------
QUERY TIME 0.00071215629577637
**************************************************
SELECT *
FROM (oc_t_preference)
--------------------------------------------------

I'm guessing the following is the fault:

QUERY TIME 0
Error number: 1054
Error description: Unknown column 'i_min' in 'field list'

I can't find any mention of 'field list' or 'i_min' in the DB. My OSClass is a fresh install of the latest version from GitHub however using an old DB that's about 6 months old.

 
Posted : 04/12/2019 10:46 am
Defected
(@dftd)
Posts: 614
Honorable Member Admin
 

[member=99]SECHNGE[/member] Seems like the database structure of the plugin is not updated. Odd as it's fresh install.
I will check it when I reach my PC and update the plugin.

Available for custom Osclass development. www.defected.dev

 
Posted : 04/12/2019 11:14 am
(@sechnge)
Posts: 8
Active Member
 

Thanks [member=3]WEBmods[/member] - really appreciate it.

If there's anything I can do to help / test just let me know (same applies going forwards, not just in this instance).

 
Posted : 04/12/2019 11:58 am
Defected
(@dftd)
Posts: 614
Honorable Member Admin
 

Glad to help. 🙂

Please screenshot me table structure in phpMyAdmin.

Go to cPanel -> phpMyAdmin -> choose your DB on the left -> find prefix_t_user_cf -> click Structure and take a screeshot.

* prefix is usually "oc" but can be anything.

** it would be good if you hide/censor (on the screenshot) your database name.

Available for custom Osclass development. www.defected.dev

 
Posted : 04/12/2019 12:06 pm
(@sechnge)
Posts: 8
Active Member
 

Root of DB structure:

t_user_cf structure:

 
Posted : 04/12/2019 12:32 pm
Defected
(@dftd)
Posts: 614
Honorable Member Admin
 

[member=99]SECHNGE[/member] Please remove the plugin and download the latest release from Market.

I just downloaded the plugin, installed on localhost and didn't have any problems.
Then I went on the topic to see again what was the issue and noticed that you said you downloaded a beta version linked above. That's an outdated URL. My bad... A stable release is ready...

https://market.osclasscommunity.com/plugins/item-post-related/user-custom-fields-11-field-types-1-1-1-bugfix_i34

Available for custom Osclass development. www.defected.dev

 
Posted : 04/12/2019 6:48 pm
(@sechnge)
Posts: 8
Active Member
 

Thanks [member=3]WEBmods[/member] - I thought I'd done this but couldn't remember so have tried again without any luck. Still getting the same error unfortunately.

For arguments sake I've just done a fresh install of OSClass with a new DB and the plugin works fine, even with the custom theme, so it seems to be something wrong with my DB not the plugin (both beta and market version are fine - both tested just out of curiosity). Probably worth me starting a fresh I think, the site was fairly new so not much on it (just setup of categories etc).

Thanks for your help with this - sorry to have wasted any of your time.

 
Posted : 04/12/2019 10:26 pm
Defected
(@dftd)
Posts: 614
Honorable Member Admin
 

[member=99]SECHNGE[/member] No problem man. 🙂

Available for custom Osclass development. www.defected.dev

 
Posted : 04/12/2019 10:39 pm
(@casper)
Posts: 4
New Member
 

Hello

I am using the Version 3.9.0
Downloaded from the following link

https://github.com/mindstellar/Osclass/issues/83

I installed the plugin but it doesn't work well!
That is, it saves the fields naturally, but when changing the options from the user control panel, it saves the change while viewing the fields and remains in the user control panel on the old options.

Also, when changing in field options from the admin control panel, users do not accept the change.

I installed version 381 and it works perfectly without any problems.
Where is the problem?

And if I install your version 391, will the plugin work properly?

I apologize, but I intend to install the script and are not sure which version will work with the plugin properly.

thank you

 
Posted : 16/08/2020 2:43 am
(@casper)
Posts: 4
New Member
 

My friend all versions have been tried with the same problem

Can fields be removed from user editing in the admin panel?

What is changed in editing the user from the admin panel remains constant in the user profile

Please help me to finish my project

 
Posted : 16/08/2020 5:40 pm
Share: