Cimy User Extra Fields - Version 1.5.2

Version Description

Download this release

Release Info

Developer Cimmo
Plugin Icon wp plugin Cimy User Extra Fields
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

README_OFFICIAL.txt CHANGED
@@ -90,6 +90,7 @@ Visualization rules
90
  New fields will be visible everywhere by default, a part some WordPress fields.
91
 
92
 
 
93
  Bugs or suggestions can be mailed at: cimmino.marco@gmail.com
94
 
95
  REQUIREMENTS:
@@ -474,6 +475,12 @@ Q: When feature XYZ will be added?
474
  A: I don't know, remember that this is a 100% free project so answer is "When I have time and/or when someone help me with a donation".
475
 
476
 
 
 
 
 
 
 
477
  Q: Can I help with a donation?
478
 
479
  A: Sure, visit the donation page or contact me via e-mail.
@@ -502,6 +509,11 @@ A lot of times I cannot reproduce the problem and I need more details, so if you
502
 
503
 
504
  CHANGELOG:
 
 
 
 
 
505
  v1.5.1 - 10/02/2010
506
  - Fixed PHP error when using dirty user_id in the profile's URL
507
  - Worked around a bug introduced by WordPress 2.9.x when admin is editing another's user profile sometimes get wrong data into Extra Fields (thanks to Serge Meier)
90
  New fields will be visible everywhere by default, a part some WordPress fields.
91
 
92
 
93
+ BEFORE writing to me read carefully ALL the documentation AND the FAQ. Missing this step means you are wasting my time!
94
  Bugs or suggestions can be mailed at: cimmino.marco@gmail.com
95
 
96
  REQUIREMENTS:
475
  A: I don't know, remember that this is a 100% free project so answer is "When I have time and/or when someone help me with a donation".
476
 
477
 
478
+ Q: I'm using your plug-in on WordPress MU per-blog installation, I'm registering users on one blog but they appear on the main blog too, why?
479
+
480
+ A: Because WordPress MU is designed like that and I can't do anything about, however all extra fields and relative data are saved per-blog.
481
+ Since I had already a long discussion with an user that didn't believe this, don't bother me to insist on this topic until you prove I'm wrong.
482
+
483
+
484
  Q: Can I help with a donation?
485
 
486
  A: Sure, visit the donation page or contact me via e-mail.
509
 
510
 
511
  CHANGELOG:
512
+ v1.5.2 - 03/03/2010
513
+ - Fixed profile page was not updating when setting 'Could not be empty' rule for picture, avatar or file fields (thanks to Erum Munir)
514
+ - Fixed WordPress MU per-blog installation and wp-content in a custom location was giving PHP error after installing cimy_uef_mu_activation.php
515
+ - Fixed WordPress MU per-blog installation can't edit posts anymore after installing cimy_uef_mu_activation.php (thanks to Ekaterina Kurasheva)
516
+
517
  v1.5.1 - 10/02/2010
518
  - Fixed PHP error when using dirty user_id in the profile's URL
519
  - Worked around a bug introduced by WordPress 2.9.x when admin is editing another's user profile sometimes get wrong data into Extra Fields (thanks to Serge Meier)
cimy_uef_mu_activation.php CHANGED
@@ -11,9 +11,9 @@
11
  */
12
  // need to know if registering with VHOST set to 'yes', as seems filters are not added in time, grr!
13
  if (constant( "VHOST" ) == 'yes')
14
- $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
15
  else
16
- $action = "";
17
 
18
  if (isset($_REQUEST["blog_id"])) {
19
  $mu_blog_id = intval($_REQUEST["blog_id"]);
@@ -23,9 +23,12 @@ if (isset($_REQUEST["blog_id"])) {
23
  }
24
  }
25
 
 
 
 
26
  // Leave this after all!
27
- if ((defined('WP_INSTALLING')) || ($action == "register"))
28
- require_once(ABSPATH.PLUGINDIR."/cimy-user-extra-fields/cimy_user_extra_fields.php");
29
 
30
  function cimy_uef_mu_blog_exists($blog_id, $c_site_id=-1) {
31
  global $wpdb, $site_id;
11
  */
12
  // need to know if registering with VHOST set to 'yes', as seems filters are not added in time, grr!
13
  if (constant( "VHOST" ) == 'yes')
14
+ $cimy_uef_mu_register_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
15
  else
16
+ $cimy_uef_mu_register_action = "";
17
 
18
  if (isset($_REQUEST["blog_id"])) {
19
  $mu_blog_id = intval($_REQUEST["blog_id"]);
23
  }
24
  }
25
 
26
+ if (!defined("WP_CONTENT_DIR"))
27
+ define("WP_CONTENT_DIR", ABSPATH."/wp_content");
28
+
29
  // Leave this after all!
30
+ if ((defined('WP_INSTALLING')) || ($cimy_uef_mu_register_action == "register"))
31
+ require_once(WP_CONTENT_DIR."/plugins/cimy-user-extra-fields/cimy_user_extra_fields.php");
32
 
