Allthings can be done but this does not sound like a very good idea to me. it is going to mean an extra sql query, which from the sound of it could be quite a heavy query.amochohan wrote:Can this be done?
I've mentioned in my original post that this sort of workaround couldn't be done due to the large volume of original existing content.david63 wrote:My suggestion would be add another column to the user table to hold the count, create a mod that updates the count whenever a comment is added and have a one off script to update the database with the current counts.
I still do not understand why you cannot do this "sort of workaround". If it is such a problem to do it as a "one off" then how are you going to cope doing it on every page?amochohan wrote:I've mentioned in my original post that this sort of workaround couldn't be done due to the large volume of original existing content.
If you put it in the user table then it will be $user->data['total_comments'] and you will have nothing else to do other than maintain the count.amochohan wrote:In fact, If i did just write a mod that could calculate the number of comments and populate the fields automatically, running it as a one off script then modifying the post function of the comment system to automatically increase the comment counter - how can I access that new variable from the database as say $user['total_comments'] (assuming i add the database field as total_comments)
In the same way as any other variable.You would need to look in memberlist.php for where it is picking up the other data and, because it is in the user table , it would be a fairly simple procedure to add it into the $template->assign_block_vars for where you want it to appear. You would then have to add a column into the template meberlist_body.htmlamochohan wrote:how would i assign it as a variable to use in the template