Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.3k views
in Q2A Core by
edited by

Note, I'm not talking about the URL structure for questions, which can be adjusted in the admin section. That works fine for me. I'm referring specifically to the URL structure for user profile pages  like ../user/Henry

Is there a way to change the user profile page URL structure to adapt to this? For that matter, is there a way to change where the user profile link links out to (which file/line controls this)?

Btw, I am using an external users table, not Q2A's native users table. I've already tried the same backup on another server that allows for the URL structure and it works fine, so I don't think it's a config issue.

 

Ah here's the solution:

I went into qa--external-users.php and changed this section from:

return '<A HREF="'.htmlspecialchars($relative_url_prefix.'user/'.urlencode($publicusername)).

'" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';
 
to
 
 
return '<A HREF="'.htmlspecialchars($relative_url_prefix.'?qa=user/'.urlencode($publicusername)).'" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';

1 Answer

+1 vote
by
The options in the admin section will also affect the URL structure for users, so you should try one of the later options.
by
edited by
That was the first thing I tried. Went through all the "OK" options (bottom 3 in my case). None fixed it. The link to the user profile is still ../user/Henry

edit: Also is there a way to change where the user profile link links out to (which file/line controls this)?

edit: I changed config from external users = true to false the URL structure does change for local users. So it looks like it may be the way I modified the external_users code. Somewhere in here... Will review $publicusername=$logged_in_user['publicusername'];
       
        return '<A HREF="'.htmlspecialchars($relative_url_prefix.'user/'.urlencode($publicusername)).
            '" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';
...