YGEX Posted October 28 Share Posted October 28 Hello, i want to add this two type of badges into my postContainer. The "staff member" badge i figured out with a method, using the "{{if $comment->author()->modShowBadge()}}" code but for the time since member registred i don`t know what code to use. So far this is what i've made : Also, do you have any recommendation of what to use instead the code i`ve used for the staff one, i wanted to be automatic instead of adding the groups id. Link to comment Share on other sites More sharing options...
Manager DawPi Posted October 28 Manager Share Posted October 28 43 minuty temu, YGEX napisał(a): code but for the time since member registred i don`t know what code to use You mean joined date? Try it: {datetime="$comment->author()->joined"} intermedia - profesjonalne rozwiązania Invision Power Board --- Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu. Link to comment Share on other sites More sharing options...
YGEX Posted October 28 Author Share Posted October 28 16 minutes ago, DawPi said: You mean joined date? Try it: {datetime="$comment->author()->joined"} More like how many days / months / years passed by since he`is registered. Link to comment Share on other sites More sharing options...
Manager Solution DawPi Posted October 28 Manager Solution Share Posted October 28 You need more code than that then, see examples - https://stackoverflow.com/questions/2915864/php-how-to-find-the-time-elapsed-since-a-date-time intermedia - profesjonalne rozwiązania Invision Power Board --- Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu. Link to comment Share on other sites More sharing options...
YGEX Posted October 28 Author Share Posted October 28 (edited) 40 minutes ago, DawPi said: You need more code than that then, see examples - https://stackoverflow.com/questions/2915864/php-how-to-find-the-time-elapsed-since-a-date-time I've made it...but is not working properly, it`s display only in days. I used the "if" and "elseif" to create the code but only the first part works... <div class="ipsType_center regTime" data-ipstooltip="" _title="Time Since User Registration" style=""> {{if $date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/86400)}} <li class="regTimeformat">{$date_joined} DAYS OF REGISTRATION</li> {{elseif $date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/2592000)}} <li class="regTimeformat">{$date_joined} MONTHS OF REGISTRATION</li> {{elseif $date_joined = floor((strtotime("now")-strtotime("{$comment->author()->joined}"))/31536000)}} <li class="regTimeformat">{$date_joined} YEARS OF REGISTRATION</li> {{endif}} </div> EDIT : I see now that i arranged the code in a wrong way, switched days with years and now works properly. Edited October 28 by YGEX i`m to blind for this xD Link to comment Share on other sites More sharing options...
Manager DawPi Posted October 28 Manager Share Posted October 28 Remember - there are no failures. There are only lessons learned from lost battles. intermedia - profesjonalne rozwiązania Invision Power Board --- Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu. Link to comment Share on other sites More sharing options...
Manager DawPi Posted October 28 Manager Share Posted October 28 Problem ROZWIĄZANY. Jeśli są jakiekolwiek wątpliwości, pytania proszę o założenie nowego tematu. Wszelkie uzasadnione reklamacje/pretensje/sugestie/rady przyjmuje ekipa forum. intermedia - profesjonalne rozwiązania Invision Power Board --- Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu. Link to comment Share on other sites More sharing options...
Recommended Posts