当前位置: 首页>>代码示例>>PHP>>正文


PHP get_user_avatar函数代码示例

本文整理汇总了PHP中get_user_avatar函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_avatar函数的具体用法?PHP get_user_avatar怎么用?PHP get_user_avatar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_user_avatar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wp_user_avatars_ajax_assign_media

/**
 * AJAX callback for setting media ID as user avatar
 *
 * @since 0.1.0
 */
function wp_user_avatars_ajax_assign_media()
{
    // check required information and permissions
    if (empty($_POST['user_id']) || empty($_POST['media_id']) || empty($_POST['_wpnonce'])) {
        die;
    }
    // Cast values
    $media_id = (int) $_POST['media_id'];
    $user_id = (int) $_POST['user_id'];
    // Bail if current user cannot proceed
    if (!current_user_can('upload_avatars') || !current_user_can('edit_avatar', $user_id)) {
        die;
    }
    // Bail if nonce verification fails
    if (!wp_verify_nonce($_POST['_wpnonce'], 'assign_wp_user_avatars_nonce')) {
        die;
    }
    // ensure the media is real is an image
    if (wp_attachment_is_image($media_id)) {
        wp_user_avatars_update_avatar($user_id, $media_id);
    }
    // Output the new avatar
    if (defined('DOING_AJAX') && DOING_AJAX) {
        echo get_user_avatar($user_id, 90);
        die;
    }
}
开发者ID:strangerstudios,项目名称:wp-user-avatars,代码行数:32,代码来源:ajax.php

示例2: get_medal

 public function get_medal()
 {
     $user_id = intval($GLOBALS['user_info']['id']);
     $medal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "medal where class_name = 'Newuser'");
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
     $data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_medal where medal_id = " . $medal['id'] . " and user_id = " . $user_id);
     if ($data) {
         //已经领取
         $result['status'] = 2;
         $result['info'] = "您已经领取过" . $medal['name'];
     } else {
         if ($user_info['mobile'] != "" && $user_info['province_id'] != 0 && $user_info['city_id'] != 0 && $user_info['byear'] != 0 && $user_info['bmonth'] != 0 && $user_info['bday'] != 0 && $user_info['sex'] != -1 && trim($user_info['my_intro']) != '' && get_user_avatar($user_id, "small") != APP_ROOT . "/public/avatar/noavatar_small.gif") {
             $link_data['user_id'] = $user_id;
             $link_data['medal_id'] = $medal['id'];
             $link_data['name'] = $medal['name'];
             $link_data['icon'] = $medal['icon'];
             $link_data['create_time'] = TIME_UTC;
             $GLOBALS['db']->autoExecute(DB_PREFIX . "user_medal", $link_data);
             $result['status'] = 1;
             //领取成功
             $result['info'] = "您已经成功领取" . $medal['name'];
         } else {
             $result['status'] = 0;
             $result['info'] = "您的个人资料未完善以及头像";
             $result['jump'] = url("shop", "uc_account");
         }
     }
     return $result;
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:29,代码来源:Newuser_medal.php

示例3: index

 public function index()
 {
     if (empty($_POST['phone']) || empty($_POST['sig'])) {
         echo json_encode(array('ret' => '104', 'msg' => '身份验证失败'));
     } else {
         $phone = $_POST['phone'];
         $sig = $_POST['sig'];
         $point = $GLOBALS['db']->getOne("select point from pl_user where phone =" . $phone);
         $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where mobile =" . $phone);
         if (!$user) {
             echo json_encode(array('ret' => '-1', 'msg' => '用户不存在'));
             exit;
         }
         // 获取头像
         $small_avatar = get_user_avatar($user['id'], 'small');
         $middle_avatar = get_user_avatar($user['id'], 'middle');
         //获取我的订单数目
         $deal_order_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where user_id=" . $user['id']);
         // 获取我的地址数目
         $consignee_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_consignee where user_id=" . $user['id']);
         // 获取我的等级名称
         $level_name = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "user_level where id=" . $user['level_id']);
         // 我的发布
         $taoxin_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "taoxin where uid=" . $user['id']);
         // 我的购物车数目
         $deal_cart_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_cart where session_id='app' and user_id=" . $user['id']);
         $result = array('ret' => '0', 'small_url' => $small_avatar, 'middle_url' => $middle_avatar, 'small_avatar' => $small_avatar, 'middle_avatar' => $middle_avatar, 'deal_order_count' => $deal_order_count, 'consignee_count' => $consignee_count, 'taoxin_count' => $taoxin_count, 'deal_cart_count' => $deal_cart_count, 'level_id' => $user['level_id'], 'level_name' => empty($level_name) ? "初入江湖" : $level_name, 'score' => $user['score'], 'point' => $point, 'my_intro' => $user['my_intro'], 'uname' => $user['user_name']);
         array_recursive($result, 'strval');
         echo json_encode($result);
     }
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:31,代码来源:appuserModule.class.php

