本文整理匯總了PHP中VTCacheUtils::setUserSignature方法的典型用法代碼示例。如果您正苦於以下問題:PHP VTCacheUtils::setUserSignature方法的具體用法?PHP VTCacheUtils::setUserSignature怎麽用?PHP VTCacheUtils::setUserSignature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::setUserSignature方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addSignature
/** Funtion to add the user's signature with the content passed
* $contents -- where we want to add the signature
* $fromname -- which user's signature will be added to the contents
*/
function addSignature($contents, $fromname)
{
$adb = PearDatabase::getInstance();
$adb->println("Inside the function addSignature");
$sign = VTCacheUtils::getUserSignature($fromname);
if ($sign === null) {
$result = $adb->pquery("select signature, first_name, last_name from vtiger_users where user_name=?", array($fromname));
$sign = $adb->query_result($result, 0, "signature");
VTCacheUtils::setUserSignature($fromname, $sign);
VTCacheUtils::setUserFullName($fromname, $adb->query_result($result, 0, "first_name") . ' ' . $adb->query_result($result, 0, "last_name"));
}
$sign = nl2br($sign);
if ($sign != '') {
$contents .= '<br><br>' . $sign;
$adb->println("Signature is added with the body => '." . $sign . "'");
} else {
$adb->println("Signature is empty for the user => '" . $fromname . "'");
}
return $contents;
}