-
Notifications
You must be signed in to change notification settings - Fork 2
/
register.php
312 lines (197 loc) · 14 KB
/
register.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<?php get_header() ?>
<div id="allwrapper">
<div id="wrapper">
<div id="lb-content">
<?php do_action( 'bp_before_register_page' ) ?>
<div class="page" id="register-page">
<form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
<h2><?php _e( 'Create an Account', 'buddypress' ) ?></h2>
<?php do_action( 'template_notices' ) ?>
<p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ) ?></p>
<?php do_action( 'bp_before_account_details_fields' ) ?>
<div class="register-section" id="basic-details-section">
<?php /***** Basic Account Details ******/ ?>
<h4><?php _e( 'Account Details', 'buddypress' ) ?></h4>
<label for="signup_username"><?php _e( 'Username', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_username_errors' ) ?>
<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_email_errors' ) ?>
<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_password_errors' ) ?>
<input type="password" name="signup_password" id="signup_password" value="" />
<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_password_confirm_errors' ) ?>
<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
</div><!-- #basic-details-section -->
<?php do_action( 'bp_after_account_details_fields' ) ?>
<?php do_action( 'bp_before_blog_details_fields' ) ?>
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( 'xprofile' ) ) : ?>
<div class="register-section" id="profile-details-section">
<h4><?php _e( 'Profile Details', 'buddypress' ) ?></h4>
<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div class="editfield">
<?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<input type="text" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" value="<?php bp_the_profile_field_edit_value() ?>" />
<?php endif; ?>
<?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_edit_value() ?></textarea>
<?php endif; ?>
<?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
<?php bp_the_profile_field_options() ?>
</select>
<?php endif; ?>
<?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
<label for="<?php bp_the_profile_field_input_name() ?>"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>" multiple="multiple">
<?php bp_the_profile_field_options() ?>
</select>
<?php endif; ?>
<?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
<div class="radio">
<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<?php bp_the_profile_field_options() ?>
<?php if ( !bp_get_the_profile_field_is_required() ) : ?>
<a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name() ?>' );"><?php _e( 'Clear', 'buddypress' ) ?></a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
<div class="checkbox">
<span class="label"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></span>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<?php bp_the_profile_field_options() ?>
</div>
<?php endif; ?>
<?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
<div class="datebox">
<label for="<?php bp_the_profile_field_input_name() ?>_day"><?php bp_the_profile_field_name() ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></label>
<?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ) ?>
<select name="<?php bp_the_profile_field_input_name() ?>_day" id="<?php bp_the_profile_field_input_name() ?>_day">
<?php bp_the_profile_field_options( 'type=day' ) ?>
</select>
<select name="<?php bp_the_profile_field_input_name() ?>_month" id="<?php bp_the_profile_field_input_name() ?>_month">
<?php bp_the_profile_field_options( 'type=month' ) ?>
</select>
<select name="<?php bp_the_profile_field_input_name() ?>_year" id="<?php bp_the_profile_field_input_name() ?>_year">
<?php bp_the_profile_field_options( 'type=year' ) ?>
</select>
</div>
<?php endif; ?>
<?php do_action( 'bp_custom_profile_edit_fields' ) ?>
<p class="description"><?php bp_the_profile_field_description() ?></p>
</div>
<?php endwhile; ?>
<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
<?php endwhile; endif; endif; ?>
</div><!-- #profile-details-section -->
<?php endif; ?>
<?php do_action( 'bp_after_signup_profile_fields' ) ?>
<?php if ( bp_get_blog_signup_allowed() ) : ?>
<?php do_action( 'bp_before_blog_details_fields' ) ?>
<?php /***** Blog Creation Details ******/ ?>
<div class="register-section" id="blog-details-section">
<h4><?php _e( 'Blog Details', 'buddypress' ) ?></h4>
<p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new blog', 'buddypress' ) ?></p>
<div id="blog-details">
<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_blog_url_errors' ) ?>
<?php if ( 'yes' == VHOST ) : ?>
http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" /> .<?php echo str_replace( 'http://', '', site_url() ) ?>
<?php else : ?>
<?php echo site_url() ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" />
<?php endif; ?>
<label for="signup_blog_title"><?php _e( 'Blog Title', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
<?php do_action( 'bp_signup_blog_title_errors' ) ?>
<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value() ?>" />
<span class="label"><?php _e( 'I would like my blog to appear in search engines, and in public listings around this site', 'buddypress' ) ?>:</span>
<?php do_action( 'bp_signup_blog_privacy_errors' ) ?>
<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes' ) ?></label>
<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No' ) ?></label>
</div>
</div><!-- #blog-details-section -->
<?php do_action( 'bp_after_blog_details_fields' ) ?>
<?php endif; ?>
<?php do_action( 'bp_before_registration_submit_buttons' ) ?>
<div class="submit">
<input type="submit"name="signup_submit" id="signup_submit" value="<?php _e( 'Complete Sign Up', 'buddypress' ) ?> →" />
</div>
<?php do_action( 'bp_after_registration_submit_buttons' ) ?>
<?php wp_nonce_field( 'bp_new_signup' ) ?>
<?php endif; // request-details signup step ?>
<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
<h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
<?php do_action( 'template_notices' ) ?>
<?php if ( bp_registration_needs_activation() ) : ?>
<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>
<?php else : ?>
<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?></p>
<?php endif; ?>
<?php if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
<h4><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h4>
<p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p>
<div id="signup-avatar">
<?php bp_signup_avatar() ?>
</div>
<p>
<input type="file" name="file" id="file" />
<input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" />
<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
<input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
<input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
</p>
<?php wp_nonce_field( 'bp_avatar_upload' ) ?>
<?php endif; ?>
<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
<h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3>
<img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" />
<div id="avatar-crop-pane">
<img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" />
</div>
<input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" />
<input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" />
<input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" />
<input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" />
<input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" />
<input type="hidden" id="x" name="x" />
<input type="hidden" id="y" name="y" />
<input type="hidden" id="w" name="w" />
<input type="hidden" id="h" name="h" />
<?php wp_nonce_field( 'bp_avatar_cropstore' ) ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; // completed-confirmation signup step ?>
<?php do_action( 'bp_custom_signup_steps' ) ?>
</form>
</div>
<?php do_action( 'bp_after_register_page' ) ?>
</div><!-- #content -->
</div>
</div>
<?php locate_template( array( 'sidebar.php' ), true ) ?>
<?php do_action( 'bp_after_directory_activity_content' ) ?>
<script type="text/javascript">
jQuery(document).ready( function() {
if ( jQuery('div#blog-details').length )
jQuery('div#blog-details').toggle();
jQuery( 'input#signup_with_blog' ).click( function() {
jQuery('div#blog-details').fadeOut().toggle();
});
});
</script>
<?php get_footer() ?>