Beispiel #1
0
images/edit_profile.gif" alt="<?php 
    echo _AT('edit_profile');
    ?>
" id="profile" title="<?php 
    echo _AT('edit_profile');
    ?>
" border="0"/></a>
				<?php 
}
?>
		</div>
		<div class="contentbox">
		<div class="row">
		<?php 
//TODO: include this in the printSocialProfileImg function itself
if (profile_image_exists($this->profile['member_id'])) {
    ?>
			<a href="get_profile_img.php?id=<?php 
    echo $this->profile['member_id'] . SEP;
    ?>
size=o"><?php 
    echo printSocialProfileImg($this->profile['member_id'], 2, false);
    ?>
		<?php 
} else {
    ?>
			<?php 
    echo printSocialProfileImg($this->profile['member_id'], 2, false);
    ?>
		<?php 
}
</fieldset>
<fieldset class="group_form"><legend class="group_form"><?php 
echo _AT('personal_information') . ' (' . _AT('optional') . ')';
?>
</legend>
	<?php 
$mod = $moduleFactory->getModule('_standard/profile_pictures');
if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) && $_POST['member_id'] && $mod->isEnabled() === TRUE) {
    ?>
		<div class="row">
			<?php 
    echo _AT('picture');
    ?>
<br/>
			<?php 
    if (profile_image_exists($_POST['member_id'])) {
        ?>
				<a href="get_profile_img.php?id=<?php 
        echo $_POST['member_id'] . SEP . 'size=o';
        ?>
"><?php 
        print_profile_img($_POST['member_id']);
        ?>
</a>
				<input type="checkbox" name="profile_pic_delete" value="1" id="profile_pic_delete" /><label for="profile_pic_delete"><?php 
        echo _AT('delete');
        ?>
</label>
			<?php 
    } else {
        ?>
/**
 * print thumbnails or profile pic
 * @param	int		image id
 * @param	int		1 for thumbnail, 2 for profile
 */
function print_profile_img($id, $type = 1)
{
    global $moduleFactory;
    $mod = $moduleFactory->getModule('_standard/profile_pictures');
    if ($mod->isEnabled() === FALSE) {
        return;
    }
    if (profile_image_exists($id)) {
        if ($type == 1) {
            echo '<img src="get_profile_img.php?id=' . $id . '" class="profile-picture" alt="" />';
        } elseif ($type == 2) {
            echo '<img src="get_profile_img.php?id=' . $id . SEP . 'size=p" class="profile-picture" alt="" />';
        }
    } else {
        echo '<img src="images/clr.gif" height="100" width="100" class="profile-picture" alt="" />';
    }
}
	$msg->addFeedback('PROFILE_UPDATED');

	header('Location: '.$_SERVER['PHP_SELF'].'?member_id='.$member_id);
	exit;
}

require(AT_INCLUDE_PATH.'header.inc.php');

?>
<div class="social-wrapper">
<?php include("lib/profile_menu.inc.php")  ?>
<br />
<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>?member_id=<?php echo $member_id; ?>" name="form">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_config['prof_pic_max_file_size']; ?>" />
<div class="input-form">
<?php if (profile_image_exists($member_id)): ?>
	<div class="row">
		<a href="get_profile_img.php?id=<?php echo $member_id.SEP.'size=o'; ?>"><img src="get_profile_img.php?id=<?php echo $member_id; ?>" alt="" /></a>
		<input type="checkbox" name="delete" value="1" id="del"/><label for="del"><?php echo _AT('delete'); ?></label>
	</div>
<?php endif; ?>
	<div class="row">
		<h3><label for="upload_picture"><?php echo _AT('upload_new_picture'); ?></label></h3>
		<input type="file" name="file" id="upload_picture"/> (<?php echo implode(', ', $supported_images); ?>)</div>

	<div class="row buttons">
		<input type="submit" name="submit" value="<?php echo _AT('save'); ?>" />
		<input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
	</div>
</div>
</form>
/* as published by the Free Software Foundation.                        */
/************************************************************************/
// $Id: edit.php 3111 2005-01-18 19:32:00Z joel $


global $display_name_formats, $moduleFactory, $db, $_modules;

?>
<div class="input-form">
	<div class="row">
		<p><a href="inbox/send_message.php?id=<?php echo $this->row['member_id']; ?>"><?php echo _AT('send_message'); ?></a></p>
		<dl id="public-profile">
			<?php $mod = $moduleFactory->getModule('_standard/profile_pictures'); 
			if ($mod->isEnabled() === TRUE): ?>
				<dt><?php echo _AT('picture'); ?></dt>
				<dd><?php if (profile_image_exists($this->row['member_id'])): ?>
				<?php
					//run a check to see if any personal album exists, if not, create one.
					$sql = 'SELECT * FROM '.TABLE_PREFIX.'pa_albums WHERE member_id='.$this->row['member_id'].' AND type_id='.AT_PA_TYPE_PERSONAL;
					$result = mysql_query($sql, $db);
					if ($result){
						$row = mysql_fetch_assoc($result);	//album info.
						$aid = $row['id'];
					}
					if (in_array('mods/_standard/photos/index.php', $_modules)){
						$img_link = AT_PA_BASENAME.'albums.php?id='.$aid;
					} else {
						$img_link = 'get_profile_img.php?id='.$this->row['member_id'].SEP.'size=o';
					}
				?>
					<a href="<?php echo $img_link ?>"><?php print_profile_img($this->row['member_id'], 2); ?></a>
?>
<br />
<form method="post" enctype="multipart/form-data" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
?member_id=<?php 
echo $this->member_id;
?>
" name="form">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo $_config['prof_pic_max_file_size'];
?>
" />
<div class="input-form">
<?php 
if (profile_image_exists($this->member_id)) {
    ?>
	<div class="row">
		<a href="get_profile_img.php?id=<?php 
    echo $this->member_id . SEP . 'size=o';
    ?>
"><img src="get_profile_img.php?id=<?php 
    echo $this->member_id;
    ?>
" alt="" /></a>
		<input type="checkbox" name="delete" value="1" id="del"/><label for="del"><?php 
    echo _AT('delete');
    ?>
</label>
	</div>
<?php 
Beispiel #7
0
/** 
 * Mimic vital's print_profile_img function, but with a more customized image definition
 * @param	int	the member id
 * @param	1 for thumbnail, 2 for profile
 * @param	true will return a href link to the profile page, false otherwise
 * @return	the profile image link
 */
function printSocialProfileImg($id, $type=1, $link=true) {
	global $moduleFactory;
	$str = '';
	$username = htmlspecialchars(AT_print(get_display_name($id), 'members.full_name'), ENT_QUOTES, 'UTF-8');
	$mod = $moduleFactory->getModule('_standard/profile_pictures');
	if ($mod->isEnabled() === FALSE) {
		return;
	}
	if (profile_image_exists($id)) {
		if ($type==1){
			$str = '<img src="get_profile_img.php?id='.$id.'" alt="'.$username.'" />';
		} elseif ($type==2){
			$str = '<img src="get_profile_img.php?id='.$id.SEP.'size=p" alt="'.$username.'" />';
		}
	} else {
		$str = '<img src="'.AT_SOCIAL_BASENAME.'images/nophoto.gif" alt="'.$username.'" />';
	}
	if (!$link){
		return $str;
	}
	return getProfileLink($id, $str);
}
?>
<br />
<form method="post" enctype="multipart/form-data" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
?member_id=<?php 
echo $member_id;
?>
" name="form">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo $_config['prof_pic_max_file_size'];
?>
" />
<div class="input-form">
<?php 
if (profile_image_exists($member_id)) {
    ?>
	<div class="row">
		<a href="get_profile_img.php?id=<?php 
    echo $member_id . SEP . 'size=o';
    ?>
"><img src="get_profile_img.php?id=<?php 
    echo $member_id;
    ?>
" alt="" /></a>
		<input type="checkbox" name="delete" value="1" id="del"/><label for="del"><?php 
    echo _AT('delete');
    ?>
</label>
	</div>
<?php