• 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)
  • I’m pretty sure that’s what I want to do, where in a post it says “Posted by: Backyard Grown” the link actually goes to the user’s profile.

    If you can tell me where exactly to insert this code in the profile.php file I’ll run right over and do it.

    Help?

    Thread Starter Xnuiem

    (@xnuiem)

    It doesnt matter. Just as long as it is in <?php ?> it will be fine.

    Somewhere right after the headers probably makes it easy to find.

    starkey

    (@starkey)

    hello, i put this code everywhere but still nothing works, so can you explain relay slowly for dummy’s where i must put it.
    maybe you miss some part?

    was this resolved?

    This seem like a cool concept plugin but it hasn’t been updated in so long…

    Any way to make it so that their photo is click-able in there comments?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Profiler] Auto Linking to User Profiles’ is closed to new replies.