There is no clean way to do this. You'll need to hack the core. But I suggest taking a harder approach and ADD more lines in order not to CHANGE so many (only one, actually).
Also bear in mind the core is not tuned to perform the query that you want to run so if there are too many questions for a given tag the query will run slower that the "most recent questions" one.
This will force the sorting for most votes and for questions with equal amounts of votes then the secondary sorting will be the amount of answers.
Follow these steps:
1. Open file qa-include/pages/tag.php
2. Locate these 4 lines:
list($questions, $tagword)=qa_db_select_with_pending(
qa_db_tag_recent_qs_selectspec($userid, $tag, $start, false, qa_opt_if_loaded('page_size_tag_qs')),
qa_db_tag_word_selectspec($tag)
);
3. Replace them with:
function qa_db_tag_most_votes_qs_selectspec($voteuserid, $tag, $start, $full=false, $count=null)
{
$count=isset($count) ? min($count, QA_DB_RETRIEVE_QS_AS) : QA_DB_RETRIEVE_QS_AS;
require_once QA_INCLUDE_DIR.'util/string.php';
$selectspec=qa_db_posts_basic_selectspec($voteuserid, $full);
$selectspec['source'].=" JOIN (SELECT postid FROM ^posttags WHERE wordid=(SELECT wordid FROM ^words WHERE word=$ AND word=$ COLLATE utf8_bin LIMIT 1)) y ON ^posts.postid=y.postid ORDER BY ^posts.netvotes DESC, ^posts.acount DESC LIMIT #,#";
array_push($selectspec['arguments'], $tag, qa_strtolower($tag), $start, $count);
return $selectspec;
}
list($questions, $tagword)=qa_db_select_with_pending(
qa_db_tag_most_votes_qs_selectspec($userid, $tag, $start, false, qa_opt_if_loaded('page_size_tag_qs')),
qa_db_tag_word_selectspec($tag)
);
For v1.6.x, you have to follow similar steps with some considerations.
1. Instead of qa-include/pages/tag.php you need to edit qa-include/qa-page-tag.php
3. Use the same code but change this line:
require_once QA_INCLUDE_DIR.'util/string.php';
with this other one:
require_once QA_INCLUDE_DIR.'qa-util-string.php';