You should place your query code in the postlist/showflat php files and use an if statement to see if the use is registered/logged in before doing the queries:
if ($user['U_Number'] > 1) { // do query }
Store the results in a variable and display the variable in your ubbt_registered.tmpl file.
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.