MyBB Community Forums
<blank> years of service - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: <blank> years of service (/thread-173297.html)

Pages: 1 2 3


RE: <blank> years of service - Corey H - 2016-01-08

(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> 



RE: <blank> years of service - Dr_The_One - 2016-01-09

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>


RE: <blank> years of service - Corey H - 2016-01-09

(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?


RE: <blank> years of service - Dr_The_One - 2016-08-21

How to show 0 years,1/2 year, 1 1/2 years of service?
any idea?


RE: <blank> years of service - Cryptexinside - 2016-08-21

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.


RE: <blank> years of service - eNvy - 2016-08-21

(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.


RE: <blank> years of service - Cryptexinside - 2016-08-21

@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


RE: <blank> years of service - Nasyr - 2016-11-22

I love how the second example is what I did for another MyBB forum.


RE: <blank> years of service - DaNnIbOi - 2017-02-13

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?


RE: <blank> years of service - Corey H - 2017-02-13

(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.