Try something like this if you want to do it with a link:
<a href="misc.php?$session[sessionurl]do=resetviewcounter&t=$threadid">Reset Whoviewed Counter</a>
Then, in your misc.php file, add this:
PHP Code:
if ($_REQUEST['do'] == "resetviewcounter")
{
if(!is_member_of($bbuserinfo, 6)) // only admins may reset counter (usergroup: 6)
{
print_no_permission();
}
$threadid = addslashes($_REQUEST['threadid']);
//***insert mysql queries
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET whoviewedcounter='' WHERE threadid=$threadid");
//redirect back to thread
$url = "showthread.php?$session[sessionurl]t=$threadid";
eval(print_standard_redirect('redirect_resetviewcounter'));
}
Add a phrase for redirect_resetviewcounter.
I think that should do it