Well, you determine the plugin by first defining which pages will use the code. It is only used on showthread.php pages? If so, you pick a hook that is called out in that php page. If you give us more information, we may be able to make suggestions on which hooks you may want to try.