示例4: add_user_to_user_cache

 /**
  *
  */
 public static function add_user_to_user_cache(&$user_cache, $row)
 {
     global $auth, $config, $user;
     $user_id = $row['user_id'];
     if ($user_id == ANONYMOUS) {
         $user_cache[$user_id] = array('joined' => '', 'posts' => '', 'from' => '', 'sig' => '', 'sig_bbcode_uid' => '', 'sig_bbcode_bitfield' => '', 'online' => false, 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'sig' => '', 'profile' => '', 'pm' => '', 'email' => '', 'www' => '', 'icq_status_img' => '', 'icq' => '', 'aim' => '', 'msn' => '', 'yim' => '', 'jabber' => '', 'search' => '', 'age' => '', 'gallery_album' => '', 'gallery_images' => '', 'gallery_search' => '', 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'warnings' => 0, 'allow_pm' => 0);
         get_user_rank($row['user_rank'], false, $user_cache[$user_id]['rank_title'], $user_cache[$user_id]['rank_image'], $user_cache[$user_id]['rank_image_src']);
     } else {
         $user_sig = '';
         if ($row['user_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) {
             $user_sig = $row['user_sig'];
         }
         $id_cache[] = $user_id;
         $user_cache[$user_id] = array('joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => isset($row['user_warnings']) ? $row['user_warnings'] : 0, 'from' => !empty($row['user_from']) ? $row['user_from'] : '', 'sig' => $user_sig, 'sig_bbcode_uid' => !empty($row['user_sig_bbcode_uid']) ? $row['user_sig_bbcode_uid'] : '', 'sig_bbcode_bitfield' => !empty($row['user_sig_bbcode_bitfield']) ? $row['user_sig_bbcode_bitfield'] : '', 'viewonline' => $row['user_allow_viewonline'], 'allow_pm' => $row['user_allow_pm'], 'avatar' => $user->optionget('viewavatars') ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '', 'age' => '', 'rank_title' => '', 'rank_image' => '', 'rank_image_src' => '', 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'online' => false, 'profile' => phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=viewprofile&u={$user_id}"), 'www' => $row['user_website'], 'aim' => $row['user_aim'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=aim&u={$user_id}") : '', 'msn' => $row['user_msnm'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=msnm&u={$user_id}") : '', 'yim' => $row['user_yim'] ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&.src=pg' : '', 'jabber' => $row['user_jabber'] && $auth->acl_get('u_sendim') ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=contact&action=jabber&u={$user_id}") : '', 'search' => $auth->acl_get('u_search') ? phpbb_gallery_url::append_sid('phpbb', 'search', "author_id={$user_id}&sr=posts") : '', 'gallery_album' => $row['personal_album_id'] && phpbb_gallery_config::get('viewtopic_icon') ? phpbb_gallery_url::append_sid('album', "album_id=" . $row['personal_album_id']) : '', 'gallery_images' => phpbb_gallery_config::get('viewtopic_images') ? $row['user_images'] : 0, 'gallery_search' => phpbb_gallery_config::get('viewtopic_images') && phpbb_gallery_config::get('viewtopic_link') && $row['user_images'] ? phpbb_gallery_url::append_sid('search', "user_id={$user_id}") : '');
         get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$user_id]['rank_title'], $user_cache[$user_id]['rank_image'], $user_cache[$user_id]['rank_image_src']);
         if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email')) {
             $user_cache[$user_id]['email'] = $config['board_email_form'] && $config['email_enable'] ? phpbb_gallery_url::append_sid('phpbb', 'memberlist', "mode=email&u={$user_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') ? '' : 'mailto:' . $row['user_email']);
         } else {
             $user_cache[$user_id]['email'] = '';
         }
         if (!empty($row['user_icq'])) {
             $user_cache[$user_id]['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $row['user_icq'];
             $user_cache[$user_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&amp;img=5" width="18" height="18" alt="" />';
         } else {
             $user_cache[$user_id]['icq_status_img'] = '';
             $user_cache[$user_id]['icq'] = '';
         }
         if ($config['allow_birthdays'] && !empty($row['user_birthday'])) {
             list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday']));
             if ($bday_year) {
                 $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
                 $diff = $now['mon'] - $bday_month;
                 if ($diff == 0) {
                     $diff = $now['mday'] - $bday_day < 0 ? 1 : 0;
                 } else {
                     $diff = $diff < 0 ? 1 : 0;
                 }
                 $user_cache[$user_id]['age'] = (int) ($now['year'] - $bday_year - $diff);
             }
         }
     }
 }
开发者ID:phpbbgallery,项目名称:phpbb-gallery,代码行数:45,代码来源:helpers.php

示例5: get_header

*/
?>

<?php 
get_header();
?>

<div class="content">


<h1 class="questiontitle"><?php 
the_title();
?>
</h1>

<?php 
global $wpdb, $table_prefix;
$users = $wpdb->get_results("select u.*, IFNULL(p.points, 0) as u_points from " . $wpdb->users . " u left join " . $table_prefix . 'user_points' . " p on u.ID=p.user_id order by u_points desc limit 20");
foreach ($users as $user) {
    ?>

<div class="topusers" style="clear:left;">
<p class="topusersimg">
<a href="<?php 
    echo get_bloginfo('url') . '/?p=' . get_option('viewprofile_page_id') . '&profile=' . $user->user_login;
    ?>
"><?php 
    echo get_user_avatar($user->ID);
    ?>
</a></p>
<div class="submittedbyhome"><a href="<?php 
开发者ID:gp6shc,项目名称:aok,代码行数:31,代码来源:top-users.php

示例6: get_user_avatar

// - new posts since last visit & you post number
//


// Get user...
$user_id = $user->data['user_id'];
$username = $user->data['username'];

$sql = 'SELECT *
	FROM ' . USERS_TABLE . '
	WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id");
$result = $db->sql_query($sql);
$member = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
		
$avatar_img = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);

$rank_title = $rank_img = '';
get_user_rank($member['user_rank'], $member['user_posts'], $rank_title, $rank_img, $rank_img_src);
		
$username = $member['username'];
$user_id = (int) $member['user_id'];
$colour = $member['user_colour'];

// Assign specific vars
$template->assign_vars(array(
	'L_NEW_POSTS'	=> $user->lang['SEARCH_NEW'] . '&nbsp;(' . $new_posts_count . ')',
	'L_SELF_POSTS'	=> $user->lang['SEARCH_SELF'] . '&nbsp;(' . $you_posts_count . ')',

	'AVATAR_IMG'	=> $avatar_img,
	
开发者ID:sietf,项目名称:sietf.org,代码行数:30,代码来源:user_menu.php

示例7: mcp_warn_user_view

	/**
	* Handles warning the user
	*/
	function mcp_warn_user_view($action)
	{
		global $phpEx, $phpbb_root_path, $config, $module;
		global $template, $db, $user, $auth;

		$user_id = request_var('u', 0);
		$username = request_var('username', '', true);
		$notify = (isset($_REQUEST['notify_user'])) ? true : false;
		$warning = utf8_normalize_nfc(request_var('warning', '', true));

		$sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";

		$sql = 'SELECT *
			FROM ' . USERS_TABLE . '
			WHERE ' . $sql_where;
		$result = $db->sql_query($sql);
		$user_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$user_row)
		{
			trigger_error('NO_USER');
		}

		// Prevent someone from warning themselves
		if ($user_row['user_id'] == $user->data['user_id'])
		{
			trigger_error('CANNOT_WARN_SELF');
		}

		$user_id = $user_row['user_id'];

		if (strpos($this->u_action, "&amp;u=$user_id") === false)
		{
			$this->p_master->adjust_url('&amp;u=' . $user_id);
			$this->u_action .= "&amp;u=$user_id";
		}

		if ($warning && $action == 'add_warning')
		{
			if (check_form_key('mcp_warn'))
			{
				add_warning($user_row, $warning, $notify);
				$msg = $user->lang['USER_WARNING_ADDED'];
			}
			else
			{
				$msg = $user->lang['FORM_INVALID'];
			}
			$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&amp;mode=user_notes&amp;u=$user_id");
			meta_refresh(2, $redirect);
			trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
		}

		// Generate the appropriate user information for the user we are looking at
		if (!function_exists('get_user_avatar'))
		{
			include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
		}

		$rank_title = $rank_img = '';
		$avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);

		// OK, they didn't submit a warning so lets build the page for them to do so
		$template->assign_vars(array(
			'U_POST_ACTION'		=> $this->u_action,

			'USERNAME'			=> $user_row['username'],
			'USER_COLOR'		=> (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
			'RANK_TITLE'		=> $rank_title,
			'JOINED'			=> $user->format_date($user_row['user_regdate']),
			'POSTS'				=> ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
			'WARNINGS'			=> ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,

			'AVATAR_IMG'		=> $avatar_img,
			'RANK_IMG'			=> $rank_img,
		));

		return $user_id;
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:83,代码来源:mcp_warn.php

示例8: investor_detailed_information

 function investor_detailed_information()
 {
     $id = intval($_REQUEST['id']);
     $result = array('status' => '', 'info' => '', 'url' => '', 'html' => '');
     if ($id > 0) {
         //投资人信息
         $investor_info = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "user where id ={$id}");
         foreach ($investor_info as $k => $v) {
             $investor_info['image'] = get_user_avatar($v['id'], "middle");
         }
         $GLOBALS['tmpl']->assign("investor_info", $investor_info);
         $result['html'] = $GLOBALS['tmpl']->fetch("inc/investor_detailed_info.html");
         $result['status'] = 1;
         $result['user_name'] = $investor_info['user_name'];
         ajax_return($result);
     } else {
         $result['status'] = 2;
         $result['info'] = "系统繁忙,请您稍后重试!";
         ajax_return($result);
     }
     return false;
 }
开发者ID:BruceJi,项目名称:fanwe,代码行数:22,代码来源:ajaxModule.class.php

示例9: init_deal_page_wap

function init_deal_page_wap($deal_info)
{
    $GLOBALS['tmpl']->assign("page_title", $deal_info['name']);
    if ($deal_info['seo_title'] != "") {
        $GLOBALS['tmpl']->assign("seo_title", $deal_info['seo_title']);
    }
    if ($deal_info['seo_keyword'] != "") {
        $GLOBALS['tmpl']->assign("seo_keyword", $deal_info['seo_keyword']);
    }
    if ($deal_info['seo_description'] != "") {
        $GLOBALS['tmpl']->assign("seo_description", $deal_info['seo_description']);
    }
    //开启限购后剩余几位
    $deal_info['deal_item_count'] = 0;
    foreach ($deal_info['deal_item_list'] as $k => $v) {
        // 统计所有真实+虚拟(钱)
        $deal_info['total_virtual_person'] += $v['virtual_person'];
        $deal_info['total_virtual_price'] += $v['price'] * $v['virtual_person'] + $v['support_amount'];
        //统计每个子项目真实+虚拟(钱)
        $deal_info['deal_item_list'][$k]['person'] = $v['virtual_person'] + $v['support_count'];
        $deal_info['deal_item_list'][$k]['money'] = $v['price'] * $v['virtual_person'] + $v['support_amount'];
        $deal_info['deal_item_list'][$k]['cart_url'] = url_wap("cart#index", array("id" => $v['id']));
        if ($v['limit_user']) {
            $deal_info['deal_item_list'][$k]['remain_person'] = $v['limit_user'] - $v['virtual_person'] - $v['support_count'];
        }
        $deal_info['deal_item_count']++;
    }
    //	$deal_info['deal_type']=$GLOBALS['db']->getOne("select name from ".DB_PREFIX."deal_cate where id=".$deal_info['cate_id']);
    $deal_info['tags_arr'] = preg_split("/[ ,]/", $deal_info['tags']);
    $deal_info['support_amount_format'] = number_price_format($deal_info['support_amount']);
    $deal_info['limit_price_format'] = number_price_format($deal_info['limit_price']);
    $deal_info['total_virtual_price_format'] = number_price_format(intval($deal_info['total_virtual_price']));
    $deal_info['remain_days'] = floor(($deal_info['end_time'] - NOW_TIME) / (24 * 3600));
    $deal_info['percent'] = round($deal_info['support_amount'] / $deal_info['limit_price'] * 100);
    //$deal_info['deal_level']=$GLOBALS['db']->getOne("select level from ".DB_PREFIX."deal_level where id=".intval($deal_info['user_level']));
    $deal_info['person'] = $deal_info['total_virtual_person'] + $deal_info['support_count'];
    $deal_info['percent'] = round($deal_info['total_virtual_price'] / $deal_info['limit_price'] * 100);
    $deal_info['update_url'] = url_wap("deal#update", array("id" => $deal_info['id']));
    $deal_info['comment_url'] = url_wap("deal#comment", array("id" => $deal_info['id']));
    $deal_info['info_url'] = url_wap("deal#info", array("id" => $deal_info['id']));
    if ($deal_info['begin_time'] > NOW_TIME) {
        $deal_info['status'] = '0';
        $deal_info['left_days'] = floor(($deal_info['begin_time'] - NOW_TIME) / (24 * 3600));
    } elseif ($deal_info['end_time'] < NOW_TIME && $deal_info['end_time'] > 0) {
        if ($deal_info['percent'] >= 100) {
            $deal_info['status'] = '1';
        } else {
            $deal_info['status'] = '2';
        }
    } else {
        if ($deal_info['end_time'] > 0) {
            $deal_info['status'] = '3';
        } else {
            $deal_info['status'] = '4';
        }
    }
    if ($GLOBALS['user_info']) {
        $is_focus = $GLOBALS['db']->getOne("select  count(*) from " . DB_PREFIX . "deal_focus_log where deal_id = " . $deal_info['id'] . " and user_id = " . intval($GLOBALS['user_info']['id']));
        $GLOBALS['tmpl']->assign("is_focus", $is_focus);
    }
    if ($deal_info['user_id'] > 0) {
        $deal_user_info = $GLOBALS['db']->getRow("select id,user_name,province,city,intro,login_time from " . DB_PREFIX . "user where id = " . $deal_info['user_id'] . " and is_effect = 1");
        if ($deal_user_info) {
            $deal_user_info['weibo_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_weibo where user_id = " . $deal_user_info['id']);
            $deal_user_info['image'] = get_user_avatar($deal_user_info['id'], 'middle');
            $deal_info['user_info'] = $deal_user_info;
        }
    }
    if (!empty($deal_info['vedio']) && !preg_match("/http://player.youku.com/embed/i", $deal_info['source_video'])) {
        $deal_info['source_vedio'] = preg_replace("/id_(.*)\\.html(.*)/i", "http://player.youku.com/embed/\${1}", baseName($deal_info['vedio']));
        $GLOBALS['db']->query("update " . DB_PREFIX . "deal set source_vedio='" . $deal_info['source_vedio'] . "'  where id=" . $deal_info['id']);
    }
    $GLOBALS['tmpl']->assign("deal_info", $deal_info);
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:74,代码来源:functions.php

示例10: preview

 function preview()
 {
     $deal['id'] = 'XXX';
     $deal_loan_type_list = load_auto_cache("deal_loan_type_list");
     if (intval($_REQUEST['quota']) == 1) {
         $deal = $GLOBALS['db']->getRow("SELECT * FROM " . DB_PREFIX . "deal_quota_submit WHERE status=1 and user_id = " . $GLOBALS['user_info']['id'] . " ORDER BY id DESC");
         $type_id = intval($deal['type_id']);
         $deal['rate_foramt'] = number_format($deal['rate'], 2);
         $data['view_info'] = unserialize($deal['view_info']);
         if ($deal['cate_id'] > 0) {
             $deal['cate_info'] = $GLOBALS['db']->getRowCached("select id,name,brief,uname,icon from " . DB_PREFIX . "deal_cate where id = " . $deal['cate_id'] . " and is_effect = 1 and is_delete = 0");
         }
         $deal['repay_time'] = strim($_REQUEST['repay_time']);
         $deal['repay_time_type'] = 1;
     } else {
         $deal['name'] = strim($_REQUEST['borrowtitle']);
         $type_id = intval($_REQUEST['borrowtype']);
         $deal['repay_time_type'] = intval($_REQUEST['repaytime_type']);
         $deal['rate_foramt'] = number_format(strim($_REQUEST['apr']), 2);
         $deal['repay_time'] = strim($_REQUEST['repaytime']);
         $icon_type = strim($_REQUEST['imgtype']);
         $icon_type_arr = array('upload' => 1, 'userImg' => 2, 'systemImg' => 3);
         $data['icon_type'] = $icon_type_arr[$icon_type];
         switch ($data['icon_type']) {
             case 1:
                 $deal['icon'] = replace_public(strim($_REQUEST['icon']));
                 break;
             case 2:
                 $deal['icon'] = replace_public(get_user_avatar($GLOBALS['user_info']['id'], 'big'));
                 break;
             case 3:
                 $deal['icon'] = $GLOBALS['db']->getOneCached("SELECT icon FROM " . DB_PREFIX . "deal_loan_type WHERE id=" . intval($_REQUEST['systemimgpath']));
         }
         $deal['description'] = replace_public(valid_str(bstrim($_REQUEST['borrowdesc'])));
         $user_view_info = $GLOBALS['user_info']['view_info'];
         $user_view_info = unserialize($user_view_info);
         $new_view_info_arr = array();
         for ($i = 1; $i <= intval($_REQUEST['file_upload_count']); $i++) {
             $img_info = array();
             $img = replace_public(strim($_REQUEST['file_' . $i]));
             if ($img != "") {
                 $img_info['name'] = strim($_REQUEST['file_name_' . $i]);
                 $img_info['img'] = $img;
                 $img_info['is_user'] = 1;
                 $user_view_info[] = $img_info;
                 $ss = $user_view_info;
                 end($ss);
                 $key = key($ss);
                 $new_view_info_arr[$key] = $img_info;
             }
         }
         $data['view_info'] = array();
         foreach ($_REQUEST['file_key'] as $k => $v) {
             if (isset($user_view_info[$v])) {
                 $data['view_info'][$v] = $user_view_info[$v];
             }
         }
         foreach ($new_view_info_arr as $k => $v) {
             $data['view_info'][$k] = $v;
         }
         if ($deal['cate_id'] > 0) {
             $deal['cate_info']['name'] = "借款预览标";
         }
     }
     $deal['borrow_amount'] = strim($_REQUEST['borrowamount']);
     $deal['borrow_amount_format'] = format_price($deal['borrow_amount'] / 10000) . "万";
     $GLOBALS['tmpl']->assign('view_info_list', $data['view_info']);
     unset($data['view_info']);
     foreach ($deal_loan_type_list as $k => $v) {
         if ($v['id'] == $type_id) {
             $deal['type_info'] = $v;
         }
     }
     $deal['min_loan_money'] = 50;
     $deal['need_money'] = $deal['borrow_amount_format'];
     //本息还款金额
     $deal['month_repay_money'] = format_price(pl_it_formula($deal['borrow_amount'], strim($deal['rate']) / 12 / 100, $deal['repay_time']));
     if ($deal['agency_id'] > 0) {
         $deal['agency_info'] = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "deal_agency where id = " . $deal['agency_id'] . " and is_effect = 1");
     }
     $deal['progress_point'] = 0;
     $deal['buy_count'] = 0;
     $deal['voffice'] = 1;
     $deal['vjobtype'] = 1;
     $deal['is_delete'] = 2;
     $u_info = get_user("*", $GLOBALS['user_info']['id']);
     $GLOBALS['tmpl']->assign("u_info", $u_info);
     $can_use_quota = get_can_use_quota($GLOBALS['user_info']['id']);
     $GLOBALS['tmpl']->assign('can_use_quota', $can_use_quota);
     $credit_file = get_user_credit_file($GLOBALS['user_info']['id'], $u_info);
     $GLOBALS['tmpl']->assign("credit_file", $credit_file);
     $user_statics = sys_user_status($GLOBALS['user_info']['id'], true);
     $GLOBALS['tmpl']->assign("user_statics", $user_statics);
     $seo_title = $deal['seo_title'] != '' ? $deal['seo_title'] : $deal['type_match_row'] . " - " . $deal['name'];
     $GLOBALS['tmpl']->assign("page_title", $seo_title);
     $seo_keyword = $deal['seo_keyword'] != '' ? $deal['seo_keyword'] : $deal['type_match_row'] . "," . $deal['name'];
     $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
     $seo_description = $deal['seo_description'] != '' ? $deal['seo_description'] : $deal['name'];
     $GLOBALS['tmpl']->assign("seo_description", $seo_description . ",");
     $GLOBALS['tmpl']->assign("deal", $deal);
//.........这里部分代码省略.........
开发者ID:neteasy-work,项目名称:fanwei_xindai_3.2,代码行数:101,代码来源:dealModule.class.php

示例11: main


//.........这里部分代码省略.........
                // Get additional profile fields and assign them to the template block var 'profile_fields'
                $user->get_profile_fields($user->data['user_id']);
                $cp->generate_profile_fields('profile', $user->get_iso_lang_id());
                break;
            case 'signature':
                if (!$auth->acl_get('u_sig')) {
                    trigger_error('NO_AUTH_SIGNATURE');
                }
                include $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
                include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                $enable_bbcode = $config['allow_sig_bbcode'] ? (bool) $user->optionget('sig_bbcode') : false;
                $enable_smilies = $config['allow_sig_smilies'] ? (bool) $user->optionget('sig_smilies') : false;
                $enable_urls = $config['allow_sig_links'] ? (bool) $user->optionget('sig_links') : false;
                $signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));
                add_form_key('ucp_sig');
                if ($submit || $preview) {
                    include $phpbb_root_path . 'includes/message_parser.' . $phpEx;
                    $enable_bbcode = $config['allow_sig_bbcode'] ? request_var('disable_bbcode', false) ? false : true : false;
                    $enable_smilies = $config['allow_sig_smilies'] ? request_var('disable_smilies', false) ? false : true : false;
                    $enable_urls = $config['allow_sig_links'] ? request_var('disable_magic_url', false) ? false : true : false;
                    if (!sizeof($error)) {
                        $message_parser = new parse_message($signature);
                        // Allowing Quote BBCode
                        $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
                        if (sizeof($message_parser->warn_msg)) {
                            $error[] = implode('<br />', $message_parser->warn_msg);
                        }
                        if (!check_form_key('ucp_sig')) {
                            $error[] = 'FORM_INVALID';
                        }
                        if (!sizeof($error) && $submit) {
                            $user->optionset('sig_bbcode', $enable_bbcode);
                            $user->optionset('sig_smilies', $enable_smilies);
                            $user->optionset('sig_links', $enable_urls);
                            $sql_ary = array('user_sig' => (string) $message_parser->message, 'user_options' => $user->data['user_options'], 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield);
                            $sql = 'UPDATE ' . USERS_TABLE . '
								SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
								WHERE user_id = ' . $user->data['user_id'];
                            $db->sql_query($sql);
                            $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
                            trigger_error($message);
                        }
                    }
                    // Replace "error" strings with their real, localised form
                    $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
                }
                $signature_preview = '';
                if ($preview) {
                    // Now parse it for displaying
                    $signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
                    unset($message_parser);
                }
                decode_message($signature, $user->data['user_sig_bbcode_uid']);
                $template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'SIGNATURE' => $signature, 'SIGNATURE_PREVIEW' => $signature_preview, 'S_BBCODE_CHECKED' => !$enable_bbcode ? ' checked="checked"' : '', 'S_SMILIES_CHECKED' => !$enable_smilies ? ' checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => !$enable_urls ? ' checked="checked"' : '', 'BBCODE_STATUS' => $config['allow_sig_bbcode'] ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.{$phpEx}", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.{$phpEx}", 'mode=bbcode') . '">', '</a>'), 'SMILIES_STATUS' => $config['allow_sig_smilies'] ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => $config['allow_sig_img'] ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => $config['allow_sig_flash'] ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'URL_STATUS' => $config['allow_sig_links'] ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'MAX_FONT_SIZE' => (int) $config['max_sig_font_size'], 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], 'S_BBCODE_IMG' => $config['allow_sig_img'] ? true : false, 'S_BBCODE_FLASH' => $config['allow_sig_flash'] ? true : false, 'S_LINKS_ALLOWED' => $config['allow_sig_links'] ? true : false));
                // Build custom bbcodes array
                display_custom_bbcodes();
                break;
            case 'avatar':
                include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                $display_gallery = request_var('display_gallery', '0');
                $avatar_select = basename(request_var('avatar_select', ''));
                $category = basename(request_var('category', ''));
                $can_upload = file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
                add_form_key('ucp_avatar');
                if ($submit) {
                    if (check_form_key('ucp_avatar')) {
                        if (avatar_process_user($error, false, $can_upload)) {
                            meta_refresh(3, $this->u_action);
                            $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
                            trigger_error($message);
                        }
                    } else {
                        $error[] = 'FORM_INVALID';
                    }
                    // Replace "error" strings with their real, localised form
                    $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
                }
                if (!$config['allow_avatar'] && $user->data['user_avatar_type']) {
                    $error[] = $user->lang['AVATAR_NOT_ALLOWED'];
                } else {
                    if ($user->data['user_avatar_type'] == AVATAR_UPLOAD && !$config['allow_avatar_upload'] || $user->data['user_avatar_type'] == AVATAR_REMOTE && !$config['allow_avatar_remote'] || $user->data['user_avatar_type'] == AVATAR_GALLERY && !$config['allow_avatar_local']) {
                        $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
                    }
                }
                $template->assign_vars(array('ERROR' => sizeof($error) ? implode('<br />', $error) : '', 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true), 'AVATAR_SIZE' => $config['avatar_filesize'], 'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=profile&amp;mode=avatar&amp;display_gallery=1'), 'S_FORM_ENCTYPE' => $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload']) ? ' enctype="multipart/form-data"' : '', 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024)));
                if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) {
                    avatar_gallery($category, $avatar_select, 4);
                } else {
                    if ($config['allow_avatar']) {
                        $avatars_enabled = $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload']) || $auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']) ? true : false;
                        $template->assign_vars(array('AVATAR_WIDTH' => request_var('width', $user->data['user_avatar_width']), 'AVATAR_HEIGHT' => request_var('height', $user->data['user_avatar_height']), 'S_AVATARS_ENABLED' => $avatars_enabled, 'S_UPLOAD_AVATAR_FILE' => $can_upload && $config['allow_avatar_upload'] ? true : false, 'S_UPLOAD_AVATAR_URL' => $can_upload && $config['allow_avatar_remote_upload'] ? true : false, 'S_LINK_AVATAR' => $auth->acl_get('u_chgavatar') && $config['allow_avatar_remote'] ? true : false, 'S_DISPLAY_GALLERY' => $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'] ? true : false));
                    }
                }
                break;
        }
        $template->assign_vars(array('L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)], 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => $this->u_action));
        // Set desired template
        $this->tpl_name = 'ucp_profile_' . $mode;
        $this->page_title = 'UCP_PROFILE_' . strtoupper($mode);
    }
开发者ID:ahmatjan,项目名称:Crimson,代码行数:101,代码来源:ucp_profile.php

示例12: show_empty_avatar

function show_empty_avatar($u_id, $type = "middle")
{
    $key = md5("AVATAR_" . $u_id . $type);
    if (isset($GLOBALS[$key])) {
        return $GLOBALS[$key];
    } else {
        $avatar_key = md5("USER_AVATAR_" . $u_id);
        $avatar_data = $GLOBALS['dynamic_avatar_cache'][$avatar_key];
        // 当前用户所有头像的动态缓存
        if (!isset($avatar_data) || !isset($avatar_data[$key])) {
            $avatar_file = get_user_avatar($u_id, $type);
            $avatar_str = "<img src='" . $avatar_file . "'  />";
            $avatar_data[$key] = $avatar_str;
            if (count($GLOBALS['dynamic_avatar_cache']) < 500) {
                $GLOBALS['dynamic_avatar_cache'][$avatar_key] = $avatar_data;
            }
        } else {
            $avatar_str = $avatar_data[$key];
        }
        $GLOBALS[$key] = $avatar_str;
        return $GLOBALS[$key];
    }
}
开发者ID:xinlechou,项目名称:wap,代码行数:23,代码来源:common.php

示例13: get_user_avatar

		  <li id="topbar_search_form"  class="has-form">
		  <form id="topbar_form" action="search.php" method="get">
		  <div class="row collapse">
			<div class="large-8 small-9 columns">
			  <input id="topbar_search_input" type="text" placeholder="Enter a name." name="epname" >
			</div>
			
			<div id="topbar_search_form_button" class="large-4 small-3 columns" >
			  <!--a href="search.php" class="alert button expand">Search</a-->
			  <input type="submit" class="alert button expand" value ="Search">
			</div>
		  </div>
		  </form>
		  </li>
		<?php 
if ($context == "logged in") {
    $output = "<li id=\"topbar_user_section\">";
    $output .= "<a href=\"user.php?user=" . $_SESSION["user_id"] . "\">";
    $output .= " <span id =\"topbar_user_image\" > ";
    $output .= "<img  src=\"" . get_user_avatar($_SESSION["user_id"])["file_path"] . "\" >";
    $output .= "</span>";
    $output .= urlencode($_SESSION["username"]);
    $output .= "</a>";
    $output .= "</li>";
    echo $output;
}
?>
		
		</ul>			
      </section>
    </nav>
开发者ID:0xCA2,项目名称:Hotline-To-Hell-Girl,代码行数:31,代码来源:header.php

示例14: get_user_information

/**
* Get user information (only for message display)
*/
function get_user_information($user_id, $user_row)
{
    global $db, $auth, $user, $cache;
    global $phpbb_root_path, $phpEx, $config;
    if (!$user_id) {
        return array();
    }
    if (empty($user_row)) {
        $sql = 'SELECT *
			FROM ' . USERS_TABLE . '
			WHERE user_id = ' . (int) $user_id;
        $result = $db->sql_query($sql);
        $user_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
    }
    // Some standard values
    $user_row['online'] = false;
    $user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = $user_row['email'] = '';
    // Generate online information for user
    if ($config['load_onlinetrack']) {
        $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
			FROM ' . SESSIONS_TABLE . "\n\t\t\tWHERE session_user_id = {$user_id}\n\t\t\tGROUP BY session_user_id";
        $result = $db->sql_query_limit($sql, 1);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $update_time = $config['load_online_time'] * 60;
        if ($row) {
            $user_row['online'] = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? true : false;
        }
    }
    if (!function_exists('get_user_avatar')) {
        include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
    }
    $user_row['avatar'] = $user->optionget('viewavatars') ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
    get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
    if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email')) {
        $user_row['email'] = $config['board_email_form'] && $config['email_enable'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=email&amp;u={$user_id}") : ($config['board_hide_emails'] && !$auth->acl_get('a_email') || empty($user_row['user_email']) ? '' : 'mailto:' . $user_row['user_email']);
    }
    return $user_row;
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:43,代码来源:ucp_pm_viewmessage.php

示例15: redirect

    case 'view_dynorun':
        /**
         * Check authorisation to perform action, redirecting to error screen if not
         */
        if (!$auth->acl_get('u_garage_browse')) {
            redirect(append_sid("{$phpbb_root_path}garage.{$phpEx}", "mode=error&amp;EID=15"));
        }
        /**
         * Get dynorun & gallery data from DB
         */
        $data = $garage_dynorun->get_dynorun($did);
        $gallery_data = $garage_image->get_dynorun_gallery($did);
        /**
         * Handle template declarations & assignments
         */
        page_header($user->lang['GARAGE']);
        $template->set_filenames(array('header' => 'garage_header.html', 'body' => 'garage_view_dynorun.html'));
        $template->assign_block_vars('navlinks', array('FORUM_NAME' => $data['vehicle'], 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}garage_vehicle.{$phpEx}", "mode=view_vehicle&amp;VID={$vid}")));
        for ($i = 0; $i < count($gallery_data); $i++) {
            if (empty($gallery_data[$i]['attach_thumb_location']) == false and $gallery_data[$i]['attach_thumb_location'] != $gallery_data[$i]['attach_location']) {
                $template->assign_vars(array('S_DISPLAY_GALLERIES' => true));
                $template->assign_block_vars('dynorun_image', array('U_IMAGE' => append_sid('garage.' . $phpEx . '?mode=view_image&amp;image_id=' . $gallery_data[$i]['attach_id']), 'IMAGE_NAME' => $gallery_data[$i]['attach_file'], 'IMAGE_SOURCE' => $phpbb_root_path . GARAGE_UPLOAD_PATH . $gallery_data[$i]['attach_thumb_location']));
            }
        }
        $template->assign_vars(array('U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", "mode=viewprofile&amp;u=" . $data['user_id']), 'YEAR' => $data['made_year'], 'MAKE' => $data['make'], 'MODEL' => $data['model'], 'USERNAME' => $data['username'], 'USERNAME_COLOUR' => get_username_string('colour', $data['user_id'], $data['username'], $data['user_colour']), 'AVATAR_IMG' => $user->optionget('viewavatars') ? get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']) : '', 'DYNOCENTRE' => $data['title'], 'BHP' => $data['bhp'] . $user->lang['DECIMAL_SEPERATOR'] . $data['bhp_decimal'], 'BHP_UNIT' => $data['bhp_unit'], 'TORQUE' => $data['torque'] . $user->lang['DECIMAL_SEPERATOR'] . $data['torque_decimal'], 'TORQUE_UNIT' => $data['torque_unit'], 'NITROUS' => $data['nitrous'], 'BOOST' => $data['boost'] . $user->lang['DECIMAL_SEPERATOR'] . $data['boost_decimal'], 'BOOST_UNIT' => $data['boost_unit'], 'PEAKPOINT' => $data['peakpoint'] . $user->lang['DECIMAL_SEPERATOR'] . $data['peakpoint_decimal']));
        $garage_template->sidemenu();
        break;
}
$garage_template->version_notice();
$template->set_filenames(array('garage_footer' => 'garage_footer.html'));
page_footer();
开发者ID:poyntesm,项目名称:phpbbgarage,代码行数:31,代码来源:garage_dynorun.php


注:本文中的get_user_avatar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。