2016-01-08, 12:47 PM
(2016-01-08, 10:44 AM)Zeeks Wrote: [ -> ]How would you make this into months instead of years?
<if $post['regdate']+(60*60*24*31) <= TIME_NOW then><span style="color: gold;">One Month of Service</span></if>
(2016-01-08, 10:44 AM)Zeeks Wrote: [ -> ]How would you make this into months instead of years?
<if $post['regdate']+(60*60*24*31) <= TIME_NOW then><span style="color: gold;">One Month of Service</span></if>
<setvar years>floor((TIME_NOW-$post['regdate'])/(60*60*24*30))</setvar>
<span class="service-{$GLOBALS['tplvars']['years']}">{$GLOBALS['tplvars']['years']} months of service</span>
<setvar years>floor((TIME_NOW-$post['regdate'])/(60*60*24*365))</setvar>
<span class="service-{$GLOBALS['tplvars']['years']}">{$GLOBALS['tplvars']['years']} years of service</span>
(2016-01-09, 06:37 AM)Dr_The_One Wrote: [ -> ]it work on local host but not showing years/months on running board.
what may be the issue?
i use following code for months:
<setvar years>floor((TIME_NOW-$post['regdate'])/(60*60*24*30))</setvar> <span class="service-{$GLOBALS['tplvars']['years']}">{$GLOBALS['tplvars']['years']} months of service</span>
Following code for years:
<setvar years>floor((TIME_NOW-$post['regdate'])/(60*60*24*365))</setvar> <span class="service-{$GLOBALS['tplvars']['years']}">{$GLOBALS['tplvars']['years']} years of service</span>
Work fine on local host but not on running board.
Below code is also not working.
<if $post['regdate']+(60*60*24*30) <= TIME_NOW then>1 month services
<elseif $post['regdate']+(60*60*24*330) <= TIME_NOW then>11 months services
<else/></if>
(2016-08-21, 05:16 PM)Cryptexinside Wrote: [ -> ]This goes to the postbit
<if $post['regdate']+(60*60*24*182) <= TIME_NOW then><div class="postbit-time postbit-time-halfyear" style="margin-top: 3px;">1/2 Year of Service</div></if>
<if $post['regdate']+(60*60*24*365) <= TIME_NOW then><div class="postbit-time postbit-time-halfyear" style="margin-top: 3px;color: #85AE31;">One Year of Service</div></if>
<if $post['regdate']+(60*60*24*700) <= TIME_NOW then><div class="postbit-time postbit-time-halfyear" style="margin-top: 3px;color: red;">Two Years of Service</div></span></if>
</div>
CSS:
.postbit-time-halfyear {
color: #2574A9
}
.postbit-time {
width: 140px;
padding: 4px 0;
text-align: center;
border-radius: 3px;
font-size: 11px;
text-shadow: none;
margin: 0 auto;
font-weight: 500;
background: #181818
}
This was coded by me, Dont copy it to other forums.
<if $post['regdate']+(60*60*24*182) <= TIME_NOW then><div class="postbit-time-halfyear">Half year of service</div></if>
.postbit-time-halfyear {
width: 140px;
font-size: 11px;
text-align: center;
margin: 3px auto 0px auto;
padding: 4px 0px;
background: #181818;
border-radius: 3px;
}
(2017-02-13, 10:10 PM)DaNnIbOi Wrote: [ -> ]Can someone help me here? I have it working thanks to @eNvy
But now it's showing like this:
How do I get rid of the first one, when the second one is due to kick in?