This is my first project using CB (download version), I wanted to display a field based on existing field(s).
Without pro version or writing a custom CB plugin, it seems fairly hard to achieve the goal. All I need is an indicator on profile/userlist for membership expiration (our membership is yearly renewal).
After some try out, here I share what I did, all you need is Joomla Plugin 'Sourcerer':
extensions.joomla.org/extensions/5051
Steps:
1. Create a new [Fields delimeter] type field in CB Field Manager
2. In description, click the [insert code <>] button and put your PHP code in:
{source}
<?php
$smdt = "[cb_memberdate]";
$mdays = round(abs(strtotime($smdt)-strtotime(date('Y-m-d')))/86400);
if ($mdays>365) {
echo "Expired";
}
?>
{/source}
3. Place the field anywhere you want like other fields.
The trick is how to refer the existing field. Here [cb_memberdate] is the stored field for member's reg date, the double-quote is important (single-quote also OK).
In my case, the code just compare the reg date with today, if it is over 1 year, then show "Expired", simple?
You can do other stuff with same trick, and refer to more existing fields in your code.
Note: the source code will show up "as is" in backend->CB User Manager
Have fun!