Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


[Tutorial] How-To: Years of Service (Template Conditionals) filter_list
Author
Message
[Tutorial] How-To: Years of Service (Template Conditionals) #1
Today, I will be giving you a tutorial on how to add years of service with template conditionals. The software of board being used in this tutorial is MyBB 1.8, however, any versions from 1.4 to 1.8 would be fine. Most of you have seen these type of additions on bulletin boards across the globe. I'm sure you would like to have one of these pages. All others are also welcome to help other individuals on this thread who may be having issues, problems, and, errors after or before reading this tutorial. Many threads will be created regarding MyBB (version) for owners and theme developers.

Well, maybe you have seen some forums with a message that says "One Year of Service" or "Two Years of Service" and so on, so here comes the easiest way to do it. Please notice that you must have installed PHP (template conditionals) in MyBB Templates. If you haven't installed template conditionals go here: http://mybbhacks.zingaburga.com/showthread.php?tid=260

1. Theme Templates
In your Templates section of the MyBB ACP, find the Post Bit Templates -> postbit or postbit_classic (choose the one that you use or add the code to both) and add the following code:

Code:
<if $post['regdate']+(60*60*24*730) <= TIME_NOW then><span class="two-years">Two Years of Service</span><elseif $post['regdate']+(60*60*24*365) <= TIME_NOW then><span class="one-year">One Year of Service</span></if>
Now add the following in your global.css:
Code:
.two-years {
color: #F80;
text-align: center;
}

.one-year {
color: #FFFFFF;
text-align: center;
}

Reply

RE: [Tutorial] How-To: Years of Service (Template Conditionals) #2
should be
Code:
<if $post['regdate']+(60*60*24*365) <= TIME_NOW then><span class="one-year">One Year of Service</span><elseif $post['regdate']+(60*60*24*730) <= TIME_NOW then><span class="two-years">Two Years of Service</span></if>

but ok.

Reply

RE: [Tutorial] How-To: Years of Service (Template Conditionals) #3
Where the code put ?

Reply

RE: [Tutorial] How-To: Years of Service (Template Conditionals) #4
where does the code go in postbit?

Reply







Users browsing this thread: 1 Guest(s)