Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Nathaniel on August 14, 2008, 03:56:15 AM

Title: Order Custom Profile Fields
Post by: Nathaniel on August 14, 2008, 03:56:15 AM
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 Support
This 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.

Donate
If 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&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted). Any amount of money is welcome.

Browser Support
This 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
Title: Re: Order Custom Profile Fields
Post by: ninedoors on August 15, 2008, 08:57:12 AM
Can this mod be used for 1.1.5?
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on August 15, 2008, 09:01:40 AM
@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).
Title: Re: Order Custom Profile Fields
Post by: ninedoors on August 15, 2008, 09:03:17 AM
Thanks for the quick reply.

Nick
Title: Re: Order Custom Profile Fields
Post by: ccbtimewiz on August 18, 2008, 12:23:32 PM
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
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on August 18, 2008, 05:30:07 PM
@ccbtimewiz,
I am glad you like it, especially seeing as you requested it. :P
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on September 10, 2008, 02:00:46 AM
v1.01
Updated for SMF 2 Beta 4.0.
Title: Re: Order Custom Profile Fields
Post by: wakewatcher on December 05, 2008, 02:07:53 AM
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.
Title: Re: Order Custom Profile Fields
Post by: fyndler on December 16, 2008, 05:17:01 AM
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
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on December 21, 2008, 03:16:12 AM
@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?
Title: Re: Order Custom Profile Fields
Post by: wakewatcher on December 21, 2008, 03:41:17 AM
2b4
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on December 21, 2008, 05:57:11 AM
@wakewatcher,
Try installing this mod and then the "Custom Fields On Memberlist" mod. I have tested that and it works fine for me.
Title: Re: Order Custom Profile Fields
Post by: chinclub on January 13, 2009, 08:21:41 PM
Is custom profiles avalible for version Custom Fields 1.1.7?
Title: Re: Order Custom Profile Fields
Post by: willerby on January 19, 2009, 06:56:00 PM
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
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on January 24, 2009, 04:41:21 AM
@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.
Title: Re: Order Custom Profile Fields
Post by: 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 :)
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on February 06, 2009, 12:43:03 AM
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. ;)
Title: Re: Order Custom Profile Fields
Post by: 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
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on February 06, 2009, 01:54:03 AM
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
Title: Re: Order Custom Profile Fields
Post by: wakewatcher on February 06, 2009, 02:09:57 AM
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)
Title: Re: Order Custom Profile Fields
Post by: fyndler on February 09, 2009, 03:41:37 PM
Possible to make so only admins can see the fileds we make ?
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on February 09, 2009, 11:47:10 PM
@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.
Title: Re: Order Custom Profile Fields
Post by: Geko on April 10, 2009, 02:20:41 AM
Please, make this available for RC1 It is very much needed :(
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on April 11, 2009, 02:32:53 AM
Geko,
Updating this mod is somewhere on my long to-do list, I will do it when I can. ;)
Title: Re: Order Custom Profile Fields
Post by: Geko on April 27, 2009, 04:05:08 AM
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....... :(
Title: Re: Order Custom Profile Fields
Post by: Hoodie on August 09, 2009, 11:17:19 PM
Any chance this is being worked on yet?  It's a great mod..
Title: Re: Order Custom Profile Fields
Post by: illusioner on December 10, 2009, 03:13:34 PM
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.
Title: Re: Order Custom Profile Fields
Post by: Atheos23 on December 18, 2009, 06:02:10 PM
Hello. Is there currently any way to make this compatible with RC2? thank you.
Title: Has anyone installed Custom Profile Field Mod on SMF 1.1.11?
Post by: WNCCmod on December 18, 2009, 09:11:26 PM
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
Title: Re: Order Custom Profile Fields
Post by: kizer on March 25, 2010, 06:48:00 PM
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.
Title: Re: Order Custom Profile Fields
Post by: kaamaru on May 14, 2010, 05:43:20 AM
Yeah, can you please update for SMF 2.0 RC3. Thanks!
Title: Re: Order Custom Profile Fields
Post by: Eclipse16V on May 23, 2010, 04:17:00 AM
Yes, please update for RC3.

Thanks
Title: Re: Order Custom Profile Fields
Post by: 4b11l on June 03, 2010, 06:31:38 PM
bump, RC3 please.
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on June 12, 2010, 12:38:26 AM
v1.1 - 12 June 2010
Updated for SMF 2 RC3.
Added AJAX/javascript reordering.
Title: Re: Order Custom Profile Fields
Post by: 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.
Title: Re: Order Custom Profile Fields
Post by: 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."
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on June 14, 2010, 09:51:54 PM
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.
Title: Re: Order Custom Profile Fields
Post by: Eclipse16V on June 15, 2010, 01:54:04 AM
Thanks for the update
Works fine
Title: Re: Order Custom Profile Fields
Post by: Aiko on June 15, 2010, 02:02:21 PM
Thank you very much for this mod and the upgrade. It works nicely :)
Title: Re: Order Custom Profile Fields
Post by: kaamaru on June 16, 2010, 05:42:19 AM
Thanks, it's an awesome mod.
Title: Re: Order Custom Profile Fields
Post by: Mihkel on August 03, 2010, 04:27:24 PM
To which table the mod saves input string ?
Title: Re: Order Custom Profile Fields
Post by: NHWD on April 17, 2011, 10:43:01 PM
I'm guessing this won't wokr on RC5
Title: Re: Order Custom Profile Fields
Post by: poetra on April 18, 2011, 04:58:35 AM
Have some one try to use it on RC5 ver??
Title: Re: Order Custom Profile Fields
Post by: Nathaniel on June 21, 2011, 07:31:46 AM
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.
Title: Re: Order Custom Profile Fields
Post by: fals on July 11, 2011, 08:27:19 AM
Perfect - this MOD was just what i needed
Title: Re: Order Custom Profile Fields
Post by: T3CHN0 on September 22, 2011, 11:44:53 AM
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
Title: Re: Order Custom Profile Fields
Post by: King Death II on March 15, 2012, 12:33:31 PM
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?
Title: Re: Order Custom Profile Fields
Post by: Eclipse16V on March 16, 2012, 04:57:35 AM
Work on 2.0.2
Title: Re: Order Custom Profile Fields
Post by: 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.

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?
Title: Re: Order Custom Profile Fields
Post by: HappyBits on February 13, 2013, 02:17:00 PM
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?
Title: Re: Order Custom Profile Fields
Post by: steiger on March 08, 2013, 04:11:03 AM
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.
Title: Re: Order Custom Profile Fields
Post by: 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?

