It works

but only partially. It executes the normal sorting and displays the posts, (<!--sort normally--> is displayed too)
but when trying to sort by helpfulpost.totalrank by accessing
http://www.example.com/showthread.php?t=xxx&sortvotes=1 a db error occurs.
I'm trying to guess what might be wrong. Thank you anyway for taking your time to write such detailed instructions, that's for sure the good starting point and it would probably work but some detail is missing.
I will try to test it tomorrow on clean installation.