XenForo 2.0 Years of Service Modification (cracked.io Like)

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
793
Points
153

Reputation:

Hello,

A friend of mine coded that for me a while back for my theme, thought of sharing it with the greatest XF Nulled community to its existence.
It's a hard-code solution, I am pretty sure you can achieve the same with trophies + user pomotions, but yeah. Here is the code for lazy people.

HTML:
## Add after <xf:macro name="user_info" arg-user="!" arg-fallbackName=""> ###

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

## Add at the bottom of your postbit ##

<xf:if is="$monthsOld < '12'">
   <div style="margin-top:5px;margin-bottom:5px;">
      <div class="service-tag user-service--postbit ">
         <div class="type-month-{$monthsOld}">{$monthsOld} months of service</div>
      </div>
   </div>
   <xf:else />
   <div style="margin-top:5px;margin-bottom:5px;">
      <div class="service-tag user-service--postbit">
         <div class="type-year-{$yearsOld}">{$yearsOld} years of service</div>
      </div>
   </div>
</xf:if>

CSS:
/*-------------------------------------------------------------------------*/
/* Years of Service
/*-------------------------------------------------------------------------*/

.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%);
}

For years, it's pretty much self-explanatory, you can take the CSS from above as framework.



xsSwxj3.png


Demo: https://wowemu.org/threads/valentines-day-2023-event.560/
Note: My theme is custom-made and is not for sale. I got quite a lot of messages since I posted this guide, just wanted to make it clear.
 
Last edited:

Samuel

Well-known member
Registered
Joined
May 13, 2021
Messages
91
Points
28

Reputation:

My question may not have anything to do with this thread, but why does everyone like to copy or (Full Copy) the cracked.io ?? Does no one have the creativity to invent something new?
No one even bothers to change the award images and even the names of user groups. Everyone implement exactly the same texts, features, awards, and... for their community as in the cracked.io community. Is this community really worth imitating?

Anyway Thanks to @Waduhek, for this post and her/his useful knowledge.
 

MEGAHERZ

Collaborate
Collaborate
Registered
Joined
Mar 16, 2019
Messages
50
Points
38

Reputation:

My question may not have anything to do with this thread, but why does everyone like to copy or (Full Copy) the cracked.io ?? Does no one have the creativity to invent something new?
No one even bothers to change the award images and even the names of user groups. Everyone implement exactly the same texts, features, awards, and... for their community as in the cracked.io community. Is this community really worth imitating?

Anyway Thanks to @Waduhek, for this post and her/his useful knowledge.
Samuelwhy be creative if what they have is perfectly fine? and btw they copied the OG leakforums lol
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
411
Points
53

Reputation:

Hello,

A friend of mine coded that for me a while back for my theme, thought of sharing it with the greatest XF Nulled community to its existence.
It's a hard-code solution, I am pretty sure you can achieve the same with trophies + user pomotions, but yeah. Here is the code for lazy people.

HTML:
## Add after <xf:macro name="user_info" arg-user="!" arg-fallbackName=""> ###

<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 * 365)) }}</xf:set>

## Add at the bottom of your postbit ##

<xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}">{$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}">{$monthsOld} months of service</div>
    </xf:if>

CSS:
/*-------------------------------------------------------------------------*/
/* Years of Service
/*-------------------------------------------------------------------------*/

.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%);
}

For years, it's pretty much self-explanatory, you can take the CSS from above as framework.



xsSwxj3.png


Demo: https://wowemu.org/threads/valentines-day-2023-event.560/
Waduhekyou need to do a better job of let members know where these codes go like what part of the theme it would go in
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
411
Points
53

Reputation:

Hello,

A friend of mine coded that for me a while back for my theme, thought of sharing it with the greatest XF Nulled community to its existence.
It's a hard-code solution, I am pretty sure you can achieve the same with trophies + user pomotions, but yeah. Here is the code for lazy people.

HTML:
## Add after <xf:macro name="user_info" arg-user="!" arg-fallbackName=""> ###

<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 * 365)) }}</xf:set>

## Add at the bottom of your postbit ##

<xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}">{$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}">{$monthsOld} months of service</div>
    </xf:if>

CSS:
/*-------------------------------------------------------------------------*/
/* Years of Service
/*-------------------------------------------------------------------------*/

.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%);
}

For years, it's pretty much self-explanatory, you can take the CSS from above as framework.



xsSwxj3.png


Demo: https://wowemu.org/threads/valentines-day-2023-event.560/
Waduhekcan you find this for invasion power board trying to get this code
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
793
Points
153

Reputation:

To apply the codes, locate to your style templates and search for "message_macros" and "extra.less"
 

ForumFlake

Well-known member
Registered
Joined
Feb 8, 2023
Messages
79
Points
8

Reputation:

I am looking for this for Invision Community version. Would you happen to have the code. the only site I have seen it with was Webflake. They had theres as Years of flaking.
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
793
Points
153

Reputation:

I am looking for this for Invision Community version. Would you happen to have the code. the only site I have seen it with was Webflake. They had theres as Years of flaking.
ForumFlakeUnfortunately not, but shouldn't be too hard if you know the conditional statements/variables invision is using.
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
411
Points
53

Reputation:

Hello,

A friend of mine coded that for me a while back for my theme, thought of sharing it with the greatest XF Nulled community to its existence.
It's a hard-code solution, I am pretty sure you can achieve the same with trophies + user pomotions, but yeah. Here is the code for lazy people.

HTML:
## Add after <xf:macro name="user_info" arg-user="!" arg-fallbackName=""> ###

<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 * 365)) }}</xf:set>

## Add at the bottom of your postbit ##

<xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}">{$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}">{$monthsOld} months of service</div>
    </xf:if>

CSS:
/*-------------------------------------------------------------------------*/
/* Years of Service
/*-------------------------------------------------------------------------*/

.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%);
}

For years, it's pretty much self-explanatory, you can take the CSS from above as framework.



xsSwxj3.png


Demo: https://wowemu.org/threads/valentines-day-2023-event.560/
Note: My theme is custom-made and is not for sale. I got quite a lot of messages since I posted this guide, just wanted to make it clear.
Waduhekhow is this to work do you have to change the <xf:if is="$yearsOld >= '1'"> every month or do it change on its own
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,529
Points
523

Reputation:

how is this to work do you have to change the <xf:if is="$yearsOld >= '1'"> every month or do it change on its own
one_finger_mannothing need to be changed, if $YearsOld is greater than 1 it goes into that section, otherwise it check $MonthOld. For years you only have to add some stylings into the css if you want some
 

richmann

Owner of Katz.To
S.V.I.P Member
Collaborate
Registered
Joined
Apr 26, 2021
Messages
29
Points
13

Reputation:

Hello,

A friend of mine coded that for me a while back for my theme, thought of sharing it with the greatest XF Nulled community to its existence.
It's a hard-code solution, I am pretty sure you can achieve the same with trophies + user pomotions, but yeah. Here is the code for lazy people.

HTML:
## Add after <xf:macro name="user_info" arg-user="!" arg-fallbackName=""> ###

<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 * 365)) }}</xf:set>

## Add at the bottom of your postbit ##

<xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}">{$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}">{$monthsOld} months of service</div>
    </xf:if>

CSS:
/*-------------------------------------------------------------------------*/
/* Years of Service
/*-------------------------------------------------------------------------*/

.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%);
}

For years, it's pretty much self-explanatory, you can take the CSS from above as framework.



xsSwxj3.png


Demo: https://wowemu.org/threads/valentines-day-2023-event.560/
Note: My theme is custom-made and is not for sale. I got quite a lot of messages since I posted this guide, just wanted to make it clear.
Waduhekhow to change it from months of service to years of service? I changed the css already to type-year and it stop showing. keeping it as type-month shows 106 months of service and so on lol
 
Last edited:

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
411
Points
53

Reputation:

how to change it from months of service to years of service? I changed the css already to type-year and it stop showing. keeping it as type-month shows 106 months of service and so on lol
richmannchange this
Code:
<xf:if is="$yearsOld >= '1'">
            <div class="service-tag type-year-{$yearsOld}">{$yearsOld} years of service</div>
        <xf:elseif is="$monthsOld >= '1'" />
            <div class="service-tag type-month-{$monthsOld}">{$monthsOld} months of service</div>
    </xf:if>
 

ForumFlake

Well-known member
Registered
Joined
Feb 8, 2023
Messages
79
Points
8

Reputation:

also how can I have different colors for each one. They are all the same color, 1 month, 2 month, etc.
 

ForumFlake

Well-known member
Registered
Joined
Feb 8, 2023
Messages
79
Points
8

Reputation:

also how can I have different colors for each one. They are all the same color, 1 month, 2 month, etc.
ForumFlakeFigured out how to do the different colors. This is completed. Just trying to straighten the 2 months of flaking out above. like staff team and administrator badge. and even like above by OP.
 
View previous replies…

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
793
Points
153

Reputation:

I have figured all the coding out, The only one I am having issues with is Yearly how can I do years of flaking to be displayed.
ForumFlakeWhen a member reaches the registered length of 12 months, it will display. If you want to manually manipulate this for each user, then you would need to get [MMO] Edit User Join Date
 
Top