Is there a way to display the value of {LINKEXPIREDAYS} on my details.tpl without the decimal places? ex: this link will expire in 4 days, not 4.345 days.
Instead of showing it as 4.345, it would be more readable to show it as 4 days, xxx hours and xxx minutes by default.
With the [x] value in the variable possibly specifying how detailed to show the time (i.e. 0 for only days, 1 for days & hours, 2 for days, hours & minutes).
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
Paul,
Is there a way to display the value of {LINKEXPIREDAYS} on my details.tpl without the decimal places? ex: this link will expire in 4 days, not 4.345 days.
Ron
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Two ways. The long term way is for 3.20 I'll edit classes/onelink.php to change the expiredays function to function expiredays($roundat = 3)
{
// returns number of days left until this link expires
if ($this->expire == 0) return false;
else
{
$timeleft = $this->expire - time();
$days = round(($timeleft / 86400), $roundat);
return $days;
}
}
and then {LINKEXPIREDAYS[0]} would round it at 0 decimal places.
Another way is to leave the file alone and just use php in your template,
Forum Regular
Usergroup: Member
Joined: Jul 01, 2003
Total Topics: 38
Total Comments: 164
Instead of showing it as 4.345, it would be more readable to show it as 4 days, xxx hours and xxx minutes by default.
With the [x] value in the variable possibly specifying how detailed to show the time (i.e. 0 for only days, 1 for days & hours, 2 for days, hours & minutes).