I tried just putting a custom mysql query at the end of the doc (like line 502) but doesn't seem to be calling. Just wondering if there would be a more desirable location in the php doc for some custom code? (note - I would like this code executed each time the ubbthreads.php file is loaded)