Changeset 3131189
- Timestamp:
- 08/05/2024 05:08:02 PM (20 months ago)
- Location:
- dynamic-user-directory/trunk
- Files:
-
- 4 edited
-
dynamic-user-directory.php (modified) (1 diff)
-
includes/admin.php (modified) (2 diffs)
-
includes/core.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dynamic-user-directory/trunk/dynamic-user-directory.php
r3093386 r3131189 3 3 * Plugin URI: http://sgcustomwebsolutions.com 4 4 * Description: Creates an alphabetically sorted user directory that will format and display specified user meta data such as name, address, and email. 5 * Version: 1.95 * Version: 2.0 6 6 * Author: Sarah Giles 7 7 * Author URI: http://sgcustomwebsolutions.com -
dynamic-user-directory/trunk/includes/admin.php
r3093386 r3131189 3125 3125 $user_meta_key_list = array(); 3126 3126 3127 $results = $wpdb->get_results("SELECT user_id FROM " . DUD_WPDB_PREFIX . "usermeta ORDER BY RAND() LIMIT 300");3127 $results = $wpdb->get_results("SELECT user_id FROM " . DUD_WPDB_PREFIX . "usermeta ORDER BY RAND() LIMIT 200"); 3128 3128 3129 3129 if($results) … … 3136 3136 3137 3137 foreach ($results as $result) 3138 { 3139 $all_meta_for_user = array_map( function( $a ){ return $a[0]; }, get_user_meta( $result->user_id ) ); 3138 { 3139 $meta_vals = get_user_meta( $result->user_id ); 3140 3141 if($meta_vals == false || empty($meta_vals)) continue; 3142 3143 $all_meta_for_user = array_map( function( $a ){ return $a[0]; }, $meta_vals ); 3140 3144 3141 3145 foreach ($all_meta_for_user as $key => $value) -
dynamic-user-directory/trunk/includes/core.php
r3093386 r3131189 1021 1021 $user_id = $uid->user_id; 1022 1022 $user_last_name = get_user_meta($user_id, 'last_name', true); 1023 $user_last_name = ltrim($user_last_name); 1023 1024 } 1024 1025 else … … 1026 1027 $user_id = $uid->ID; 1027 1028 $user_last_name = $uid->display_name; 1029 $user_last_name = ltrim($user_last_name); 1028 1030 } 1029 1031 … … 1915 1917 $ud_display_listings = !empty($dud_options['ud_display_listings']) ? $dud_options['ud_display_listings'] : ""; 1916 1918 $inc = 1; 1917 1918 1919 if("dev-directory" === $dud_options['dud_instance_name']) 1920 { 1921 echo "<BR><BR>In format meta val...<BR>"; 1922 } 1923 1919 1924 1920 //*** Image *********************************************** 1925 1921 if(!is_array($user_meta_fld) && $format === "34") … … 2002 1998 else if(!is_array($user_meta_fld) && ($format === "30" || $format === "37" || $format === "38")) 2003 1999 { 2004 $user_meta_fld = str_replace ( "-", " ", $user_meta_fld); 2005 2006 if($format === "30") //first letter in caps 2007 return ucwords($user_meta_fld); 2008 else if ($format === "37") //all caps 2009 return strtoupper($user_meta_fld); 2010 else if ($format === "38") //all lower case 2011 return strtolower($user_meta_fld); 2000 $mepr_options = null; 2001 $is_member_press = false; 2002 2003 try 2004 { 2005 $mepr_options = MeprOptions::fetch(); 2006 if(!is_null($mepr_options)) 2007 { 2008 foreach($mepr_options->custom_fields as $line) { 2009 2010 //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>"; 2011 2012 if($line->field_key == $meta_fld_key_name) { 2013 foreach($line->options as $option_key => $option_val) { 2014 2015 $no_hyphens = str_replace ( "-", " ", $user_meta_fld); 2016 2017 //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>"; 2018 2019 if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) { 2020 $value = $option_val->option_name; 2021 return $value; 2022 } 2023 } 2024 } 2025 } 2026 2027 //echo "<BR>"; 2028 } 2029 else 2030 { 2031 $user_meta_fld = str_replace ( "-", " ", $user_meta_fld); 2032 2033 if($format === "30") //first letter in caps 2034 return ucwords($user_meta_fld); 2035 else if ($format === "37") //all caps 2036 return strtoupper($user_meta_fld); 2037 else if ($format === "38") //all lower case 2038 return strtolower($user_meta_fld); 2039 } 2040 2041 } 2042 catch(Exception $e) 2043 { 2044 ; 2045 } 2046 2047 return $user_meta_fld; 2012 2048 } 2013 2049 -
dynamic-user-directory/trunk/readme.txt
r3093387 r3131189 98 98 == Changelog == 99 99 100 = 2.0 = 101 - Released 8/5/24 102 - Successfully tested against WordPress 6.6.1 103 - Fixed: Corrected bug where the plugin settings page could not be saved due to some bad data in the local WP database. 104 - Fixed: Corrected code that was producing the PHP warning message: 'Warning: Undefined array key "dud_instance_name" in .../public_html/wp-content/plugins/dynamic-user-directory/includes/core.php on line 1919' 105 - Fixed: Corrected bug that kept users from being shown in directory if the last name field began with a space 106 - Enhancement: For MemberPress users, the "Hide Hyphens" formatting option will automatically show the option name instead of the option value (which does not preserve the original capitalization) 107 100 108 = 1.9 = 101 109 - Released 5/27/24
Note: See TracChangeset
for help on using the changeset viewer.