Website Sale Banner

🏷️ This Website is For Sale

Available Now

ℹ️ Reason for Sale: Due to limited availability, I am unable to continue maintaining the site at this time.

đź’° Pricing

$300

Flexible for negotiation

đź’ł Payment Method

PayPal (Friends & Family Only)

Secure transaction required

📦 What's Included

âś… All related files
âś… Complete database
❌ User data excluded
❌ Current theme excluded
❌ Domain excluded
❌ Hosting excluded

XF2 Tutorials Years Of Service (Postbit)

JowLix

XenForo Expert

Staff member
LIFETIME ELITE
Coin Coins
22,316
This is seen on many boards like this:
firefox_i2kVJ13PGh.webp


However you can achieve somewhat similar results easy.

In message_macros added the following:
PHP:
    arg-itemProp="">
    <xf:set var="$monthsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30)) }}</xf:set>
    <xf:set var="$yearsOld">{{ number(($xf.time - $user.register_date) / (60 * 60 * 24 * 30 * 12)) }}</xf:set>
    <section class="message-user"

PHP:
                                arg-valueClass="pairs pairs--justified" />
                        </xf:if>
                    </xf:if>
                </xf:contentcheck>
    <xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}"><i class="fa fa-star" aria-hidden="true"></i> {$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}"><i class="fa fa-star" aria-hidden="true"></i> {$monthsOld} months of service</div>
    </xf:if>
                </div>
            </xf:if>
        </xf:if>
        <span class="message-userArrow"></span>

Add the following to Extra.less:
CSS:
.type-month-1,
.type-month-2,
.type-month-3,
.type-month-4,
.type-month-5,
.type-month-6,
.type-month-7,
.type-month-8,
.type-month-9,
.type-month-10,
.type-month-11
 {
    color: hsl(199, 100%, 54%);
    border-bottom-style: solid;
    border-width: 2px;
}

.service-tag {
    order: 9;
    width: 85%;
    padding: 4px 6px;
    text-align: center;
    border-radius: 1px;
    font-size: 11px;
    text-shadow: none;
    text-transform: uppercase;
    margin: 3px auto 0 auto;
    margin-bottom: 5px;
    font-weight: bold;
    background: hsl(0, 0%, 7%);
}

You'll have to further tweaking this to your liking.
 
Back
Top