33
  function cimy_uef_mu_blog_exists($blog_id, $c_site_id=-1) {
34
  global $wpdb, $site_id;
cimy_uef_register.php CHANGED
@@ -287,7 +287,6 @@ function cimy_registration_check($user_login, $user_email, $errors) {
287
  $i++;
288
 
289
  foreach ($fields as $thisField) {
290
-
291
  $field_id = $thisField['ID'];
292
  $name = $thisField['NAME'];
293
  $rules = $thisField['RULES'];
@@ -336,6 +335,8 @@ function cimy_registration_check($user_login, $user_email, $errors) {
336
  $file_size = $_FILES[$input_name]['size'] / 1024;
337
  $file_type = $_FILES[$input_name]['type'];
338
  $value = $_FILES[$input_name]['name'];
 
 
339
  }
340
 
341
  switch ($type) {
@@ -354,8 +355,17 @@ function cimy_registration_check($user_login, $user_email, $errors) {
354
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('hasn&#8217;t a correct email syntax.', $cimy_uef_domain));
355
  }
356
 
357
- if ((!$rules['can_be_empty']) && (in_array($type, $rule_canbeempty))) {
358
- if ($value == '')
 
 
 
 
 
 
 
 
 
359
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('couldn&#8217;t be empty.', $cimy_uef_domain));
360
  }
361
 
@@ -395,7 +405,7 @@ function cimy_registration_check($user_login, $user_email, $errors) {
395
 
396
  // CHECK IF IT IS A REAL PICTURE
397
  if (($type == "picture") || ($type == "avatar")) {
398
- if (stristr($file_type, "image/") === false) {
399
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('should be an image.', $cimy_uef_domain));
400
  }
401
  }
287
  $i++;
288
 
289
  foreach ($fields as $thisField) {
 
290
  $field_id = $thisField['ID'];
291
  $name = $thisField['NAME'];
292
  $rules = $thisField['RULES'];
335
  $file_size = $_FILES[$input_name]['size'] / 1024;
336
  $file_type = $_FILES[$input_name]['type'];
337
  $value = $_FILES[$input_name]['name'];
338
+ $old_file = $_POST[$input_name."_oldfile"];
339
+ $del_old_file = $_POST[$input_name."_del"];
340
  }
341
 
342
  switch ($type) {
355
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('hasn&#8217;t a correct email syntax.', $cimy_uef_domain));
356
  }
357
 
358
+ if ((!$rules['can_be_empty']) && (in_array($type, $rule_canbeempty)) && ($value == "")) {
359
+ $empty_error = true;
360
+
361
+ // IF 1. it's a file type
362
+ // AND 2. there is an old one uploaded
363
+ // AND 3. this old one is not gonna be deleted
364
+ // THEN do not throw the empty error.
365
+ if ((in_array($type, $cimy_uef_file_types)) && ($old_file != "") && ($del_old_file == ""))
366
+ $empty_error = false;
367
+
368
+ if ($empty_error)
369
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('couldn&#8217;t be empty.', $cimy_uef_domain));
370
  }
371
 
405
 
406
  // CHECK IF IT IS A REAL PICTURE
407
  if (($type == "picture") || ($type == "avatar")) {
408
+ if ((stristr($file_type, "image/") === false) && ($value != "")) {
409
  $errors->add($unique_id, '<strong>'.__("ERROR", $cimy_uef_domain).'</strong>: '.$label.' '.__('should be an image.', $cimy_uef_domain));
410
  }
411
  }
cimy_user_extra_fields.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cimy User Extra Fields
4
  Plugin URI: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Plugin Description: Add some useful fields to registration and user's info
6
- Version: 1.5.1
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  */
@@ -192,7 +192,7 @@ require_once($cuef_plugin_dir.'/cimy_uef_options.php');
192
  require_once($cuef_plugin_dir.'/cimy_uef_admin.php');
193
 
194
  $cimy_uef_name = "Cimy User Extra Fields";
195
- $cimy_uef_version = "1.5.1";
196
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
197
 
198
  $start_cimy_uef_comment = "<!--\n";
3
  Plugin Name: Cimy User Extra Fields
4
  Plugin URI: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/
5
  Plugin Description: Add some useful fields to registration and user's info
6
+ Version: 1.5.2
7
  Author: Marco Cimmino
8
  Author URI: mailto:cimmino.marco@gmail.com
9
  */
192
  require_once($cuef_plugin_dir.'/cimy_uef_admin.php');
193
 
194
  $cimy_uef_name = "Cimy User Extra Fields";
195
+ $cimy_uef_version = "1.5.2";
196
  $cimy_uef_url = "http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra-fields/";
197
 
198
  $start_cimy_uef_comment = "<!--\n";
readme.txt CHANGED
@@ -5,7 +5,7 @@ Website link: http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-user-extra
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar
6
  Requires at least: 2.6
7
  Tested up to: 2.9
8
- Stable tag: 1.5.1
9
 
10
  Add some useful fields to registration and user's info
11
 
5
  Tags: cimy, admin, registration, profile, extra fields, avatar, gravatar
6
  Requires at least: 2.6
7
  Tested up to: 2.9
8
+ Stable tag: 1.5.2
9
 
10
  Add some useful fields to registration and user's info
11