26/10/2010, 23:00:08
Base-toi sur le code du plugin :
tu récupères l'output et tu le places dans la fonction mail.
Code :
function smarty_cms_function_last_modified_by($params, &$smarty)
{
global $gCms;
$pageinfo = $gCms->variables['pageinfo'];
$id = "";
if (isset($pageinfo) && $pageinfo->content_last_modified_by_id > -1)
{
$id = $pageinfo->content_last_modified_by_id;
} else {
return "";
}
if(empty($params['fofunction smarty_cms_function_last_modified_by($params, &$smarty)
{
global $gCms;
$pageinfo = $gCms->variables['pageinfo'];
$id = "";
if (isset($pageinfo) && $pageinfo->content_last_modified_by_id > -1)
{
$id = $pageinfo->content_last_modified_by_id;
} else {
return "";
}
if(empty($params['format']))
{
$format = "id";
}
else
{
$format = $params['format'];
$userops =& $gCms->GetUserOperations();
$thisuser =& $userops->LoadUserByID($id);
}
$output = '';
if($format==="id") {
$output = $id;
} else if ($format==="username") {
$output = cms_htmlentities($thisuser->username);
} else if ($format==="fullname") {
$output = cms_htmlentities($thisuser->firstname ." ". $thisuser->lastname);
}
if( isset($params['assign']) ) {
$smarty = $gCms->GetSmarty();
$smarty->assign($params['assign'],$output);
return;
}
return $output;
}