• Once you install this plugin, you may notice that the links throughout the program dont go to the new profile page. Here is how to fix this. Eric, please feel free to add it to the program if you would like.

    in profiler.php, add:

    if ($_GET["author"] || substr_count($_SERVER["REQUEST_URI"], "author")){
    	add_action('wp', 'pf_redirect');
    }
    
     	function pf_redirect(){
    		global $wpdb;
    
     		if ($_GET["author"]){
     			$user_name = $wpdb->get_var($wpdb->prepare("select user_login from " . $wpdb->prefix . "users where ID = %d limit 1", $_GET["author"]));
            }
            else if (substr_count($_SERVER["REQUEST_URI"], "author")){
            	if (substr($_SERVER["REQUEST_URI"], -1, 1) == "/"){
            		$uri = substr($_SERVER["REQUEST_URI"], 0, -1);
                }
                else {
                	$uri = $_SERVER["REQUEST_URI"];
                }
                $pos = strrpos($uri, "/");
            	$user_name = substr($uri, $pos + 1);
            }
    
     		$url = "/users?user=$user_name";
     		header("Location: $url");
     		exit();
     	}

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Profiler] Auto Linking to User Profiles’ is closed to new replies.