update #__comprofiler AS a set a.`cb_countdown_birthday` = (select CASE WHEN `cb_birthdate` = '0000-00-00' THEN '9999' WHEN CONCAT(YEAR(now()),RIGHT(`cb_birthdate`,6)) < now() THEN DATEDIFF(ADDDATE(CONCAT(YEAR(now()),RIGHT(`cb_birthdate`,6)), INTERVAL 1 year),now()) ELSE DATEDIFF(CONCAT(YEAR(now()),RIGHT(`cb_birthdate`,6)),now()) END from #__comprofiler AS b where b.`id` = a.`id`);
<span class="label label-default">[cb:date format="d/m" date="[cb_birthdate]" /]</span><div class="block" style="line-height: normal;margin-bottom: 28px;"><a href="/url_to_userprofile-[user_id]"><img src="[avatar]"/></a>
<span class="myclass"><a href="/url_to_userprofile-[user_id]">[firstname] [lastname]</a></span>[cb:if cb_countdown_birthday="0"] <i class="fa fa-2x fa-gift"></i>[/cb:if]
</div>
Please Log in to join the conversation.
Please Log in to join the conversation.
select (@row_number:=@row_number + 1) AS numrow, firstname, lastname, cb_birth_date, user_id, CASE WHEN avatar is null THEN '/components/com_comprofiler/plugin/templates/default/images/avatar/nophoto.png' ELSE concat('/images/comprofiler/',avatar) END as avatar, CASE WHEN CONCAT(YEAR(now()),RIGHT(`cb_birth_date`,6)) < DATE_FORMAT(NOW(),'%Y-%m-%d') THEN CONVERT(DATEDIFF(ADDDATE(CONCAT(YEAR(now()),RIGHT(`cb_birth_date`,6)), INTERVAL 1 year),now()),DECIMAL) ELSE CONVERT(DATEDIFF(CONCAT(YEAR(now()),RIGHT(`cb_birth_date`,6)),now()),DECIMAL) END as 'countdown' from #__comprofiler, (SELECT @row_number:=0) AS t where cb_birth_date <> '0000-00-00' ORDER BY countdown asc LIMIT 0, 12;
<li class="ligne[column_numrow]"><span class="label label-default">[cb:date format="d/m" date="[column_cb_birth_date]" /]</span> <a href="/profil-[column_user_id]" title="[column_firstname] [column_lastname]"><img class="cbImgPict cbFullPict img-thumbnail" src="[column_avatar]" alt="[column_firstname] [column_lastname]"></a> <b> <a href="/profil-[column_user_id]" title="[column_firstname] [column_lastname]">[column_firstname] [column_lastname]</a></b>[cb:if column_countdown="0"] <i class="fa fa-2x fa-gift"></i>[/cb:if]</li>
Please Log in to join the conversation.