Plugin Directory

Changeset 3158437


Ignore:
Timestamp:
09/26/2024 08:06:15 PM (18 months ago)
Author:
Sarah_Dev
Message:

2.1

  • Released 9/27/24
  • Successfully tested against WordPress 6.6.2
  • Fixed: Corrected PHP "class not found" error displayed on sites that do not have MemberPress and have selected one of the "Hide Hyphens" format options.
Location:
dynamic-user-directory/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamic-user-directory/trunk/dynamic-user-directory.php

    r3131189 r3158437  
    33* Plugin URI: http://sgcustomwebsolutions.com
    44* Description: Creates an alphabetically sorted user directory that will format and display specified user meta data such as name, address, and email.
    5 * Version: 2.0
     5* Version: 2.1
    66* Author: Sarah Giles
    77* Author URI: http://sgcustomwebsolutions.com
  • dynamic-user-directory/trunk/includes/core.php

    r3131189 r3158437  
    20032003        try
    20042004        {
    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) {
     2005            if(class_exists('MeprOptions'))
     2006            {   
     2007                $mepr_options = MeprOptions::fetch();
     2008               
     2009                if(!is_null($mepr_options))
     2010                {
     2011                    foreach($mepr_options->custom_fields as $line) {
    20142012                       
    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;
     2013                      //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>";
     2014                     
     2015                      if($line->field_key == $meta_fld_key_name) {
     2016                        foreach($line->options as $option_key => $option_val) {
     2017                           
     2018                          $no_hyphens = str_replace ( "-", " ", $user_meta_fld);
     2019                           
     2020                          //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>";
     2021                           
     2022                          if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) {
     2023                            $value = $option_val->option_name;
     2024                            return $value;
     2025                          }
     2026                        }
    20222027                      }
    20232028                    }
    2024                   }
     2029                   
     2030                    //echo "<BR>";
    20252031                }
     2032                else
     2033                {
     2034                    $user_meta_fld = str_replace ( "-", " ", $user_meta_fld);
     2035           
     2036                    if($format === "30") //first letter in caps
     2037                        return ucwords($user_meta_fld);
     2038                    else if ($format === "37") //all caps
     2039                        return strtoupper($user_meta_fld); 
     2040                    else if ($format === "38") //all lower case
     2041                        return strtolower($user_meta_fld); 
     2042                }
     2043            }
     2044            else
     2045            {
    20262046               
    2027                 //echo "<BR>";
    2028             }
    2029             else
    2030             {
    20312047                $user_meta_fld = str_replace ( "-", " ", $user_meta_fld);
    20322048       
     
    20372053                else if ($format === "38") //all lower case
    20382054                    return strtolower($user_meta_fld); 
     2055               
    20392056            }
    20402057           
     
    21902207                        try
    21912208                        {
    2192                             $mepr_options = MeprOptions::fetch();
    2193                             if(!is_null($mepr_options))
     2209                            if(class_exists('MeprOptions'))
    21942210                            {
    2195                                 foreach($mepr_options->custom_fields as $line) {
    2196                                    
    2197                                   //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>";
    2198                                  
    2199                                   if($line->field_key == $meta_fld_key_name) {
    2200                                     foreach($line->options as $option_key => $option_val) {
     2211                                $mepr_options = MeprOptions::fetch();
     2212                                if(!is_null($mepr_options))
     2213                                {
     2214                                    foreach($mepr_options->custom_fields as $line) {
    22012215                                       
    2202                                       $no_hyphens = str_replace ( "-", " ", $user_meta_fld[$met]);
    2203                                        
    2204                                       //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>";
    2205                                        
    2206                                       if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) {
    2207                                         $value = $option_val->option_name;
    2208                                         $key = $option_val->option_name;
    2209                                         $is_member_press = true;
     2216                                      //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>";
     2217                                     
     2218                                      if($line->field_key == $meta_fld_key_name) {
     2219                                        foreach($line->options as $option_key => $option_val) {
     2220                                           
     2221                                          $no_hyphens = str_replace ( "-", " ", $user_meta_fld[$met]);
     2222                                           
     2223                                          //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>";
     2224                                           
     2225                                          if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) {
     2226                                            $value = $option_val->option_name;
     2227                                            $key = $option_val->option_name;
     2228                                            $is_member_press = true;
     2229                                          }
     2230                                        }
    22102231                                      }
    22112232                                    }
    2212                                   }
     2233                                   
     2234                                    //echo "<BR>";
    22132235                                }
    2214                                
    2215                                 //echo "<BR>";
    22162236                            }
    22172237                           
     
    23092329                            try
    23102330                            {
    2311                                 $mepr_options = MeprOptions::fetch();
    2312                                 if(!is_null($mepr_options))
     2331                                if(class_exists('MeprOptions'))
    23132332                                {
    2314                                     foreach($mepr_options->custom_fields as $line) {
    2315                                        
    2316                                       //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>";
    2317                                      
    2318                                       if($line->field_key == $meta_fld_key_name) {
    2319                                         foreach($line->options as $option_key => $option_val) {
     2333                                    $mepr_options = MeprOptions::fetch();
     2334                                    if(!is_null($mepr_options))
     2335                                    {
     2336                                        foreach($mepr_options->custom_fields as $line) {
    23202337                                           
    2321                                           $no_hyphens = str_replace ( "-", " ", $user_meta_fld[$met]);
    2322                                            
    2323                                           //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>";
    2324                                            
    2325                                           if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) {
    2326                                             $value = $option_val->option_name;
    2327                                             $key = $option_val->option_name;
    2328                                             $is_member_press = true;
     2338                                          //echo "Line Field Key: " . $line->field_key . ", DUD Fld Key: " . $meta_fld_key_name . "<BR>";
     2339                                         
     2340                                          if($line->field_key == $meta_fld_key_name) {
     2341                                            foreach($line->options as $option_key => $option_val) {
     2342                                               
     2343                                              $no_hyphens = str_replace ( "-", " ", $user_meta_fld[$met]);
     2344                                               
     2345                                              //echo "Line Option Val: " . $option_val->option_name . ", Meta Fld Val: " . $no_hyphens . "<BR>";
     2346                                               
     2347                                              if(strtoupper($option_val->option_name) === strtoupper($no_hyphens)) {
     2348                                                $value = $option_val->option_name;
     2349                                                $key = $option_val->option_name;
     2350                                                $is_member_press = true;
     2351                                              }
     2352                                            }
    23292353                                          }
    23302354                                        }
    2331                                       }
     2355                                       
     2356                                        //echo "<BR>";
    23322357                                    }
    2333                                    
    2334                                     //echo "<BR>";
    23352358                                }
    23362359                            }
  • dynamic-user-directory/trunk/readme.txt

    r3148864 r3158437  
    55Tags: user directory, MemberPress, BuddyPress, member directory, user registration, user meta fields, profile fields, member directory, website directory, directory, user listing, users, members, user profile, user profiles
    66Requires at least: 3.0.1
    7 Tested up to: 6.6.1
    8 Stable tag: 2.0
     7Tested up to: 6.6.2
     8Stable tag: 2.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898== Changelog ==
    9999
     100= 2.1 =
     101- Released 9/27/24
     102- Successfully tested against WordPress 6.6.2
     103- Fixed: Corrected PHP "class not found" error displayed on sites that do not have MemberPress and have selected one of the "Hide Hyphens" format options.
     104
    100105= 2.0 =
    101106- Released 8/5/24
Note: See TracChangeset for help on using the changeset viewer.