How do you change the sort order that the Links display in modify_select.html? It seems sort of random now, would like to make it alphabetical. Is this possible? How?
Mar 17, 2003, 6:41 PM
Enthusiast (520 posts)
Mar 17, 2003, 6:41 PM
Post #2 of 11
Views: 5968
Howdie,
Mel gave me this answer:
include this in the next version to sort by alphabetical order, so if I
change your code, it will not affect upgrading in the future, just the
current versions. This is what you need to do:
in the file Modify.pm found in admin/Links/User
find the line that starts the subroutine (around line 400):
sub _list_owned_links {
Then inside here, there will be a line:
$link_db->select_options ("LIMIT " . (($nh-1)*$mh) . ",$mh");
(It's about 6 lines down)
replace this with the line:
$link_db->select_options ("ORDER BY Title ASC", "LIMIT " . (($nh-1)*$mh) .
",$mh");
Mel gave me this answer:
Quote:
They only way to do this is to actually modify the code, but Alex will include this in the next version to sort by alphabetical order, so if I
change your code, it will not affect upgrading in the future, just the
current versions. This is what you need to do:
in the file Modify.pm found in admin/Links/User
find the line that starts the subroutine (around line 400):
sub _list_owned_links {
Then inside here, there will be a line:
$link_db->select_options ("LIMIT " . (($nh-1)*$mh) . ",$mh");
(It's about 6 lines down)
replace this with the line:
$link_db->select_options ("ORDER BY Title ASC", "LIMIT " . (($nh-1)*$mh) .
",$mh");
Oct 5, 2011, 1:02 AM
Veteran / Moderator (18436 posts)
Oct 5, 2011, 1:02 AM
Post #4 of 11
Views: 5726
Hi,
It looks like Alex released and update to the code, so that it sorted by Title now, but there still seems to be no option to change a setting, or pass in so=xxx and sb=xxx. You still need to edit the code in /Links/User/Modify.pm to do what you want:
..change that to:
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
It looks like Alex released and update to the code, so that it sorted by Title now, but there still seems to be no option to change a setting, or pass in so=xxx and sb=xxx. You still need to edit the code in /Links/User/Modify.pm to do what you want:
Code:
$link_db->select_options("ORDER BY Title ASC", "LIMIT $limit OFFSET $offset");..change that to:
Code:
$link_db->select_options("ORDER BY Your_Field ASC", "LIMIT $limit OFFSET $offset");Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Oct 11, 2011, 11:37 PM
Veteran / Moderator (18436 posts)
Oct 11, 2011, 11:37 PM
Post #6 of 11
Views: 5686
Hi,
It looks like $offset etc are created from: (in /Links/User/Modify.pm _list_owned_links() )
..so you could try adding this before that line:
...or whatever number you want.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
It looks like $offset etc are created from: (in /Links/User/Modify.pm _list_owned_links() )
Code:
my ($limit, $offset, $nh) = Links::limit_offset();..so you could try adding this before that line:
Code:
$IN->param( 'mh' => 50 );...or whatever number you want.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Hi Andy,
It is perfect!
I have an additional question.
I would like to move a column of my Links table.
I would like to use in SQL Monitor:
ALTER TABLE MY_TABLE MODIFY COLUMN MY_COLUMN TYPE_OF_MY_COLUMN FIRSTDo You think that it is possible?
Thanks for your feedback!
Mick
It is perfect!
I have an additional question.
I would like to move a column of my Links table.
I would like to use in SQL Monitor:
Code:
ALTER TABLE MY_TABLE MODIFY COLUMN MY_COLUMN TYPE_OF_MY_COLUMN AFTER OTHER_COLONNE ALTER TABLE MY_TABLE MODIFY COLUMN MY_COLUMN TYPE_OF_MY_COLUMN FIRST
Thanks for your feedback!
Mick
Oct 17, 2011, 4:14 AM
Veteran / Moderator (18436 posts)
Oct 17, 2011, 4:14 AM
Post #8 of 11
Views: 5662
Hi,
The easiest way to do that, would be using this free plugin :
http://www.gossamer-threads.com/...0v3%20plugin#p308647
I use that quite a bit to change the sort order for fields.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
The easiest way to do that, would be using this free plugin :
http://www.gossamer-threads.com/...0v3%20plugin#p308647
I use that quite a bit to change the sort order for fields.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Oct 17, 2011, 7:49 AM
Veteran / Moderator (18436 posts)
Oct 17, 2011, 7:49 AM
Post #11 of 11
Views: 5629
Mmm can't say I've ever noticed. Alternativly, you can edit the field order in phpMyAdmin, and then do a "Re-Sync" of the table, and that *should* re-order them properly for you (be sure to make a backup of your .def file first though!)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!