Changeset 854698
- Timestamp:
- 02/10/2014 12:15:01 PM (12 years ago)
- Location:
- ngp-forms/trunk
- Files:
-
- 5 edited
-
ngp-donation-frontend.php (modified) (1 diff)
-
ngp-new-wave-frontend.php (modified) (2 diffs)
-
ngp-signup-frontend.php (modified) (2 diffs)
-
ngp-volunteer-frontend.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ngp-forms/trunk/ngp-donation-frontend.php
r817678 r854698 360 360 } else if(count($names)>2) { 361 361 // Check for Prefix 362 array_walk($namePrefixes, function($value, $key, &$the_names) { 363 if(strlen($the_names[0])==strlen($value) && stripos($the_names[0], $value)!==false && isset($the_names[0])) { 364 $the_names['prefix'] = $value; 365 unset($the_names[0]); 362 $names[0] = str_replace('.', '', trim($names[0])); 363 foreach($namePrefix as $namePrefix) { 364 if(strlen($names[0])==strlen($namePrefix) || stripos($names[0], $namePrefix)!==false && isset($names[0])) { 365 $names['prefix'] = $namePrefix; 366 unset($names[0]); 366 367 } 367 } , &$names);368 } 368 369 369 370 // Check for Suffix 370 array_walk($nameSuffixes, function($value, $key, &$the_names) {371 foreach($nameSuffixes as $nameSuffix) { 371 372 $possible_suffix = null; 372 foreach($ the_names as $k => $v) {373 foreach($names as $k => $v) { 373 374 if(is_int($k)) { 374 375 $possible_skey = $k; 375 376 $possible_suffix = $v; 376 377 } 378 $key = trim($key); 379 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 380 $the_names['suffix'] = $value; 381 unset($names[$possible_skey]); 382 } 377 383 } 378 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 379 $the_names['suffix'] = $value; 380 unset($the_names[$possible_skey]); 381 } 382 }, &$names); 384 } 383 385 384 386 // Whatever is left over, set as FirstName, MiddleName, LastName -
ngp-forms/trunk/ngp-new-wave-frontend.php
r742326 r854698 178 178 $names = explode(' ', $_POST['FullName']); 179 179 unset($cons_data['FullName']); 180 array_walk($names, function(&$value) {180 foreach($names as $key => $value) { 181 181 $chars = "\t\n\r\0\x0B,.[]{};:\"'\x00..\x1F"; 182 $ value= trim($value, $chars);183 } );182 $names[$key] = trim($value, $chars); 183 } 184 184 if(count($names)==1) { 185 185 $cons_data['LastName'] = $names[0]; … … 189 189 } else if(count($names)>2) { 190 190 // Check for Prefix 191 array_walk($namePrefixes, function($value, $key, &$the_names) { 192 if(strlen($the_names[0])==strlen($value) && stripos($the_names[0], $value)!==false && isset($the_names[0])) { 193 $the_names['Prefix'] = $value.'.'; 194 unset($the_names[0]); 191 $names[0] = str_replace('.', '', trim($names[0])); 192 foreach($namePrefix as $namePrefix) { 193 if(strlen($names[0])==strlen($namePrefix) || stripos($names[0], $namePrefix)!==false && isset($names[0])) { 194 $names['prefix'] = $namePrefix; 195 unset($names[0]); 195 196 } 196 } , &$names);197 } 197 198 198 199 // Check for Suffix 199 array_walk($nameSuffixes, function($value, $key, &$the_names) {200 foreach($nameSuffixes as $nameSuffix) { 200 201 $possible_suffix = null; 201 foreach($ the_names as $k => $v) {202 foreach($names as $k => $v) { 202 203 if(is_int($k)) { 203 204 $possible_skey = $k; 204 205 $possible_suffix = $v; 205 206 } 207 $key = trim($key); 208 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 209 $the_names['suffix'] = $value; 210 unset($names[$possible_skey]); 211 } 206 212 } 207 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 208 $the_names['Suffix'] = $value; 209 unset($the_names[$possible_skey]); 210 } 211 }, &$names); 213 } 212 214 213 215 $names = array_merge($names); -
ngp-forms/trunk/ngp-signup-frontend.php
r742326 r854698 178 178 $names = explode(' ', $_POST['FullName']); 179 179 unset($cons_data['FullName']); 180 array_walk($names, function(&$value) {180 foreach($names as $key => $value) { 181 181 $chars = "\t\n\r\0\x0B,.[]{};:\"'\x00..\x1F"; 182 $ value= trim($value, $chars);183 } );182 $names[$key] = trim($value, $chars); 183 } 184 184 if(count($names)==1) { 185 185 $cons_data['lastName'] = $names[0]; … … 189 189 } else if(count($names)>2) { 190 190 // Check for Prefix 191 array_walk($namePrefixes, function($value, $key, &$the_names) { 192 if(strlen($the_names[0])==strlen($value) && stripos($the_names[0], $value)!==false && isset($the_names[0])) { 193 $the_names['prefix'] = $value.'.'; 194 unset($the_names[0]); 191 $names[0] = str_replace('.', '', trim($names[0])); 192 foreach($namePrefix as $namePrefix) { 193 if(strlen($names[0])==strlen($namePrefix) || stripos($names[0], $namePrefix)!==false && isset($names[0])) { 194 $names['prefix'] = $namePrefix; 195 unset($names[0]); 195 196 } 196 } , &$names);197 } 197 198 198 199 // Check for Suffix 199 array_walk($nameSuffixes, function($value, $key, &$the_names) {200 foreach($nameSuffixes as $nameSuffix) { 200 201 $possible_suffix = null; 201 foreach($ the_names as $k => $v) {202 foreach($names as $k => $v) { 202 203 if(is_int($k)) { 203 204 $possible_skey = $k; 204 205 $possible_suffix = $v; 205 206 } 207 $key = trim($key); 208 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 209 $the_names['suffix'] = $value; 210 unset($names[$possible_skey]); 211 } 206 212 } 207 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 208 $the_names['suffix'] = $value; 209 unset($the_names[$possible_skey]); 210 } 211 }, &$names); 213 } 212 214 213 215 $names = array_merge($names); -
ngp-forms/trunk/ngp-volunteer-frontend.php
r723969 r854698 160 160 $names = explode(' ', $_POST['FullName']); 161 161 unset($cons_data['FullName']); 162 array_walk($names, function(&$value) {162 foreach($names as $key => $value) { 163 163 $chars = "\t\n\r\0\x0B,.[]{};:\"'\x00..\x1F"; 164 $ value= trim($value, $chars);165 } );164 $names[$key] = trim($value, $chars); 165 } 166 166 if(count($names)==1) { 167 167 $cons_data['lastName'] = $names[0]; … … 171 171 } else if(count($names)>2) { 172 172 // Check for Prefix 173 array_walk($namePrefixes, function($value, $key, &$the_names) { 174 if(strlen($the_names[0])==strlen($value) && stripos($the_names[0], $value)!==false && isset($the_names[0])) { 175 $the_names['prefix'] = $value; 176 unset($the_names[0]); 173 $names[0] = str_replace('.', '', trim($names[0])); 174 foreach($namePrefix as $namePrefix) { 175 if(strlen($names[0])==strlen($namePrefix) || stripos($names[0], $namePrefix)!==false && isset($names[0])) { 176 $names['prefix'] = $namePrefix; 177 unset($names[0]); 177 178 } 178 } , &$names);179 } 179 180 180 181 // Check for Suffix 181 array_walk($nameSuffixes, function($value, $key, &$the_names) {182 foreach($nameSuffixes as $nameSuffix) { 182 183 $possible_suffix = null; 183 foreach($ the_names as $k => $v) {184 foreach($names as $k => $v) { 184 185 if(is_int($k)) { 185 186 $possible_skey = $k; 186 187 $possible_suffix = $v; 187 188 } 189 $key = trim($key); 190 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 191 $the_names['suffix'] = $value; 192 unset($names[$possible_skey]); 193 } 188 194 } 189 if(strlen($possible_suffix)==strlen($key) && stripos($possible_suffix, $key)!==false) { 190 $the_names['suffix'] = $value; 191 unset($the_names[$possible_skey]); 192 } 193 }, &$names); 195 } 194 196 195 197 $names = array_merge($names); -
ngp-forms/trunk/readme.txt
r851354 r854698 6 6 Stable tag: 1.2.7 7 7 8 Integrate NGP "Classic" (NGP VAN) donation, signup, and volunteer forms with your site. You'll need an SSL certificate running on your site if you want to use the donation portion of this plugin. 9 10 This plugin _does not_ work with the new NGP Action Platform. 8 Integrate NGP "Classic" (NGP VAN) donation, signup, and volunteer forms with your site. 11 9 12 10 == Description ==
Note: See TracChangeset
for help on using the changeset viewer.