PDA

View Full Version : To show in postbit number of threads a user created


KrisP
08-28-2009, 02:01 PM
I would like to show how many threads a user has created in some subforums - shown in postbit.

Any existing mod can accomplish this?

Lynne
08-28-2009, 02:59 PM
Have you tried searching for one yet? search "postbit" in "all mods" "titles only" and you should find one.

KrisP
08-28-2009, 03:20 PM
Yes, there is a mod showing number of threads in postbit: https://vborg.vbsupport.ru/showthread.php?t=219765&highlight=threads

but it dosent show for a specific forum, the query

$user_theard_query = $db->query_read("SELECT COUNT(threadid) AS total FROM " . TABLE_PREFIX . "thread WHERE postuserid=$threads_posts");


- collects data from thread table, which dosent have forumid - so the query has to be ran against another table. Perhaps someone can help here ?

Lynne
08-28-2009, 03:24 PM
Just add to the WHERE part "AND forumid = x"

KrisP
08-28-2009, 03:27 PM
Hey, you are right, will try that one, thanks mate!

Gio~Logist
08-28-2009, 06:58 PM
Yea, I definitely hope that isn't a query per post though, that would be beyond unnecessary and your server wouldn't appreciate it.

The proper way to do this would be to create a new column in the user table and +1 it when a thread is created.

Lynne
08-28-2009, 07:05 PM
Yea, I definitely hope that isn't a query per post though, that would be beyond unnecessary and your server wouldn't appreciate it.

The proper way to do this would be to create a new column in the user table and +1 it when a thread is created.
Yep, that's what I do. :cool:

Gio~Logist
08-28-2009, 07:17 PM
Yep, that's what I do. :cool:

Thank god, because I don't know who would answer you if you ever had a question :p

Lynne
08-28-2009, 07:50 PM
Hehe. Unfortunately, I got no answer to the last help thread I created. :D Or rather, I finally got an answer, but no resolution to the problem. lol (I usually try everything I can think of before asking for help.)