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

Instead of showing only asked and answered events I would like to add commented as well.

A recently commented question or answer should also be listed on top.

How could I do that?

 

PS: I also thought of using the activity page. But there are all other events listed as well that I do not need.

Q2A version: 1.5.4

1 Answer

+1 vote
by

This is how I did it → you need to change qa-page-default.php:

change line 56:

    @list($questions1, $questions2, $categories, $categoryid, $favorite, $custompage)=qa_db_select_with_pending(
        qa_db_qs_selectspec($userid, 'created', 0, $slugs, null, false, false, qa_opt_if_loaded('page_size_activity')),
        qa_db_recent_a_qs_selectspec($userid, 0, $slugs),
        qa_db_category_nav_selectspec($slugs, false, false, true),

to:

    // added $questions3 to get all comments
    @list($questions1, $questions2, $questions3, $categories, $categoryid, $favorite, $custompage)=qa_db_select_with_pending(
        qa_db_qs_selectspec($userid, 'created', 0, $slugs, null, false, false, qa_opt_if_loaded('page_size_activity')),
        qa_db_recent_a_qs_selectspec($userid, 0, $slugs),
        qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), // added line to get q with comments
        qa_db_category_nav_selectspec($slugs, false, false, true),
 

change line 135:

    $questions=qa_any_sort_and_dedupe(array_merge($questions1, $questions2));


to:

    $questions=qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3)); // eetv: added $questions3
 

Love having merged part of "activity" page (which is unnecessary now) into the main page!

Kai

by
Is there any way to paginate this main page now that the comments and answers are there too?
by
have not found time to get into pagination. Try so in couple of days/weeks...
...