Not Solved <blank> years of service
#11
Not Solved
(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> 
Reply
#12
Not Solved
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>
Reply
#13
Not Solved
(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>

Did you remember to install the plugin on the running board as well?
Reply
#14
Not Solved
How to show 0 years,1/2 year, 1 1/2 years of service?
any idea?
Reply
#15
Not Solved
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.
Reply
#16
Not Solved
(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.

Yeah, don't copy that into other forums.

He's using "postbit-time" and "postbit-time-halfyear" (two classes) to style all but at the same time is putting raw css in the same label (style="margin-top: 3px;color: red;").

------------------------------

Instead, you can copy this code in what forum you want:

<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;
}

By the way, this was coded by me using CSS, an open source language that describes the style of an HTML document.
I don't give support on PM.
Reply
#17
Not Solved
@up Well, Yeah he dont need to make .postbit-time-halfyear
he can edit the color in the div this will make his work easier since he just need the .postbit-time
Reply
#18
Not Solved
I love how the second example is what I did for another MyBB forum.
Check out all my submissions here - click me
MyBB support at it's finest. 
Reply
#19
Not Solved
Can someone help me here? I have it working thanks to @eNvy

But now it's showing like this:
[Image: service.png]

How do I get rid of the first one, when the second one is due to kick in?
Reply
#20
Not Solved
(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:
[Image: service.png]

How do I get rid of the first one, when the second one is due to kick in?

Show us the code that you're using.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)