Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Create an user signup date?

Quote Reply
Create an user signup date?
Hello, I would like to create an extra field called sign up date which will help me remove any users that are old and haven't validate their account. I would like links sql to add the date automatically when the account is created. I am a newbie can someone walk me through this? Tongue
Quote Reply
Re: [flybuzz] Create an user signup date? In reply to
Create the new column in the table editor.

Database > Users/Properties > Add Column

Then in include_form.html add:

<input type="hidden" name="new_column_name" value="<%timestamp%>">

Then create the timestamp global:

sub { return time; }
Quote Reply
Re: [Paul] Create an user signup date? In reply to
I don't think it worked... I know when a user adds a link, LSQL adds a date for that. Can't I just use the same way for when a new user register for his account...?
Quote Reply
Re: [flybuzz] Create an user signup date? In reply to
It is default in Community in case you are interested...

Klaus

http://www.ameinfo.com
Quote Reply
Re: [flybuzz] Create an user signup date? In reply to
I can't see why Paul's solution wouldn't work - but just as an alternative, I use

<input type="hidden" name="UserAdded" value="<%GT::Date::date_get()%>">

and my UserAdded field is a date field.
Quote Reply
Re: [afinlr] Create an user signup date? In reply to
Hi,

a timestamp changes every time the record is altered. (The first timestamp changes, at least)

A few months ago, a thread was done with a variety of solutions, including the one I've been using for over 2 years, since Links 1.x days.

Basically, you set a field in the Links table to default value NOW(), and when the link is created the first time, it's set, then ignored in all future updates.

Timestamps can't be used, but you can use a DATEETIME field.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Create an user signup date? In reply to
Hi

I was just looking at my list of users and noticed that there is a field in the User table for:

Signup_date

This is blanks for all users, how can this be configured to record the 'user signup date'?

Thanks
Colin Thompson
Quote Reply
Re: [colintho] Create an user signup date? In reply to
Hi,

The easiest way, is to add this in signup_form.html:

Code:
<input type="hidden" value="<%GT::Date::date_get()%>" name="Signup_Date" />

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!
Quote Reply
Re: [Andy] Create an user signup date? In reply to
Andy

thanks, thats great.

When I use the "User: Search form" in the database, the options for searching users by 'signup date' only allows these:

Like
Exact Match
Not equal

Is it possible to configure this to be:

Exact Match
Greater Than
Less Than
Not Equal

Is this something to do with the 'fiedl type'?

Thanks
Colin Thompson
Quote Reply
Re: [colintho] Create an user signup date? In reply to
Hi,

No problem.

Regarding:

Quote:
Is it possible to configure this to be:

Exact Match
Greater Than
Less Than
Not Equal

Is this something to do with the 'fiedl type'?

I don't think that'll be possible. Greater than, less than etc is only available with INT (number) type fields, not dates.

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!
Quote Reply
Re: [Andy] Create an user signup date? In reply to
Andy

this is used in the Links table for 'add date' & 'mod date'

can it be used for signup_date?
Colin Thompson
Quote Reply
Re: [colintho] Create an user signup date? In reply to
Maybe - you could try changing the field to a DATE field, instead of CHAR/TEXT

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!
Quote Reply
Re: [Andy] Create an user signup date? In reply to
Andy

appears to work although I noticed that all users without a signup_date were set to:

Signup Date0000-00-00

So when searching 'Less Than' or 'Greater Than' they will not be included with accuracy (depending on which search is done)


Thanks
Colin Thompson
Quote Reply
Re: [colintho] Create an user signup date? In reply to
Hi,

Yeah, basically.

You could do it manually in SQL Monitor - something like:

Code:
SELECT COUNT(*) FROM glinks_Users WHERE Signup_Date >= '2008-04-01' AND Signup_Date != '0000-00-00'

(totally untested, but something like that should work)

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!