User registration & user profile – Profile Builder - Version 1.1.9

Version Description

Minor changes to readme file.

Download this release

Release Info

Developer barinagabriel
Plugin Icon 128x128 User registration & user profile – Profile Builder
Version 1.1.9
Comparing to
See all releases

Code changes from version 1.1.8 to 1.1.9

Files changed (224) hide show
  1. 1.0.1/css/style.css +0 -38
  2. 1.0.1/includes/wppb-front-end-login.php +0 -86
  3. 1.0.1/includes/wppb-front-end-profile.php +0 -279
  4. 1.0.1/includes/wppb-front-end-register.php +0 -280
  5. 1.0.1/includes/wppb-menu-file.php +0 -330
  6. 1.0.1/profile-builder.php +0 -130
  7. 1.0.1/readme.txt +0 -71
  8. 1.0.1/uninstall.php +0 -10
  9. 1.0.10/css/style.css +0 -38
  10. 1.0.10/includes/wppb-front-end-login.php +0 -92
  11. 1.0.10/includes/wppb-front-end-profile.php +0 -317
  12. 1.0.10/includes/wppb-front-end-register.php +0 -284
  13. 1.0.10/includes/wppb-menu-file.php +0 -330
  14. 1.0.10/profile-builder.php +0 -120
  15. 1.0.10/readme.txt +0 -94
  16. 1.0.10/screenshots/screenshot1.jpg +0 -0
  17. 1.0.10/screenshots/screenshot2.jpg +0 -0
  18. 1.0.10/screenshots/screenshot3.jpg +0 -0
  19. 1.0.10/screenshots/screenshot4.jpg +0 -0
  20. 1.0.10/uninstall.php +0 -7
  21. 1.0.2/css/style.css +0 -38
  22. 1.0.2/includes/wppb-front-end-login.php +0 -86
  23. 1.0.2/includes/wppb-front-end-profile.php +0 -279
  24. 1.0.2/includes/wppb-front-end-register.php +0 -280
  25. 1.0.2/includes/wppb-menu-file.php +0 -330
  26. 1.0.2/profile-builder.php +0 -8
  27. 1.0.2/readme.txt +0 -74
  28. 1.0.2/screenshots/screenshot-1.jpg +0 -0
  29. 1.0.2/screenshots/screenshot-2.jpg +0 -0
  30. 1.0.2/screenshots/screenshot-3.jpg +0 -0
  31. 1.0.2/uninstall.php +0 -2
  32. 1.0.3/css/style.css +0 -38
  33. 1.0.3/includes/wppb-front-end-login.php +0 -86
  34. 1.0.3/includes/wppb-front-end-profile.php +0 -279
  35. 1.0.3/includes/wppb-front-end-register.php +0 -280
  36. 1.0.3/includes/wppb-menu-file.php +0 -330
  37. 1.0.3/profile-builder.php +0 -8
  38. 1.0.3/readme.txt +0 -74
  39. 1.0.3/screenshots/screenshot-1.jpg +0 -0
  40. 1.0.3/screenshots/screenshot-2.jpg +0 -0
  41. 1.0.3/screenshots/screenshot-3.jpg +0 -0
  42. 1.0.3/uninstall.php +0 -2
  43. 1.0.4/css/style.css +0 -38
  44. 1.0.4/includes/wppb-front-end-login.php +0 -86
  45. 1.0.4/includes/wppb-front-end-profile.php +0 -279
  46. 1.0.4/includes/wppb-front-end-register.php +0 -280
  47. 1.0.4/includes/wppb-menu-file.php +0 -330
  48. 1.0.4/profile-builder.php +0 -8
  49. 1.0.4/readme.txt +0 -74
  50. 1.0.4/screenshots/screenshot-1.jpg +0 -0
  51. 1.0.4/screenshots/screenshot-2.jpg +0 -0
  52. 1.0.4/screenshots/screenshot-3.jpg +0 -0
  53. 1.0.4/uninstall.php +0 -2
  54. 1.0.5/css/style.css +0 -38
  55. 1.0.5/includes/wppb-front-end-login.php +0 -86
  56. 1.0.5/includes/wppb-front-end-profile.php +0 -279
  57. 1.0.5/includes/wppb-front-end-register.php +0 -280
  58. 1.0.5/includes/wppb-menu-file.php +0 -330
  59. 1.0.5/profile-builder.php +0 -117
  60. 1.0.5/readme.txt +0 -83
  61. 1.0.5/screenshots/screenshot-1.jpg +0 -0
  62. 1.0.5/screenshots/screenshot-2.jpg +0 -0
  63. 1.0.5/screenshots/screenshot-3.jpg +0 -0
  64. 1.0.5/uninstall.php +0 -7
  65. 1.0.6/css/style.css +0 -38
  66. 1.0.6/includes/wppb-front-end-login.php +0 -86
  67. 1.0.6/includes/wppb-front-end-profile.php +0 -279
  68. 1.0.6/includes/wppb-front-end-register.php +0 -280
  69. 1.0.6/includes/wppb-menu-file.php +0 -330
  70. 1.0.6/profile-builder.php +0 -117
  71. 1.0.6/readme.txt +0 -86
  72. 1.0.6/screenshots/screenshot-1.jpg +0 -0
  73. 1.0.6/screenshots/screenshot-2.jpg +0 -0
  74. 1.0.6/screenshots/screenshot-3.jpg +0 -0
  75. 1.0.6/uninstall.php +0 -2
  76. 1.0.7/css/style.css +0 -38
  77. 1.0.7/includes/wppb-front-end-login.php +0 -86
  78. 1.0.7/includes/wppb-front-end-profile.php +0 -279
  79. 1.0.7/includes/wppb-front-end-register.php +0 -280
  80. 1.0.7/includes/wppb-menu-file.php +0 -330
  81. 1.0.7/profile-builder.php +0 -117
  82. 1.0.7/readme.txt +0 -86
  83. 1.0.7/screenshots/screenshot-1.jpg +0 -0
  84. 1.0.7/screenshots/screenshot-2.jpg +0 -0
  85. 1.0.7/screenshots/screenshot-3.jpg +0 -0
  86. 1.0.7/uninstall.php +0 -7
  87. 1.0.8/css/style.css +0 -38
  88. 1.0.8/includes/wppb-front-end-login.php +0 -86
  89. 1.0.8/includes/wppb-front-end-profile.php +0 -279
  90. 1.0.8/includes/wppb-front-end-register.php +0 -280
  91. 1.0.8/includes/wppb-menu-file.php +0 -330
  92. 1.0.8/profile-builder.php +0 -117
  93. 1.0.8/readme.txt +0 -86
  94. 1.0.8/screenshots/screenshot-1.jpg +0 -0
  95. 1.0.8/screenshots/screenshot-2.jpg +0 -0
  96. 1.0.8/screenshots/screenshot-3.jpg +0 -0
  97. 1.0.8/uninstall.php +0 -7
  98. 1.0.9/css/style.css +0 -38
  99. 1.0.9/includes/wppb-front-end-login.php +0 -92
  100. 1.0.9/includes/wppb-front-end-profile.php +0 -285
  101. 1.0.9/includes/wppb-front-end-register.php +0 -284
  102. 1.0.9/includes/wppb-menu-file.php +0 -330
  103. 1.0.9/profile-builder.php +0 -120
  104. 1.0.9/readme.txt +0 -90
  105. 1.0.9/screenshots/screenshot-1.jpg +0 -0
  106. 1.0.9/screenshots/screenshot-2.jpg +0 -0
  107. 1.0.9/screenshots/screenshot-3.jpg +0 -0
  108. 1.0.9/uninstall.php +0 -7
  109. 1.0/css/style.css +0 -38
  110. 1.0/includes/wppb-front-end-login.php +0 -86
  111. 1.0/includes/wppb-front-end-profile.php +0 -279
  112. 1.0/includes/wppb-front-end-register.php +0 -280
  113. 1.0/includes/wppb-menu-file.php +0 -330
  114. 1.0/profile-builder.php +0 -130
  115. 1.0/readme.txt +0 -62
  116. 1.0/screenshots/screenshot-1.jpg +0 -0
  117. 1.0/screenshots/screenshot-2.jpg +0 -0
  118. 1.0/screenshots/screenshot-3.jpg +0 -0
  119. 1.0/uninstall.php +0 -10
  120. 1.1.5/tags/1.0.1/css/style.css +0 -38
  121. 1.1.5/tags/1.0.1/includes/wppb-front-end-login.php +0 -86
  122. 1.1.5/tags/1.0.1/includes/wppb-front-end-profile.php +0 -279
  123. 1.1.5/tags/1.0.1/includes/wppb-front-end-register.php +0 -280
  124. 1.1.5/tags/1.0.1/includes/wppb-menu-file.php +0 -330
  125. 1.1.5/tags/1.0.1/profile-builder.php +0 -130
  126. 1.1.5/tags/1.0.1/readme.txt +0 -71
  127. 1.1.5/tags/1.0.1/screenshots/screenshot-1.jpg +0 -0
  128. 1.1.5/tags/1.0.1/screenshots/screenshot-2.jpg +0 -0
  129. 1.1.5/tags/1.0.1/screenshots/screenshot-3.jpg +0 -0
  130. 1.1.5/tags/1.0.1/uninstall.php +0 -10
  131. 1.1.5/tags/1.0.10/css/style.css +0 -38
  132. 1.1.5/tags/1.0.10/includes/wppb-front-end-login.php +0 -92
  133. 1.1.5/tags/1.0.10/includes/wppb-front-end-profile.php +0 -317
  134. 1.1.5/tags/1.0.10/includes/wppb-front-end-register.php +0 -284
  135. 1.1.5/tags/1.0.10/includes/wppb-menu-file.php +0 -330
  136. 1.1.5/tags/1.0.10/profile-builder.php +0 -120
  137. 1.1.5/tags/1.0.10/readme.txt +0 -94
  138. 1.1.5/tags/1.0.10/screenshots/screenshot1.jpg +0 -0
  139. 1.1.5/tags/1.0.10/screenshots/screenshot2.jpg +0 -0
  140. 1.1.5/tags/1.0.10/screenshots/screenshot3.jpg +0 -0
  141. 1.1.5/tags/1.0.10/screenshots/screenshot4.jpg +0 -0
  142. 1.1.5/tags/1.0.10/screenshots/screenshot6.jpg +0 -0
  143. 1.1.5/tags/1.0.10/screenshots/screenshot7.jpg +0 -0
  144. 1.1.5/tags/1.0.10/uninstall.php +0 -7
  145. 1.1.5/tags/1.0.2/css/style.css +0 -38
  146. 1.1.5/tags/1.0.2/includes/wppb-front-end-login.php +0 -86
  147. 1.1.5/tags/1.0.2/includes/wppb-front-end-profile.php +0 -279
  148. 1.1.5/tags/1.0.2/includes/wppb-front-end-register.php +0 -280
  149. 1.1.5/tags/1.0.2/includes/wppb-menu-file.php +0 -330
  150. 1.1.5/tags/1.0.2/profile-builder.php +0 -8
  151. 1.1.5/tags/1.0.2/readme.txt +0 -74
  152. 1.1.5/tags/1.0.2/screenshots/screenshot-1.jpg +0 -0
  153. 1.1.5/tags/1.0.2/screenshots/screenshot-2.jpg +0 -0
  154. 1.1.5/tags/1.0.2/screenshots/screenshot-3.jpg +0 -0
  155. 1.1.5/tags/1.0.2/uninstall.php +0 -2
  156. 1.1.5/tags/1.0.3/css/style.css +0 -38
  157. 1.1.5/tags/1.0.3/includes/wppb-front-end-login.php +0 -86
  158. 1.1.5/tags/1.0.3/includes/wppb-front-end-profile.php +0 -279
  159. 1.1.5/tags/1.0.3/includes/wppb-front-end-register.php +0 -280
  160. 1.1.5/tags/1.0.3/includes/wppb-menu-file.php +0 -330
  161. 1.1.5/tags/1.0.3/profile-builder.php +0 -8
  162. 1.1.5/tags/1.0.3/readme.txt +0 -74
  163. 1.1.5/tags/1.0.3/screenshots/screenshot-1.jpg +0 -0
  164. 1.1.5/tags/1.0.3/screenshots/screenshot-2.jpg +0 -0
  165. 1.1.5/tags/1.0.3/screenshots/screenshot-3.jpg +0 -0
  166. 1.1.5/tags/1.0.3/uninstall.php +0 -2
  167. 1.1.5/tags/1.0.4/css/style.css +0 -38
  168. 1.1.5/tags/1.0.4/includes/wppb-front-end-login.php +0 -86
  169. 1.1.5/tags/1.0.4/includes/wppb-front-end-profile.php +0 -279
  170. 1.1.5/tags/1.0.4/includes/wppb-front-end-register.php +0 -280
  171. 1.1.5/tags/1.0.4/includes/wppb-menu-file.php +0 -330
  172. 1.1.5/tags/1.0.4/profile-builder.php +0 -8
  173. 1.1.5/tags/1.0.4/readme.txt +0 -74
  174. 1.1.5/tags/1.0.4/screenshots/screenshot-1.jpg +0 -0
  175. 1.1.5/tags/1.0.4/screenshots/screenshot-2.jpg +0 -0
  176. 1.1.5/tags/1.0.4/screenshots/screenshot-3.jpg +0 -0
  177. 1.1.5/tags/1.0.4/uninstall.php +0 -2
  178. 1.1.5/tags/1.0.5/css/style.css +0 -38
  179. 1.1.5/tags/1.0.5/includes/wppb-front-end-login.php +0 -86
  180. 1.1.5/tags/1.0.5/includes/wppb-front-end-profile.php +0 -279
  181. 1.1.5/tags/1.0.5/includes/wppb-front-end-register.php +0 -280
  182. 1.1.5/tags/1.0.5/includes/wppb-menu-file.php +0 -330
  183. 1.1.5/tags/1.0.5/profile-builder.php +0 -117
  184. 1.1.5/tags/1.0.5/readme.txt +0 -83
  185. 1.1.5/tags/1.0.5/screenshots/screenshot-1.jpg +0 -0
  186. 1.1.5/tags/1.0.5/screenshots/screenshot-2.jpg +0 -0
  187. 1.1.5/tags/1.0.5/screenshots/screenshot-3.jpg +0 -0
  188. 1.1.5/tags/1.0.5/uninstall.php +0 -7
  189. 1.1.5/tags/1.0.6/css/style.css +0 -38
  190. 1.1.5/tags/1.0.6/includes/wppb-front-end-login.php +0 -86
  191. 1.1.5/tags/1.0.6/includes/wppb-front-end-profile.php +0 -279
  192. 1.1.5/tags/1.0.6/includes/wppb-front-end-register.php +0 -280
  193. 1.1.5/tags/1.0.6/includes/wppb-menu-file.php +0 -330
  194. 1.1.5/tags/1.0.6/profile-builder.php +0 -117
  195. 1.1.5/tags/1.0.6/readme.txt +0 -86
  196. 1.1.5/tags/1.0.6/screenshots/screenshot-1.jpg +0 -0
  197. 1.1.5/tags/1.0.6/screenshots/screenshot-2.jpg +0 -0
  198. 1.1.5/tags/1.0.6/screenshots/screenshot-3.jpg +0 -0
  199. 1.1.5/tags/1.0.6/uninstall.php +0 -2
  200. 1.1.5/tags/1.0.7/css/style.css +0 -38
  201. 1.1.5/tags/1.0.7/includes/wppb-front-end-login.php +0 -86
  202. 1.1.5/tags/1.0.7/includes/wppb-front-end-profile.php +0 -279
  203. 1.1.5/tags/1.0.7/includes/wppb-front-end-register.php +0 -280
  204. 1.1.5/tags/1.0.7/includes/wppb-menu-file.php +0 -330
  205. 1.1.5/tags/1.0.7/profile-builder.php +0 -117
  206. 1.1.5/tags/1.0.7/readme.txt +0 -86
  207. 1.1.5/tags/1.0.7/screenshots/screenshot-1.jpg +0 -0
  208. 1.1.5/tags/1.0.7/screenshots/screenshot-2.jpg +0 -0
  209. 1.1.5/tags/1.0.7/screenshots/screenshot-3.jpg +0 -0
  210. 1.1.5/tags/1.0.7/uninstall.php +0 -7
  211. 1.1.5/tags/1.0.8/css/style.css +0 -38
  212. 1.1.5/tags/1.0.8/includes/wppb-front-end-login.php +0 -86
  213. 1.1.5/tags/1.0.8/includes/wppb-front-end-profile.php +0 -279
  214. 1.1.5/tags/1.0.8/includes/wppb-front-end-register.php +0 -280
  215. 1.1.5/tags/1.0.8/includes/wppb-menu-file.php +0 -330
  216. 1.1.5/tags/1.0.8/profile-builder.php +0 -117
  217. 1.1.5/tags/1.0.8/readme.txt +0 -86
  218. 1.1.5/tags/1.0.8/screenshots/screenshot-1.jpg +0 -0
  219. 1.1.5/tags/1.0.8/screenshots/screenshot-2.jpg +0 -0
  220. 1.1.5/tags/1.0.8/screenshots/screenshot-3.jpg +0 -0
  221. 1.1.5/tags/1.0.8/uninstall.php +0 -7
  222. 1.1.5/tags/1.0.9/css/style.css +0 -38
  223. 1.1.5/tags/1.0.9/includes/wppb-front-end-login.php +0 -92
  224. 1.1.5/tags/1.0.9/includes/wppb-front-end-profile.php +0 -179
