Gossamer Forum
Home : Products : Gossamer Links : Discussions :

ORDER OF THE FIELDS IN THE ADMIN FORM

Quote Reply
ORDER OF THE FIELDS IN THE ADMIN FORM
WinkHi, can we change, the order of the fields in the admin links form

Actually we have


1: Title
2: URL
3: LinkOwner
4: Add Date
5 : Mod Date

and so on...

But How to to if for example I want this :

1: URL
2: Add Date
3 : Mod Date
4 : URL
5 : LinkOwner


Thanks for the help



FMPWink
Quote Reply
Re: [fmp] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
You can sort the fields in your lsql_Links.def file, the 'pos' => ' ', is the order you want to change to reflect it! Just try to be carefully when change the position!
Quote Reply
Re: [xpert] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
txs...Wink
Quote Reply
Re: [xpert] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
I did that myself but each I synchronize the database, the column order goes back to how it was before. Quite confusing Crazy
Quote Reply
Re: [nt6] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
I think the columns are ordered by the order they are in the database. I've not checked but I'm guessing Links SQL uses a DESCRIBE command when re-syncing which will return all columns in the order then exist in the table.

Hence, re-syncing will just restructure the defs again and so I'd have to say you can't really custom sort the field display without some hardcore hacking.

Last edited by:

Paul: Aug 24, 2002, 8:34 AM
Quote Reply
Re: [nt6] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
How about tap into the SQL.pm and change it under the

# --------- Links Table ----------------

Quote Reply
Re: [xpert] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
Change what, could you be more clear ?
Quote Reply
Re: [nt6] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
# --------- Links Table ----------------

$output .= Links::language('dialog_create', 'Links');

$c = $DB->creator('Links');

$c->clear_schema() if ($action eq 'force');

$c->cols (

ID => { pos => 1, type => 'INT', not_null => 1, unsigned => 1, regex => '^\d+$', form_display => Links::language('prompt_ID') },

Title => { pos => 2, type => 'CHAR', size => 100, not_null => 1, weight => 3, form_display => Links::language('prompt_Title') },

URL => { pos => 3, type => 'CHAR', size => 255, not_null => 1, weight => 1, default => 'http://', regex => '^\w+:', form_display => Links::language('prompt_URL') },

LinkOwner => { pos => 4, type => 'CHAR', size => 50, not_null => 1, default => 'admin', form_display => Links::language('prompt_LinkOwner') },

Add_Date => { pos => 5, type => 'DATE', not_null => 1, form_display => Links::language('prompt_Add_Date') },

Mod_Date => { pos => 6, type => 'DATE', not_null => 1, form_display => Links::language('prompt_Mod_Date') },

Description => { pos => 7, type => 'TEXT', weight => 1, form_display => Links::language('prompt_Description') },

Contact_Name => { pos => 8, type => 'CHAR', size => 255, form_display => Links::language('prompt_Contact_Name') },

Contact_Email => { pos => 9, type => 'CHAR', size => 255, form_display => Links::language('prompt_Contact_Email') },

Hits => { pos => 10, type => 'INT', not_null => 1, default => 0, regex => '^\d+$', form_display => Links::language('prompt_Hits') },

isNew => { pos => 11, type => 'ENUM', values => ['No', 'Yes'], not_null => 1, default => 'No', form_display => Links::language('prompt_isNew') },

isChanged => { pos => 12, type => 'ENUM', values => ['No', 'Yes'], not_null => 1, default => 'No', form_display => Links::language('prompt_isChanged') },

isPopular => { pos => 13, type => 'ENUM', values => ['No', 'Yes'], not_null => 1, default => 'No', form_display => Links::language('prompt_isPopular') },

isValidated => { pos => 14, type => 'ENUM', values => ['No', 'Yes'], not_null => 1, default => 'Yes', form_display => Links::language('prompt_isValidated') },

Rating => { pos => 15, type => 'FLOAT', display => 12, decimal => 2, not_null => 1, default => 0, regex => '^\d+\.?\d*$', form_display => Links::language('prompt_Rating') },

Votes => { pos => 16, type => 'SMALLINT', unsigned => 1, not_null => 1, default => 0, regex => '^\d+$', form_display => Links::language('prompt_Votes') },

Status => { pos => 17, type => 'SMALLINT', not_null => 1, default => 0, regex => '^\-?\d+$', form_display => Links::language('prompt_Status') },

Date_Checked => { pos => 18, type => 'DATETIME', default => '', form_display => Links::language('prompt_Date_Checked') },

Timestmp => { pos => 19, type => 'TIMESTAMP', time_check => 1, form_display => Links::language('prompt_Timestmp') }

);

Change the position of course!!

Quote Reply
Re: [fmp] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
I had asked Mel about this, too. And the reply I got was something like this: You have to export your database and resort the order of the colums. Then re-upload it. I think you have to resync you DB then. I chose NOT to do it, as I didn't want to mess with it.

Just thought I'd share. I give no guarantees to the accuracy of my instructions. Crazy
Quote Reply
Re: [xpert] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
Yeah, that's what I did. It was lovely until I resynched. The it was ugly again. Frown
Quote Reply
Re: [Evoir] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
>>
You have to export your database and resort the order of the colums.
<<

Thats kind of along the lines of what I was saying above :)
Quote Reply
Re: [Evoir] ORDER OF THE FIELDS IN THE ADMIN FORM In reply to
It is actually quite a complicated process. The order of the columns in the .def files rely on the columns in the actual table. This affects when we use stuff like fetchrow_array. If you'd like, take a look at this URL for more info on how to do it another way.

http://www.mysql.com/...ge_column_order.html

My recommendation is not to do it. But if you still want to, do what this document says, and then when you're done, resync the database. It will require some experience with mysql and creating sql queries.

If what you're hoping to do is to have a custom column appear near the top of the list, you can do so... but it will require some work.

First, go to mysqlman, then look at the properties of the Links Table. Then click on Add Fields and chose where you want this new column to go by selecting the new position. Add the new column, and then resync your database. It will now show up in another position rather than the end of the table.

If you already have a column, you can still copy all the information using an update query. UPDATE Links set NewColumn = OldColumn.

There are certain Links SQL specific fields that you can change the order of in this way, but (once again) it should only be done by someone experienced in SQL and Links SQL

Hope this helps Smile