-
Notifications
You must be signed in to change notification settings - Fork 1
/
author.php
153 lines (152 loc) · 3.63 KB
/
author.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php get_header(); ?>
<?php if ( is_user_logged_in() ) { ?>
<!-- This sets the $curauth variable -->
<?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>
<div class="contents">
<!-- START - ABOUT AUTHOR -->
<div class="post"><div class="post-content"><div class="entry">
<fieldset>
<legend>
About <?php echo $curauth->first_name; echo ' '. $curauth->last_name; echo ' ('. $curauth->nickname .')'; ?>
</legend>
</fieldset>
<div class="profilepic">
<?php
echo get_avatar( $curauth->ID );
?>
</div>
<table class="profiletable">
<th class="first">Academic</th>
<tr>
<td class="title">
School
</td>
<td>
<?php echo $curauth->school; ?>
</td>
</tr>
<tr>
<td class="title">
Graduating Class
</td>
<td>
<?php echo $curauth->year; ?>
</td>
</tr>
<th>Online Role</th>
<tr>
<td class="title">
Role
</td>
<td>
<?php
$user_roles = $curauth->roles;
$user_role = array_shift($user_roles);
if ($user_role == 'administrator') {
echo 'An Administrator';
} elseif ($user_role == 'editor') {
echo 'Website Editor';
} elseif ($user_role == 'author') {
echo 'Website Author';
} elseif ($user_role == 'contributor') {
echo 'Team Member';
} elseif ($user_role == 'subscriber') {
echo 'Subscriber';
} else {
echo "$user_role";
}
?>
</td>
</tr>
<th>Contact</th>
<tr>
<td class="title">
Email
</td>
<td>
<a href="mailto:<?php echo $curauth->user_email; ?>"><?php echo $curauth->user_email; ?></a>
</td>
</tr>
<tr>
<td class="title">
Facebook URL
</td>
<td>
<a href="http://<?php echo $curauth->facebook; ?>">Go To Profile</a>
</td>
</tr>
<th>About</th>
<tr>
<td class="title">
Bio
</td>
<td>
<?php echo $curauth->user_description; ?>
</td>
</tr>
</table>
<div class="clear"></div>
</div></div></div>
<!-- END - ABOUT AUTHOR -->
<!-- START - POSTS -->
<div class="post"><div class="post-content"><div class="entry">
<fieldset>
<legend>
Posts by <?php echo $curauth->nickname; ?>
</legend>
</fieldset>
<div class="authorsposts">
<ul>
<!-- The Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<img src="<?php echo $image[0]; ?>" />
<?php endif; ?>
<?php the_title(); ?></a>
<br />
<?php the_time('d M Y'); ?> in <?php the_category('&');?>
</li>
<?php endwhile; else: ?>
<p><?php _e('No posts by this author.'); ?></p>
<?php endif; ?>
<!-- End Loop -->
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<!-- END - POSTS -->
<!-- START - OTHERS -->
<div class="post"><div class="post-content"><div class="entry">
<fieldset>
<legend>
Other Users
</legend>
</fieldset>
<div id="authorlist"><ul class="profiles"><?php contributors(); ?></ul></div>
</div>
</div>
</div>
</div>
<!-- END - OTHERS -->
<!-- START - ELSE -->
<?php } else{ ?>
<div class="contents">
<div class="post"><div class="post-content"><div class="entry">
Please log in to view this page.
</div>
</div>
</div></div>
<?php }?>
<!-- END - ALL -->
<?php get_footer(); ?>