This is how I solved it finally, new code of qa-uact-layer.php:
<?php
/*
Question2Answer User Activity Plus plugin, v1.0
License: http://www.gnu.org/licenses/gpl.html
*/
class qa_html_theme_layer extends qa_html_theme_base
{
/* override to add tabs */
function doctype(){
qa_html_theme_base::doctype();
$handle_raw = $this->user_handle();
$activePage = '';
if(!isset($handle_raw)) {
// e.g. yourdomain.com/user-activity/answers/username
$parts = explode('/', $this->request);
if($parts[0]=='user-activity') {
$activePage = $parts[1];
$handle_raw = isset($parts[2]) ? $parts[2] : null;
}
}
// add main sub navigation (2 items), only if on UA-page
if($this->template == 'plugin' && isset($handle_raw)) {
$this->content['navigation']['sub'] = array(
'profile' => array(
'url' => qa_path_html('user/'.$handle_raw, null, qa_opt('site_url')),
'label' => $handle_raw,
'selected' => false
),
'history' => array(
'url' => qa_path_html('user/'.$handle_raw, array('tab'=>'history'), qa_opt('site_url')),
'label' => qa_opt('user_act_list_tab'),
'selected' => false
),
);
}
// adds subnavigation to user pages
if( $this->template === 'user' || ($this->template == 'plugin' && isset($handle_raw)) ) {
// add tab element for all questions
$this->content['navigation']['sub']['allQuestions'] = array(
'label' => qa_lang_html('useractivity/all_questions'),
'url' => qa_path('user-activity/questions/'.$handle_raw),
'selected' => $activePage=='questions'?true:false
);
// add tab element for all questions
$this->content['navigation']['sub']['allAnswers'] = array(
'label' => qa_lang_html('useractivity/all_answers'),
'url' => qa_path('user-activity/answers/'.$handle_raw),
'selected' => $activePage=='answers'?true:false
);
// add tab element for all comments
$this->content['navigation']['sub']['allComments'] = array(
'label' => qa_lang_html('useractivity/all_comments'),
'url' => qa_path('user-activity/comments/'.$handle_raw),
'selected' => $activePage=='comments'?true:false
);
}
}
// grab the handle of the profile you're looking at
private function user_handle()
{
preg_match( '#user/([^/]+)#', $this->request, $matches );
return empty($matches[1]) ? null : $matches[1];
}
// grab the handle of the profile you're looking at
private function user_handle2()
{
// preg_match( '#user-activity/([^/]+)#', $this->request, $matches );
// return empty($matches[2]) ? null : $matches[2];
// e.g. http://www.gute-mathe-fragen.de/user/echteinfachtv
$parts = explode('/', parse_url($this->request));
return $parts[2];
}
}
Note that from 1.6.2 you have the answers / questions tab in each user profile together with the list. However, comments listing is still missing.
And: The user activity plugin shows the text of each answer and each comment (first 150 chars), what I really like.