News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Display topics started

Started by WasdMan, October 09, 2012, 10:30:51 AM

Previous topic - Next topic

WasdMan

There's a package: Topic Count in Profiles

This amendment as attached image shows changes in the profile page:



However, the amendment I would like to also display the post in Forums, like in the picture:



How and what should I change?

Arantor

I originally wrote that mod and I deliberately did not put it under the user's name because of performance concerns.

It's bad enough in the profile but to put it like that in the user name area would be catastrophic for performance. You could completely rewrite things to store it as you go (like post count), but that's an awful lot of work, not to mention requiring changes in a lot of places.
Holder of controversial views, all of which my own.


WasdMan


Arantor

Not without a LOT of work, like I said. Certainly not just by tweaking that mod.
Holder of controversial views, all of which my own.


WasdMan

Can you give some clues? At least how I could get started!?

Arantor

First, modify the members database table to include a column for topics.

Second, modify the createPost routine so that when a new topic is created, the members count is updated.

Third, modify loadMemberData and loadMemberContext to also load that content.

Fourth, modify Display.template.php to display it.

Fifth, go back and figure out how many topics everyone else already has so that the counts are correct, being careful to ignore the recycled bin.

Sixth, modify the delete/restore topic code so that when you delete a topic, it subtracts one from that count, and when you restore a topic it adds one.

This all assumes that you don't actually want to have boards where topics aren't counted, e.g. post games boards.

Lastly, make sure all of these checks do not apply or aren't a problem if the poster is a guest.
Holder of controversial views, all of which my own.


Advertisement: