Jump to content
FLASH SALE (EXTENDED TO 2/21/19)! Take 20% off all store products! Read more... ×
We're hiring! We are accepting applications for Junior Moderator, Uploader, and Support Team. Read more... ×
Having trouble connecting to our Discord server or has your role been mistakenly removed? Let us know! Read more... ×
  • 0
mr-pimpen

IPS 4.3 Quick Help with one coding.

Question

I have been trying for a long time to get this one coding. Does anyone know how to figure out the coding for "X amount of years a user has registered" And what it does is it displays for example 2011-2012 i been a 1 year member and it shows a circle with 1 year and you can have different colors for different years.

 

Similar to a site called the tech game. and another site called nulledbb it has 1 YEAR OF SERVICE 

 

this would mean alot for the help

Edited by Jeffrey
added prefix

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

@mr-pimpen

There is something like and you can try

 

 

{datetime="$member->joined"}

or

{$member->joined->dayAndMonth()} 

 

You can find samples in

core > front > profile > profileHeader

 

Also this should work for the social plugin or postbit container

//86400 stands for seconds in a day
//leftinfo class is a dummy class.

<li class="cAuthorPane_photo">
 {{$date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400) ;}}  
<span class="leftinfo"><i class="fa fa-calendar"></i> With us: {$date_joined} days</span>
</li> 



//2628000 stands for seconds in month
<li class="cAuthorPane_photo">
 {{$day = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400) ;}} 
 {{$month = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/2628000) ;}}  
<span class="leftinfo"><i class="fa fa-calendar"></i> With us since: {$day} Days {$month} Months</span>
</li>

About year u can make ,if {$month} > 12, change the string "Month" to "Year", ofc that will need code edits

it works with days,idk about years, never tested

But a better option is the plugin:

https://invisioncommunity.com/files/file/7354-enhanced-joined-date/

If you want to add in another place such as the social info plugin, you can check how the code works and do it, or if you manage to get the plugin I can give a hand .

 

That works if you add my code in the postContainer template, not compatible with enhanced user plugin because it overwrites the postbitContainer code.

 

Screenshot_3.png

Edited by S!r.ReaDy

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, S!r.ReaDy said:

@mr-pimpen

There is something like and you can try

 

 

{datetime="$member->joined"}

or

{$member->joined->dayAndMonth()} 

 

You can find samples in

core > front > profile > profileHeader

 

Also this should work for the social plugin or postbit container

//86400 stands for seconds in a day
//leftinfo class is a dummy class.

<li class="cAuthorPane_photo">
 {{$date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400) ;}}  
<span class="leftinfo"><i class="fa fa-calendar"></i> With us: {$date_joined} days</span>
</li> 



//2628000 stands for seconds in month
<li class="cAuthorPane_photo">
 {{$day = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400) ;}} 
 {{$month = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/2628000) ;}}  
<span class="leftinfo"><i class="fa fa-calendar"></i> With us since: {$day} Days {$month} Months</span>
</li>

About year u can make ,if {$month} > 12, change the string "Month" to "Year", ofc that will need code edits

it works with days,idk about years, never tested

But a better option is the plugin:

https://invisioncommunity.com/files/file/7354-enhanced-joined-date/

If you want to add in another place such as the social info plugin, you can check how the code works and do it, or if you manage to get the plugin I can give a hand .

 

That works if you add my code in the postContainer template, not compatible with enhanced user plugin because it overwrites the postbitContainer code.

 

Screenshot_3.png

With theme use you? Looks nice 

Share this post


Link to post
Share on other sites
  • 0
37 minutes ago, IpBoardfreak said:

With theme use you? Looks nice 

Fline

Edited by S!r.ReaDy

Share this post


Link to post
Share on other sites
  • 0
23 minutes ago, S!r.ReaDy said:

Fline

Can you send me please a message I need the theme please 

Share this post


Link to post
Share on other sites
  • 0

Its in the downloads easy to search

 

 

Any how that's the file

Share this post


Link to post
Share on other sites
  • 0
As your topic appears to be a support topic for IPS, we have moved it to the appropriate forum.

Share this post


Link to post
Share on other sites
What do you think? Remember the human.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×