MyBB Community Forums

Full Version: Years of Service Postbit Add-On 1.8.20
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
[Image: uFfvWg7.png]

[Image: rzi6g0I.png]

Required
<div class="smalltext" style="background: #212121;padding: 7px;margin: 5px 0;">
<if $post['regdate']+(60*60*24*1095) <= TIME_NOW then><span style="color: #FF0040;">4 Years of Service</span>
<elseif $post['regdate']+(60*60*24*1095) <= TIME_NOW then><span style="color: #FF0080;">3 Years of Service</span>
<elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><span style="color: #FF00BF;">2 Years of Service</span>
<elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><span style="color: #FF00FF;">1 Year of Service</span>
<elseif $post['regdate']+(60*60*24*330) <= TIME_NOW then><span style="color: #0080FF;">11 Months of Service</span>
<elseif $post['regdate']+(60*60*24*300) <= TIME_NOW then><span style="color: #00FFFF;">10 Months of Service</span>
<elseif $post['regdate']+(60*60*24*270) <= TIME_NOW then><span style="color: #00FF80;">9 Months of Service</span>
<elseif $post['regdate']+(60*60*24*240) <= TIME_NOW then><span style="color: #00FF00;">8 Months of Service</span>
<elseif $post['regdate']+(60*60*24*210) <= TIME_NOW then><span style="color: #FF4000;">7 Months of Service</span>
<elseif $post['regdate']+(60*60*24*180) <= TIME_NOW then><span style="color: #FF8000;">6 Months of Service</span>
<elseif $post['regdate']+(60*60*24*150) <= TIME_NOW then><span style="color: #FFBF00;">5 Months of Service</span>
<elseif $post['regdate']+(60*60*24*120) <= TIME_NOW then><span style="color: #FFFF00;">4 Months of Service</span>
<elseif $post['regdate']+(60*60*24*90) <= TIME_NOW then><span style="color: #F4FA58;">3 Months of Service</span>
<elseif $post['regdate']+(60*60*24*60) <= TIME_NOW then><span style="color: #D8D8D8;">2 Months of Service</span>
<elseif $post['regdate']+(60*60*24*30) <= TIME_NOW then><span style="color: #848484;">1 Month of Service</span>
<elseif $post['regdate']+(60*60*24*0) <= TIME_NOW then><span style="color: #848484;">Less Than a Month</span></if>
</div>

Tested on v1.8.20

Demo: https://forum.sinfulsite.com/thread-1169-post-4032.html
You'd better post that in Tutorials and a plugin should be more efficient.
Thanks a lot,it worked and looking nice.
where i have to paste this codes some one make tut for that ?

Thank you ...
(2019-05-10, 06:58 AM)FaridAzhar777 Wrote: [ -> ][Image: uFfvWg7.png]

[Image: rzi6g0I.png]

Required
<div class="smalltext" style="background: #212121;padding: 7px;margin: 5px 0;">
<if $post['regdate']+(60*60*24*1095) <= TIME_NOW then><span style="color: #FF0040;">4 Years of Service</span>
<elseif $post['regdate']+(60*60*24*1095) <= TIME_NOW then><span style="color: #FF0080;">3 Years of Service</span>
<elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><span style="color: #FF00BF;">2 Years of Service</span>
<elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><span style="color: #FF00FF;">1 Year of Service</span>
<elseif $post['regdate']+(60*60*24*330) <= TIME_NOW then><span style="color: #0080FF;">11 Months of Service</span>
<elseif $post['regdate']+(60*60*24*300) <= TIME_NOW then><span style="color: #00FFFF;">10 Months of Service</span>
<elseif $post['regdate']+(60*60*24*270) <= TIME_NOW then><span style="color: #00FF80;">9 Months of Service</span>
<elseif $post['regdate']+(60*60*24*240) <= TIME_NOW then><span style="color: #00FF00;">8 Months of Service</span>
<elseif $post['regdate']+(60*60*24*210) <= TIME_NOW then><span style="color: #FF4000;">7 Months of Service</span>
<elseif $post['regdate']+(60*60*24*180) <= TIME_NOW then><span style="color: #FF8000;">6 Months of Service</span>
<elseif $post['regdate']+(60*60*24*150) <= TIME_NOW then><span style="color: #FFBF00;">5 Months of Service</span>
<elseif $post['regdate']+(60*60*24*120) <= TIME_NOW then><span style="color: #FFFF00;">4 Months of Service</span>
<elseif $post['regdate']+(60*60*24*90) <= TIME_NOW then><span style="color: #F4FA58;">3 Months of Service</span>
<elseif $post['regdate']+(60*60*24*60) <= TIME_NOW then><span style="color: #D8D8D8;">2 Months of Service</span>
<elseif $post['regdate']+(60*60*24*30) <= TIME_NOW then><span style="color: #848484;">1 Month of Service</span>
<elseif $post['regdate']+(60*60*24*0) <= TIME_NOW then><span style="color: #848484;">Less Than a Month</span></if>
</div>

Tested on v1.8.20

Demo: https://forum.sinfulsite.com/thread-1169-post-4032.html

This tutorial is lacking a few steps.

You did not indicate WHERE that code is supposed to go to. No one has any idea where that code goes.

You did not indicate HOW someone can change the colors of the postbit fonts. 

You did not indicate HOW to change the font styling to something different if someone prefers a different default font styling of their theme.

Those items needs to be explained in detail.

Take Crazycat's idea and make this a plugin. You can add the plugin in the MyBB 'Extend' section for everyone to view and download.
What?

It is a basic HTML... there is no need to add these steps.
(2019-05-30, 06:31 PM)Eldenroot Wrote: [ -> ]What?

It is a basic HTML... there is no need to add these steps.

It may be easy for you, but not for others.

Remember... others are not like you.
You should create a plugin to use this add-on and instead of using if statements; use switch()
@serpius i added the above codes to my postbit template and modified them for my needs, like this:

[attachment=41805]

And the result is:

[attachment=41806]

I didn't try it in the postbit classic,till now.

Regards.
not working with 1.8.21

i am getting error

[Image: Screenshot_1241.png]
Pages: 1 2