本文整理匯總了PHP中IPSMember::buildAvatar方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::buildAvatar方法的具體用法?PHP IPSMember::buildAvatar怎麽用?PHP IPSMember::buildAvatar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::buildAvatar方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDisplayContent
/**
* Returns content for the page.
*
* @access public
* @author Matt Mecham
* @param array Member data
* @return array Array of tabs, content
*/
public function getDisplayContent($member = array())
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_forums'), 'forums');
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_member_form'), 'forums');
//-----------------------------------------
// Get member data
//-----------------------------------------
$member = IPSMember::load($member['member_id'], 'extendedProfile');
$member['_avatar'] = str_replace('<img ', '<img id="MF__avatar" ', IPSMember::buildAvatar($member));
//-----------------------------------------
// Show...
//-----------------------------------------
return array('tabs' => $this->html->acp_member_form_tabs($member), 'content' => $this->html->acp_member_form_main($member));
}
示例2: recent_topics_last_x
//.........這裏部分代碼省略.........
return;
}
$this->DB->build(array('select' => 't.*', 'from' => array('topics' => 't'), 'where' => "t.tid IN (" . implode(",", array_values($all)) . ")", 'add_join' => array(array('select' => 'p.*', 'from' => array('posts' => 'p'), 'where' => 'p.pid=t.topic_firstpost', 'type' => 'left'), array('select' => 'f.use_html', 'from' => array('forums' => 'f'), 'where' => "f.id=t.forum_id", 'type' => 'left'), array('select' => 'm.member_id, m.members_display_name, m.member_group_id, m.members_seo_name, m.mgroup_others, m.login_anonymous, m.last_visit, m.last_activity', 'from' => array('members' => 'm'), 'where' => 'm.member_id=p.author_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
$outer = $this->DB->execute();
//-----------------------------------------
// Loop through..
//-----------------------------------------
while ($row = $this->DB->fetch($outer)) {
$data[$row['tid']] = $row;
}
krsort($unpinned);
krsort($pinned);
foreach ($unpinned as $date => $tid) {
if (count($pinned) < $limit) {
$pinned[$date] = $tid;
} else {
break;
}
$count++;
}
/* Now put it altogether */
foreach ($pinned as $date => $tid) {
//-----------------------------------------
// INIT
//-----------------------------------------
$entry = $data[$tid];
$bottom_string = "";
$read_more = "";
$top_string = "";
$got_these_attach = 0;
if ($entry['topic_hasattach']) {
$parseAttachments = true;
}
//-----------------------------------------
// Parse the post
//-----------------------------------------
IPSText::getTextClass('bbcode')->parse_smilies = $entry['use_emo'];
IPSText::getTextClass('bbcode')->parse_html = ($entry['use_html'] and $entry['post_htmlstate']) ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_nl2br = $entry['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'topics';
IPSText::getTextClass('bbcode')->parsing_mgroup = $entry['member_group_id'];
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $entry['mgroup_others'];
$entry['post'] = IPSText::getTextClass('bbcode')->preDisplayParse($entry['post']);
//-----------------------------------------
// BASIC INFO
//-----------------------------------------
$real_posts = $entry['posts'];
$entry['posts'] = ipsRegistry::getClass('class_localization')->formatNumber(intval($entry['posts']));
if (!$entry['author_id']) {
$entry['members_display_name'] = $this->settings['guest_name_pre'] . $entry['author_name'] . $this->settings['guest_name_suf'];
$entry['member_id'] = 0;
} else {
$entry = IPSMember::buildDisplayData($entry);
}
//-----------------------------------------
// Get Date
//-----------------------------------------
$entry['date'] = $this->registry->class_localization->getDate($entry['post_date'], "manual{" . $this->settings['csite_article_date'] . "}");
//-----------------------------------------
// Attachments?
//-----------------------------------------
if ($entry['pid']) {
$attach_pids[$entry['pid']] = $entry['pid'];
}
//-----------------------------------------
// Avatar
//-----------------------------------------
$entry['avatar'] = IPSMember::buildAvatar($entry);
if (IPSMember::checkPermissions('download', $entry['forum_id']) === FALSE) {
$this->settings['show_img_upload'] = 0;
}
//-----------------------------------------
// View image...
//-----------------------------------------
$entry['post'] = IPSText::getTextClass('bbcode')->memberViewImages($entry['post']);
$rows[] = $entry;
}
$output = $this->registry->getClass('output')->getTemplate('portal')->articles($rows);
//-----------------------------------------
// Process Attachments
//-----------------------------------------
if ($parseAttachments and count($attach_pids)) {
if (!is_object($this->class_attach)) {
//-----------------------------------------
// Grab render attach class
//-----------------------------------------
require_once IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php';
$this->class_attach = new class_attach($this->registry);
$this->class_attach->attach_post_key = '';
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_topic'), 'forums');
}
$this->class_attach->attach_post_key = '';
$this->class_attach->type = 'post';
$this->class_attach->init();
$output = $this->class_attach->renderAttachments($output, $attach_pids);
$output = $output[0]['html'];
}
return $output;
}
示例3: formAvatar
/**
* Show the avatar page
*
* @access public
* @author Matt Mecham
* @return string Processed HTML
*/
public function formAvatar()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member = IPSMember::load($this->memberData['member_id'], 'extendedProfile,customFields,groups');
//-----------------------------------------
// Check to make sure that we can edit profiles..
//-----------------------------------------
if (!$member['g_edit_profile']) {
$this->registry->getClass('output')->showError('members_profile_disabled', 1021);
}
if (!$this->settings['avatars_on']) {
$this->registry->getClass('output')->showError('members_profile_disabled', 1030);
}
//-----------------------------------------
// Organise the dimensions
//-----------------------------------------
if (strpos($this->memberData['avatar_size'], "x")) {
list($this->settings['currentWidth'], $this->settings['currentHeight']) = explode("x", strtolower($member['avatar_size']));
}
list($this->settings['maxWidth'], $this->settings['maxHeight']) = explode("x", strtolower($this->settings['avatar_dims']));
list($w, $h) = explode("x", strtolower($this->settings['avatar_def']));
//-----------------------------------------
// Get the avatar gallery
//-----------------------------------------
$av_categories = array_merge(array(0 => array(0, '< ' . $this->lang->words['av_root'] . ' >')), IPSMember::getFunction()->getHostedAvatarCategories());
//-----------------------------------------
// Get the avatar gallery selected
//-----------------------------------------
$url_avatar = "http://";
$avatar_type = "na";
if ($member['avatar_location'] != "" and $member['avatar_location'] != "noavatar") {
if (!$member['avatar_type']) {
if (preg_match("/^upload:/", $member['avatar'])) {
$avatar_type = "upload";
} else {
if (!preg_match("/^http/i", $member['avatar'])) {
$avatar_type = "local";
} else {
$url_avatar = $member['avatar'];
$avatar_type = "url";
}
}
} else {
switch ($member['avatar_type']) {
case 'upload':
$avatar_type = 'upload';
break;
case 'url':
$avatar_type = 'url';
$url_avatar = $member['avatar_location'];
break;
case 'gravatar':
$avatar_type = 'gravatar';
break;
default:
$avatar_type = 'local';
break;
}
}
}
//-----------------------------------------
// Rest of the form..
//-----------------------------------------
if ($member['g_avatar_upload'] == 1) {
$this->uploadFormMax = 9000000;
}
//-----------------------------------------
// Force a form action?
//-----------------------------------------
$is_reset = 0;
if ($this->settings['upload_domain']) {
$is_reset = 1;
$original = $this->settings['base_url'];
if ($this->member->session_type == 'cookie') {
$this->settings['base_url'] = $this->settings['upload_domain'] . '/index.' . $this->settings['php_ext'] . '?';
} else {
$this->settings['base_url'] = $this->settings['upload_domain'] . '/index.' . $this->settings['php_ext'] . '?s=' . $this->member->session_id . '&';
}
}
//-----------------------------------------
// If yes, show little thingy at top
//-----------------------------------------
$this->lang->words['av_allowed_files'] = sprintf($this->lang->words['av_allowed_files'], implode(' .', explode("|", $this->settings['avatar_ext'])));
$return = $this->registry->getClass('output')->getTemplate('ucp')->memberAvatarForm(array('member' => $member, 'avatar_categories' => $av_categories, 'current_url_avatar' => $url_avatar, 'current_avatar_image' => IPSMember::buildAvatar($member, 0, 1), 'current_avatar_type' => $this->lang->words['av_t_' . $avatar_type], 'current_avatar_dims' => $avatar_type != 'gravatar' ? $member['avatar_size'] == "x" ? "" : $member['avatar_size'] : ''));
//-----------------------------------------
// Reset forced form action?
//-----------------------------------------
if ($is_reset) {
$this->settings['base_url'] = $original;
}
return $return;
//.........這裏部分代碼省略.........
示例4: avatar
/**
* @desc Returns the HTML code to show a member's avatar.
* @param int $userID User ID. If $userID is ommited, the last known member id is used.
* @return string HTML Code for member's avatar, or false on failure
* @author Matthias Reuter
* @sample
* <code>
* $ipbwi->member->avatar(5);
* </code>
* @since 2.0
*/
public function avatar($userID = false)
{
// No Member ID specified? Go for the current users UID.
$member = $this->info($userID);
$avatar = IPSMember::buildAvatar($member);
#$avatar = str_replace('http://www.gravatar.com/avatar/f4b24f6f1dad5d1dfb39dcb281897203?d=http%3A%2F%2Froot.pc-intern.com%2Fdevelopment%2Fprojects.pc-intern.com%2Fpublic%2Fstyle_avatars%2Fblank_avatar.gif','http://root.pc-intern.com/development/projects.pc-intern.com/public/style_images/master/profile/default_thumb.png',$avatar);
return $avatar;
}
示例5: define
* @subpackage Members
* @link http://www.
* @version $Rev$
*
*/
//-----------------------------------------
// Get stuff we need
//-----------------------------------------
define('IPB_THIS_SCRIPT', 'api');
define('IPB_LOAD_SQL', 'queries');
require_once '../../initdata.php';
require_once IPS_ROOT_PATH . 'sources/base/ipsRegistry.php';
$registry = ipsRegistry::instance();
$registry->init();
$id = intval(ipsRegistry::$request['id']);
$member = IPSMember::load($id);
$avatar = IPSMember::buildAvatar($member);
//-----------------------------------------
// Print avatar
//-----------------------------------------
print <<<HTML
<!DOCTYPE html
\t PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
\t "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
\t<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
\t<head>
\t</head>
\t<body>{$avatar}</body>
\t</html>
HTML;
exit;