well this one wasn't requested but i myself was trying to plain around with mysql and all and i came up with a new hack
What does this hack do?
// +++++++++++++++++++++
Simply shows what forum the user is most active in and the percentage of his posts in that forum compared to overall
What to do?
// +++++++++++++++++++++
File Modifications (2)
Template Modifications (1)
Templates to Add (1)
It's a fairly easy hack to install maybe 1-2 minutes max but i like how it looks shows on the getinfo template when viewing another member's profile... simple yet wicked
Instructions in the .php file attached below just open in a text editor
Notice i didn't include this on the postbit template because it would up the query count by a fair amount so i figured the getinfo would be suffice... If you like this hack i'd be greatful if you clicked install... regards and enjoy
g-force2k2
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Actually Neo all you did was do an order by... the actually query itself already selected both the posts in that forum that they replied in most as well as the forumid... so i fail to see what your code change did? regards...
Originally posted by g-force2k2 Actually Neo all you did was do an order by... the actually query itself already selected both the posts in that forum that they replied in most as well as the forumid... so i fail to see what your code change did? regards...
g-force2k2
well try the queries in in your MySQL of choise and you will see what I mean... I can give you a example...
using it without the ORDER BY I get for user number 81
It worked, thanks. Just to verify, this is what the code should look like for me now, right?
PHP Code:
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
// thanks to neo for the query fix :)
$t_post = $DB_site->query_first("
SELECT COUNT(postid) AS ppforum, thread.forumid AS forumid
FROM post
LEFT JOIN thread ON thread.threadid = post.threadid
WHERE userid = '$userinfo[userid]'
GROUP BY(forumid)
ORDER BY ppforum
DESC LIMIT 1");
if(empty($t_post[ppforum])) {
$forumactive = "";
} else {
$f_name = $DB_site->query_first("
SELECT title
FROM forum
WHERE forumid = '$t_post[forumid]'");
$f_posts = round(($t_post[ppforum] / $userinfo[posts]) * 100,2);
$p_type = iif($t_post[ppforum] == 1,'Post','Posts');
if($bbuserinfo[usergroupid] == 5 OR $bbuserinfo[usergroupid] == 6 OR $bbuserinfo[usergroupid] == 7) {
eval("\$forumactive = \"".gettemplate('getinfo_forumactive')."\";");
} else {
$forumactive = "";
}
}
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
And what did you think of the change for the percentage?