We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Module, EE2 Limited Time

Development and Programming

Nate Snitzer's avatar
Nate Snitzer
6 posts
15 years ago
Nate Snitzer's avatar Nate Snitzer

Hi everyone,

Here is a new module I developed for a site I’m working on. I needed something that worked like First Timer where it grabbed the first login time of a new user, but a little more robust, as I didn’t want to do redirects to a new page, just show certain content to the new user until a certain expiration time, such as if a user first logs on. If I wish to show instructions or a special offer for two days and then expire it, I can define that on the template as well.

The tag consist of this…

{exp:limited_time start="123" seconds="123" minutes="123" hours="123" days="123" weeks="123"}
{expires} // Expiration date in unix format that can be EE date formatted. e.g. {expires format="%d/%m/%y"}
{start} // Start date in unix format that can be EE date formatted. e.g. {start format="%d/%m/%y"}
{countdown} // Countdown time left in seconds. Slap on your own PHP or javascript on this one to make a countdown timer if you want.
{/exp:limited_time}

The parameters are as follows.

start - (optional) - This can be used to insert a pre-defined start date in unix format, otherwise the module defaults to the users first log in date. This is useful if you wish to show content for a limited amount of time on a blog post for instance. You can just place {entry_date} into this parameter.

seconds, minutes, hours, days, weeks - (optional) - These parameters take a numeric value and define when you wish the content between the tag pairs to expire from the start date. The default time is 1 day. I’m working on extending the functionality to allow custom default times in the future.

Please use it and beat it up. This is my first real ExpressionEngine module, and it’s slightly hacked together from other modules and my own code. I’m still pretty green when it comes to programming, so let me know if you see improvement anywhere. This is open source, so both commercial and private use are welcomed and I hope you guys can get some good use out of it.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.