Hello,
I've been doing a lot of reading throughout any VB resource I could find, but still cannot figure out how to get this to work;
I have built an SQL query that returns the count of a user's topics in certain forums. I want to use this as a variable, so I can use it in my postbit templates, next to each user avatar for example.
The code I THINK I should use to define the variable with this SQL query is this;
$stories = $vbulletin->db->query_read("
SELECT
Count(vbthread.threadid)
FROM vbthread
WHERE
(vbthread.forumid = '57' OR
vbthread.forumid = '58' OR
vbthread.forumid = '59' OR
vbthread.forumid = '60' OR
vbthread.forumid = '61' OR
vbthread.forumid = '62' OR
vbthread.forumid = '63' ) AND
vbthread.postuserid = '$post[userid]'
");
1. Is this correct? If not, what is the way to define my query as a variable?
2. Where should I use this code to define the variable and then be able to use the $stories variable inside my postbit template? I tried creating a new plugin using a hook from postbit_start or postbit_complete, but it does not work.
Any ideas please? I've been trying to make this work for quite a few days now.
Thanks.
