Advertisement
mekcas

register

Oct 30th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.01 KB | None | 0 0
  1. <?php
  2. global $bp;
  3.  
  4. if ( !defined( 'ABSPATH' ) ) exit;
  5. $register_id = vibe_get_bp_page_id('register');
  6.  
  7. $site_lock = vibe_get_option('site_lock');
  8. if(!empty($site_lock)){
  9. include_once(get_template_directory()."/login-page.php");
  10. exit;
  11. }
  12.  
  13. get_header( vibe_get_header() );
  14. ?>
  15. <section id="title">
  16. <?php do_action('wplms_before_title'); ?>
  17. <div class="<?php echo vibe_get_container(); ?>">
  18. <div class="row">
  19. <div class="col-md-12">
  20. <div class="pagetitle">
  21. <?php
  22. $breadcrumbs=get_post_meta($register_id,'vibe_breadcrumbs',true);
  23. if(vibe_validate($breadcrumbs)){
  24. vibe_breadcrumbs();
  25. }
  26. ?>
  27. <h1><?php the_title(); ?></h1>
  28. <?php the_sub_title($register_id); ?>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </section>
  34. <section id="content">
  35. <div class="<?php echo vibe_get_container(); ?>">
  36. <div class="col-md-9 col-sm-8">
  37.  
  38. <div class="content padder">
  39.  
  40. <div id="buddypress">
  41.  
  42. <?php
  43.  
  44. /**
  45. * Fires at the top of the BuddyPress member registration page template.
  46. *
  47. * @since 1.1.0
  48. */
  49. do_action( 'bp_before_register_page' ); ?>
  50.  
  51. <div class="page" id="register-page">
  52.  
  53. <form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
  54.  
  55. <?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
  56. <?php
  57.  
  58. /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
  59. do_action( 'template_notices' ); ?>
  60. <?php
  61.  
  62. /**
  63. * Fires before the display of the registration disabled message.
  64. *
  65. * @since 1.5.0
  66. */
  67. do_action( 'bp_before_registration_disabled' ); ?>
  68.  
  69. <p><?php _e( 'User registration is currently not allowed.', 'vibe' ); ?></p>
  70.  
  71. <?php
  72.  
  73. /**
  74. * Fires after the display of the registration disabled message.
  75. *
  76. * @since 1.5.0
  77. */
  78. do_action( 'bp_after_registration_disabled' ); ?>
  79. <?php endif; // registration-disabled signup step ?>
  80.  
  81. <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
  82.  
  83. <?php
  84.  
  85. /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
  86. do_action( 'template_notices' );
  87.  
  88. $content ='';
  89. if(!empty($register_id)){
  90. $content = get_post_field('post_content',$register_id);
  91. }
  92. if(!empty($content)){
  93. echo apply_filters('the_content',$content);
  94. }else{
  95. echo '<p>'.__( '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.', 'vibe' ).'</p>';
  96. }
  97.  
  98. /**
  99. * Fires before the display of member registration account details fields.
  100. *
  101. * @since 1.1.0
  102. */
  103. do_action( 'bp_before_account_details_fields' ); ?>
  104.  
  105. <div class="register-section" id="basic-details-section">
  106.  
  107. <?php /***** Basic Account Details ******/ ?>
  108.  
  109. <h4><?php _e( 'Account Details', 'vibe' ); ?></h4>
  110. <div<?php bp_field_css_class( 'editfield' ); ?>>
  111. <label for="signup_username"><?php _e( 'Username', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  112. <?php
  113.  
  114. /**
  115. * Fires and displays any member registration username errors.
  116. *
  117. * @since 1.1.0
  118. */
  119. do_action( 'bp_signup_username_errors' ); ?>
  120. <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" <?php bp_form_field_attributes( 'username' ); ?>/>
  121. </div>
  122. <div<?php bp_field_css_class( 'editfield' ); ?>>
  123. <label for="signup_email"><?php _e( 'Email Address', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  124. <?php
  125.  
  126. /**
  127. * Fires and displays any member registration email errors.
  128. *
  129. * @since 1.1.0
  130. */
  131. do_action( 'bp_signup_email_errors' ); ?>
  132. <input type="email" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" <?php bp_form_field_attributes( 'email' ); ?>/>
  133. </div>
  134. <div<?php bp_field_css_class( 'editfield' ); ?>>
  135. <label for="signup_password"><?php _e( 'Choose a Password', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  136. <?php
  137.  
  138. /**
  139. * Fires and displays any member registration password errors.
  140. *
  141. * @since 1.1.0
  142. */
  143. do_action( 'bp_signup_password_errors' ); ?>
  144. <input type="password" name="signup_password" id="signup_password" value="" class="password-entry form_field" <?php bp_form_field_attributes( 'password' ); ?>/>
  145. <div id="pass-strength-result"></div>
  146. </div>
  147. <div<?php bp_field_css_class( 'editfield' ); ?>>
  148. <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  149. <?php
  150.  
  151. /**
  152. * Fires and displays any member registration password confirmation errors.
  153. *
  154. * @since 1.1.0
  155. */
  156. do_action( 'bp_signup_password_confirm_errors' ); ?>
  157. <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/>
  158. </div>
  159. <?php
  160.  
  161. /**
  162. * Fires and displays any extra member registration details fields.
  163. *
  164. * @since 1.9.0
  165. */
  166. do_action( 'bp_account_details_fields' ); ?>
  167.  
  168. </div><!-- #basic-details-section -->
  169.  
  170. <?php
  171.  
  172. /**
  173. * Fires after the display of member registration account details fields.
  174. *
  175. * @since 1.1.0
  176. */
  177. do_action( 'bp_after_account_details_fields' ); ?>
  178.  
  179. <?php /***** Extra Profile Details ******/ ?>
  180.  
  181. <?php if ( bp_is_active( 'xprofile' ) ) : ?>
  182.  
  183. <?php
  184.  
  185. /**
  186. * Fires before the display of member registration xprofile fields.
  187. *
  188. * @since 1.2.4
  189. */
  190. do_action( 'bp_before_signup_profile_fields' ); ?>
  191.  
  192. <div class="register-section" id="profile-details-section">
  193.  
  194. <h4><?php _e( 'Profile Details', 'vibe' ); ?></h4>
  195.  
  196. <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
  197.  
  198.  
  199.  
  200.  
  201. <? $count=0; ?>
  202.  
  203. <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
  204.  
  205. <?php
  206. //grup name by hajar
  207.  
  208. $args = array('profile_group_id' => $current_profile_group_id);
  209. $data_groups = bp_xprofile_group::get( $args );
  210. echo '<h1>'.$data_groups[$count]->name.'</h1>';
  211. $count++;
  212. echo '<p>'.'It looks like you have not given any responses here yet.'.'</p>';
  213. ?>
  214.  
  215.  
  216.  
  217. <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
  218.  
  219. <div<?php bp_field_css_class( 'editfield' ); ?>>
  220.  
  221. <?php
  222. $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
  223. $field_type->edit_field_html();
  224.  
  225. /**
  226. * Fires before the display of the visibility options for xprofile fields.
  227. *
  228. * @since 1.7.0
  229. */
  230. do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
  231.  
  232. if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
  233. <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
  234. <?php
  235. printf(
  236. __( 'This field can be seen by: %s', 'vibe' ),
  237. '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
  238. );
  239. ?>
  240. <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'vibe' ); ?></a>
  241. </p>
  242.  
  243. <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
  244. <fieldset>
  245. <legend><?php _e( 'Who can see this field?', 'vibe' ) ?></legend>
  246.  
  247. <?php bp_profile_visibility_radio_buttons() ?>
  248.  
  249. </fieldset>
  250. <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'vibe' ) ?></a>
  251.  
  252. </div>
  253. <?php else : ?>
  254. <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
  255. <?php
  256. printf(
  257. __( 'This field can be seen by: %s', 'vibe' ),
  258. '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
  259. );
  260. ?>
  261. </p>
  262. <?php endif ?>
  263.  
  264. <?php
  265.  
  266. /**
  267. * Fires after the display of the visibility options for xprofile fields.
  268. *
  269. * @since 1.1.0
  270. */
  271. do_action( 'bp_custom_profile_edit_fields' ); ?>
  272. <?php
  273. //now buddypress already show descption below the field since 2.9
  274. if(function_exists('version_compare') && !empty($bp->version) && version_compare($bp->version, '2.9.0','<')){
  275.  
  276. echo '<p class="description">'.bp_the_profile_field_description().'</p>';
  277. }?>
  278.  
  279. </div>
  280.  
  281. <?php endwhile; ?>
  282.  
  283. <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_field_ids(); ?>" />
  284.  
  285. <?php endwhile; endif; endif; ?>
  286.  
  287. <?php
  288.  
  289. /**
  290. * Fires and displays any extra member registration xprofile fields.
  291. *
  292. * @since 1.9.0
  293. */
  294. do_action( 'bp_signup_profile_fields' ); ?>
  295.  
  296. </div><!-- #profile-details-section -->
  297.  
  298. <?php
  299.  
  300. /**
  301. * Fires after the display of member registration xprofile fields.
  302. *
  303. * @since 1.1.0
  304. */
  305. do_action( 'bp_after_signup_profile_fields' ); ?>
  306.  
  307. <?php endif; ?>
  308.  
  309. <?php if ( bp_get_blog_signup_allowed() ) : ?>
  310.  
  311. <?php
  312.  
  313. /**
  314. * Fires before the display of member registration blog details fields.
  315. *
  316. * @since 1.1.0
  317. */
  318. do_action( 'bp_before_blog_details_fields' ); ?>
  319.  
  320. <?php /***** Blog Creation Details ******/ ?>
  321.  
  322. <div class="register-section" id="blog-details-section">
  323.  
  324. <h4><?php _e( 'Blog Details', 'vibe' ); ?></h4>
  325.  
  326. <p><label for="signup_with_blog"><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 site', 'vibe' ); ?></label></p>
  327.  
  328. <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
  329.  
  330. <label for="signup_blog_url"><?php _e( 'Blog URL', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  331. <?php
  332.  
  333. /**
  334. * Fires and displays any member registration blog URL errors.
  335. *
  336. * @since 1.1.0
  337. */
  338. do_action( 'bp_signup_blog_url_errors' ); ?>
  339.  
  340. <?php if ( is_subdomain_install() ) : ?>
  341. http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_signup_subdomain_base(); ?>
  342. <?php else : ?>
  343. <?php echo home_url( '/' ); ?> <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" />
  344. <?php endif; ?>
  345.  
  346. <label for="signup_blog_title"><?php _e( 'Site Title', 'vibe' ); ?> <?php _e( '(required)', 'vibe' ); ?></label>
  347. <?php
  348.  
  349. /**
  350. * Fires and displays any member registration blog title errors.
  351. *
  352. * @since 1.1.0
  353. */
  354. do_action( 'bp_signup_blog_title_errors' ); ?>
  355. <input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
  356.  
  357. <span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'vibe' ); ?></span>
  358. <?php
  359.  
  360. /**
  361. * Fires and displays any member registration blog privacy errors.
  362. *
  363. * @since 1.1.0
  364. */
  365. do_action( 'bp_signup_blog_privacy_errors' ); ?>
  366.  
  367. <label for="signup_blog_privacy_public"><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', 'vibe' ); ?></label>
  368. <label for="signup_blog_privacy_private"><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', 'vibe' ); ?></label>
  369.  
  370. <?php
  371.  
  372. /**
  373. * Fires and displays any extra member registration blog details fields.
  374. *
  375. * @since 1.9.0
  376. */
  377. do_action( 'bp_blog_details_fields' ); ?>
  378.  
  379. </div>
  380.  
  381. </div><!-- #blog-details-section -->
  382.  
  383. <?php
  384.  
  385. /**
  386. * Fires after the display of member registration blog details fields.
  387. *
  388. * @since 1.1.0
  389. */
  390. do_action( 'bp_after_blog_details_fields' ); ?>
  391.  
  392. <?php endif; ?>
  393.  
  394. <?php
  395.  
  396. /**
  397. * Fires before the display of the registration submit buttons.
  398. *
  399. * @since 1.1.0
  400. */
  401. do_action( 'bp_before_registration_submit_buttons' ); ?>
  402.  
  403. <div class="submit">
  404. <input type="submit" name="signup_submit" id="signup_submit" value="<?php _ex( 'Complete Sign Up','singn up button on register page', 'vibe' ); ?>" />
  405. </div>
  406.  
  407. <?php
  408.  
  409. /**
  410. * Fires after the display of the registration submit buttons.
  411. *
  412. * @since 1.1.0
  413. */
  414. do_action( 'bp_after_registration_submit_buttons' ); ?>
  415.  
  416. <?php wp_nonce_field( 'bp_new_signup' ); ?>
  417.  
  418. <?php endif; // request-details signup step ?>
  419.  
  420. <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
  421.  
  422. <?php
  423.  
  424. /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
  425. do_action( 'template_notices' ); ?>
  426. <?php
  427.  
  428. /**
  429. * Fires before the display of the registration confirmed messages.
  430. *
  431. * @since 1.5.0
  432. */
  433. do_action( 'bp_before_registration_confirmed' ); ?>
  434.  
  435. <?php if ( bp_registration_needs_activation() ) : ?>
  436. <h3 class="heading"><span><?php _e('Activate your account','vibe'); ?></span></h3>
  437. <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.', 'vibe' ); ?></p>
  438. <?php else : ?>
  439. <h3 class="heading"><span><?php _e('Account creatd, login to your account','vibe'); ?></span></h3>
  440. <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'vibe' ); ?></p>
  441. <?php endif; ?>
  442.  
  443. <?php
  444.  
  445. /**
  446. * Fires after the display of the registration confirmed messages.
  447. *
  448. * @since 1.5.0
  449. */
  450. do_action( 'bp_after_registration_confirmed' ); ?>
  451.  
  452. <?php endif; // completed-confirmation signup step ?>
  453.  
  454. <?php
  455.  
  456. /**
  457. * Fires and displays any custom signup steps.
  458. *
  459. * @since 1.1.0
  460. */
  461. do_action( 'bp_custom_signup_steps' ); ?>
  462.  
  463. </form>
  464.  
  465. </div>
  466.  
  467. <?php
  468.  
  469. /**
  470. * Fires at the bottom of the BuddyPress member registration page template.
  471. *
  472. * @since 1.1.0
  473. */
  474. do_action( 'bp_after_register_page' ); ?>
  475.  
  476. </div><!-- #buddypress -->
  477.  
  478. </div><!-- .padder -->
  479. </div>
  480. <div class="col-md-3 col-sm-4">
  481. <div class="sidebar">
  482. <?php
  483. $sidebar = apply_filters('wplms_sidebar','buddypress',$register_id);
  484. if ( !function_exists('dynamic_sidebar')|| !dynamic_sidebar($sidebar) ) : ?>
  485. <?php endif; ?>
  486. </div>
  487. </div>
  488. </div>
  489. </section><!-- #content -->
  490. <script type="text/javascript">
  491. jQuery(document).ready( function() {
  492. if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') )
  493. jQuery('div#blog-details').toggle();
  494.  
  495. jQuery( 'input#signup_with_blog' ).click( function() {
  496. jQuery('div#blog-details').fadeOut().toggle();
  497. });
  498. });
  499. </script>
  500.  
  501. <?php get_footer( vibe_get_footer() );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement