Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Question on Status field

Quote Reply
Question on Status field
Dear all,

I tired to add one more selection under the Status field (Registered User). After that, I tired to add one a register user, but it didn't how the new selection filed that I added.

The original selection field is:
Not Validated|Registered|Editor|Administrator

I changed it to:
Not Validated|Registered|Editor|Administrator|Manager

When I add a new register user, the Status selection just didn't show the "Manager" field.

Any idea?

------------------
Bear EveryWhere
Quote Reply
Re: Question on Status field In reply to
Did you go to the section AFTER the field definitions, (in the .def file) and add the new choice to the selection list?


------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/









[This message has been edited by pugdog (edited December 22, 1999).]
Quote Reply
Re: Question on Status field In reply to
Dear pugdog,

What you mean? Should I edit the .def file to make it effective?



------------------
Bear EveryWhere
Quote Reply
Re: Question on Status field In reply to
In the def files...

Code:
%db_def = (
Username => ['1', 'CHAR', '25', '25', '1', '', ''],
Password => ['2', 'CHAR', '25', '25', '1', '', ''],
Email => ['3', 'CHAR', '40', '50', '0', '', ''],
Validation => ['4', 'CHAR', '20', '20', '0', '', ''],
Status => ['5', 'CHAR', '0', '13', '1', 'Not Validated', 'Not Validated|Registered|Editor|Administrator']
);

%db_select_fields = (
Status => 'Not Validated,Registered,Editor,Administrator,Manager'
);
%db_checkbox_fields = (

);
%db_radio_fields = (

);

You can put the fields in the various areas to have the program generate the appropriate features.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: Question on Status field In reply to
The Status field (and any select list) is defined using an ENUM type in Mysql. To add a new option, you need to alter the table. You should type into the SQL Monitor.

ALTER TABLE Users
CHANGE Status Status ENUM("Not Validated","Registered","Editor","Administrator","Manager") NOT NULL DEFAULT "Not Validated"

Then if you click resync it will regenerate the .def files with the proper values for the select field.

Cheers,

Alex
Quote Reply
Re: Question on Status field In reply to
Ah... that makes a world of sense..

But, as pointed out in the previous thread, if you do resync -- You will lose index weights, custom validations, etc. You will also lose any selection/checkbox values that aren't defined as ENUM types in Mysql as described above.

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: Question on Status field In reply to
So which way I should do? Edit the .def file or just type what Alex said in SQL minitor?

Merry Christmas everyone!

Cheers


------------------
Bear EveryWhere
Quote Reply
Re: Question on Status field In reply to
Ok....

In your case, since you have edited your DEF files already (if you haven't, make the changes as I showed). Then copy your DEF files to a subdirectory on your server, or to your local harddrive.

Go into the SQL monitor, and do what Alex said. This will permanently fix your database.

Then, copy your saved DEF files back into the defs directory (they should not have been changed, but just in case they were...)

This will have:

1) Changed the fields inside MySQL so that if you hit resync you will get the updates, but you lose your custom changes (such as weights)

2) It will have changed the def files to make them work the way you want (you edited them by hand, and copied them back for safety)

3) It will have preserved the def files so you don't have add back your other changes such as Weight and Validation (see #2)

4) It WILL NOTT have changed the SQL.mysql file, so if you try to re-install links you'll have to do this all again. (from setup.cgi -- to make the changes "system wide" you should edit the SQL.mysql file as well, and change the parameters to the Users table as well).

5) You should KEEP NOTES on any changes you make to setup and configuration files because %$*(@) happens!!!!



Is this clear as mud??

Smile

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/