1.0.1/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/profile-builder.php DELETED
@@ -1,130 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI:
5
- Description: Profile Builder lets you create, edit and delete custom user information-fields from the frontend, and also lets you add new, custom fields. You can use the following shortcodes: [wppb-edit-profile] for the front-end profile information, [wppb-login] for a log-in menu or [wppb-register] to register a new user.
6
- Version: v1.0
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
- */
11
-
12
-
13
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
-
28
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
-
46
-
47
- global $wp_roles;
48
-
49
- $all_roles = $wp_roles->roles;
50
- $editable_roles = apply_filters('editable_roles', $all_roles);
51
-
52
-
53
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
54
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
55
- $rolesArray = array();
56
- foreach ( $editable_roles as $key => $data )
57
- $rolesArray = array( $key => 'show' ) + $rolesArray;
58
- $rolesArray = array_reverse($rolesArray,true);
59
- add_option( 'wppb_display_admin_settings', $rolesArray);
60
- }
61
-
62
- }
63
-
64
-
65
-
66
- function wppb_create_menu(){
67
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
68
- }
69
-
70
-
71
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
72
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
73
- register_setting( 'wppb_default_style', 'wppb_default_style' );
74
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
75
- }
76
-
77
-
78
- function wppb_add_plugin_stylesheet() {
79
- $wppb_showDefaultCss = get_option('wppb_default_style');
80
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
81
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
82
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
83
- wp_register_style('wppb_stylesheet', $styleUrl);
84
- wp_enqueue_style( 'wppb_stylesheet');
85
- }
86
- }
87
-
88
-
89
-
90
-
91
- function wppb_show_admin_bar($content){
92
- global $current_user;
93
-
94
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
95
-
96
- if ($admintSettingsPresent != 'not_found'){
97
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
98
- $userRole = ($current_user->data->wp_capabilities);
99
- if ($userRole != NULL){
100
- $currentRole = key($userRole);
101
- $getSettings = $wppb_showAdminBar[$currentRole];
102
- if ($getSettings == 'show')
103
- return true;
104
- elseif ($getSettings == 'hide')
105
- return false;
106
- }
107
- }
108
- else
109
- return true;
110
- }
111
-
112
-
113
-
114
-
115
-
116
-
117
- if (is_admin() ){ // if we are in the admin menu
118
- include_once('includes/wppb-menu-file.php'); // include the menu file
119
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
120
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
121
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
122
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
123
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
124
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
125
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
126
- add_shortcode('wppb-login', 'wppb_front_end_login');
127
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
128
- add_shortcode('wppb-register', 'wppb_front_end_register');
129
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/readme.txt DELETED
@@ -1,71 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.1
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.1 =
68
- Changes to the ReadMe File
69
-
70
- = 1.0 =
71
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.1/uninstall.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
- exit (); // If uninstall not called from WordPress exit
5
-
6
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
7
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
8
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
9
-
10
- ?>
 
 
 
 
 
 
 
 
 
 
1.0.10/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/includes/wppb-front-end-login.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- ob_start();
21
- global $wppb_login;
22
-
23
- echo '<div class="wppb_holder" id="wppb_login">';
24
-
25
- if ( is_user_logged_in() ) : // Already logged in
26
- global $user_ID;
27
- $wppb_user = get_userdata( $user_ID );
28
- if($wppb_user->display_name == ''){
29
- $wppb_user->display_name = $wppb_user->user_login;
30
- }
31
-
32
- ?>
33
-
34
-
35
-
36
-
37
- <p class="alert">
38
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
39
- </p><!-- .alert -->
40
-
41
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
42
- <?php
43
- //$wppb_login = get_userdata( $wppb_login->ID );
44
- if($wppb_login->display_name == ''){
45
- $wppb_login->display_name = $wppb_login->user_login;
46
- }
47
-
48
- ?>
49
-
50
- <p class="success">
51
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
52
- </p><!-- .success-->
53
- <?php else : // Not logged in ?>
54
-
55
- <?php if (!empty( $_POST['action'] )): ?>
56
- <p class="error">
57
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
58
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
59
- </p><!-- .error -->
60
- <?php endif; ?>
61
-
62
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
63
- <p class="login-form-username">
64
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
65
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
66
- </p><!-- .form-username -->
67
-
68
- <p class="login-form-password">
69
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
70
- <input type="password" name="password" id="password" class="text-input" />
71
- </p><!-- .form-password -->
72
- <p class="login-form-submit">
73
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
74
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
75
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
76
- <input type="hidden" name="action" value="log-in" />
77
- </p><!-- .form-submit -->
78
- <p>
79
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
80
- </p>
81
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
82
- </form><!-- .sign-in -->
83
-
84
- <?php endif;?>
85
- </div>
86
- <?php
87
-
88
- $output = ob_get_contents();
89
- ob_end_clean();
90
- return $output;
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/includes/wppb-front-end-profile.php DELETED
@@ -1,317 +0,0 @@
1
- <?php
2
- /*
3
- wp_update_user only attempts to clear and reset cookies if it's updating the password.
4
- The php function setcookie(), used in both the cookie-clearing and cookie-resetting functions,
5
- adds to the page headers and therefore must be called within the first php tag on the page, and
6
- before the WordPress get_header() function. Since wp_update_user needs this, it must be at the
7
- beginning of the page as well.
8
- */
9
- $wppb_saved_pass = false;
10
- $wppb_error_pass = false;
11
-
12
- function wppb_save_the_password(){
13
- global $wppb_saved_pass;
14
- global $wppb_error_pass;
15
- /* Load registration file. */
16
- require_once(ABSPATH . WPINC . '/registration.php');
17
- /* Get user info. */
18
- global $current_user;
19
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] )
23
- {
24
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
25
- $wppb_saved_pass = true;
26
- } else {
27
- $wppb_error_pass = true;
28
- }
29
- }
30
- }
31
- }
32
- add_action('init', 'wppb_save_the_password');
33
-
34
- /* the shortcode function */
35
- function wppb_front_end_profile_info() {
36
- global $wppb_saved_pass;
37
- global $wppb_error_pass;
38
-
39
- ob_start();
40
- get_currentuserinfo();
41
- $wppb_defaultOptions = get_option('wppb_default_settings');
42
- $changesSaved = 'no';
43
-
44
- /* Load registration file. */
45
- require_once(ABSPATH . WPINC . '/registration.php');
46
- /* Get user info. */
47
- global $current_user;
48
- /* If profile was saved, update profile. */
49
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
50
-
51
- if (email_exists( $_POST['email'] ) != FALSE)
52
- $thisEmail = email_exists( $_POST['email'] );
53
- else $thisEmail = $current_user->id;
54
-
55
- /* Update user password. */
56
- if ($wppb_saved_pass == true){
57
- $changesSaved = 'yes';
58
- }
59
- if ($wppb_error_pass == true){
60
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
61
- }
62
-
63
-
64
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
65
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
67
- $changesSaved = 'yes';
68
- }else
69
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
70
- }else
71
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
72
-
73
-
74
-
75
- /* Update user information. */
76
- if ($wppb_defaultOptions['firstname'] == 'show'){
77
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
78
- $changesSaved = 'yes';
79
- }
80
- if ($wppb_defaultOptions['lastname'] == 'show'){
81
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
82
- $changesSaved = 'yes';
83
- }
84
-
85
- if ($wppb_defaultOptions['nickname'] == 'show'){
86
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
87
- $changesSaved = 'yes';
88
- }
89
-
90
- if ($wppb_defaultOptions['dispname'] == 'show'){
91
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
92
- $changesSaved = 'yes';
93
- }
94
-
95
- if ($wppb_defaultOptions['website'] == 'show'){
96
- $wppbPos = strpos($_POST['website'], 'http://');
97
- if($wppbPos !== FALSE){
98
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
99
- $changesSaved = 'yes';
100
- }else{
101
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
102
- $changesSaved = 'yes';
103
- }
104
- }
105
-
106
- if ($wppb_defaultOptions['aim'] == 'show'){
107
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
108
- $changesSaved = 'yes';
109
- }
110
-
111
- if ($wppb_defaultOptions['yahoo'] == 'show'){
112
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
113
- $changesSaved = 'yes';
114
- }
115
-
116
- if ($wppb_defaultOptions['jabber'] == 'show'){
117
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
118
- $changesSaved = 'yes';
119
- }
120
-
121
- if ($wppb_defaultOptions['bio'] == 'show'){
122
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
123
- $changesSaved = 'yes';
124
- }
125
-
126
- }
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
- ?>
135
- <div class="wppb_holder" id="wppb_modify">
136
- <?php if ( !is_user_logged_in() ) : ?>
137
-
138
- <p class="warning">
139
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
140
- </p><!-- .warning -->
141
-
142
- <?php else : ?>
143
-
144
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
145
- <?php
146
- if ($changesSaved == 'yes'){
147
- echo '<p class="changes-saved">';
148
- _e('The changes made have been successfully saved.', 'profilebuilder');
149
- echo'</p><!-- .changes-saved -->';
150
- }
151
- ?>
152
-
153
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
154
- <p>
155
- <strong>Name</strong>
156
- </p>
157
- <?php
158
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
159
- <p class="username">
160
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
161
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
162
- </p><!-- .first_name -->';
163
- }
164
- ?>
165
-
166
- <?php
167
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
168
- <p class="first_name">
169
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
170
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
171
- </p><!-- .first_name -->';
172
- }
173
- ?>
174
-
175
- <?php
176
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
177
- <p class="last_name">
178
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
179
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
180
- </p><!-- .last_name -->';
181
- }
182
- ?>
183
-
184
- <?php
185
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
186
- <p class="nickname">
187
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
188
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
189
- </p><!-- .nickname -->';
190
- }
191
- ?>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
195
- <p class="display_name">
196
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
197
- <select name="display_name" id="display_name">';
198
- $public_display = array();
199
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
200
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
201
- if ( !empty($thisFirstName))
202
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
203
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
204
- if ( !empty($thisLastName))
205
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
206
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
207
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
208
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
209
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
210
- }
211
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
212
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
213
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
214
- $public_display = array_map( 'trim', $public_display );
215
- foreach ( $public_display as $id => $item ) {
216
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
217
- }
218
- echo'</select>
219
- </p><!-- .display_name -->';
220
- }
221
- ?>
222
-
223
-
224
- <p>
225
- <strong>Contact Info</strong>
226
- </p>
227
-
228
- <?php
229
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
230
- <p class="form-email">
231
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
232
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
233
- </p><!-- .form-email -->';
234
- }
235
- ?>
236
-
237
- <?php
238
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
239
- <p class="form-website">
240
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
241
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
242
- </p><!-- .form-website -->';
243
- }
244
- ?>
245
-
246
- <?php
247
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
248
- <p class="form-aim">
249
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
250
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
251
- </p><!-- .form-aim -->';
252
- }
253
- ?>
254
-
255
- <?php
256
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
257
- <p class="form-yim">
258
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
259
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
260
- </p><!-- .form-yim -->';
261
- }
262
- ?>
263
-
264
- <?php
265
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
266
- <p class="form-jabber">
267
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
268
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
269
- </p><!-- .form-jabber -->';
270
- }
271
- ?>
272
-
273
- <p>
274
- <strong>About Yourself</strong>
275
- </p>
276
-
277
- <?php
278
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
279
- <p class="form-description">
280
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
281
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
282
- </p><!-- .form-description -->';
283
- }
284
- ?>
285
-
286
- <?php
287
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
288
- <p class="form-password">
289
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
290
- <input class="text-input" name="pass1" type="password" id="pass1" />
291
- </p><!-- .form-password -->
292
-
293
- <p class="form-password">
294
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
295
- <input class="text-input" name="pass2" type="password" id="pass2" />
296
- </p><!-- .form-password -->';
297
- }
298
- ?>
299
-
300
-
301
- <p class="form-submit">
302
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
303
- <?php// wp_nonce_field( 'update-user' ) ?>
304
- <input name="action" type="hidden" id="action" value="update-user" />
305
- </p><!-- .form-submit -->
306
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
307
- </form><!-- #edituser -->
308
-
309
- <?php endif; ?>
310
- </div>
311
- <?php
312
- $output = ob_get_contents();
313
- ob_end_clean();
314
- return $output;
315
- }
316
-
317
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/includes/wppb-front-end-register.php DELETED
@@ -1,284 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- ob_start();
5
- $wppb_defaultOptions = get_option('wppb_default_settings');
6
- global $current_user;
7
- get_currentuserinfo();
8
-
9
- /* Load registration file. */
10
- require_once( ABSPATH . WPINC . '/registration.php' );
11
-
12
- /* Check if users can register. */
13
- $registration = get_option( 'users_can_register' );
14
-
15
- /* If user registered, input info. */
16
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
17
-
18
- $user_pass = esc_attr( $_POST['passw1'] );
19
- $userdata = array(
20
- 'user_pass' => $user_pass,
21
- 'user_login' => esc_attr( $_POST['user_name'] ),
22
- 'first_name' => esc_attr( $_POST['first_name'] ),
23
- 'last_name' => esc_attr( $_POST['last_name'] ),
24
- 'nickname' => esc_attr( $_POST['nickname'] ),
25
- 'user_email' => esc_attr( $_POST['email'] ),
26
- 'user_url' => esc_attr( $_POST['website'] ),
27
- 'aim' => esc_attr( $_POST['aim'] ),
28
- 'yim' => esc_attr( $_POST['yim'] ),
29
- 'jabber' => esc_attr( $_POST['jabber'] ),
30
- 'description' => esc_attr( $_POST['description'] ),
31
- 'role' => get_option( 'default_role' ),
32
- );
33
-
34
- if ( !$userdata['user_login'] )
35
- $error = __('A username is required for registration.', 'profilebuilder');
36
- elseif ( username_exists($userdata['user_login']) )
37
- $error = __('Sorry, that username already exists!', 'profilebuilder');
38
-
39
- elseif ( !is_email($userdata['user_email'], true) )
40
- $error = __('You must enter a valid email address.', 'profilebuilder');
41
- elseif ( email_exists($userdata['user_email']) )
42
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
43
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
44
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
45
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
46
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
47
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
48
- }
49
-
50
- else{
51
- $the_registered_name = $_POST['user_name'];
52
- $new_user = wp_insert_user( $userdata );
53
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
54
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
55
- $fromemail = get_bloginfo('name');
56
- $mailPassword = $_POST['passw1'];
57
- $mailUsername = $_POST['user_name'];
58
- $subject = 'A new account has been created for you.';
59
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
60
- $messageSent = wp_mail( $email, $subject, $msg);
61
- if( $messageSent == TRUE)
62
- $sentEmailStatus = 2;
63
- else
64
- $sentEmailStatus = 1;
65
- }
66
-
67
- }
68
- }
69
-
70
- ?>
71
- <div class="wppb_holder" id="wppb_register">
72
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
73
- <?php
74
- global $user_ID;
75
- $login = get_userdata( $user_ID );
76
- if($login->display_name == ''){
77
- $login->display_name = $login->user_login;
78
- }
79
- ?>
80
- <p class="log-in-out alert">
81
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
82
- </p><!-- .log-in-out .alert -->
83
-
84
- <?php elseif ( $new_user ) : ?>
85
-
86
-
87
- <?php
88
-
89
- echo'<p class="success">';
90
- if ( current_user_can( 'create_users' ) )
91
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
92
- else
93
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
94
- echo'</p><!-- .success -->';
95
- ?>
96
-
97
- <?php
98
- if(isset($_POST['send_password'])){
99
- if ($sentEmailStatus == 1){
100
- echo '<p class="error">';
101
- echo 'An error occured while trying to send the notification email.';
102
- echo '</p><!-- .error -->';
103
- }elseif ($sentEmailStatus == 2){
104
- echo '<p class="success">';
105
- echo 'An email containing the username and password was successfully sent.';
106
- echo '</p><!-- .success -->';
107
- }
108
- }
109
- ?>
110
- <?php else : ?>
111
-
112
- <?php if ( $error ) : ?>
113
- <p class="error">
114
- <?php echo $error; ?>
115
- </p><!-- .error -->
116
- <?php endif; ?>
117
-
118
-
119
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
120
- <p class="alert">
121
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
122
- </p><!-- .alert -->
123
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
124
- <p class="alert">
125
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
126
- </p><!-- .alert -->
127
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
128
- <p class="alert">
129
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
130
- </p><!-- .alert -->
131
-
132
- <?php endif; ?>
133
-
134
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
135
-
136
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
137
-
138
- <p>
139
- <strong>Name</strong>
140
- </p>
141
-
142
- <?php
143
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
144
- <p class="form-username">
145
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
146
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
147
- </p><!-- .form-username -->';
148
- }
149
- ?>
150
-
151
- <?php
152
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
153
- <p class="first_name">
154
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
155
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
156
- </p><!-- .first_name -->';
157
- }
158
- ?>
159
-
160
- <?php
161
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
162
- <p class="last_name">
163
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
164
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
165
- </p><!-- .last_name -->';
166
- }
167
- ?>
168
-
169
- <?php
170
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
171
- <p class="nickname">
172
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
173
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
174
- </p><!-- .nickname -->';
175
- }
176
- ?>
177
-
178
- <p>
179
- <strong>Contact Info</strong>
180
- </p>
181
-
182
- <?php
183
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
184
- <p class="form-email">
185
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
186
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
187
- </p><!-- .form-email -->';
188
- }
189
- ?>
190
-
191
- <?php
192
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
193
- <p class="form-website">
194
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
195
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
196
- </p><!-- .form-website -->';
197
- }
198
- ?>
199
-
200
- <?php
201
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
202
- <p class="form-aim">
203
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
204
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
205
- </p><!-- .form-aim -->';
206
- }
207
- ?>
208
-
209
- <?php
210
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
211
- <p class="form-yim">
212
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
213
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
214
- </p><!-- .form-yim -->';
215
- }
216
- ?>
217
-
218
- <?php
219
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
220
- <p class="form-jabber">
221
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
222
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
223
- </p><!-- .form-jabber -->';
224
- }
225
- ?>
226
-
227
- <p>
228
- <strong>About Yourself</strong>
229
- </p>
230
-
231
- <?php
232
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
233
- <p class="form-description">
234
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
235
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
236
- </p><!-- .form-description -->';
237
- }
238
- ?>
239
-
240
- <?php
241
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
242
- <p class="form-password">
243
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
244
- <input class="text-input" name="passw1" type="password" id="pass1" />
245
- </p><!-- .form-password -->
246
-
247
- <p class="form-password">
248
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
249
- <input class="text-input" name="passw2" type="password" id="pass2" />
250
- </p><!-- .form-password -->';
251
- }
252
- ?>
253
- <?php
254
- if ( current_user_can( 'delete_users' ) )
255
- echo '
256
- <p class="send-confirmation-email">
257
- <label for="pass1">';
258
- //_e('Send Password? ', 'profilebuilder');
259
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
260
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
261
- </p><!-- .send-confirmation-email -->';
262
- ?>
263
-
264
- <p class="form-submit">
265
- <?php echo $referer; ?>
266
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
267
- <input name="action" type="hidden" id="action" value="adduser" />
268
- </p><!-- .form-submit -->
269
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
270
- </form><!-- #adduser -->
271
-
272
- <?php endif; ?>
273
-
274
- <?php endif; ?>
275
-
276
-
277
- </div>
278
- <?php
279
- $output = ob_get_contents();
280
- ob_end_clean();
281
- return $output;
282
- }
283
-
284
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/profile-builder.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.10
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
-
118
- /* Allow shortcodes to be used in the text widgets */
119
- add_filter('widget_text', 'do_shortcode');
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/readme.txt DELETED
@@ -1,94 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: registration, profile, user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1.2
8
- Stable tag: 1.0.10
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.10 =
68
- Bugfix - The wp_update_user attempts to clear and reset cookies if it's updating the password.
69
- Because of that we get "headers already sent". Fixed by hooking into the init.
70
-
71
- = 1.0.9 =
72
- Bugfix - On the edit profile page the website field added a new http:// everytime you updated your profile.
73
- Bugfix/ExtraFeature - Add support for shortcodes to be run in a text widget area.
74
-
75
- = 1.0.6 =
76
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
77
-
78
- = 1.0.5 =
79
- You can now actualy install the plugin. All because of a silly line break.
80
-
81
- = 1.0.4 =
82
- Still no Change.
83
-
84
- = 1.0.3 =
85
- No Change.
86
-
87
- = 1.0.2 =
88
- Small changes.
89
-
90
- = 1.0.1 =
91
- Changes to the ReadMe File
92
-
93
- = 1.0 =
94
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.10/screenshots/screenshot1.jpg DELETED
Binary file
1.0.10/screenshots/screenshot2.jpg DELETED
Binary file
1.0.10/screenshots/screenshot3.jpg DELETED
Binary file
1.0.10/screenshots/screenshot4.jpg DELETED
Binary file
1.0.10/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.0.2/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.0.2/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.2
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.2/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.2/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.2/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.2/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.0.3/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.0.3/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.3
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.3/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.3/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.3/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.3/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.0.4/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.0.4/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.4
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.4/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.4/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.4/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.4/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.0.5/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.5
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/readme.txt DELETED
@@ -1,83 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.5
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.5 =
68
- You can now actualy install the plugin. All because of a silly line break.
69
-
70
- = 1.0.4 =
71
- Still no Change.
72
-
73
- = 1.0.3 =
74
- No Change.
75
-
76
- = 1.0.2 =
77
- Small changes.
78
-
79
- = 1.0.1 =
80
- Changes to the ReadMe File
81
-
82
- = 1.0 =
83
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.5/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.5/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.5/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.5/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.0.6/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.6
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.6
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.6/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.6/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.6/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.6/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.0.7/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.6
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.7/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.7/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.7/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.7/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.0.8/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.8
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.8
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.8/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.8/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.8/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.8/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.0.9/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/includes/wppb-front-end-login.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- ob_start();
21
- global $wppb_login;
22
-
23
- echo '<div class="wppb_holder" id="wppb_login">';
24
-
25
- if ( is_user_logged_in() ) : // Already logged in
26
- global $user_ID;
27
- $wppb_user = get_userdata( $user_ID );
28
- if($wppb_user->display_name == ''){
29
- $wppb_user->display_name = $wppb_user->user_login;
30
- }
31
-
32
- ?>
33
-
34
-
35
-
36
-
37
- <p class="alert">
38
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
39
- </p><!-- .alert -->
40
-
41
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
42
- <?php
43
- //$wppb_login = get_userdata( $wppb_login->ID );
44
- if($wppb_login->display_name == ''){
45
- $wppb_login->display_name = $wppb_login->user_login;
46
- }
47
-
48
- ?>
49
-
50
- <p class="success">
51
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
52
- </p><!-- .success-->
53
- <?php else : // Not logged in ?>
54
-
55
- <?php if (!empty( $_POST['action'] )): ?>
56
- <p class="error">
57
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
58
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
59
- </p><!-- .error -->
60
- <?php endif; ?>
61
-
62
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
63
- <p class="login-form-username">
64
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
65
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
66
- </p><!-- .form-username -->
67
-
68
- <p class="login-form-password">
69
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
70
- <input type="password" name="password" id="password" class="text-input" />
71
- </p><!-- .form-password -->
72
- <p class="login-form-submit">
73
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
74
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
75
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
76
- <input type="hidden" name="action" value="log-in" />
77
- </p><!-- .form-submit -->
78
- <p>
79
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
80
- </p>
81
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
82
- </form><!-- .sign-in -->
83
-
84
- <?php endif;?>
85
- </div>
86
- <?php
87
-
88
- $output = ob_get_contents();
89
- ob_end_clean();
90
- return $output;
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/includes/wppb-front-end-profile.php DELETED
@@ -1,285 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- ob_start();
4
- get_currentuserinfo();
5
- $wppb_defaultOptions = get_option('wppb_default_settings');
6
- $changesSaved = 'no';
7
-
8
-
9
-
10
- /* Load registration file. */
11
- require_once(ABSPATH . WPINC . '/registration.php');
12
- /* Get user info. */
13
- global $current_user;
14
- /* If profile was saved, update profile. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
16
-
17
- if (email_exists( $_POST['email'] ) != FALSE)
18
- $thisEmail = email_exists( $_POST['email'] );
19
- else $thisEmail = $current_user->id;
20
-
21
- /* Update user password. */
22
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
23
- if ( $_POST['pass1'] == $_POST['pass2'] ){
24
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
25
- $changesSaved = 'yes';
26
- }else
27
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
28
- }
29
-
30
-
31
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
32
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
33
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
34
- $changesSaved = 'yes';
35
- }else
36
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
37
- }else
38
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
39
-
40
-
41
-
42
- /* Update user information. */
43
- if ($wppb_defaultOptions['firstname'] == 'show'){
44
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
45
- $changesSaved = 'yes';
46
- }
47
- if ($wppb_defaultOptions['lastname'] == 'show'){
48
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
49
- $changesSaved = 'yes';
50
- }
51
-
52
- if ($wppb_defaultOptions['nickname'] == 'show'){
53
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
54
- $changesSaved = 'yes';
55
- }
56
-
57
- if ($wppb_defaultOptions['dispname'] == 'show'){
58
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
59
- $changesSaved = 'yes';
60
- }
61
-
62
- if ($wppb_defaultOptions['website'] == 'show'){
63
- $wppbPos = strpos($_POST['website'], 'http://');
64
- if($wppbPos !== FALSE){
65
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
66
- $changesSaved = 'yes';
67
- }else{
68
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
69
- $changesSaved = 'yes';
70
- }
71
- }
72
-
73
- if ($wppb_defaultOptions['aim'] == 'show'){
74
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
75
- $changesSaved = 'yes';
76
- }
77
-
78
- if ($wppb_defaultOptions['yahoo'] == 'show'){
79
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
80
- $changesSaved = 'yes';
81
- }
82
-
83
- if ($wppb_defaultOptions['jabber'] == 'show'){
84
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
85
- $changesSaved = 'yes';
86
- }
87
-
88
- if ($wppb_defaultOptions['bio'] == 'show'){
89
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
90
- $changesSaved = 'yes';
91
- }
92
-
93
- }
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
- ?>
102
- <div class="wppb_holder" id="wppb_modify">
103
- <?php if ( !is_user_logged_in() ) : ?>
104
-
105
- <p class="warning">
106
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
107
- </p><!-- .warning -->
108
-
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
112
- <?php
113
- if ($changesSaved == 'yes'){
114
- echo '<p class="changes-saved">';
115
- _e('The changes made have been successfully saved.', 'profilebuilder');
116
- echo'</p><!-- .changes-saved -->';
117
- }
118
- ?>
119
-
120
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
121
- <p>
122
- <strong>Name</strong>
123
- </p>
124
- <?php
125
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
126
- <p class="username">
127
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
128
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
129
- </p><!-- .first_name -->';
130
- }
131
- ?>
132
-
133
- <?php
134
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
135
- <p class="first_name">
136
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
137
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
138
- </p><!-- .first_name -->';
139
- }
140
- ?>
141
-
142
- <?php
143
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
144
- <p class="last_name">
145
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
146
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
147
- </p><!-- .last_name -->';
148
- }
149
- ?>
150
-
151
- <?php
152
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
153
- <p class="nickname">
154
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
155
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
156
- </p><!-- .nickname -->';
157
- }
158
- ?>
159
-
160
- <?php
161
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
162
- <p class="display_name">
163
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
164
- <select name="display_name" id="display_name">';
165
- $public_display = array();
166
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
167
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
168
- if ( !empty($thisFirstName))
169
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
170
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
171
- if ( !empty($thisLastName))
172
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
173
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
174
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
175
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
176
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
177
- }
178
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
179
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
180
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
181
- $public_display = array_map( 'trim', $public_display );
182
- foreach ( $public_display as $id => $item ) {
183
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
184
- }
185
- echo'</select>
186
- </p><!-- .display_name -->';
187
- }
188
- ?>
189
-
190
-
191
- <p>
192
- <strong>Contact Info</strong>
193
- </p>
194
-
195
- <?php
196
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
197
- <p class="form-email">
198
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
199
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
200
- </p><!-- .form-email -->';
201
- }
202
- ?>
203
-
204
- <?php
205
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
206
- <p class="form-website">
207
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
208
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
209
- </p><!-- .form-website -->';
210
- }
211
- ?>
212
-
213
- <?php
214
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
215
- <p class="form-aim">
216
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
217
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
218
- </p><!-- .form-aim -->';
219
- }
220
- ?>
221
-
222
- <?php
223
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
224
- <p class="form-yim">
225
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
226
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
227
- </p><!-- .form-yim -->';
228
- }
229
- ?>
230
-
231
- <?php
232
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
233
- <p class="form-jabber">
234
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
235
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
236
- </p><!-- .form-jabber -->';
237
- }
238
- ?>
239
-
240
- <p>
241
- <strong>About Yourself</strong>
242
- </p>
243
-
244
- <?php
245
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
246
- <p class="form-description">
247
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
248
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
249
- </p><!-- .form-description -->';
250
- }
251
- ?>
252
-
253
- <?php
254
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
255
- <p class="form-password">
256
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
257
- <input class="text-input" name="pass1" type="password" id="pass1" />
258
- </p><!-- .form-password -->
259
-
260
- <p class="form-password">
261
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
262
- <input class="text-input" name="pass2" type="password" id="pass2" />
263
- </p><!-- .form-password -->';
264
- }
265
- ?>
266
-
267
-
268
- <p class="form-submit">
269
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
270
- <?php// wp_nonce_field( 'update-user' ) ?>
271
- <input name="action" type="hidden" id="action" value="update-user" />
272
- </p><!-- .form-submit -->
273
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
274
- </form><!-- #edituser -->
275
-
276
- <?php endif; ?>
277
- </div>
278
- <?php
279
- $output = ob_get_contents();
280
- ob_end_clean();
281
- return $output;
282
-
283
- }
284
-
285
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/includes/wppb-front-end-register.php DELETED
@@ -1,284 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- ob_start();
5
- $wppb_defaultOptions = get_option('wppb_default_settings');
6
- global $current_user;
7
- get_currentuserinfo();
8
-
9
- /* Load registration file. */
10
- require_once( ABSPATH . WPINC . '/registration.php' );
11
-
12
- /* Check if users can register. */
13
- $registration = get_option( 'users_can_register' );
14
-
15
- /* If user registered, input info. */
16
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
17
-
18
- $user_pass = esc_attr( $_POST['passw1'] );
19
- $userdata = array(
20
- 'user_pass' => $user_pass,
21
- 'user_login' => esc_attr( $_POST['user_name'] ),
22
- 'first_name' => esc_attr( $_POST['first_name'] ),
23
- 'last_name' => esc_attr( $_POST['last_name'] ),
24
- 'nickname' => esc_attr( $_POST['nickname'] ),
25
- 'user_email' => esc_attr( $_POST['email'] ),
26
- 'user_url' => esc_attr( $_POST['website'] ),
27
- 'aim' => esc_attr( $_POST['aim'] ),
28
- 'yim' => esc_attr( $_POST['yim'] ),
29
- 'jabber' => esc_attr( $_POST['jabber'] ),
30
- 'description' => esc_attr( $_POST['description'] ),
31
- 'role' => get_option( 'default_role' ),
32
- );
33
-
34
- if ( !$userdata['user_login'] )
35
- $error = __('A username is required for registration.', 'profilebuilder');
36
- elseif ( username_exists($userdata['user_login']) )
37
- $error = __('Sorry, that username already exists!', 'profilebuilder');
38
-
39
- elseif ( !is_email($userdata['user_email'], true) )
40
- $error = __('You must enter a valid email address.', 'profilebuilder');
41
- elseif ( email_exists($userdata['user_email']) )
42
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
43
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
44
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
45
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
46
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
47
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
48
- }
49
-
50
- else{
51
- $the_registered_name = $_POST['user_name'];
52
- $new_user = wp_insert_user( $userdata );
53
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
54
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
55
- $fromemail = get_bloginfo('name');
56
- $mailPassword = $_POST['passw1'];
57
- $mailUsername = $_POST['user_name'];
58
- $subject = 'A new account has been created for you.';
59
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
60
- $messageSent = wp_mail( $email, $subject, $msg);
61
- if( $messageSent == TRUE)
62
- $sentEmailStatus = 2;
63
- else
64
- $sentEmailStatus = 1;
65
- }
66
-
67
- }
68
- }
69
-
70
- ?>
71
- <div class="wppb_holder" id="wppb_register">
72
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
73
- <?php
74
- global $user_ID;
75
- $login = get_userdata( $user_ID );
76
- if($login->display_name == ''){
77
- $login->display_name = $login->user_login;
78
- }
79
- ?>
80
- <p class="log-in-out alert">
81
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
82
- </p><!-- .log-in-out .alert -->
83
-
84
- <?php elseif ( $new_user ) : ?>
85
-
86
-
87
- <?php
88
-
89
- echo'<p class="success">';
90
- if ( current_user_can( 'create_users' ) )
91
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
92
- else
93
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
94
- echo'</p><!-- .success -->';
95
- ?>
96
-
97
- <?php
98
- if(isset($_POST['send_password'])){
99
- if ($sentEmailStatus == 1){
100
- echo '<p class="error">';
101
- echo 'An error occured while trying to send the notification email.';
102
- echo '</p><!-- .error -->';
103
- }elseif ($sentEmailStatus == 2){
104
- echo '<p class="success">';
105
- echo 'An email containing the username and password was successfully sent.';
106
- echo '</p><!-- .success -->';
107
- }
108
- }
109
- ?>
110
- <?php else : ?>
111
-
112
- <?php if ( $error ) : ?>
113
- <p class="error">
114
- <?php echo $error; ?>
115
- </p><!-- .error -->
116
- <?php endif; ?>
117
-
118
-
119
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
120
- <p class="alert">
121
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
122
- </p><!-- .alert -->
123
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
124
- <p class="alert">
125
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
126
- </p><!-- .alert -->
127
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
128
- <p class="alert">
129
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
130
- </p><!-- .alert -->
131
-
132
- <?php endif; ?>
133
-
134
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
135
-
136
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
137
-
138
- <p>
139
- <strong>Name</strong>
140
- </p>
141
-
142
- <?php
143
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
144
- <p class="form-username">
145
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
146
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
147
- </p><!-- .form-username -->';
148
- }
149
- ?>
150
-
151
- <?php
152
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
153
- <p class="first_name">
154
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
155
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
156
- </p><!-- .first_name -->';
157
- }
158
- ?>
159
-
160
- <?php
161
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
162
- <p class="last_name">
163
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
164
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
165
- </p><!-- .last_name -->';
166
- }
167
- ?>
168
-
169
- <?php
170
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
171
- <p class="nickname">
172
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
173
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
174
- </p><!-- .nickname -->';
175
- }
176
- ?>
177
-
178
- <p>
179
- <strong>Contact Info</strong>
180
- </p>
181
-
182
- <?php
183
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
184
- <p class="form-email">
185
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
186
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
187
- </p><!-- .form-email -->';
188
- }
189
- ?>
190
-
191
- <?php
192
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
193
- <p class="form-website">
194
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
195
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
196
- </p><!-- .form-website -->';
197
- }
198
- ?>
199
-
200
- <?php
201
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
202
- <p class="form-aim">
203
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
204
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
205
- </p><!-- .form-aim -->';
206
- }
207
- ?>
208
-
209
- <?php
210
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
211
- <p class="form-yim">
212
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
213
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
214
- </p><!-- .form-yim -->';
215
- }
216
- ?>
217
-
218
- <?php
219
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
220
- <p class="form-jabber">
221
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
222
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
223
- </p><!-- .form-jabber -->';
224
- }
225
- ?>
226
-
227
- <p>
228
- <strong>About Yourself</strong>
229
- </p>
230
-
231
- <?php
232
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
233
- <p class="form-description">
234
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
235
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
236
- </p><!-- .form-description -->';
237
- }
238
- ?>
239
-
240
- <?php
241
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
242
- <p class="form-password">
243
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
244
- <input class="text-input" name="passw1" type="password" id="pass1" />
245
- </p><!-- .form-password -->
246
-
247
- <p class="form-password">
248
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
249
- <input class="text-input" name="passw2" type="password" id="pass2" />
250
- </p><!-- .form-password -->';
251
- }
252
- ?>
253
- <?php
254
- if ( current_user_can( 'delete_users' ) )
255
- echo '
256
- <p class="send-confirmation-email">
257
- <label for="pass1">';
258
- //_e('Send Password? ', 'profilebuilder');
259
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
260
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
261
- </p><!-- .send-confirmation-email -->';
262
- ?>
263
-
264
- <p class="form-submit">
265
- <?php echo $referer; ?>
266
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
267
- <input name="action" type="hidden" id="action" value="adduser" />
268
- </p><!-- .form-submit -->
269
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
270
- </form><!-- #adduser -->
271
-
272
- <?php endif; ?>
273
-
274
- <?php endif; ?>
275
-
276
-
277
- </div>
278
- <?php
279
- $output = ob_get_contents();
280
- ob_end_clean();
281
- return $output;
282
- }
283
-
284
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/profile-builder.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.9
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
-
118
- /* Allow shortcodes to be used in the text widgets */
119
- add_filter('widget_text', 'do_shortcode');
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/readme.txt DELETED
@@ -1,90 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: registration, profile, user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1.2
8
- Stable tag: 1.0.9
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.9 =
68
- Bugfix - On the edit profile page the website field added a new http:// everytime you updated your profile.
69
- Bugfix/ExtraFeature - Add support for shortcodes to be run in a text widget area.
70
-
71
- = 1.0.6 =
72
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
73
-
74
- = 1.0.5 =
75
- You can now actualy install the plugin. All because of a silly line break.
76
-
77
- = 1.0.4 =
78
- Still no Change.
79
-
80
- = 1.0.3 =
81
- No Change.
82
-
83
- = 1.0.2 =
84
- Small changes.
85
-
86
- = 1.0.1 =
87
- Changes to the ReadMe File
88
-
89
- = 1.0 =
90
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0.9/screenshots/screenshot-1.jpg DELETED
Binary file
1.0.9/screenshots/screenshot-2.jpg DELETED
Binary file
1.0.9/screenshots/screenshot-3.jpg DELETED
Binary file
1.0.9/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.0/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/profile-builder.php DELETED
@@ -1,130 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI:
5
- Description: Profile Builder lets you create, edit and delete custom user information-fields from the frontend, and also lets you add new, custom fields. You can use the following shortcodes: [wppb-edit-profile] for the front-end profile information, [wppb-login] for a log-in menu or [wppb-register] to register a new user.
6
- Version: v1.0
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
- */
11
-
12
-
13
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
-
28
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
-
46
-
47
- global $wp_roles;
48
-
49
- $all_roles = $wp_roles->roles;
50
- $editable_roles = apply_filters('editable_roles', $all_roles);
51
-
52
-
53
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
54
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
55
- $rolesArray = array();
56
- foreach ( $editable_roles as $key => $data )
57
- $rolesArray = array( $key => 'show' ) + $rolesArray;
58
- $rolesArray = array_reverse($rolesArray,true);
59
- add_option( 'wppb_display_admin_settings', $rolesArray);
60
- }
61
-
62
- }
63
-
64
-
65
-
66
- function wppb_create_menu(){
67
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
68
- }
69
-
70
-
71
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
72
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
73
- register_setting( 'wppb_default_style', 'wppb_default_style' );
74
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
75
- }
76
-
77
-
78
- function wppb_add_plugin_stylesheet() {
79
- $wppb_showDefaultCss = get_option('wppb_default_style');
80
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
81
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
82
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
83
- wp_register_style('wppb_stylesheet', $styleUrl);
84
- wp_enqueue_style( 'wppb_stylesheet');
85
- }
86
- }
87
-
88
-
89
-
90
-
91
- function wppb_show_admin_bar($content){
92
- global $current_user;
93
-
94
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
95
-
96
- if ($admintSettingsPresent != 'not_found'){
97
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
98
- $userRole = ($current_user->data->wp_capabilities);
99
- if ($userRole != NULL){
100
- $currentRole = key($userRole);
101
- $getSettings = $wppb_showAdminBar[$currentRole];
102
- if ($getSettings == 'show')
103
- return true;
104
- elseif ($getSettings == 'hide')
105
- return false;
106
- }
107
- }
108
- else
109
- return true;
110
- }
111
-
112
-
113
-
114
-
115
-
116
-
117
- if (is_admin() ){ // if we are in the admin menu
118
- include_once('includes/wppb-menu-file.php'); // include the menu file
119
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
120
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
121
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
122
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
123
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
124
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
125
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
126
- add_shortcode('wppb-login', 'wppb_front_end_login');
127
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
128
- add_shortcode('wppb-register', 'wppb_front_end_register');
129
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/readme.txt DELETED
@@ -1,62 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
- You can use the following shortcodes:
23
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
24
- * [wppb-login] - for a log-in form.
25
- * [wppb-register] - to add a registration form.
26
-
27
- Also, users with administrator rights have access to the following features:
28
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
29
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
30
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
31
-
32
- NOTE:
33
- this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
34
- from the back-end, while custom fields will only be visible in the front-end.
35
-
36
-
37
-
38
- == Installation ==
39
-
40
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
41
- 1. Activate the plugin through the 'Plugins' menu in WordPress
42
- 1. Create a new page and use one of the shortcodes available
43
-
44
- == Frequently Asked Questions ==
45
-
46
- Q: Will it change the default admin-panel from the back-end by adding/disableing information-fields?
47
- A: No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
48
-
49
- Q: Will the information be also updated for any hidden fields?
50
- A: No, only fields visible to the users will/can be modified/updated.
51
-
52
-
53
- == Screenshots ==
54
-
55
- 1. Login Page: screenshot-1.jpg
56
- 2. Register Page: screenshot-2.jpg
57
- 3. Backend Settings: screenshot-3.jpg
58
-
59
- == Changelog ==
60
-
61
- = 1.0 =
62
- * Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.0/screenshots/screenshot-1.jpg DELETED
Binary file
1.0/screenshots/screenshot-2.jpg DELETED
Binary file
1.0/screenshots/screenshot-3.jpg DELETED
Binary file
1.0/uninstall.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
- exit (); // If uninstall not called from WordPress exit
5
-
6
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
7
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
8
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
9
-
10
- ?>
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/profile-builder.php DELETED
@@ -1,130 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI:
5
- Description: Profile Builder lets you create, edit and delete custom user information-fields from the frontend, and also lets you add new, custom fields. You can use the following shortcodes: [wppb-edit-profile] for the front-end profile information, [wppb-login] for a log-in menu or [wppb-register] to register a new user.
6
- Version: v1.0
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
- */
11
-
12
-
13
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
-
28
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
-
46
-
47
- global $wp_roles;
48
-
49
- $all_roles = $wp_roles->roles;
50
- $editable_roles = apply_filters('editable_roles', $all_roles);
51
-
52
-
53
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
54
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
55
- $rolesArray = array();
56
- foreach ( $editable_roles as $key => $data )
57
- $rolesArray = array( $key => 'show' ) + $rolesArray;
58
- $rolesArray = array_reverse($rolesArray,true);
59
- add_option( 'wppb_display_admin_settings', $rolesArray);
60
- }
61
-
62
- }
63
-
64
-
65
-
66
- function wppb_create_menu(){
67
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
68
- }
69
-
70
-
71
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
72
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
73
- register_setting( 'wppb_default_style', 'wppb_default_style' );
74
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
75
- }
76
-
77
-
78
- function wppb_add_plugin_stylesheet() {
79
- $wppb_showDefaultCss = get_option('wppb_default_style');
80
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
81
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
82
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
83
- wp_register_style('wppb_stylesheet', $styleUrl);
84
- wp_enqueue_style( 'wppb_stylesheet');
85
- }
86
- }
87
-
88
-
89
-
90
-
91
- function wppb_show_admin_bar($content){
92
- global $current_user;
93
-
94
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
95
-
96
- if ($admintSettingsPresent != 'not_found'){
97
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
98
- $userRole = ($current_user->data->wp_capabilities);
99
- if ($userRole != NULL){
100
- $currentRole = key($userRole);
101
- $getSettings = $wppb_showAdminBar[$currentRole];
102
- if ($getSettings == 'show')
103
- return true;
104
- elseif ($getSettings == 'hide')
105
- return false;
106
- }
107
- }
108
- else
109
- return true;
110
- }
111
-
112
-
113
-
114
-
115
-
116
-
117
- if (is_admin() ){ // if we are in the admin menu
118
- include_once('includes/wppb-menu-file.php'); // include the menu file
119
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
120
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
121
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
122
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
123
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
124
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
125
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
126
- add_shortcode('wppb-login', 'wppb_front_end_login');
127
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
128
- add_shortcode('wppb-register', 'wppb_front_end_register');
129
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
130
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/readme.txt DELETED
@@ -1,71 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.1
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.1 =
68
- Changes to the ReadMe File
69
-
70
- = 1.0 =
71
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.1/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.1/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.1/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.1/uninstall.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
- exit (); // If uninstall not called from WordPress exit
5
-
6
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
7
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
8
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
9
-
10
- ?>
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/includes/wppb-front-end-login.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- ob_start();
21
- global $wppb_login;
22
-
23
- echo '<div class="wppb_holder" id="wppb_login">';
24
-
25
- if ( is_user_logged_in() ) : // Already logged in
26
- global $user_ID;
27
- $wppb_user = get_userdata( $user_ID );
28
- if($wppb_user->display_name == ''){
29
- $wppb_user->display_name = $wppb_user->user_login;
30
- }
31
-
32
- ?>
33
-
34
-
35
-
36
-
37
- <p class="alert">
38
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
39
- </p><!-- .alert -->
40
-
41
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
42
- <?php
43
- //$wppb_login = get_userdata( $wppb_login->ID );
44
- if($wppb_login->display_name == ''){
45
- $wppb_login->display_name = $wppb_login->user_login;
46
- }
47
-
48
- ?>
49
-
50
- <p class="success">
51
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
52
- </p><!-- .success-->
53
- <?php else : // Not logged in ?>
54
-
55
- <?php if (!empty( $_POST['action'] )): ?>
56
- <p class="error">
57
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
58
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
59
- </p><!-- .error -->
60
- <?php endif; ?>
61
-
62
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
63
- <p class="login-form-username">
64
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
65
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
66
- </p><!-- .form-username -->
67
-
68
- <p class="login-form-password">
69
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
70
- <input type="password" name="password" id="password" class="text-input" />
71
- </p><!-- .form-password -->
72
- <p class="login-form-submit">
73
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
74
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
75
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
76
- <input type="hidden" name="action" value="log-in" />
77
- </p><!-- .form-submit -->
78
- <p>
79
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
80
- </p>
81
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
82
- </form><!-- .sign-in -->
83
-
84
- <?php endif;?>
85
- </div>
86
- <?php
87
-
88
- $output = ob_get_contents();
89
- ob_end_clean();
90
- return $output;
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/includes/wppb-front-end-profile.php DELETED
@@ -1,317 +0,0 @@
1
- <?php
2
- /*
3
- wp_update_user only attempts to clear and reset cookies if it's updating the password.
4
- The php function setcookie(), used in both the cookie-clearing and cookie-resetting functions,
5
- adds to the page headers and therefore must be called within the first php tag on the page, and
6
- before the WordPress get_header() function. Since wp_update_user needs this, it must be at the
7
- beginning of the page as well.
8
- */
9
- $wppb_saved_pass = false;
10
- $wppb_error_pass = false;
11
-
12
- function wppb_save_the_password(){
13
- global $wppb_saved_pass;
14
- global $wppb_error_pass;
15
- /* Load registration file. */
16
- require_once(ABSPATH . WPINC . '/registration.php');
17
- /* Get user info. */
18
- global $current_user;
19
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] )
23
- {
24
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
25
- $wppb_saved_pass = true;
26
- } else {
27
- $wppb_error_pass = true;
28
- }
29
- }
30
- }
31
- }
32
- add_action('init', 'wppb_save_the_password');
33
-
34
- /* the shortcode function */
35
- function wppb_front_end_profile_info() {
36
- global $wppb_saved_pass;
37
- global $wppb_error_pass;
38
-
39
- ob_start();
40
- get_currentuserinfo();
41
- $wppb_defaultOptions = get_option('wppb_default_settings');
42
- $changesSaved = 'no';
43
-
44
- /* Load registration file. */
45
- require_once(ABSPATH . WPINC . '/registration.php');
46
- /* Get user info. */
47
- global $current_user;
48
- /* If profile was saved, update profile. */
49
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
50
-
51
- if (email_exists( $_POST['email'] ) != FALSE)
52
- $thisEmail = email_exists( $_POST['email'] );
53
- else $thisEmail = $current_user->id;
54
-
55
- /* Update user password. */
56
- if ($wppb_saved_pass == true){
57
- $changesSaved = 'yes';
58
- }
59
- if ($wppb_error_pass == true){
60
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
61
- }
62
-
63
-
64
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
65
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
67
- $changesSaved = 'yes';
68
- }else
69
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
70
- }else
71
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
72
-
73
-
74
-
75
- /* Update user information. */
76
- if ($wppb_defaultOptions['firstname'] == 'show'){
77
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
78
- $changesSaved = 'yes';
79
- }
80
- if ($wppb_defaultOptions['lastname'] == 'show'){
81
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
82
- $changesSaved = 'yes';
83
- }
84
-
85
- if ($wppb_defaultOptions['nickname'] == 'show'){
86
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
87
- $changesSaved = 'yes';
88
- }
89
-
90
- if ($wppb_defaultOptions['dispname'] == 'show'){
91
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
92
- $changesSaved = 'yes';
93
- }
94
-
95
- if ($wppb_defaultOptions['website'] == 'show'){
96
- $wppbPos = strpos($_POST['website'], 'http://');
97
- if($wppbPos !== FALSE){
98
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
99
- $changesSaved = 'yes';
100
- }else{
101
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
102
- $changesSaved = 'yes';
103
- }
104
- }
105
-
106
- if ($wppb_defaultOptions['aim'] == 'show'){
107
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
108
- $changesSaved = 'yes';
109
- }
110
-
111
- if ($wppb_defaultOptions['yahoo'] == 'show'){
112
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
113
- $changesSaved = 'yes';
114
- }
115
-
116
- if ($wppb_defaultOptions['jabber'] == 'show'){
117
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
118
- $changesSaved = 'yes';
119
- }
120
-
121
- if ($wppb_defaultOptions['bio'] == 'show'){
122
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
123
- $changesSaved = 'yes';
124
- }
125
-
126
- }
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
- ?>
135
- <div class="wppb_holder" id="wppb_modify">
136
- <?php if ( !is_user_logged_in() ) : ?>
137
-
138
- <p class="warning">
139
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
140
- </p><!-- .warning -->
141
-
142
- <?php else : ?>
143
-
144
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
145
- <?php
146
- if ($changesSaved == 'yes'){
147
- echo '<p class="changes-saved">';
148
- _e('The changes made have been successfully saved.', 'profilebuilder');
149
- echo'</p><!-- .changes-saved -->';
150
- }
151
- ?>
152
-
153
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
154
- <p>
155
- <strong>Name</strong>
156
- </p>
157
- <?php
158
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
159
- <p class="username">
160
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
161
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
162
- </p><!-- .first_name -->';
163
- }
164
- ?>
165
-
166
- <?php
167
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
168
- <p class="first_name">
169
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
170
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
171
- </p><!-- .first_name -->';
172
- }
173
- ?>
174
-
175
- <?php
176
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
177
- <p class="last_name">
178
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
179
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
180
- </p><!-- .last_name -->';
181
- }
182
- ?>
183
-
184
- <?php
185
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
186
- <p class="nickname">
187
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
188
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
189
- </p><!-- .nickname -->';
190
- }
191
- ?>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
195
- <p class="display_name">
196
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
197
- <select name="display_name" id="display_name">';
198
- $public_display = array();
199
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
200
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
201
- if ( !empty($thisFirstName))
202
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
203
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
204
- if ( !empty($thisLastName))
205
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
206
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
207
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
208
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
209
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
210
- }
211
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
212
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
213
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
214
- $public_display = array_map( 'trim', $public_display );
215
- foreach ( $public_display as $id => $item ) {
216
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
217
- }
218
- echo'</select>
219
- </p><!-- .display_name -->';
220
- }
221
- ?>
222
-
223
-
224
- <p>
225
- <strong>Contact Info</strong>
226
- </p>
227
-
228
- <?php
229
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
230
- <p class="form-email">
231
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
232
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
233
- </p><!-- .form-email -->';
234
- }
235
- ?>
236
-
237
- <?php
238
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
239
- <p class="form-website">
240
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
241
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
242
- </p><!-- .form-website -->';
243
- }
244
- ?>
245
-
246
- <?php
247
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
248
- <p class="form-aim">
249
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
250
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
251
- </p><!-- .form-aim -->';
252
- }
253
- ?>
254
-
255
- <?php
256
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
257
- <p class="form-yim">
258
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
259
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
260
- </p><!-- .form-yim -->';
261
- }
262
- ?>
263
-
264
- <?php
265
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
266
- <p class="form-jabber">
267
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
268
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
269
- </p><!-- .form-jabber -->';
270
- }
271
- ?>
272
-
273
- <p>
274
- <strong>About Yourself</strong>
275
- </p>
276
-
277
- <?php
278
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
279
- <p class="form-description">
280
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
281
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
282
- </p><!-- .form-description -->';
283
- }
284
- ?>
285
-
286
- <?php
287
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
288
- <p class="form-password">
289
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
290
- <input class="text-input" name="pass1" type="password" id="pass1" />
291
- </p><!-- .form-password -->
292
-
293
- <p class="form-password">
294
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
295
- <input class="text-input" name="pass2" type="password" id="pass2" />
296
- </p><!-- .form-password -->';
297
- }
298
- ?>
299
-
300
-
301
- <p class="form-submit">
302
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
303
- <?php// wp_nonce_field( 'update-user' ) ?>
304
- <input name="action" type="hidden" id="action" value="update-user" />
305
- </p><!-- .form-submit -->
306
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
307
- </form><!-- #edituser -->
308
-
309
- <?php endif; ?>
310
- </div>
311
- <?php
312
- $output = ob_get_contents();
313
- ob_end_clean();
314
- return $output;
315
- }
316
-
317
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/includes/wppb-front-end-register.php DELETED
@@ -1,284 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- ob_start();
5
- $wppb_defaultOptions = get_option('wppb_default_settings');
6
- global $current_user;
7
- get_currentuserinfo();
8
-
9
- /* Load registration file. */
10
- require_once( ABSPATH . WPINC . '/registration.php' );
11
-
12
- /* Check if users can register. */
13
- $registration = get_option( 'users_can_register' );
14
-
15
- /* If user registered, input info. */
16
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
17
-
18
- $user_pass = esc_attr( $_POST['passw1'] );
19
- $userdata = array(
20
- 'user_pass' => $user_pass,
21
- 'user_login' => esc_attr( $_POST['user_name'] ),
22
- 'first_name' => esc_attr( $_POST['first_name'] ),
23
- 'last_name' => esc_attr( $_POST['last_name'] ),
24
- 'nickname' => esc_attr( $_POST['nickname'] ),
25
- 'user_email' => esc_attr( $_POST['email'] ),
26
- 'user_url' => esc_attr( $_POST['website'] ),
27
- 'aim' => esc_attr( $_POST['aim'] ),
28
- 'yim' => esc_attr( $_POST['yim'] ),
29
- 'jabber' => esc_attr( $_POST['jabber'] ),
30
- 'description' => esc_attr( $_POST['description'] ),
31
- 'role' => get_option( 'default_role' ),
32
- );
33
-
34
- if ( !$userdata['user_login'] )
35
- $error = __('A username is required for registration.', 'profilebuilder');
36
- elseif ( username_exists($userdata['user_login']) )
37
- $error = __('Sorry, that username already exists!', 'profilebuilder');
38
-
39
- elseif ( !is_email($userdata['user_email'], true) )
40
- $error = __('You must enter a valid email address.', 'profilebuilder');
41
- elseif ( email_exists($userdata['user_email']) )
42
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
43
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
44
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
45
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
46
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
47
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
48
- }
49
-
50
- else{
51
- $the_registered_name = $_POST['user_name'];
52
- $new_user = wp_insert_user( $userdata );
53
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
54
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
55
- $fromemail = get_bloginfo('name');
56
- $mailPassword = $_POST['passw1'];
57
- $mailUsername = $_POST['user_name'];
58
- $subject = 'A new account has been created for you.';
59
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
60
- $messageSent = wp_mail( $email, $subject, $msg);
61
- if( $messageSent == TRUE)
62
- $sentEmailStatus = 2;
63
- else
64
- $sentEmailStatus = 1;
65
- }
66
-
67
- }
68
- }
69
-
70
- ?>
71
- <div class="wppb_holder" id="wppb_register">
72
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
73
- <?php
74
- global $user_ID;
75
- $login = get_userdata( $user_ID );
76
- if($login->display_name == ''){
77
- $login->display_name = $login->user_login;
78
- }
79
- ?>
80
- <p class="log-in-out alert">
81
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
82
- </p><!-- .log-in-out .alert -->
83
-
84
- <?php elseif ( $new_user ) : ?>
85
-
86
-
87
- <?php
88
-
89
- echo'<p class="success">';
90
- if ( current_user_can( 'create_users' ) )
91
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
92
- else
93
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
94
- echo'</p><!-- .success -->';
95
- ?>
96
-
97
- <?php
98
- if(isset($_POST['send_password'])){
99
- if ($sentEmailStatus == 1){
100
- echo '<p class="error">';
101
- echo 'An error occured while trying to send the notification email.';
102
- echo '</p><!-- .error -->';
103
- }elseif ($sentEmailStatus == 2){
104
- echo '<p class="success">';
105
- echo 'An email containing the username and password was successfully sent.';
106
- echo '</p><!-- .success -->';
107
- }
108
- }
109
- ?>
110
- <?php else : ?>
111
-
112
- <?php if ( $error ) : ?>
113
- <p class="error">
114
- <?php echo $error; ?>
115
- </p><!-- .error -->
116
- <?php endif; ?>
117
-
118
-
119
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
120
- <p class="alert">
121
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
122
- </p><!-- .alert -->
123
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
124
- <p class="alert">
125
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
126
- </p><!-- .alert -->
127
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
128
- <p class="alert">
129
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
130
- </p><!-- .alert -->
131
-
132
- <?php endif; ?>
133
-
134
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
135
-
136
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
137
-
138
- <p>
139
- <strong>Name</strong>
140
- </p>
141
-
142
- <?php
143
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
144
- <p class="form-username">
145
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
146
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
147
- </p><!-- .form-username -->';
148
- }
149
- ?>
150
-
151
- <?php
152
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
153
- <p class="first_name">
154
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
155
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
156
- </p><!-- .first_name -->';
157
- }
158
- ?>
159
-
160
- <?php
161
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
162
- <p class="last_name">
163
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
164
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
165
- </p><!-- .last_name -->';
166
- }
167
- ?>
168
-
169
- <?php
170
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
171
- <p class="nickname">
172
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
173
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
174
- </p><!-- .nickname -->';
175
- }
176
- ?>
177
-
178
- <p>
179
- <strong>Contact Info</strong>
180
- </p>
181
-
182
- <?php
183
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
184
- <p class="form-email">
185
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
186
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
187
- </p><!-- .form-email -->';
188
- }
189
- ?>
190
-
191
- <?php
192
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
193
- <p class="form-website">
194
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
195
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
196
- </p><!-- .form-website -->';
197
- }
198
- ?>
199
-
200
- <?php
201
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
202
- <p class="form-aim">
203
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
204
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
205
- </p><!-- .form-aim -->';
206
- }
207
- ?>
208
-
209
- <?php
210
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
211
- <p class="form-yim">
212
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
213
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
214
- </p><!-- .form-yim -->';
215
- }
216
- ?>
217
-
218
- <?php
219
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
220
- <p class="form-jabber">
221
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
222
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
223
- </p><!-- .form-jabber -->';
224
- }
225
- ?>
226
-
227
- <p>
228
- <strong>About Yourself</strong>
229
- </p>
230
-
231
- <?php
232
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
233
- <p class="form-description">
234
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
235
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
236
- </p><!-- .form-description -->';
237
- }
238
- ?>
239
-
240
- <?php
241
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
242
- <p class="form-password">
243
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
244
- <input class="text-input" name="passw1" type="password" id="pass1" />
245
- </p><!-- .form-password -->
246
-
247
- <p class="form-password">
248
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
249
- <input class="text-input" name="passw2" type="password" id="pass2" />
250
- </p><!-- .form-password -->';
251
- }
252
- ?>
253
- <?php
254
- if ( current_user_can( 'delete_users' ) )
255
- echo '
256
- <p class="send-confirmation-email">
257
- <label for="pass1">';
258
- //_e('Send Password? ', 'profilebuilder');
259
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
260
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
261
- </p><!-- .send-confirmation-email -->';
262
- ?>
263
-
264
- <p class="form-submit">
265
- <?php echo $referer; ?>
266
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
267
- <input name="action" type="hidden" id="action" value="adduser" />
268
- </p><!-- .form-submit -->
269
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
270
- </form><!-- #adduser -->
271
-
272
- <?php endif; ?>
273
-
274
- <?php endif; ?>
275
-
276
-
277
- </div>
278
- <?php
279
- $output = ob_get_contents();
280
- ob_end_clean();
281
- return $output;
282
- }
283
-
284
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/profile-builder.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.10
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
-
118
- /* Allow shortcodes to be used in the text widgets */
119
- add_filter('widget_text', 'do_shortcode');
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/readme.txt DELETED
@@ -1,94 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: registration, profile, user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1.2
8
- Stable tag: 1.0.10
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.10 =
68
- Bugfix - The wp_update_user attempts to clear and reset cookies if it's updating the password.
69
- Because of that we get "headers already sent". Fixed by hooking into the init.
70
-
71
- = 1.0.9 =
72
- Bugfix - On the edit profile page the website field added a new http:// everytime you updated your profile.
73
- Bugfix/ExtraFeature - Add support for shortcodes to be run in a text widget area.
74
-
75
- = 1.0.6 =
76
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
77
-
78
- = 1.0.5 =
79
- You can now actualy install the plugin. All because of a silly line break.
80
-
81
- = 1.0.4 =
82
- Still no Change.
83
-
84
- = 1.0.3 =
85
- No Change.
86
-
87
- = 1.0.2 =
88
- Small changes.
89
-
90
- = 1.0.1 =
91
- Changes to the ReadMe File
92
-
93
- = 1.0 =
94
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.10/screenshots/screenshot1.jpg DELETED
Binary file
1.1.5/tags/1.0.10/screenshots/screenshot2.jpg DELETED
Binary file
1.1.5/tags/1.0.10/screenshots/screenshot3.jpg DELETED
Binary file
1.1.5/tags/1.0.10/screenshots/screenshot4.jpg DELETED
Binary file
1.1.5/tags/1.0.10/screenshots/screenshot6.jpg DELETED
Binary file
1.1.5/tags/1.0.10/screenshots/screenshot7.jpg DELETED
Binary file
1.1.5/tags/1.0.10/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.1.5/tags/1.0.2/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.2
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.2/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.2/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.2/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.2/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.1.5/tags/1.0.3/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.1.5/tags/1.0.3/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.3
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.3/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.3/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.3/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.3/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.1.5/tags/1.0.4/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/profile-builder.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /* Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
3
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
4
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
5
- function wppb_create_menu(){
6
-
7
-
8
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
9
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
10
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
11
  wp_register_style('wppb_stylesheet', $styleUrl);
12
  wp_enqueue_style( 'wppb_stylesheet');
13
  }
14
- if (is_admin() ){ // if we are in the admin menu
15
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
 
 
 
 
 
 
 
0
  $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
1
  $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
2
  if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
3
  wp_register_style('wppb_stylesheet', $styleUrl);
4
  wp_enqueue_style( 'wppb_stylesheet');
5
  }
 
6
  add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
1.1.5/tags/1.0.4/readme.txt DELETED
@@ -1,74 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.4
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.2 =
68
- Small changes.
69
-
70
- = 1.0.1 =
71
- Changes to the ReadMe File
72
-
73
- = 1.0 =
74
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.4/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.4/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.4/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.4/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.1.5/tags/1.0.5/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.5
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/readme.txt DELETED
@@ -1,83 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.5
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.5 =
68
- You can now actualy install the plugin. All because of a silly line break.
69
-
70
- = 1.0.4 =
71
- Still no Change.
72
-
73
- = 1.0.3 =
74
- No Change.
75
-
76
- = 1.0.2 =
77
- Small changes.
78
-
79
- = 1.0.1 =
80
- Changes to the ReadMe File
81
-
82
- = 1.0 =
83
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.5/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.5/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.5/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.5/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.6
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.6
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.6/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.6/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.6/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.6/uninstall.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
 
 
1.1.5/tags/1.0.7/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.6
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.7/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.7/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.7/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.7/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/includes/wppb-front-end-login.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- global $wppb_login;
21
-
22
- echo '<div class="wppb_holder" id="wppb_login">';
23
-
24
- if ( is_user_logged_in() ) : // Already logged in
25
- global $user_ID;
26
- $wppb_user = get_userdata( $user_ID );
27
- if($wppb_user->display_name == ''){
28
- $wppb_user->display_name = $wppb_user->user_login;
29
- }
30
-
31
- ?>
32
-
33
-
34
-
35
-
36
- <p class="alert">
37
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
38
- </p><!-- .alert -->
39
-
40
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
41
- <?php
42
- //$wppb_login = get_userdata( $wppb_login->ID );
43
- if($wppb_login->display_name == ''){
44
- $wppb_login->display_name = $wppb_login->user_login;
45
- }
46
-
47
- ?>
48
-
49
- <p class="success">
50
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
51
- </p><!-- .success-->
52
- <?php else : // Not logged in ?>
53
-
54
- <?php if (!empty( $_POST['action'] )): ?>
55
- <p class="error">
56
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
57
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
58
- </p><!-- .error -->
59
- <?php endif; ?>
60
-
61
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
62
- <p class="login-form-username">
63
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
64
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
65
- </p><!-- .form-username -->
66
-
67
- <p class="login-form-password">
68
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
69
- <input type="password" name="password" id="password" class="text-input" />
70
- </p><!-- .form-password -->
71
- <p class="login-form-submit">
72
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
73
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
74
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
75
- <input type="hidden" name="action" value="log-in" />
76
- </p><!-- .form-submit -->
77
- <p>
78
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
79
- </p>
80
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
81
- </form><!-- .sign-in -->
82
-
83
- <?php endif;?>
84
- </div>
85
- <?php
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/includes/wppb-front-end-profile.php DELETED
@@ -1,279 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- get_currentuserinfo();
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- $changesSaved = 'no';
6
-
7
-
8
-
9
- /* Load registration file. */
10
- require_once(ABSPATH . WPINC . '/registration.php');
11
- /* Get user info. */
12
- global $current_user;
13
- /* If profile was saved, update profile. */
14
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
15
-
16
- if (email_exists( $_POST['email'] ) != FALSE)
17
- $thisEmail = email_exists( $_POST['email'] );
18
- else $thisEmail = $current_user->id;
19
-
20
- /* Update user password. */
21
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
22
- if ( $_POST['pass1'] == $_POST['pass2'] ){
23
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
24
- $changesSaved = 'yes';
25
- }else
26
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
27
- }
28
-
29
-
30
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
31
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
32
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
33
- $changesSaved = 'yes';
34
- }else
35
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
36
- }else
37
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
38
-
39
-
40
-
41
- /* Update user information. */
42
- if ($wppb_defaultOptions['firstname'] == 'show'){
43
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
44
- $changesSaved = 'yes';
45
- }
46
- if ($wppb_defaultOptions['lastname'] == 'show'){
47
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
48
- $changesSaved = 'yes';
49
- }
50
-
51
- if ($wppb_defaultOptions['nickname'] == 'show'){
52
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
53
- $changesSaved = 'yes';
54
- }
55
-
56
- if ($wppb_defaultOptions['dispname'] == 'show'){
57
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
58
- $changesSaved = 'yes';
59
- }
60
-
61
- if ($wppb_defaultOptions['website'] == 'show'){
62
- if(strpos($_POST['website'], 'http://') || empty( $_POST['website'] )){
63
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
64
- $changesSaved = 'yes';
65
- }else{
66
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
67
- $changesSaved = 'yes';
68
- }
69
- }
70
-
71
- if ($wppb_defaultOptions['aim'] == 'show'){
72
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
73
- $changesSaved = 'yes';
74
- }
75
-
76
- if ($wppb_defaultOptions['yahoo'] == 'show'){
77
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
78
- $changesSaved = 'yes';
79
- }
80
-
81
- if ($wppb_defaultOptions['jabber'] == 'show'){
82
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
83
- $changesSaved = 'yes';
84
- }
85
-
86
- if ($wppb_defaultOptions['bio'] == 'show'){
87
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
88
- $changesSaved = 'yes';
89
- }
90
-
91
- }
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
- ?>
100
- <div class="wppb_holder" id="wppb_modify">
101
- <?php if ( !is_user_logged_in() ) : ?>
102
-
103
- <p class="warning">
104
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
105
- </p><!-- .warning -->
106
-
107
- <?php else : ?>
108
-
109
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
110
- <?php
111
- if ($changesSaved == 'yes'){
112
- echo '<p class="changes-saved">';
113
- _e('The changes made have been successfully saved.', 'profilebuilder');
114
- echo'</p><!-- .changes-saved -->';
115
- }
116
- ?>
117
-
118
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
119
- <p>
120
- <strong>Name</strong>
121
- </p>
122
- <?php
123
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
124
- <p class="username">
125
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
126
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
127
- </p><!-- .first_name -->';
128
- }
129
- ?>
130
-
131
- <?php
132
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
133
- <p class="first_name">
134
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
135
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
136
- </p><!-- .first_name -->';
137
- }
138
- ?>
139
-
140
- <?php
141
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
142
- <p class="last_name">
143
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
144
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
145
- </p><!-- .last_name -->';
146
- }
147
- ?>
148
-
149
- <?php
150
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
151
- <p class="nickname">
152
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
153
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
154
- </p><!-- .nickname -->';
155
- }
156
- ?>
157
-
158
- <?php
159
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
160
- <p class="display_name">
161
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
162
- <select name="display_name" id="display_name">';
163
- $public_display = array();
164
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
165
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
166
- if ( !empty($thisFirstName))
167
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
168
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
169
- if ( !empty($thisLastName))
170
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
171
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
172
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
173
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
174
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
175
- }
176
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
177
- if ( !in_array( $thisDisplayName, $public_display ) ) // Only add this if it isn't duplicated elsewhere
178
- $public_display = array( 'display_displayname' => $thisDisplayName ) + $public_display;
179
- $public_display = array_map( 'trim', $public_display );
180
- foreach ( $public_display as $id => $item ) {
181
- echo '<option id="'.$id.'" value="'.$item.'"'; selected( $thisDisplayName, $item ); echo'>'.$item.'</option>';
182
- }
183
- echo'</select>
184
- </p><!-- .display_name -->';
185
- }
186
- ?>
187
-
188
-
189
- <p>
190
- <strong>Contact Info</strong>
191
- </p>
192
-
193
- <?php
194
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
195
- <p class="form-email">
196
- <label for="email">'; _e('E-mail', 'profilebuilder');echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
197
- <input class="text-input" name="email" type="text" id="email" value="'; the_author_meta( 'user_email', $current_user->id ); echo'" />
198
- </p><!-- .form-email -->';
199
- }
200
- ?>
201
-
202
- <?php
203
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
204
- <p class="form-website">
205
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
206
- <input class="text-input" name="website" type="text" id="website" value="'; the_author_meta( 'user_url', $current_user->id ); echo'" />
207
- </p><!-- .form-website -->';
208
- }
209
- ?>
210
-
211
- <?php
212
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
213
- <p class="form-aim">
214
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
215
- <input class="text-input" name="aim" type="text" id="aim" value="'; the_author_meta( 'aim', $current_user->id ); echo'" />
216
- </p><!-- .form-aim -->';
217
- }
218
- ?>
219
-
220
- <?php
221
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
222
- <p class="form-yim">
223
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
224
- <input class="text-input" name="yim" type="text" id="yim" value="'; the_author_meta( 'yim', $current_user->id ); echo'" />
225
- </p><!-- .form-yim -->';
226
- }
227
- ?>
228
-
229
- <?php
230
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
231
- <p class="form-jabber">
232
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
233
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; the_author_meta( 'jabber', $current_user->id ); echo'" />
234
- </p><!-- .form-jabber -->';
235
- }
236
- ?>
237
-
238
- <p>
239
- <strong>About Yourself</strong>
240
- </p>
241
-
242
- <?php
243
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
244
- <p class="form-description">
245
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
246
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; the_author_meta( 'description', $current_user->id ); echo'</textarea>
247
- </p><!-- .form-description -->';
248
- }
249
- ?>
250
-
251
- <?php
252
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
253
- <p class="form-password">
254
- <label for="pass1">'; _e('New Password', 'profilebuilder'); echo'</label>
255
- <input class="text-input" name="pass1" type="password" id="pass1" />
256
- </p><!-- .form-password -->
257
-
258
- <p class="form-password">
259
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
260
- <input class="text-input" name="pass2" type="password" id="pass2" />
261
- </p><!-- .form-password -->';
262
- }
263
- ?>
264
-
265
-
266
- <p class="form-submit">
267
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profilebuilder'); ?>" />
268
- <?php// wp_nonce_field( 'update-user' ) ?>
269
- <input name="action" type="hidden" id="action" value="update-user" />
270
- </p><!-- .form-submit -->
271
- <?php wp_nonce_field('verify_edit_user','edit_nonce_field'); ?>
272
- </form><!-- #edituser -->
273
-
274
- <?php endif; ?>
275
- </div>
276
- <?php
277
- }
278
-
279
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/includes/wppb-front-end-register.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
-
3
- function wppb_front_end_register(){
4
- $wppb_defaultOptions = get_option('wppb_default_settings');
5
- global $current_user;
6
- get_currentuserinfo();
7
-
8
- /* Load registration file. */
9
- require_once( ABSPATH . WPINC . '/registration.php' );
10
-
11
- /* Check if users can register. */
12
- $registration = get_option( 'users_can_register' );
13
-
14
- /* If user registered, input info. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser' && wp_verify_nonce($_POST['register_nonce_field'],'verify_true_registration') ) {
16
-
17
- $user_pass = esc_attr( $_POST['passw1'] );
18
- $userdata = array(
19
- 'user_pass' => $user_pass,
20
- 'user_login' => esc_attr( $_POST['user_name'] ),
21
- 'first_name' => esc_attr( $_POST['first_name'] ),
22
- 'last_name' => esc_attr( $_POST['last_name'] ),
23
- 'nickname' => esc_attr( $_POST['nickname'] ),
24
- 'user_email' => esc_attr( $_POST['email'] ),
25
- 'user_url' => esc_attr( $_POST['website'] ),
26
- 'aim' => esc_attr( $_POST['aim'] ),
27
- 'yim' => esc_attr( $_POST['yim'] ),
28
- 'jabber' => esc_attr( $_POST['jabber'] ),
29
- 'description' => esc_attr( $_POST['description'] ),
30
- 'role' => get_option( 'default_role' ),
31
- );
32
-
33
- if ( !$userdata['user_login'] )
34
- $error = __('A username is required for registration.', 'profilebuilder');
35
- elseif ( username_exists($userdata['user_login']) )
36
- $error = __('Sorry, that username already exists!', 'profilebuilder');
37
-
38
- elseif ( !is_email($userdata['user_email'], true) )
39
- $error = __('You must enter a valid email address.', 'profilebuilder');
40
- elseif ( email_exists($userdata['user_email']) )
41
- $error = __('Sorry, that email address is already used!', 'profilebuilder');
42
- elseif (( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) || ( $_POST['pass1'] != $_POST['pass2'] )){
43
- if ( empty($_POST['passw1'] ) || empty( $_POST['passw2'] )) //verify if the user has completed both password fields
44
- $error = __('You didn\'t complete one of the password-fields!', 'profilebuilder');
45
- elseif ( $_POST['pass1'] != $_POST['pass2'] ) //verify if the the password and the retyped password are a match
46
- $error = __('The entered passwords don\'t match!', 'profilebuilder');
47
- }
48
-
49
- else{
50
- $the_registered_name = $_POST['user_name'];
51
- $new_user = wp_insert_user( $userdata );
52
- if (isset($_POST['send_password']) && ($_POST['send_password'] == 1)){
53
- $email = $_POST['email']; //change these variables to modify sent email message, destination and source.
54
- $fromemail = get_bloginfo('name');
55
- $mailPassword = $_POST['passw1'];
56
- $mailUsername = $_POST['user_name'];
57
- $subject = 'A new account has been created for you.';
58
- $msg = 'Welcome to blog '.$fromemail.'. Your username is:'.$mailUsername.' and password:'.$mailPassword;
59
- $messageSent = wp_mail( $email, $subject, $msg);
60
- if( $messageSent == TRUE)
61
- $sentEmailStatus = 2;
62
- else
63
- $sentEmailStatus = 1;
64
- }
65
-
66
- }
67
- }
68
-
69
- ?>
70
- <div class="wppb_holder" id="wppb_register">
71
- <?php if ( is_user_logged_in() && !current_user_can( 'create_users' ) ) : ?>
72
- <?php
73
- global $user_ID;
74
- $login = get_userdata( $user_ID );
75
- if($login->display_name == ''){
76
- $login->display_name = $login->user_login;
77
- }
78
- ?>
79
- <p class="log-in-out alert">
80
- <?php printf( __('You are logged in as <a href="%1$s" title="%2$s">%2$s</a>. You don\'t need another account.', 'profilebuilder'), get_author_posts_url( $login->ID ), $login->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Logout &raquo;', 'profilebuilder'); ?></a>
81
- </p><!-- .log-in-out .alert -->
82
-
83
- <?php elseif ( $new_user ) : ?>
84
-
85
-
86
- <?php
87
-
88
- echo'<p class="success">';
89
- if ( current_user_can( 'create_users' ) )
90
- printf( __('A user account for %1$s has been created.', 'profilebuilder'), $the_registered_name );
91
- else
92
- printf( __('Thank you for registering, %1$s.', 'profilebuilder'), $the_registered_name );
93
- echo'</p><!-- .success -->';
94
- ?>
95
-
96
- <?php
97
- if(isset($_POST['send_password'])){
98
- if ($sentEmailStatus == 1){
99
- echo '<p class="error">';
100
- echo 'An error occured while trying to send the notification email.';
101
- echo '</p><!-- .error -->';
102
- }elseif ($sentEmailStatus == 2){
103
- echo '<p class="success">';
104
- echo 'An email containing the username and password was successfully sent.';
105
- echo '</p><!-- .success -->';
106
- }
107
- }
108
- ?>
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) : ?>
112
- <p class="error">
113
- <?php echo $error; ?>
114
- </p><!-- .error -->
115
- <?php endif; ?>
116
-
117
-
118
- <?php if ( current_user_can( 'create_users' ) && $registration ) : ?>
119
- <p class="alert">
120
- <?php _e('Users can register themselves or you can manually create users here.', 'profilebuilder'); ?>
121
- </p><!-- .alert -->
122
- <?php elseif ( current_user_can( 'create_users' ) ) : ?>
123
- <p class="alert">
124
- <?php _e('Users cannot currently register themselves, but you can manually create users here.', 'profilebuilder'); ?>
125
- </p><!-- .alert -->
126
- <?php elseif ( !current_user_can( 'create_users' ) && !$registration) : ?>
127
- <p class="alert">
128
- <?php _e('Only an administrator can add new users.', 'profilebuilder'); ?>
129
- </p><!-- .alert -->
130
-
131
- <?php endif; ?>
132
-
133
- <?php if ( $registration || current_user_can( 'create_users' ) ) : ?>
134
-
135
- <form method="post" id="adduser" class="user-forms" action="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">
136
-
137
- <p>
138
- <strong>Name</strong>
139
- </p>
140
-
141
- <?php
142
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
143
- <p class="form-username">
144
- <label for="user_name">'; _e('Username', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
145
- <input class="text-input" name="user_name" type="text" id="user_name" value="'; if ( $error ) echo wp_specialchars( $_POST['user_name'], 1 ); echo'" />
146
- </p><!-- .form-username -->';
147
- }
148
- ?>
149
-
150
- <?php
151
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
152
- <p class="first_name">
153
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
154
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; if ( $error ) echo wp_specialchars( $_POST['first_name'], 1 ); echo'" />
155
- </p><!-- .first_name -->';
156
- }
157
- ?>
158
-
159
- <?php
160
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
161
- <p class="last_name">
162
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
163
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; if ( $error ) echo wp_specialchars( $_POST['last_name'], 1 ); echo'" />
164
- </p><!-- .last_name -->';
165
- }
166
- ?>
167
-
168
- <?php
169
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
170
- <p class="nickname">
171
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'</label>
172
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; if ( $error ) echo wp_specialchars( $_POST['nickname'], 1 ); echo'" />
173
- </p><!-- .nickname -->';
174
- }
175
- ?>
176
-
177
- <p>
178
- <strong>Contact Info</strong>
179
- </p>
180
-
181
- <?php
182
- if ($wppb_defaultOptions['email'] == 'show'){ echo'
183
- <p class="form-email">
184
- <label for="email">'; _e('E-mail', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
185
- <input class="text-input" name="email" type="text" id="email" value="'; if ( $error ) echo wp_specialchars( $_POST['email'], 1 ); echo'" />
186
- </p><!-- .form-email -->';
187
- }
188
- ?>
189
-
190
- <?php
191
- if ($wppb_defaultOptions['website'] == 'show'){ echo'
192
- <p class="form-website">
193
- <label for="website">'; _e('Website', 'profilebuilder'); echo'</label>
194
- <input class="text-input" name="website" type="text" id="website" value="'; if ( $error ) echo wp_specialchars( $_POST['website'], 1 ); echo'" />
195
- </p><!-- .form-website -->';
196
- }
197
- ?>
198
-
199
- <?php
200
- if ($wppb_defaultOptions['aim'] == 'show'){ echo'
201
- <p class="form-aim">
202
- <label for="aim">'; _e('AIM', 'profilebuilder'); echo'</label>
203
- <input class="text-input" name="aim" type="text" id="aim" value="'; if ( $error ) echo wp_specialchars( $_POST['aim'], 1 ); echo'" />
204
- </p><!-- .form-aim -->';
205
- }
206
- ?>
207
-
208
- <?php
209
- if ($wppb_defaultOptions['yahoo'] == 'show'){ echo'
210
- <p class="form-yim">
211
- <label for="yim">'; _e('Yahoo IM', 'profilebuilder'); echo'</label>
212
- <input class="text-input" name="yim" type="text" id="yim" value="'; if ( $error ) echo wp_specialchars( $_POST['yim'], 1 ); echo'" />
213
- </p><!-- .form-yim -->';
214
- }
215
- ?>
216
-
217
- <?php
218
- if ($wppb_defaultOptions['jabber'] == 'show'){ echo'
219
- <p class="form-jabber">
220
- <label for="jabber">'; _e('Jabber / Google Talk', 'profilebuilder'); echo'</label>
221
- <input class="text-input" name="jabber" type="text" id="jabber" value="'; if ( $error ) echo wp_specialchars( $_POST['jabber'], 1 ); echo'" />
222
- </p><!-- .form-jabber -->';
223
- }
224
- ?>
225
-
226
- <p>
227
- <strong>About Yourself</strong>
228
- </p>
229
-
230
- <?php
231
- if ($wppb_defaultOptions['bio'] == 'show'){ echo'
232
- <p class="form-description">
233
- <label for="description">'; _e('Biographical Info', 'profilebuilder'); echo'</label>
234
- <textarea class="text-input" name="description" id="description" rows="5" cols="30">'; if ( $error ) echo wp_specialchars( $_POST['description'], 1 ); echo'</textarea>
235
- </p><!-- .form-description -->';
236
- }
237
- ?>
238
-
239
- <?php
240
- if ($wppb_defaultOptions['password'] == 'show'){ echo'
241
- <p class="form-password">
242
- <label for="pass1">'; _e('Password', 'profilebuilder'); echo'</label>
243
- <input class="text-input" name="passw1" type="password" id="pass1" />
244
- </p><!-- .form-password -->
245
-
246
- <p class="form-password">
247
- <label for="pass2">'; _e('Repeat Password', 'profilebuilder'); echo'</label>
248
- <input class="text-input" name="passw2" type="password" id="pass2" />
249
- </p><!-- .form-password -->';
250
- }
251
- ?>
252
- <?php
253
- if ( current_user_can( 'delete_users' ) )
254
- echo '
255
- <p class="send-confirmation-email">
256
- <label for="pass1">';
257
- //_e('Send Password? ', 'profilebuilder');
258
- echo'<input id="send_password" type="checkbox" name="send_password" value="1"';if (isset($_POST['send_password'])) echo 'checked';echo'/>
259
- <i>'; _e(' Send these credentials via email.', 'profilebuilder');echo'</i></label>
260
- </p><!-- .send-confirmation-email -->';
261
- ?>
262
-
263
- <p class="form-submit">
264
- <?php echo $referer; ?>
265
- <input name="adduser" type="submit" id="addusersub" class="submit button" value="<?php if ( current_user_can( 'create_users' ) ) _e('Add User', 'profilebuilder'); else _e('Register', 'profilebuilder'); ?>" />
266
- <input name="action" type="hidden" id="action" value="adduser" />
267
- </p><!-- .form-submit -->
268
- <?php wp_nonce_field('verify_true_registration','register_nonce_field'); ?>
269
- </form><!-- #adduser -->
270
-
271
- <?php endif; ?>
272
-
273
- <?php endif; ?>
274
-
275
-
276
- </div>
277
- <?php
278
- }
279
-
280
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/includes/wppb-menu-file.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- function wppb_display_menu(){
4
-
5
- ?>
6
- <div class="wrap">
7
- <?php screen_icon(); ?>
8
- <h2> Profile Builder </h2>
9
- <?php if ($_GET["settings-updated"] == 'true')
10
- echo'<div id="message" class="updated below-h2">
11
- <p>
12
- Changes saved.
13
- </p>
14
- </div>';
15
- ?>
16
- <h3><?php _e('Basic Information'); ?> </h3>
17
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
18
-
19
- <tbody class="plugins">
20
- <tr height="10"></tr>
21
- <tr>
22
- <td><font size="2">Welcome to Profile Builder!</font></td>
23
- </tr>
24
- <tr height="10"></tr>
25
- <tr>
26
- <td>Profile Builder lets you customize your website by adding a front-end menu for all your users, giving them a more flexible way to modify their user-information or to register new users. Also, grants users with administrator rights to customize basic fields. To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).</td>
27
- </tr>
28
- <tr>
29
- <td>Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile]. Publish your page and you are done!</td>
30
- </tr>
31
- <tr>
32
- <td>You can use the following shortcodes:</td>
33
- </tr>
34
- <tr>
35
- <td><span style="padding-left:50px"></span>&rarr; [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).</td>
36
- </tr>
37
- <tr>
38
- <td><span style="padding-left:50px"></span>&rarr; [wppb-login] - for a basic log-in menu.</td>
39
- </tr>
40
- <tr>
41
- <td><span style="padding-left:50px"></span>&rarr; [wppb-register] - to add a registration form.</td>
42
- </tr>
43
- <tr height="10"></tr>
44
- <tr>
45
- <td>Also, users with administrator rights have access to the following features:</td>
46
- </tr>
47
- <tr>
48
- <td><span style="padding-left:50px"></span>&rarr; add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.</td>
49
- </tr>
50
- <tr>
51
- <td><span style="padding-left:50px"></span>&rarr; select whether to display or not the admin bar in the front end for a specific user-group registered to the site.</td>
52
- </tr>
53
- <tr>
54
- <td><span style="padding-left:50px"></span>&rarr; select which information-field can the users see/modify. The hidden fields' values remain unmodified.</td>
55
- </tr>
56
- <tr>
57
- <td>NOTE: this plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable) from the back-end, while custom fields will only be visible in the front-end.</td>
58
- </tr>
59
- </tbody>
60
-
61
- </table>
62
-
63
-
64
- <form method="post" action="options.php">
65
- <?php $wppb_showDefaultCss = get_option('wppb_default_style'); ?>
66
- <?php settings_fields('wppb_default_style'); ?>
67
- <br/>
68
-
69
- <h3><?php _e('Plug-in Layout'); ?> </h3>
70
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
71
-
72
- <tbody class="plugins">
73
- <tr height="10"></tr>
74
- <tr>
75
- <td><font size="2">Use default stylesheet:</font></td>
76
- <td>
77
- <select name="wppb_default_style" width="60" style="width: 60px">
78
- <option value="yes" <?php if ($wppb_showDefaultCss == 'yes') echo ' selected';?>>yes</option>
79
- <option value="no" <?php if ($wppb_showDefaultCss == 'no') echo ' selected';?>>no</option>
80
- </select>
81
-
82
- </td>
83
- </tr>
84
- <tr>
85
- <td></td>
86
- <td>
87
- <input type="hidden" name="action" value="update" />
88
- <p class="submit">
89
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
90
- </p>
91
- </form>
92
- </td>
93
- </tr>
94
- </tbody>
95
- </table>
96
-
97
-
98
-
99
-
100
-
101
-
102
- <form method="post" action="options.php">
103
- <?php $wppb_showAdminBar = get_option('wppb_display_admin_settings'); ?>
104
- <?php settings_fields('wppb_display_admin_settings'); ?>
105
-
106
- <br/>
107
-
108
- <h3><?php _e('Show/Hide the Admin Bar on Front End'); ?> </h3>
109
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
110
- <thead>
111
- <tr>
112
- <th class="manage-column" scope="col">User-group</th>
113
- <th class="manage-column" scope="col">Visibility</th>
114
- </tr>
115
- </thead>
116
- <tbody>
117
- <tr height="10"></tr>
118
- <?php
119
- foreach($wppb_showAdminBar as $key => $data){
120
- echo'<tr>
121
- <td>
122
- <font size="2">'.$key.'</font>
123
- </td>
124
- <td>
125
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="show"';if ($wppb_showAdminBar[$key] == 'show') echo ' checked';echo'/><font size="1">Show</font><span style="padding-left:20px"></span>
126
- <input type="radio" name="wppb_display_admin_settings['.$key.']" value="hide"';if ($wppb_showAdminBar[$key] == 'hide') echo ' checked';echo'/><font size="1">Hide</font>
127
- </td>
128
- </tr>';
129
- }
130
- ?>
131
-
132
- <tbody class="plugins">
133
- <tr height="10"></tr>
134
- <tr>
135
- <td>
136
- </td>
137
- <td>
138
- <input type="hidden" name="action" value="update" />
139
- <p class="submit">
140
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
141
- </p>
142
- </form>
143
- </td>
144
- </tr>
145
-
146
- </tbody>
147
- </table>
148
-
149
-
150
-
151
- <form method="post" action="options.php">
152
- <?php $wppb_defaultOptions = get_option('wppb_default_settings'); ?>
153
- <?php settings_fields('wppb-option-group'); ?>
154
-
155
- <br/>
156
-
157
- <h3><?php _e('Default Profile Fields'); ?> </h3>
158
- <table class="wp-list-table widefat fixed pages" cellspacing="0">
159
- <thead>
160
- <tr>
161
- <th class="manage-column" scope="col">Input Field Name</th>
162
- <th class="manage-column" scope="col">Visibility</th>
163
- </tr>
164
- </thead>
165
- <tbody class="plugins" >
166
- <tr height="10"></tr>
167
- <tr>
168
- <td><font size="4">Name:</font></td>
169
- <td></td>
170
- </tr>
171
- </tbody>
172
- <tbody>
173
- <tr>
174
- <td>
175
- <span style="padding-left:50px"></span><font size="2">Username</font>
176
- </td>
177
- <td>
178
- <input type="radio" name="wppb_default_settings[username]" value="show" checked /><font size="1">Show</font><span style="padding-left:20px"></span>
179
- <input type="radio" name="wppb_default_settings[username]" value="hide" disabled /><font size="1" color="grey">Hide</font>
180
- </td>
181
- </tr>
182
- <tr>
183
- <td>
184
- <span style="padding-left:50px"></span><font size="2">First Name</font>
185
- </td>
186
- <td>
187
- <input type="radio" name="wppb_default_settings[firstname]" value="show" <?php if ($wppb_defaultOptions['firstname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
188
- <input type="radio" name="wppb_default_settings[firstname]" value="hide" <?php if ($wppb_defaultOptions['firstname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td>
193
- <span style="padding-left:50px"></span><font size="2">Last Name</font>
194
- </td>
195
- <td>
196
- <input type="radio" name="wppb_default_settings[lastname]" value="show" <?php if ($wppb_defaultOptions['lastname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
197
- <input type="radio" name="wppb_default_settings[lastname]" value="hide" <?php if ($wppb_defaultOptions['lastname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td>
202
- <span style="padding-left:50px"></span><font size="2">Nickname</font>
203
- </td>
204
- <td>
205
- <input type="radio" name="wppb_default_settings[nickname]" value="show" <?php if ($wppb_defaultOptions['nickname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
206
- <input type="radio" name="wppb_default_settings[nickname]" value="hide" <?php if ($wppb_defaultOptions['nickname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
207
- </td>
208
- </tr>
209
- <tr>
210
- <td>
211
- <span style="padding-left:50px"></span><font size="2">Display name publicly as ...</font>
212
- </td>
213
- <td>
214
- <input type="radio" name="wppb_default_settings[dispname]" value="show" <?php if ($wppb_defaultOptions['dispname'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
215
- <input type="radio" name="wppb_default_settings[dispname]" value="hide" <?php if ($wppb_defaultOptions['dispname'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
216
- </td>
217
- </tr>
218
- <tbody class="plugins">
219
- <tr height="10"></tr>
220
- <tr>
221
- <td><font size="4">Contact Info:</font></td>
222
- <td></td>
223
- </tr>
224
- </tbody>
225
- <tbody>
226
- <tr>
227
- <td>
228
- <span style="padding-left:50px"></span><font size="2">E-mail</font>
229
- </td>
230
- <td>
231
- <input type="radio" name="wppb_default_settings[email]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
232
- <input type="radio" name="wppb_default_settings[email]" value="hide" disabled><font size="1" color="grey">Hide</font>
233
- </td>
234
- </tr>
235
- <tr>
236
- <td>
237
- <span style="padding-left:50px"></span><font size="2">Website</font>
238
- </td>
239
- <td>
240
- <input type="radio" name="wppb_default_settings[website]" value="show" <?php if ($wppb_defaultOptions['website'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
241
- <input type="radio" name="wppb_default_settings[website]" value="hide" <?php if ($wppb_defaultOptions['website'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
242
- </td>
243
- </tr>
244
- <tbody class="plugins">
245
- </tbody>
246
- <tbody>
247
- <tr>
248
- <td>
249
- <span style="padding-left:50px"></span><font size="2">AIM</font>
250
- </td>
251
- <td>
252
- <input type="radio" name="wppb_default_settings[aim]" value="show" <?php if ($wppb_defaultOptions['aim'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
253
- <input type="radio" name="wppb_default_settings[aim]" value="hide" <?php if ($wppb_defaultOptions['aim'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>
258
- <span style="padding-left:50px"></span><font size="2">Yahoo IM</font>
259
- </td>
260
- <td>
261
- <input type="radio" name="wppb_default_settings[yahoo]" value="show" <?php if ($wppb_defaultOptions['yahoo'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
262
- <input type="radio" name="wppb_default_settings[yahoo]" value="hide" <?php if ($wppb_defaultOptions['yahoo'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
263
- </td>
264
- </tr>
265
- <tr>
266
- <td>
267
- <span style="padding-left:50px"></span><font size="2">Jabber / Google Talk</font>
268
- </td>
269
- <td>
270
- <input type="radio" name="wppb_default_settings[jabber]" value="show" <?php if ($wppb_defaultOptions['jabber'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
271
- <input type="radio" name="wppb_default_settings[jabber]" value="hide" <?php if ($wppb_defaultOptions['jabber'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
272
- </td>
273
- </tr>
274
- <tbody class="plugins">
275
- <tr height="10"></tr>
276
- <tr>
277
- <td><font size="4">About Yourself:</font></td>
278
- <td></td>
279
- </tr>
280
- </tbody>
281
- <tbody>
282
- <tr>
283
- <td>
284
- <span style="padding-left:50px"></span><font size="2">Biographical Info</font>
285
- </td>
286
- <td>
287
- <input type="radio" name="wppb_default_settings[bio]" value="show" <?php if ($wppb_defaultOptions['bio'] == 'show') echo 'checked';?> /><font size="1">Show</font><span style="padding-left:20px"></span>
288
- <input type="radio" name="wppb_default_settings[bio]" value="hide" <?php if ($wppb_defaultOptions['bio'] == 'hide') echo 'checked';?> /><font size="1">Hide</font>
289
- </td>
290
- </tr>
291
- <tbody class="plugins">
292
- <tr>
293
- <td>
294
- </td>
295
- <td>
296
- </td>
297
- </tr>
298
- </tbody>
299
- <tbody>
300
- <tr>
301
- <td>
302
- <span style="padding-left:50px"></span><font size="2">New Password</font>
303
- </td>
304
- <td>
305
- <input type="radio" name="wppb_default_settings[password]" value="show" checked><font size="1">Show</font><span style="padding-left:20px"></span>
306
- <input type="radio" name="wppb_default_settings[password]" value="hide" disabled><font size="1" color="grey">Hide</font>
307
- </td>
308
- </tr>
309
- <tbody class="plugins">
310
- <tr height="10"></tr>
311
- <tr>
312
- <td>
313
- </td>
314
- <td>
315
- <input type="hidden" name="action" value="update" />
316
- <p class="submit">
317
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> <?php //Note the use of the _e() function to handle translation of the text ?>
318
- </p>
319
- </form>
320
- </td>
321
- </tr>
322
-
323
- </tbody>
324
- </table>
325
-
326
- </div>
327
-
328
- <?php
329
- }
330
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/profile-builder.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Profile Builder
4
- Plugin URI: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/
5
- Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
6
- Version: 1.0.8
7
- Author: Reflection Media
8
- Author URI: http://reflectionmedia.ro
9
- License: GPL2
10
-
11
- == Copyright ==
12
- Copyright 2011 Reflection Media (wwww.reflectionmedia.ro)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
- */
26
-
27
- register_activation_hook( __FILE__ , 'wppb_initialize_variables' ); //initialize some values upon plug-in activation
28
-
29
- function wppb_initialize_variables(){
30
- $wppb_default_settings = array( 'username' => 'show',
31
- 'firstname'=> 'show',
32
- 'lastname' => 'show',
33
- 'nickname' => 'show',
34
- 'dispname' => 'show',
35
- 'email' => 'show',
36
- 'website' => 'show',
37
- 'aim' => 'show',
38
- 'yahoo' => 'show',
39
- 'jabber' => 'show',
40
- 'bio' => 'show',
41
- 'password' => 'show' );
42
- add_option( 'wppb_default_settings', $wppb_default_settings ); //set all fields visible on first activation of the plugin
43
- add_option( 'wppb_default_style', 'yes');
44
-
45
- global $wp_roles;
46
- $all_roles = $wp_roles->roles;
47
- $editable_roles = apply_filters('editable_roles', $all_roles);
48
-
49
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
50
-
51
- if ($admintSettingsPresent == 'not_found'){ // if the field doesn't exists, then create it
52
- $rolesArray = array();
53
- foreach ( $editable_roles as $key => $data )
54
- $rolesArray = array( $key => 'show' ) + $rolesArray;
55
- $rolesArray = array_reverse($rolesArray,true);
56
- add_option( 'wppb_display_admin_settings', $rolesArray);
57
- }
58
- }
59
-
60
-
61
- function wppb_create_menu(){
62
- add_submenu_page('users.php', 'Profile Builder', 'Profile Builder', 'delete_users', 'ProfileBuilderSettings', 'wppb_display_menu');
63
- }
64
-
65
-
66
- function wppb_register_settings() { // whitelist options, you can add more register_settings changing the second parameter
67
- register_setting( 'wppb-option-group', 'wppb_default_settings' );
68
- register_setting( 'wppb_default_style', 'wppb_default_style' );
69
- register_setting( 'wppb_display_admin_settings', 'wppb_display_admin_settings' );
70
- }
71
-
72
-
73
- function wppb_add_plugin_stylesheet() {
74
- $wppb_showDefaultCss = get_option('wppb_default_style');
75
- $styleUrl = WP_PLUGIN_URL . '/profile-builder/css/style.css';
76
- $styleFile = WP_PLUGIN_DIR . '/profile-builder/css/style.css';
77
- if ( file_exists($styleFile) && $wppb_showDefaultCss == 'yes') {
78
- wp_register_style('wppb_stylesheet', $styleUrl);
79
- wp_enqueue_style( 'wppb_stylesheet');
80
- }
81
- }
82
-
83
-
84
- function wppb_show_admin_bar($content){
85
- global $current_user;
86
- $admintSettingsPresent = get_option('wppb_display_admin_settings','not_found');
87
- if ($admintSettingsPresent != 'not_found'){
88
- $wppb_showAdminBar = get_option('wppb_display_admin_settings');
89
- $userRole = ($current_user->data->wp_capabilities);
90
- if ($userRole != NULL){
91
- $currentRole = key($userRole);
92
- $getSettings = $wppb_showAdminBar[$currentRole];
93
- if ($getSettings == 'show')
94
- return true;
95
- elseif ($getSettings == 'hide')
96
- return false;
97
- }
98
- }
99
- else
100
- return true;
101
- }
102
-
103
-
104
- if (is_admin() ){ // if we are in the admin menu
105
- include_once('includes/wppb-menu-file.php'); // include the menu file
106
- add_action('admin_init', 'wppb_register_settings'); // register the settings for the menu only display sidebar menu for a user with a certain capability, in this case only the "admin"
107
- add_action('admin_menu','wppb_create_menu'); // call the wppb_create_menu function
108
- }else{ // if we aren't in the admin back-end menu, aka we are in the front-end view
109
- add_action('wp_print_styles', 'wppb_add_plugin_stylesheet'); // include the standard style-sheet or specify the path to a new one
110
- include_once('includes/wppb-front-end-profile.php'); // include the menu file for the profile informations
111
- add_shortcode('wppb-edit-profile', 'wppb_front_end_profile_info');
112
- include_once('includes/wppb-front-end-login.php'); // include the menu file for the login screen
113
- add_shortcode('wppb-login', 'wppb_front_end_login');
114
- include_once('includes/wppb-front-end-register.php'); // include the menu file for the register screen
115
- add_shortcode('wppb-register', 'wppb_front_end_register');
116
- add_filter( 'show_admin_bar' , 'wppb_show_admin_bar'); // set the front-end admin bar to show/hide
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/readme.txt DELETED
@@ -1,86 +0,0 @@
1
- === Profile Builder ===
2
-
3
- Contributors: reflectionmedia, barinagabriel
4
- Donate link: http://www.cozmoslabs.com/2011/04/12/wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin
5
- Tags: user registration, custom field registration, customize profile, user fields, builder, profile builder
6
- Requires at least: 3.1
7
- Tested up to: 3.1
8
- Stable tag: 1.0.8
9
-
10
-
11
- Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed.
12
-
13
-
14
- == Description ==
15
-
16
- Profile Builder lets you customize your website by adding a front-end menu for all your users,
17
- giving them a more flexible way to modify their user-information or to register new users.
18
- Also, grants users with administrator rights to customize basic fields.
19
- To achieve this, just create a new page, and give it an intuitive name(i.e. Edit Profile).
20
- Now all you need to do is add the following shortcode(for the previous example): [wppb-edit-profile].
21
- Publish your page and you are done!
22
-
23
- You can use the following shortcodes:
24
-
25
- * [wppb-edit-profile] - to grant users a front-end acces to their personal information(requires user to be logged in).
26
- * [wppb-login] - for a log-in form.
27
- * [wppb-register] - to add a registration form.
28
-
29
- Also, users with administrator rights have access to the following features:
30
-
31
- * add a custom stylesheet/inherit values from the current theme or use the default one, built into this plug-in.
32
- * select whether to display or not the admin bar in the front end for a specific user-group registered to the site.
33
- * select which information-field can the users see/modify. The hidden fields' values remain unmodified.
34
-
35
- NOTE:
36
-
37
- This plugin only adds/removes fields in the front-end. The default information-fields will still be visible(and thus modifiable)
38
- from the back-end, while custom fields will only be visible in the front-end.
39
-
40
-
41
-
42
- == Installation ==
43
-
44
- 1. Upload the profile-builder folder to the `/wp-content/plugins/` directory
45
- 1. Activate the plugin through the 'Plugins' menu in WordPress
46
- 1. Create a new page and use one of the shortcodes available
47
-
48
- == Frequently Asked Questions ==
49
-
50
- = Will it change the default admin-panel from the back-end by adding/disableing information-fields? =
51
-
52
- No, profile-builder only affects the front-end of your site, leaving the default fields unmodified
53
-
54
- = Will the information be also updated for any hidden fields? =
55
-
56
- No, only fields visible to the users will/can be modified/updated.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Login Page: screenshot-1.jpg
62
- 2. Register Page: screenshot-2.jpg
63
- 3. Backend Settings: screenshot-3.jpg
64
-
65
- == Changelog ==
66
-
67
- = 1.0.6 =
68
- Apparently the WordPress.org svn converts my EOL from Windows to Mac and because of that you get "The plugin does not have a valid header."
69
-
70
- = 1.0.5 =
71
- You can now actualy install the plugin. All because of a silly line break.
72
-
73
- = 1.0.4 =
74
- Still no Change.
75
-
76
- = 1.0.3 =
77
- No Change.
78
-
79
- = 1.0.2 =
80
- Small changes.
81
-
82
- = 1.0.1 =
83
- Changes to the ReadMe File
84
-
85
- = 1.0 =
86
- Added the posibility of displaying/hiding default WordPress information-fields, and to modify basic layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.8/screenshots/screenshot-1.jpg DELETED
Binary file
1.1.5/tags/1.0.8/screenshots/screenshot-2.jpg DELETED
Binary file
1.1.5/tags/1.0.8/screenshots/screenshot-3.jpg DELETED
Binary file
1.1.5/tags/1.0.8/uninstall.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
- exit (); // If uninstall not called from WordPress exit
4
-
5
- delete_option( 'wppb_default_settings' ); // Delete default settings from options table
6
- delete_option( 'wppb_default_style' ); // Delete "use default css or not" settings
7
- delete_option( 'wppb_display_admin_settings' ); // Delete display admin bar option
 
 
 
 
 
 
 
1.1.5/tags/1.0.9/css/style.css DELETED
@@ -1,38 +0,0 @@
1
- /*
2
- NOTES:
3
- The global Profile Builder class is: wppb_holder
4
- The id for the individual sections are: wppb_modify for [wppb-profile-info]
5
- wppb_login for [wppb-registered-login]
6
- wppb_register for [wppb-register-new]
7
-
8
- */
9
- /* WPPB_MODIFY */
10
- #wppb_modify p label{
11
- display:block;
12
- }
13
- #wppb_modify input[type=text], #wppb_modify input[type=password], #wppb_modify select, #wppb_modify textarea{
14
- width:50%;
15
- margin-bottom:5px;
16
- }
17
- #wppb_modify textarea{
18
- width:70%;
19
- }
20
- .changes-saved, .success{
21
- color:green;
22
- }
23
- .warning, .error{
24
- color:red;
25
- }
26
-
27
- /* WPPB_REGISTER */
28
-
29
- #wppb_register p label{
30
- display:block;
31
- }
32
- #wppb_register input[type=text], #wppb_register input[type=password], #wppb_register select, #wppb_register textarea{
33
- width:50%;
34
- margin-bottom:5px;
35
- }
36
- #wppb_register textarea{
37
- width:70%;
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.9/includes/wppb-front-end-login.php DELETED
@@ -1,92 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
-
6
- // wp_signon can only be executed before anything is outputed in the page
7
- // because of that we're adding it to the init hook
8
- $wppb_login = false;
9
-
10
- function wppb_signon(){
11
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'log-in' && wp_verify_nonce($_POST['login_nonce_field'],'verify_true_login')) :
12
- global $error;
13
- global $wppb_login;
14
- $wppb_login = wp_signon( array( 'user_login' => $_POST['user-name'], 'user_password' => $_POST['password'], 'remember' => $_POST['remember-me'] ), false );
15
- endif;
16
- }
17
- add_action('init', 'wppb_signon');
18
-
19
- function wppb_front_end_login(){
20
- ob_start();
21
- global $wppb_login;
22
-
23
- echo '<div class="wppb_holder" id="wppb_login">';
24
-
25
- if ( is_user_logged_in() ) : // Already logged in
26
- global $user_ID;
27
- $wppb_user = get_userdata( $user_ID );
28
- if($wppb_user->display_name == ''){
29
- $wppb_user->display_name = $wppb_user->user_login;
30
- }
31
-
32
- ?>
33
-
34
-
35
-
36
-
37
- <p class="alert">
38
- <?php printf( __('You are currently logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_user->ID ), $wppb_user->display_name ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'profilebuilder'); ?>"><?php _e('Log out &raquo;', 'profilebuilder'); ?></a>
39
- </p><!-- .alert -->
40
-
41
- <?php elseif ( $wppb_login->ID ) : // Successful login ?>
42
- <?php
43
- //$wppb_login = get_userdata( $wppb_login->ID );
44
- if($wppb_login->display_name == ''){
45
- $wppb_login->display_name = $wppb_login->user_login;
46
- }
47
-
48
- ?>
49
-
50
- <p class="success">
51
- <?php printf( __('You have successfully logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'profilebuilder'), get_author_posts_url( $wppb_login->ID ), $wppb_login->display_name ); ?>
52
- </p><!-- .success-->
53
- <?php else : // Not logged in ?>
54
-
55
- <?php if (!empty( $_POST['action'] )): ?>
56
- <p class="error">
57
- <?php if ( trim($_POST['user-name']) == '') echo '<strong>ERROR:</strong> The username field is empty. '; ?>
58
- <?php if ( is_wp_error($wppb_login) ) echo $wppb_login->get_error_message();?>
59
- </p><!-- .error -->
60
- <?php endif; ?>
61
-
62
- <form action="<?php the_permalink(); ?>" method="post" class="sign-in">
63
- <p class="login-form-username">
64
- <label for="user-name"><?php _e('Username', 'profilebuilder'); ?></label>
65
- <input type="text" name="user-name" id="user-name" class="text-input" value="<?php echo wp_specialchars( $_POST['user-name'], 1 ); ?>" />
66
- </p><!-- .form-username -->
67
-
68
- <p class="login-form-password">
69
- <label for="password"><?php _e('Password', 'profilebuilder'); ?></label>
70
- <input type="password" name="password" id="password" class="text-input" />
71
- </p><!-- .form-password -->
72
- <p class="login-form-submit">
73
- <input type="submit" name="submit" class="submit button" value="<?php _e('Log in', 'profilebuilder'); ?>" />
74
- <input class="remember-me checkbox" name="remember-me" id="remember-me" type="checkbox" checked="checked" value="forever" />
75
- <label for="remember-me"><?php _e('Remember me', 'profilebuilder'); ?></label>
76
- <input type="hidden" name="action" value="log-in" />
77
- </p><!-- .form-submit -->
78
- <p>
79
- <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=lostpassword"><?php _e('Lost password?', 'profilebuilder'); ?></a>
80
- </p>
81
- <?php wp_nonce_field('verify_true_login','login_nonce_field'); ?>
82
- </form><!-- .sign-in -->
83
-
84
- <?php endif;?>
85
- </div>
86
- <?php
87
-
88
- $output = ob_get_contents();
89
- ob_end_clean();
90
- return $output;
91
-
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1.1.5/tags/1.0.9/includes/wppb-front-end-profile.php DELETED
@@ -1,285 +0,0 @@
1
- <?php
2
- function wppb_front_end_profile_info() {
3
- ob_start();
4
- get_currentuserinfo();
5
- $wppb_defaultOptions = get_option('wppb_default_settings');
6
- $changesSaved = 'no';
7
-
8
-
9
-
10
- /* Load registration file. */
11
- require_once(ABSPATH . WPINC . '/registration.php');
12
- /* Get user info. */
13
- global $current_user;
14
- /* If profile was saved, update profile. */
15
- if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' && wp_verify_nonce($_POST['edit_nonce_field'],'verify_edit_user') ) {
16
-
17
- if (email_exists( $_POST['email'] ) != FALSE)
18
- $thisEmail = email_exists( $_POST['email'] );
19
- else $thisEmail = $current_user->id;
20
-
21
- /* Update user password. */
22
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
23
- if ( $_POST['pass1'] == $_POST['pass2'] ){
24
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
25
- $changesSaved = 'yes';
26
- }else
27
- $error = __('The passwords you entered didn\'t match. Your password was not updated.', 'profilebuilder');
28
- }
29
-
30
-
31
- if ( !empty( $_POST['email'] ) && is_email( $_POST['email'] )){ // if the user entered a valid email address
32
- if (($thisEmail == $current_user->id)){ // if the entered email address is not already registered to some other user
33
- wp_update_user( array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] )));
34
- $changesSaved = 'yes';
35
- }else
36
- $error = __('The e-mail address you entered is already registered to a different user. Your e-mail address was not updated.', 'profilebuilder');
37
- }else
38
- $error = __('The e-mail address you entered is not a valid one. Your e-mail address was not updated.', 'profilebuilder');
39
-
40
-
41
-
42
- /* Update user information. */
43
- if ($wppb_defaultOptions['firstname'] == 'show'){
44
- wp_update_user( array( 'ID' => $current_user->id, 'first_name' => esc_attr( $_POST['first_name'] )));
45
- $changesSaved = 'yes';
46
- }
47
- if ($wppb_defaultOptions['lastname'] == 'show'){
48
- wp_update_user( array( 'ID' => $current_user->id, 'last_name' => esc_attr( $_POST['last_name'] )));
49
- $changesSaved = 'yes';
50
- }
51
-
52
- if ($wppb_defaultOptions['nickname'] == 'show'){
53
- wp_update_user( array( 'ID' => $current_user->id, 'nickname' => esc_attr( $_POST['nickname'] )));
54
- $changesSaved = 'yes';
55
- }
56
-
57
- if ($wppb_defaultOptions['dispname'] == 'show'){
58
- wp_update_user( array( 'ID' => $current_user->id, 'display_name' => esc_attr( $_POST['display_name'] )));
59
- $changesSaved = 'yes';
60
- }
61
-
62
- if ($wppb_defaultOptions['website'] == 'show'){
63
- $wppbPos = strpos($_POST['website'], 'http://');
64
- if($wppbPos !== FALSE){
65
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => esc_attr( $_POST['website'] )));
66
- $changesSaved = 'yes';
67
- }else{
68
- wp_update_user( array( 'ID' => $current_user->id, 'user_url' => 'http://'.esc_attr( $_POST['website'] )));
69
- $changesSaved = 'yes';
70
- }
71
- }
72
-
73
- if ($wppb_defaultOptions['aim'] == 'show'){
74
- update_user_meta( $current_user->id, 'aim', esc_attr( $_POST['aim'] ) );
75
- $changesSaved = 'yes';
76
- }
77
-
78
- if ($wppb_defaultOptions['yahoo'] == 'show'){
79
- update_user_meta( $current_user->id, 'yim', esc_attr( $_POST['yim'] ) );
80
- $changesSaved = 'yes';
81
- }
82
-
83
- if ($wppb_defaultOptions['jabber'] == 'show'){
84
- update_user_meta( $current_user->id, 'jabber', esc_attr( $_POST['jabber'] ) );
85
- $changesSaved = 'yes';
86
- }
87
-
88
- if ($wppb_defaultOptions['bio'] == 'show'){
89
- update_user_meta( $current_user->id, 'description', esc_attr( $_POST['description'] ) );
90
- $changesSaved = 'yes';
91
- }
92
-
93
- }
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
- ?>
102
- <div class="wppb_holder" id="wppb_modify">
103
- <?php if ( !is_user_logged_in() ) : ?>
104
-
105
- <p class="warning">
106
- <?php _e('You must be logged in to edit your profile.', 'profilebuilder'); ?>
107
- </p><!-- .warning -->
108
-
109
- <?php else : ?>
110
-
111
- <?php if ( $error ) echo '<p class="error">' . $error . '</p>'; ?>
112
- <?php
113
- if ($changesSaved == 'yes'){
114
- echo '<p class="changes-saved">';
115
- _e('The changes made have been successfully saved.', 'profilebuilder');
116
- echo'</p><!-- .changes-saved -->';
117
- }
118
- ?>
119
-
120
- <form method="post" id="edituser" class="user-forms" action="<?php the_permalink(); ?>">
121
- <p>
122
- <strong>Name</strong>
123
- </p>
124
- <?php
125
- if ($wppb_defaultOptions['username'] == 'show'){ echo'
126
- <p class="username">
127
- <label for="user_login">'; _e('Username', 'profilebuilder'); echo'</label>
128
- <input class="text-input" name="user_login" type="text" id="user_login" value="'; the_author_meta( 'user_login', $current_user->id ); echo'" disabled="disabled"/> <label for="user_login"><i>'; _e(' Usernames cannot be changed.'); echo'</i></label>
129
- </p><!-- .first_name -->';
130
- }
131
- ?>
132
-
133
- <?php
134
- if ($wppb_defaultOptions['firstname'] == 'show'){ echo'
135
- <p class="first_name">
136
- <label for="first_name">'; _e('First Name', 'profilebuilder'); echo'</label>
137
- <input class="text-input" name="first_name" type="text" id="first_name" value="'; the_author_meta( 'first_name', $current_user->id ); echo '" />
138
- </p><!-- .first_name -->';
139
- }
140
- ?>
141
-
142
- <?php
143
- if ($wppb_defaultOptions['lastname'] == 'show'){ echo'
144
- <p class="last_name">
145
- <label for="last_name">'; _e('Last Name', 'profilebuilder'); echo'</label>
146
- <input class="text-input" name="last_name" type="text" id="last_name" value="'; the_author_meta( 'last_name', $current_user->id ); echo '" />
147
- </p><!-- .last_name -->';
148
- }
149
- ?>
150
-
151
- <?php
152
- if ($wppb_defaultOptions['nickname'] == 'show'){ echo'
153
- <p class="nickname">
154
- <label for="nickname">'; _e('Nickname', 'profilebuilder'); echo'<i>'; _e(' (required)', 'profilebuilder');echo'</i></label>
155
- <input class="text-input" name="nickname" type="text" id="nickname" value="'; the_author_meta( 'nickname', $current_user->id ); echo'" />
156
- </p><!-- .nickname -->';
157
- }
158
- ?>
159
-
160
- <?php
161
- if ($wppb_defaultOptions['dispname'] == 'show'){ echo'
162
- <p class="display_name">
163
- <label for="display_name">'; _e('Display name publicly as', 'profilebuilder'); echo'</label>
164
- <select name="display_name" id="display_name">';
165
- $public_display = array();
166
- $public_display['display_username'] = get_the_author_meta('user_login', $current_user->id);
167
- $thisFirstName = get_the_author_meta('first_name', $current_user->id);
168
- if ( !empty($thisFirstName))
169
- $public_display['display_firstname'] = get_the_author_meta('first_name', $current_user->id);
170
- $thisLastName = get_the_author_meta('last_name', $current_user->id);
171
- if ( !empty($thisLastName))
172
- $public_display['display_lastname'] = get_the_author_meta('last_name', $current_user->id);
173
- $public_display['display_nickname'] = get_the_author_meta('nickname', $current_user->id);
174
- if ( !empty($thisFirstName) && !empty($thisLastName) ) {
175
- $public_display['display_firstlast'] = $thisFirstName . ' ' . $thisLastName;
176
- $public_display['display_lastfirst'] = $thisLastName . ' ' . $thisFirstName;
177
- }
178
- $thisDisplayName = get_the_author_meta('display_name', $current_user->id);
179
- if ( !in_array( $thisDisplay