Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1328)
Order Custom Profile Fields 1.1.1 by Nathaniel
Overview:This Mod allows you to reorder your Custom Profile Fields, so that they have the order that you want. You can order them where you normally create/edit Custom Profile Fields, in the admin panel under "Configuration" -> "Features And Options" -> "Profile Fields". The order that you specify will be used for the Profile Pages and for the Registration Page, if you have enabled "Show on Registration" for some of the fields. The order will also be used for the topic display template if you have selected the "display on topic view" option for the specific fields.
Please remember that you have to enable the "Advanced Profile Fields" option in the admin panel under "Configuration" -> "Core Features", before you will be able to add/edit/view your Custom Profile Fields.
When dragging a field, don't try to drag it by the name/title which is a link, drag it via the main body of the table row.
You can change the colour of a field that is being dragged, with a simple edit to your "Themes/{themename}/Admin.template.php" file. Do a search for "custom_profile_field_selected_color" (the rest should be obvious, don't forget that the colour needs to be in hexadecimal).
SMF Version SupportThis mod is officially supported for SMF 2.0 final and above only. Below is a list of available versions of this mod and the previous versions of SMF that they supported. Use them at your own risk. The mod author will not be supporting or upgrading this mod in any way for versions of SMF below 2.0 final.
Version 1.01: SMF 2 Beta 3.1 Public and Beta 4.
Version 1.1: SMF 2 RC2 (possibly), SMF 2 RC3 and RC4.
Version 1.1.1: SMF 2 RC5.
DonateIf this mod has helped you, then feel free to support the developer by
Donating (https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VCFQ7MJNVXLLA&lc=AU&item_name=Donation¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted). Any amount of money is welcome.
Browser SupportThis is only relevant to the AJAX for the admin page. If the javascript/ajax does not work, then the old method of ordering custom profile fields (using up/down arrows) will be displayed.
These are the browsers that I have confirmed the AJAX/javascript works for, as well as the OS I tested them under (I didn't test any browser with Mac OS).
Chrome 5 (under windows xp and linux)
Opera 10 (under windows xp and linux)
Firefox 3.6 (under windows xp and linux)
Safari 5 (under windows xp)
Internet Explorer 6/7/8 (under windows xp)
Version Changes:
v1.1.1 - 21 July 2011
Support for SMF 2.0 final.
v1.1 - 12 June 2010
Updated for SMF 2 RC3.
Added ajax/javascript reordering.
v1.01 - 10 September 2008
Updated for SMF 2 Beta 4.0.
v1.0 - 10 August 2008
Original Mod release.
Thank you to ccbtimewiz for giving me the idea for this mod. I actually really wanted to call it "The ccbtimewiz Mod", but he wouldn't allow it. ;D
Can this mod be used for 1.1.5?
@ninedoors ,
Short answer: No.
Long Answer:
This mod edits the Custom Profile Field Feature for SMF 2 Beta, this feature is not included with SMF 1.1.5 so there is no point in having a mod for it. The Custom Profile Field Mod (http://custom.simplemachines.org/mods/index.php?mod=319) is designed to allow people to use the Custom Profile Field Feature for SMF 1.1.x, so that is probably what you are looking for, if you want those fields to be ordered, then you should request that in the support topic for that mod (http://www.simplemachines.org/community/index.php?topic=79004.0).
Thanks for the quick reply.
Nick
Quote from: LHVWB on August 14, 2008, 03:56:15 AM
Thank you to ccbtimewiz for giving me the idea for this mod. I actually really wanted to call it "The ccbtimewiz Mod", but he wouldn't allow it. ;D
:P
Regardless, great mod. =D
@ccbtimewiz,
I am glad you like it, especially seeing as you requested it. :P
v1.01
Updated for SMF 2 Beta 4.0.
You must first uninstall the "custom field on member list" mod or this installation will fail. (I haven't yet tried re-installing cfoml to see if it has problems.
This mod is gretae gj
Only thing is that it says show under post count but they are showing over instead :/
Any idea how to fix that ?
Thanks
@wakewatcher,
Which version of SMF are you running?
@fyndler,
Which exact page are you referring to? Could you please describe you issue a little bit more, I can't clearly see what the issue is. Also, Which version of SMF are you running?
2b4
@wakewatcher,
Try installing this mod and then the "Custom Fields On Memberlist" mod. I have tested that and it works fine for me.
Is custom profiles avalible for version Custom Fields 1.1.7?
LHVWB,
Great mod, much needed. Bit cheeky this one but related to Mod. I want to display one of my custom profile field's output (Membership Number) within the display.template user info box next to each post.
Because custom profile fields are named and stored separately, I can't work out the code to just pick up an output from a custom field for given member.
Can you help or should this be posted elsewhere (in 2.0b4 board?)
W
@chinclub,
No. This mod is only for the SMF 2 inbuilt feature, not the SMF 1.1.7 mod.
@willerby,
I think you are looking for the 'Show on Topic View' option, its available when you edit a profile field in the admin pannel.
doesn't seem to work with rc1... i'm crossing my fingers it will get updated soon :)
Quote from: LadyC on February 05, 2009, 08:08:53 PM
doesn't seem to work with rc1... i'm crossing my fingers it will get updated soon :)
Um, yeah. This is a fairly large mod, so it will get updated when I find the time. Might happen in the next day, might take me a bit longer (also depends on what the issue is with RC1). Ironically I have no planned changes for this mod, so it should be fairly early in my list of mods to update. ;D
Basically RC1 rocks! So I'll get around to updating it sometime. ;)
While you are at it why don't you ajax-ize it and make the re-ordering drag and drop. :D
Quote from: wakewatcher on February 06, 2009, 01:08:44 AM
While you are at it why don't you ajax-ize it and make the re-ordering drag and drop. :D
I could, but that would delay the next update by a fair chunk of time, while I find the extra time to learn enough Ajax to do that - ie. probably not going to happen in the near future. A compatibility update should suffice for now. :P
Yeah I know there isn't enough time in the day to do it all! Anyway when you get around to it here's a nice tutorial. I just added something similar to something I'm working on and actually thought about your mod as I was doing it. (If I ever get to the point of understanding the mod packaging stuff I might be able to help.)
http://www.phpriot.com/articles/sortable-lists-with-php-and-ajax (http://www.phpriot.com/articles/sortable-lists-with-php-and-ajax)
Possible to make so only admins can see the fileds we make ?
@wakewatcher,
I have had a look at that, been working on it in my limited free time. Using that method involves rewriting a HTML table template with ul's and li's, which doesn't work too well for some browsers. Still working on that.
@fyndler,
This mod is not concerned with who can view the fields or the fields themselves. This mod is only designed to change the order of your fields.
Please, make this available for RC1 It is very much needed :(
Geko,
Updating this mod is somewhere on my long to-do list, I will do it when I can. ;)
QuoteGeko,
Updating this mod is somewhere on my long to-do list, I will do it when I can. ;)
Of course. It is a great mod and very much needed.
please....... :(
Any chance this is being worked on yet? It's a great mod..
This is a great idea. I tried to use it for RC2 and it didn't install properly (probably because it's RC2 and not RC1 so no fault of the mod itself).
There is no mod necessary to have custom profile fields in RC2 - the functionality to have them is already built in with RC2. If this mod can be adjusted to order those, that would be most uber cool thing ever. :)
Thank you! Have a great day.
Hello. Is there currently any way to make this compatible with RC2? thank you.
Package Manager says installed. Every file listed in Manual Install was installed as specified. Every installed file is CHMOD 755. Does not work.
None of the experts has a relevant comment.
The warning says this has not been tested on 1.1.11 but no errors emerged on installation.
Thanks
Any chance this will be updated any time soon? I'm running 2.0RC2, but I'm sure 2 and 3 would be pretty close.
Yeah, can you please update for SMF 2.0 RC3. Thanks!
Yes, please update for RC3.
Thanks
bump, RC3 please.
v1.1 - 12 June 2010
Updated for SMF 2 RC3.
Added AJAX/javascript reordering.
Quote from: Nathaniel on June 12, 2010, 12:38:26 AM
v1.1 - 12 June 2010
Updated for SMF 2 RC3.
Added AJAX/javascript reordering.
Let me be the first to thank you for this mod by upgrading it to RC3.
how do i enable this or configure this in smf 2.0 rc3? i don't see this, "Please remember that you have to enable the "Advanced Profile Fields" option in the admin panel under "Configuration" -> "Features And Options", before you will be able to add/edit/view your Custom Profile Fields."
Quote from: 4b11l on June 12, 2010, 02:12:20 AM
Quote from: Nathaniel on June 12, 2010, 12:38:26 AM
v1.1 - 12 June 2010
Updated for SMF 2 RC3.
Added AJAX/javascript reordering.
Let me be the first to thank you for this mod by upgrading it to RC3.
Jade beat you to it. :P
Quote from: kkattfish on June 14, 2010, 06:43:51 PM
how do i enable this or configure this in smf 2.0 rc3? i don't see this, "Please remember that you have to enable the "Advanced Profile Fields" option in the admin panel under "Configuration" -> "Features And Options", before you will be able to add/edit/view your Custom Profile Fields."
With SMF 2 RC3 you enable the Custom Profile fields feature (called 'Advanced profile fields' in this section) under 'Configuration' -> 'Core Features'.
I'll update the mod page to reflect this.
Thanks for the update
Works fine
Thank you very much for this mod and the upgrade. It works nicely :)
Thanks, it's an awesome mod.
To which table the mod saves input string ?
I'm guessing this won't wokr on RC5
Have some one try to use it on RC5 ver??
Quote from: Mihkel on August 03, 2010, 04:27:24 PM
To which table the mod saves input string ?
This mod doesn't save an input string. The relevant ordering is saved to the usual smf_custom_fields table in the database.
Quote from: NHWD on April 17, 2011, 10:43:01 PM
I'm guessing this won't wokr on RC5
Quote from: poetra on April 18, 2011, 04:58:35 AM
Have some one try to use it on RC5 ver??
The latest version should work on RC5, it definitely works on SMF 2.0 final.
Perfect - this MOD was just what i needed
Hi
great Mod idea...
I just installed this mod and it installed no errors but I can't find the settings
Configuration" -> "Features And Options" -> "Profile Fields" But nothing there.
I have about 20 custom fields there already from what a added with all the different time
zones so a member can select just [1] for his time zone to display in the list of profile info
and all members can then see each others each others time of when replying.
Does custom fields stop this mod from working?
Plus if your intersted in my idea for a mod!!! have a look at Time Zones (http://www.simplemachines.org/community/index.php?topic=452409.msg3160247#msg3160247) I posted on the SMF board
there are other mod for times but nothing like this
I see the mod has been updated for 2.0 but does that mean it works on 2.0.2 also? If not, can it be updated?
Work on 2.0.2
Just installed this mod and it would be really great except that it does not save the position.
Drag and Drop works but there is no change to the position column in the smf_custom_fields table.
I am running 2.0.3 and the installation of the mod worked without a problem.
If I manually change the position values in the database they are correctly used.
Any hints how I can debug this problem?
Steiger, I am seeing the same behavior that you are reporting - I can drag and drop the fields and put them into the correct order, but when I refresh the page they show up in a different order. This is very strange, given that the mod was working previously. According to my notes I added fields on January 31st, so it must have worked then. I added more fields today but I can't order them.
However, your problems predate all of my work.
I am running SMF 2.0.4 with Firefox 18 and these mods:
1. Join Password 1.0.4
2. SMF 2.0.4 Update 1.0
3. Default_Membergroup 2.0
4. Order Custom Profile Fields 1.1.1
5. SMF 2.0.3 Update 1.0
Hmmm, I added 'Join Password' and 'Default Member Group' after my last field additions on January 31st; perhaps one of them is interacting with 'Order Custom Profile Fields'? What mods do you have installed?
Sorry, for replying late but notifications do not work for me and I was on vacation until last weekend.
Here is my list of mods:
1. SMF 2.0.4 Update 1.0
2. Disable 'last edit by...' for Administrators 1.9
3. Restrict Email Providers on Registration 1.2
4. Simple Audio Video Embedder 2.0.6
5. SimplePortal - German Informal 2.3.5
6. SimplePortal 2.3.5
7. Custom SQL Profile Field Mod 1.0
8. Order Custom Profile Fields 1.1.1
But AFAIR I tried this with "Order Custom Profile Fields" as the only mod and it did not work as well.
Hmmm, I didn't get a notification for your post either.
So we are both running SMF 2.0.4, but we aren't running any of the same mods except for 'Order Custom Profile Fields'. It never worked for you. For me it worked at first but does not work now.
Steiger, would you mind sharing the SQL you used to manually change the position values?
Does anyone have any suggestions for debugging or troubleshooting?
Good mod. should be in SMF by default.
I can't see SMF adding 30KB+ of code for a single page.
Just to update everyone on my investigations:
- 'SELECT position, id_field, field_name FROM smf_custom_fields ORDER BY position;' will show the names of the custom profile fields and the current order in which they will appear on the registration page.
- When I did this, I found three fields with Position =16; that seems wrong. Should Position have a 'Unique' attribute? If so, this would be a change in SMF itself.
- 'update smf_custom_fields set position =17 where id_field = 31;' will move the field with ID=31 to Position 17. Change the Position of the fields to fit your needs.
However, after eliminating the duplicates, 'Order Custom Profile Fields' still does not work. I can drag and drop fields, but as soon as I refresh the page they are back to their original positions.
@Jessica., how many custom fields do you have? It seems silly to think that something might have a limit of 16 custom fields, but 16 _is_ a magic number, and that is where my duplicates were.
QuoteShould Position have a 'Unique' attribute? If so, this would be a change in SMF itself.
That would be a change to this mod, because SMF doesn't have the position column itself.
Good to know Arantor; thank you.
I think I can confidently say now that the cause of the problem is that the mod is generating duplicate position numbers. I had 23 custom profile fields (zero through 22) and added one; here is what smf_custom_fields looks like afterward:
mysql> SELECT position, id_field, field_name FROM smf_custom_fields ORDER BY position;
+----------+----------+------------------------------------------+
| position | id_field | field_name |
+----------+----------+------------------------------------------+
| 0 | 1 | First Name |
.
.
.
| 20 | 36 | Work Phone Number |
| 21 | 34 | Cell Phone Number |
| 21 | 37 | Emergency Contact |
| 22 | 35 | Home Phone Number |
+----------+----------+------------------------------------------+
24 rows in set (0.00 sec)
In SMF, the new field (Emergency Contact) shows up before or after the Cell Phone Number. That is, on some screens it appears before, and on other screens it appears after, depending on the order in which the query decides to return them.
At the moment I don't have time to dig into the source code of the Mod to find the bug and fix it, but if anyone else has the time and the inclination, I think you now know exactly what to look for.
Quote from: HappyBits on March 11, 2013, 02:14:10 PM
Hmmm, I didn't get a notification for your post either.
So we are both running SMF 2.0.4, but we aren't running any of the same mods except for 'Order Custom Profile Fields'. It never worked for you. For me it worked at first but does not work now.
Steiger, would you mind sharing the SQL you used to manually change the position values?
Sorry for responding so late but I still do not receive any notifications for any threads from this forum. And currently I have no time to look proactively for any replies.
I think you have already found some SQL code to change the order of profile fields.
I just changed the position field of each profile field manually.
As the set of fields is rather static in my installation I do not need to do this very often.
Hi everyone;
I tried to install this mod for SMF 2.0.7, and followed all the steps mention here:
http://custom.simplemachines.org/mods/index.php?action=parse
then when i went to "Profile Fields" section of my forum, i received the following error:
Unknown column 'position' in 'field list'
File: C:\xampp\htdocs\smf_2-0-7_install\Sources\ManageSettings.php
Line: 1528
attached is my ManageSettings.php file.
Cheers
Quote from: amir.decom on April 09, 2014, 03:14:12 AM
then when i went to "Profile Fields" section of my forum, i received the following error:
Unknown column 'position' in 'field list'
File: C:\xampp\htdocs\smf_2-0-7_install\Sources\ManageSettings.php
Line: 1528
I just solved it by using the install package and quit manual installing.
This works fine for me in 2.0.9 using the install manager.
Quote from: Alanar on February 20, 2015, 08:14:31 PM
This works fine for me in 2.0.9 using the install manager.
Its always best to use the package manager over manual edits unless you have no choice because of other code edits. ;)
Nathaniel hasn't been active in nearly 2 years, but I'm hoping he lurks these pages.... what's the chance of getting this mod to display in 2 columns instead of 1? Does anyone else know if it is easily accomplished? thx
Quote from: Gantry on December 06, 2015, 12:48:55 PM
Nathaniel hasn't been active in nearly 2 years, but I'm hoping he lurks these pages.... what's the chance of getting this mod to display in 2 columns instead of 1? Does anyone else know if it is easily accomplished? thx
oops, just realized I posted in the wrong mod thread, plz ignore the above
Quote from: steiger on January 11, 2013, 06:01:44 AM
Just installed this mod and it would be really great except that it does not save the position.
Drag and Drop works but there is no change to the position column in the smf_custom_fields table.
Any hints how I can debug this problem?
Finally had a go at fixing this issue and had a win!
In ./Sources/ManageSettings.phpFind:
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.js?1.4.2"></script>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.tablednd.js?0.5"></script>';
Replace with:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.js"></script>
<script src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.tablednd.js"></script>';
Quote from: GL700Wing on October 18, 2018, 08:01:23 PM
Finally had a go at fixing this issue and had a win!
Just discovered the fix above could be made simpler ...
In ./Sources/ManageSettings.phpFind:
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.js?1.4.2"></script>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.tablednd.js?0.5"></script>';
Replace with:
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.js"></script>
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/ordercustomprofilefields/jquery.tablednd.js"></script>';
any way to make this work on 2.0.18?
Looks like the only "failure" of the mod install is in ManageSettings.php -- but I notice significant differences which I believe are security and/or php 7.x updates. So, it would seem that the mod needs a review by a coder to confirm the 2.0.18 source versus the mod update AND the mod new source throughout.
the biggest thing to note (other than the escaped single quotes -- ' versus /') is that the use of "create_function" was replaced.
for example:
'data' => array(
'function' => function($rowData) use ($txt)
{
$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
},
'style' => 'width: 15%;',
),
'data' => array(
'function' => create_function('$rowData', '
global $scripturl;
return sprintf(\'<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>\', $scripturl, $rowData[\'id_field\'], $rowData[\'field_name\'], $rowData[\'field_desc\']);
'),
'style' => 'width: 62%;',
),
'data' => array(
'function' => create_function('$rowData', '
global $txt;
$textKey = sprintf(\'custom_profile_type_%1$s\', $rowData[\'field_type\']);
return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
'),
'style' => 'width: 15%;',
),
there are other differences, but these (several) references to the deprecated create_function appear to be the biggest
Quote from: Kindred on December 20, 2021, 08:48:03 AMLooks like the only "failure" of the mod install is in ManageSettings.php -- but I notice significant differences which I believe are security and/or php 7.x updates. So, it would seem that the mod needs a review by a coder to confirm the 2.0.18 source versus the mod update AND the mod new source throughout.
the biggest thing to note (other than the escaped single quotes -- ' versus /') is that the use of "create_function" was replaced.
for example:
'data' => array(
'function' => function($rowData) use ($txt)
{
$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
},
'style' => 'width: 15%;',
),
'data' => array(
'function' => create_function('$rowData', '
global $scripturl;
return sprintf(\'<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>\', $scripturl, $rowData[\'id_field\'], $rowData[\'field_name\'], $rowData[\'field_desc\']);
'),
'style' => 'width: 62%;',
),
'data' => array(
'function' => create_function('$rowData', '
global $txt;
$textKey = sprintf(\'custom_profile_type_%1$s\', $rowData[\'field_type\']);
return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
'),
'style' => 'width: 15%;',
),
there are other differences, but these (several) references to the deprecated create_function appear to be the biggest
Well, I suppose I could chop away at it and always uninstall ......... thanks.
I sure wish the features this mod offers was part of SMF itself. I need to reorder my profile fields when I add new ones without deleting them all and starting over to do it. sadly I know nothing about coding and have no time to learn it, but I would gladly pay a reasonable price for a coder to fix this mod for everyone. If anyone is interested, please PM me.
The functionality is in the upcoming 2.1 release.
Quote from: Arantor on January 08, 2022, 07:29:54 PMThe functionality is in the upcoming 2.1 release.
Thank you my friend. I suspected that might be the case so I literally just installed a 2.1 test forum and BOOM! there it is. Great News! I'm very excited for 2.1's release. I absolutely love my SMF forum and look forward to seeing the next version.
Happy New Year!