Thanks to
Ghia's post and
jimmyx's post above, i can suggest you a solution.
In french here.And the translation :
So, I suggest a first test with the addition of a field (date_birthday) in the 'profile' module, and displaying this date into 'yogurt' module.
I first created a field (date format) in the module 'profile' (under XOOPS 2.3.x, profil 1.51 and yogurt 3.3).
The label is 'Date of birth', and the name of the field in the database will be 'date_birthday'.
Then I edit my profile in module 'profile', and I set a date of birth.
I found this date in my profile.
edit /modules/yogurt/index.php
And juste before the line :
include("../../footer.php");
Add :
$profile_handler =& xoops_getmodulehandler('profile','profile');
$profile = $profile_handler->get($xoopsUser->getVar('uid'));
$date_birthday = date('d/m/Y', $profile->getVar('date_birthday'));
$xoopsTpl->assign('date_birthday',$date_birthday);
As this date is stored as an integer, I use the php function 'date' to change the format.
I can now use the smarty variable :
<{$date_birthday}>
That's what I do with the file
/modules/yogurt/templates/yogurt/index.html, changing the line 105:
<p class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:span><span class="yogurt-profileinfo-value"><{$user_uname}>span>p>
With :
<p class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:span><span class="yogurt-profileinfo-value"><{$user_uname}> - <{$date_birthday}>span>p>
Wich displays :
I can use this variable everywhere in the template.
In case of text variable, you can use this simple code :
$my_variable = $profile->getVar('my_text_variable');
$xoopsTpl->assign('my_text_variable',$my_variable);
Instead of :
$date_birthday = date('d/m/Y', $profile->getVar('date_birthday'));
$xoopsTpl->assign('date_birthday',$date_birthday);
I can the display this variable where I want with
<{$my_text_variable}>