Does anyone have any suggestions for debugging or troubleshooting?
Title: Re: Order Custom Profile Fields
Post by: Jessica. on March 12, 2013, 04:19:01 PM
Good mod. should be in SMF by default.
Title: Re: Order Custom Profile Fields
Post by: Arantor on March 12, 2013, 04:24:29 PM
I can't see SMF adding 30KB+ of code for a single page.
Title: Re: Order Custom Profile Fields
Post by: HappyBits on March 15, 2013, 11:14:04 AM
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.
Title: Re: Order Custom Profile Fields
Post by: Arantor on March 15, 2013, 11:24:00 AM
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.
Title: Re: Order Custom Profile Fields
Post by: HappyBits on March 22, 2013, 01:51:04 PM
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.
Title: Re: Order Custom Profile Fields
Post by: steiger on March 25, 2013, 03:29:28 PM
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.
Title: Re: Order Custom Profile Fields
Post by: amir.decom on April 09, 2014, 03:14:12 AM
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
Title: Re: Order Custom Profile Fields
Post by: amir.decom on April 09, 2014, 04:30:43 AM
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.
Title: Re: Order Custom Profile Fields
Post by: Alanar on February 20, 2015, 08:14:31 PM
This works fine for me in 2.0.9 using the install manager.
Title: Re: Order Custom Profile Fields
Post by: Night09 on February 20, 2015, 08:37:36 PM
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. ;)
Title: Re: Order Custom Profile Fields
Post by: 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
Title: Re: Order Custom Profile Fields
Post by: Gantry on December 06, 2015, 03:05:32 PM
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
Title: Re: Order Custom Profile Fields
Post by: GL700Wing on October 18, 2018, 08:01:23 PM
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.php

Find:
<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>';

Title: Re: Order Custom Profile Fields
Post by: GL700Wing on October 19, 2018, 07:04:40 PM
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.php

Find:
<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>';
Title: Re: Order Custom Profile Fields
Post by: rcane on December 20, 2021, 01:30:16 AM
any way to make this work on 2.0.18?
Title: Re: Order Custom Profile Fields
Post by: Kindred on December 20, 2021, 08:48:03 AM
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:

Code (actual 2.0.18 code) Select
'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%;',
),

Code ("mod searching for") Select
                '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%;',
                ),

Code ("mod replace with (NEEDS FIXING!)") Select
                '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
Title: Re: Order Custom Profile Fields
Post by: rcane on December 20, 2021, 12:54:08 PM
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:

Code (actual 2.0.18 code) Select
'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%;',
),

Code ("mod searching for") Select
                '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%;',
                ),

Code ("mod replace with (NEEDS FIXING!)") Select
                '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.

Title: Re: Order Custom Profile Fields
Post by: Michael Vail on January 08, 2022, 07:28:33 PM
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.
Title: Re: Order Custom Profile Fields
Post by: Arantor on January 08, 2022, 07:29:54 PM
The functionality is in the upcoming 2.1 release.
Title: Re: Order Custom Profile Fields
Post by: Michael Vail on January 08, 2022, 08:40:04 PM
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!