MyBB Support

Need help customising Years of Service.

Submitted by Specific, , Thread ID: 24111

Thread Closed
19-11-2016, 04:37 PM
This post was last modified: 19-11-2016, 05:53 PM by Specific
#1
I've got a new problem

It's showing 6 months while my account is registered for over 2 years, so it should show the 2 years one instead.

Code:
<if $post['regdate']+(60*60*24*182) <= TIME_NOW then><div class="time.6.months" style="margin-top: 1px;color: gold;">6 Months of Service</div>
<elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><div class="time.12.months" style="margin-top: 1px;color: purple;">One Year of Service</div>
<elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><div class="time.24.months" style="margin-top: 1px;color: red;">Two Years of Service</div></if>

Anyone know what Im doing wrong here?

RE: Need help customising Years of Service.

#2
php
[Image: InZ3hGx.png]

RE: Need help customising Years of Service.

OP
#3
19-11-2016, 04:59 PM
Faded Wrote:
php

I just added it to the main post, i forgot ;s

RE: Need help customising Years of Service.

#4
You gotta add the PHP plugin thingy I forgot what it was. It's here somewhere

[Image: Yp8ZHSk.gif]

RE: Need help customising Years of Service.

OP
#5
19-11-2016, 05:16 PM
Zenith Wrote:
You gotta add the PHP plugin thingy I forgot what it was. It's here somewhere

I've added the plugin that allows php in templates, but this didn't fix it.

RE: Need help customising Years of Service.

#6
19-11-2016, 05:16 PM
Zenith Wrote:
You gotta add the PHP plugin thingy I forgot what it was. It's here somewhere

Template Conditionals.
[Image: InZ3hGx.png]

RE: Need help customising Years of Service.

OP
This post was last modified: 19-11-2016, 05:22 PM by Specific
#7
19-11-2016, 05:18 PM
Faded Wrote:
Template Conditionals.

Yeah I already have that added, unless there's a setting after adding the plugin.

Ok the problem Im having now is that it shows the wrong status..

It's showing 6 months while my account is registered for over 2 years, so it should show the 2 years one instead.

Code:
<if $post['regdate']+(60*60*24*182) <= TIME_NOW then><div class="time.6.months" style="margin-top: 1px;color: gold;">6 Months of Service</div>
<elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><div class="time.12.months" style="margin-top: 1px;color: purple;">One Year of Service</div>
<elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><div class="time.24.months" style="margin-top: 1px;color: red;">Two Years of Service</div></if>

Anyone know what Im doing wrong here?

RE: Need help customising Years of Service.

#8
19-11-2016, 05:18 PM
Specific Wrote:
Yeah I already have that added, unless there's a setting after adding the plugin.

Ok the problem Im having now is that it shows the wrong status..

It's showing 6 months while my account is registered for over 2 years, so it should show the 2 years one instead.

Code:
<if $post['regdate']+(60*60*24*182) <= TIME_NOW then><div class="time.6.months" style="margin-top: 1px;color: gold;">6 Months of Service</div>
<elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><div class="time.12.months" style="margin-top: 1px;color: purple;">One Year of Service</div>
<elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><div class="time.24.months" style="margin-top: 1px;color: red;">Two Years of Service</div></if>

Anyone know what Im doing wrong here?

Aren't you missing divs?
[Image: InZ3hGx.png]

RE: Need help customising Years of Service.

OP
This post was last modified: 20-11-2016, 01:28 PM by Specific
#9
19-11-2016, 05:32 PM
Faded Wrote:
Aren't you missing divs?

No.

Code:
<div class="time.6.months" style="margin-top: 1px;color: gold;">6 Months of Service</div>

Can anybody please help ;s?

Bumping it up.

I need help

Users browsing this thread: 3 Guest(s)