YGEX Posted October 28, 2023 Posted October 28, 2023 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.
Manager DawPi Posted October 28, 2023 Manager Posted October 28, 2023 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.
YGEX Posted October 28, 2023 Author Posted October 28, 2023 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.
Manager Solution DawPi Posted October 28, 2023 Manager Solution Posted October 28, 2023 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.
YGEX Posted October 28, 2023 Author Posted October 28, 2023 (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, 2023 by YGEX i`m to blind for this xD
Manager DawPi Posted October 28, 2023 Manager Posted October 28, 2023 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.
Manager DawPi Posted October 28, 2023 Manager Posted October 28, 2023 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.
Recommended Posts