本文整理匯總了PHP中Surfer::get_avatar_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP Surfer::get_avatar_url方法的具體用法?PHP Surfer::get_avatar_url怎麽用?PHP Surfer::get_avatar_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Surfer
的用法示例。
在下文中一共展示了Surfer::get_avatar_url方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: build_mail_content
/**
* build main content of a message
*
* Note: this function returns legacy HTML, not modern XHTML, because this is what most
* e-mail client software can afford.
*
* @param string headline
* @param string main content
* @return string text to be send by e-mail
*/
public static function build_mail_content($headline, $content = '')
{
global $context;
// start the notification
$text = '';
// the illustrated headline
if ($headline) {
// insert poster image, if possible
if ($url = Surfer::get_avatar_url()) {
$text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="middle">' . '<td align="left" valign="middle" width="9%"><img src="' . $url . '" alt="" title="avatar"></td>' . '<td width="1%"> </td>' . '<td align="left" valign="middle" width="90%">' . '<font face="Helvetica, Arial, sans-serif" color="navy" size="+1">' . $headline . '</font>' . '</td>' . '</tr>' . '</table>';
} else {
$text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="middle">' . '<td align="left" valign="middle" width="100%">' . '<font face="Helvetica, Arial, sans-serif" color="navy" size="+1">' . $headline . '</font>' . '</td>' . '</tr>' . '</table>';
}
}
// the full content
if ($content) {
$text .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . '<tr valign="top">' . '<td align="left" valign="top" width="100%">' . '<div style="border-left: solid 2px #ccc; padding: 10px 0 10px 10px; margin: 20px 0;">' . '<font face="Helvetica, Arial, sans-serif" color="navy">' . $content . '</font>' . '</div>' . '</td>' . '</tr>' . '</table>';
}
// the full message
return $text;
}