Skip to content

Instantly share code, notes, and snippets.

@aristath
Created May 25, 2013 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/5648600 to your computer and use it in GitHub Desktop.
Save aristath/5648600 to your computer and use it in GitHub Desktop.
<?php
$fileid = null;
// If this is a multisite installation, append the blogid to the filename
if ( is_multisite() ) {
global $blog_id;
if ( $blog_id > 1 )
$fileid = '_id-' . $blog_id;
else
$fileid = null;
}
$filename = 'photo' . $fileid . '.jpg';
?>
<div class="profile-picture" id="photoChange">
<img alt="profile picture" src="<?php echo get_template_directory_uri() ?>/images/<?php echo $filename; ?>?<?php echo md5(microtime()); ?>" />
<span class="border"></span>
<a href="#" class="change"><?php _e('Change', $shortname); ?> 153x186</a>
</div>
<?php
$fileid = null;
// If this is a multisite installation, append the blogid to the filename
if ( is_multisite() ) {
global $blog_id;
if ( $blog_id > 1 )
$fileid = '_id-' . $blog_id;
else
$fileid = null;
}
$filename = 'photo' . $fileid . '.jpg';
?>
<div class="about">
<div class="photo-inner"><img src="<?php echo get_template_directory_uri(); ?>/images/<?php echo $filename; ?>" height="186" width="153" /></div>
//Profile picture
}else if(isset($_FILES['photo'])) {
$fileid = null;
// If this is a multisite installation, append the blogid to the filename
if ( is_multisite() ) {
global $blog_id;
if ( $blog_id > 1 )
$fileid = '_id-' . $blog_id;
else
$fileid = null;
}
$filename = 'photo' . $fileid . '.jpg';
$file = &$_FILES['photo'];
$allowedExt = array('jpg', 'png', 'jpeg', 'gif');
$destination = RBISTA_IMAGES.DS.$filename;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment