PHP Code:
<?php
// setup vbulletin backend
require_once('./global.php');
// clean id
$threadid = intval($_GET['id']);
// exit if empty id
if (!$threadid)
{
exit;
}
// update views counter
if ($vbulletin->options['threadviewslive'])
{
// doing it as they happen; for optimization purposes, this cannot use a DM!
$db->shutdown_query("
UPDATE " . TABLE_PREFIX . "thread
SET views = views + 1
WHERE threadid = $threadid
");
}
else
{
// or doing it once an hour
$db->shutdown_query("
INSERT INTO " . TABLE_PREFIX . "threadviews
(threadid)
VALUES
($threadid)
");
}
?>
Put it in a file called track.php and upload it.