Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

How to do this?

Quote Reply
How to do this?
Hi,

I am trying to pass the dates (YYY-MM-DD format) thru the Signup Form as hidden fields:

(1) Submission Date:

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

The View Source shows OK Value. ... 2003-03-05

(2)Renewal Date: Now how do i add 365 days to the above and pass it as a hidden field "dgraph_rdate"

I tried my best with <%set ....> but always get 1971-01-01

Thnx

Anup
Quote Reply
Re: [anup123] How to do this? In reply to
Hi Anup,

Try something like:

Code:
value="<%GT::Date::date_add(GT::Date::date_get(), 365)%>"

I dont' have time to test it here at work but it's worth a try.

~Charlie

Last edited by:

Chaz: Mar 4, 2003, 3:26 PM
Quote Reply
Re: [Chaz] How to do this? In reply to
Hi Charlie,

I had tried this before trying <%set ...%> but the result is same:

1971-01-01

So just 365 days (or whatever value we substitute there) gets added to 1970-01-01

Its almost the same which has carried on from the following thread which never reached conclusion:

http://www.gossamer-threads.com/...ate%20add%22;#204374

Thnx

Anup

Last edited by:

anup123: Mar 4, 2003, 4:16 PM
Quote Reply
Re: [anup123] How to do this? In reply to
Try this code as a global:

Code:
sub {
require GT::Date;

my $date = GT::Date::date_get();

return GT::Date::date_add($date, 365);
}

and putting a template var in for that global in the template. It works on my install.

~Charlie
Quote Reply
Re: [Chaz] How to do this? In reply to
Hi Charlie

Yes it worked. That was great. Thanx a lot. As an extension of this i would just want on your opinion on following:

(1). Can there be a global for allocating different <%users_space_allowed%> for different domains instead of same for all domains?

(2). Can there be a global for Validating Accounts depending upon domain --Validated for Few and Validated by Admin for others. Say for two domains the accounts are "Validated" and for the balance three the admin has to validate the accounts.

As on the drop down menu issue i think it is much of a task to implement that as it would need manual modifications of templates every time a new category is added.

Thnx once again..

Anup
Quote Reply
Re: [anup123] How to do this? In reply to
I'm glad that date global worked for you.

As for the two items you need help with: You would need a plugin to do what you want on both items. And you would have to make sure the subs that you would need to plug are actually pluggable on top of that. i don't remember which methods are pluggable in the member create process off the top of my head.

Regards,
Charlie
Quote Reply
Re: [Chaz] How to do this? In reply to
Hi Charlie,

Thnx for all the help. The other date manipulations work well within the template with <%set .....=......%> except for the date_add which always takes the 1970 as the base. I have tried with date_diff, date_is_greater, date_is_smaller all works with the <%set .....=....%> but not date_add. This is confusing for a Novice Like Me....

Probably GT staff would be able to throw more light on this as to why date_add does not work without having a global and just by using <%set ....=...%>.

Probably for all the "Expired Accounts" i would just eliminate the messages list include etc and all other utility fuctions of the account so that the user can login but not do anything (except for a user who has carefully noted down all the url's and page addresses etc)

Thnx

Anup


=_= =_= =_= =_= =_= =_=


You can chain me, you can torture me, you can even destroy this body, but you will never imprison my mind.
-Mahatma Gandhi
Quote Reply
Re: [Chaz] How to do this? In reply to
Hi Charlie,

Yes i could do the following wrt expired accounts (at template level though --- which may not be completely foolproof):
  • The user with expired account cannot read any incoming mail.
  • The user cannot use the compose any message.
  • And The Folder Level navigation is disabled.
  • In fact any of the menu items can be made non functional and navigation would lead to expired message page.


I know that this is not foolproof for a user who can track all the page addresses (against which i am opening page without the explorer menu). The best would be infact that the user is logged out in case of expired account and taken to a custom page which displays the necessary message but as you had indicated this may not be possible at template level.

I am sure you would definitely work out the details for logging out a user with an expired account. Hows your plan with Address Book enhancement going?

Thnx a lot for all the help....

Anup
Quote Reply
Re: [anup123] How to do this? In reply to
I'm still working on that project that I should have finished last weekend :/ I hope to have that done early this weekend. After that, I have a couple of days between projects to take a look at the Address Book import plugin.

~Charlie