本文整理汇总了PHP中VTCacheUtils::getUserSignature方法的典型用法代码示例。如果您正苦于以下问题:PHP VTCacheUtils::getUserSignature方法的具体用法?PHP VTCacheUtils::getUserSignature怎么用?PHP VTCacheUtils::getUserSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTCacheUtils
的用法示例。
在下文中一共展示了VTCacheUtils::getUserSignature方法的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;
}