Wouldn't this add one query for EACH post in showthread? So if you have 20 posts, that is an additional 20 queries in showthread on top of whatever you have already? Plus since you are doing a count, this will slow down the loading of showthread. Not that there is any way around this without adding another column to store the number. But good work in making it work. Not sure if this can be optimized without adding another column to the user table.
|