webassist/plugins/catalog/popularbox.php
I'd suggest making a copy of that file and create your own plugin for the new functionality based on that page. That way if you update to a dot release it won't overwrite your changes and you can easily carry your upates over.