forked from corgus/eas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
author.php
134 lines (112 loc) · 4.45 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
<?php
$this_author = get_userdata($author);
$this_meta = get_user_meta($author);
$admin = eas_user_is_admin();
$owner = eas_user_is_owner();
if ($wp_query->query_vars['approve'] == 1 && $admin) {
$temp_user = new WP_User($author);
$temp_user->set_role('artist');
delete_user_meta($author, 'unverified');
eas_update_usermeta($author, 'verified', 1);
eas_artist_approval_email($author);
wp_redirect(eas_artist_page_url($author).'?action=artistapproved');
exit;
} else if ($wp_query->query_vars['approve'] == -1 && $admin) {
eas_update_usermeta($author, 'declined', 1);
wp_redirect('/artists/approve/?action=decline');
}
if ($wp_query->query_vars['follow'] == '1') {
eas_follow($author);
wp_redirect(eas_artist_page_url($author).'?action=follow');
exit;
} else if ($wp_query->query_vars['follow'] == '-1') {
eas_unfollow($author);
wp_redirect(eas_artist_page_url($author).'?action=unfollow');
exit;
}
$contestview = false;
$juror = eas_user_is_juror();
if ($wp_query->query_vars['contestname'] == 'crossingborders' && $juror) {
$contestview = true;
$contestname = 'crossingborders';
} else if ($wp_query->query_vars['contestname'] == 'crossingborders' && !$juror) {
wp_redirect(eas_artist_page_url($author));
}
$artist = eas_is_artist($author);
$artistpending = false;
if (!$artist && !$contestview && !$admin) {
$artistpending = true;
$_GET["action"] = 'artistpending';
}
?>
<?php get_header(); ?>
<?php roots_content_before(); ?>
<div id="content" class="<?php echo CONTAINER_CLASSES; ?>">
<?php roots_main_before(); ?>
<div id="main" class="<?php echo FULLWIDTH_CLASSES; ?>" role="main">
<?php if ($artist || $owner || $contestview) { ?>
<div class="page-header">
<div id="artist_profile_header">
<div class="artist_avatar float_left">
<?php eas_display_avatar($author); ?>
</div>
<div id="artist_profile_info" class="float_left">
<div class="artist_name"><?php echo $this_author->nickname; ?></div>
<?php eas_follow_button(); ?>
<?php eas_display_meta($this_meta, 'location');?>
<?php eas_display_meta($this_meta, 'school'); ?>
<?php eas_display_email_for_admins($author); ?>
</div>
<br class="clear" />
</div>
</div>
<?php if ($artistpending && $admin) eas_approve_artist_button(); ?>
<?php if (!$contestview) { ?>
<small>
<div class="userdescription">
<?php eas_display_meta($this_meta, 'description', false); ?>
</div>
</small>
<?php } ?>
<div class="row">
<div class= "span9" <?php /*echo MAIN_CLASSES; */?>>
<?php
if (!$contestview) {
$artworks = eas_artworks_by_user($author);
} else {
$artworks = eas_artworks_by_user($author, -1, $contestname);
?>
<p><a href="<?php echo trailingslashit(get_bloginfo('siteurl')).'crossingborders/submissions' ?>">View all Crossing Borders submissions</a>
<?php
}
foreach ($artworks as $a) {
echo eas_get_figure_tag($a->ID, 'large');
}
?>
</div>
<?php if (!$contestview) { ?>
<div class="span3">
<?php $favs = eas_get_favorites($author);
if (count($favs)) { ?>
<h3><?php echo $this_author->nickname; ?>'s Favorites</h3>
<br />
<?php foreach ($favs as $f) {
$img = eas_artwork_img($f->id, 'large');
$src = $img[0];
$url = eas_artwork_url($f->id);
echo "<a href= ".$url."><img src= ".$src."></a>";
} ?>
<?php } ?>
</div>
<?php } ?>
<?php } else {
?>
This user has not yet been approved to be an artist. Once your art is submitted it should take no more than 48 hours for approval.
<?php
} ?>
</div>
</div><!-- /#main -->
<?php roots_main_after(); ?>
</div><!-- /#content -->
<?php roots_content_after(); ?>
<?php get_footer(); ?>