/    Sign up×
Community /Pin to ProfileBookmark

publishing time

I have a script that has a drop-down for how long the listing will be published. Right now, it uses the following to decide between 2 weeks, 1 month, 3 months, or 6 months:

[code=php]
$cadate = time();
if ($gueltig == ’14’) $caend = $cadate + 1209600;
elseif ($gueltig == ’30’) $caend = $cadate + 2592000;
elseif ($gueltig == ’90’) $caend = $cadate + 7776000;
elseif ($gueltig == ‘182’) $caend = $cadate + 15724800;
else $caend = $cadate + 1209600;
$deltime = strftime(“”._CLADS_STRF.””,$caend);
[/code]

I know this is a stab in the dark, and without seeing the rest of the code, is there another elseif I can add so that the listing will be there permanently?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@ScleppelDec 27.2005 — Well without seeing the rest of the code... you could add this elseif, this would set the deltime to 19/01/2038 (or sometime close to that), so it wouldn't get deleted any time soon (32 years).
[code=php] $cadate = time();
if ($gueltig == '14') $caend = $cadate + 1209600;
elseif ($gueltig == '30') $caend = $cadate + 2592000;
elseif ($gueltig == '90') $caend = $cadate + 7776000;
elseif ($gueltig == '182') $caend = $cadate + 15724800;
elseif ($gueltig == 'perm') $caend = 2147483647; // when unix time ends (19/01/2038).
else $caend = $cadate + 1209600;
$deltime = strftime(""._CLADS_STRF."",$caend);[/code]

You would need to add an opion form Permenant to your dropdown(?) with the value "perm"(, unless you change it).
Copy linkTweet thisAlerts:
@lilqhgalauthorDec 31.2005 — Thanks this works perfectly!!!! ?

Just out of curiosity, what happens in 2038 when unix time ends?
Copy linkTweet thisAlerts:
@ScleppelDec 31.2005 — As far as i know, the dates will reset to January 1, 1970 when it was created/started. [URL=http://www.deepsky.com/~merovech/2038.html]More information...[/URL]
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYDec 31.2005 — but until 2038 all systems will most probably have been switched to 64-bit, which will only delay the problem for a few years..emm..a few billion years (Sunday, December 4, 292,277,026,596 )

[url=http://en.wikipedia.org/wiki/Year_2038_problem]wikipedia article about 2038[/url]
×

Success!

Help @lilqhgal spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...