Webmastersite.net
Register Log In


Display output

Comments on

mrkarron
Experienced

Usergroup: Customer
Joined: Oct 02, 2003

Total Topics: 33
Total Comments: 97
Posted Jan 05, 2005 - 9:13 AM:

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
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jan 06, 2005 - 4:42 AM:

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,
Quantum
Forum Regular

Usergroup: Member
Joined: Jul 01, 2003

Total Topics: 38
Total Comments: 164
Quantum
Posted Jan 06, 2005 - 3:51 PM:

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).
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.