I have to hack qa-page-user.php to get an "edit your profile" button onto this page.
I just want to show the edit button if the user sees his own profile.
Question is, how can I find out if he sees his own profile?
I tried:
$userid=qa_get_logged_in_userid(); if(isset($userid)) { $qa_content['custom_btn']='edit button...'; } But this is for every logged in user.
Do I have to get the URL and parse the username from their? e.g. http://question2answer.org/qa/user/echteinfachtv+%28Kai%29
Or is there a session variable I can retrieve?
Or ... ?
Insert after line: qa_lang_sub($favorite ? 'main/remove_x_favorites' : 'users/add_user_x_favorites', $handle));
This code: if($userid == qa_get_logged_in_userid()) { $qa_content['custom_btn']='<a class="btnblue" style="position:absolute;top:50px;right:0;" href="../account">Profil bearbeiten</a>'; }
All credits go to monk333 ! :o)
And now each user has a nice blue edit button for his own profile =)
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.