Adds a profile page

This commit is contained in:
nikolark committed 2014-08-10 15:11:17 +02:00
1 parent 78b1b046d0
commit aafa31b066
4 files changed
+42 -4

No files matched your search

@@ -385,4 +385,12 @@ function neuf_show_admin_bar($content) {
} }
add_filter( 'show_admin_bar' , 'neuf_show_admin_bar'); add_filter( 'show_admin_bar' , 'neuf_show_admin_bar');
function get_grav_url($user) {
$default = "mm";
$size = 50;
$grav_url = "https://www.gravatar.com/avatar/" . md5( strtolower( trim( $user->user_email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
return $grav_url;
}
?> ?>
+1 -3
View File
@@ -10,9 +10,7 @@
// User menu // User menu
$user = wp_get_current_user(); $user = wp_get_current_user();
$default = "mm"; $grav_url = get_grav_url($user);
$size = 50;
$grav_url = "https://www.gravatar.com/avatar/" . md5( strtolower( trim( $user->user_email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
?> ?>
<div class="user-menu-wrap"> <div class="user-menu-wrap">
<a href="#" class="profile-badge"><img src="<?php echo $grav_url; ?> " class="profile-picture" /><span class="profile-inner"><?php echo $user->display_name; ?> <i class="icon-down">&#x25B6;</i></span></a> <a href="#" class="profile-badge"><img src="<?php echo $grav_url; ?> " class="profile-picture" /><span class="profile-inner"><?php echo $user->display_name; ?> <i class="icon-down">&#x25B6;</i></span></a>
@@ -0,0 +1,32 @@
<?php
/*
* Template Name: User profile
*/
get_header();
$user = wp_get_current_user();
?>
<div class="container profile">
<div id="content">
<h5><?php echo $user->display_name; ?></h5>
<ul>
<li><strong>Epost:</strong> <?php echo $user->user_email; ?></li>
<li><strong>Rolle på aktiv.neuf.no:</strong> <?php echo $user->roles[0]; ?></li>
</ul>
<h5>Profilbilde</h5>
<img src="<?php echo get_grav_url($user); ?>" /><br>
Endre profilbildet ditt på <a href="https://nb.gravatar.com">gravatar.com</a>.
<h5>Passord</h5>
Endre passordet ditt via <a href="https://brukerinfo.neuf.no">Brukerinfo</a>.
<h5>Profil og medlemskap</h5>
Se status på medlemskapet, endre navn, epost, med mer via <a href="https://inside.studentersamfundet.no">Inside</a>.
</div>
</div> <!-- .container -->
<?php
get_footer();
?>
+1 -1
View File
@@ -4,7 +4,7 @@
<h2>Dagens program</h2> <h2>Dagens program</h2>
<div class="events-today"> <div class="events-today">
<ul class="program-list"><!-- JS magic --></ul> <ul class="program-list"><!-- JS magic --></ul>
<div class="text-right"><a href="https://studentersamfundet.no/program/">Vis hele programmet</a></div> <a href="https://studentersamfundet.no/program/">Vis hele programmet</a>
</div> </div>
</div> </div>