In the dosearch script the sql query is built up over a series of steps. The last step is appending a limit statement. Make a copy of the $query just before that last step, and use it to query the database. The size of the resulting array is the total number of search results.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.