Truality
Left for good
- 1,006
- Posts
- 13
- Years
- Seen May 17, 2013
Hello everyone, I've thought several times about posting this but I was quite hesitant, and I finally got enough info on it today.
So this suggestion is about adding something to each member's profile 'statistics' page, which shows a percentage of their posts and in which section they make it. I've seen it in a forum I frequent and it's really cool, the best plus of it is-of course-that it lets you know which sections you or anybody else frequents the most and the least.
For example:
That's just a mere example with names and numbers, supposedly more forums could be added to show a 0%, meaning the member has no posts in that area.
The thing I was searching for all this time, though, was a code, and I finally found it somewhere in that forum. Here's the code and credits for it go to the member's name mentioned:
So that's about it. I really want to know what you think about it. Let's see how this goes, shall we?
So this suggestion is about adding something to each member's profile 'statistics' page, which shows a percentage of their posts and in which section they make it. I've seen it in a forum I frequent and it's really cool, the best plus of it is-of course-that it lets you know which sections you or anybody else frequents the most and the least.
For example:
Code:
[FONT=Tahoma][B]Truality's Active Area[/B]
Community Questions and feedback: 22%[/FONT] [FONT=Tahoma]
Emulation: 18%
Art Gallery: 26%
Other Voting Polls: 20%
Other Chat: 14%[/FONT]
The thing I was searching for all this time, though, was a code, and I finally found it somewhere in that forum. Here's the code and credits for it go to the member's name mentioned:
Spoiler:
[link]
I don't know if it can't be implemented here but that's all I got.
KeepWalking said:Hi.
I've created a cron job with this code:
After that i created a new class in includes/class_profileblock.phpCode:$_ACTIVEFORUMS = array( 28 => "Forum name1", 30 => "Forum name2", 109 => "Forum name3", 108 => "Forum name4", 107 => "Forum name5", 110 => "Forum name6", 87 => "Forum name7", 115 => "Forum name8", 114 => "Forum name9", 52 => "Forum name10", 112 => "Forum name11", 27 => "Forum name12", 123 => "Forum name13" // ETC ETC ETC // ); // WE PUT THE FORUM ID AND THE ACTIVE AREA NAME $Q = $db->sql_query(" select post.threadid, thread.forumid as forumid, userid, postid FROM post LEFT JOIN thread ON thread.threadid = post.threadid WHERE post.visible = 1 AND post.infraction = 0 "); $TOTAL = array(); while ($row = $db->sql_fetchrow($Q)) { $TOTAL[$row['userid']]++; if ($_ACTIVEFORUMS[$row['forumid']]) $ACTIVE[$row['userid']][$_ACTIVEFORUMS[$row['forumid']]]++; } $RESULT = array(); foreach ($ACTIVE as $i => $v) { if (!empty($v)) foreach ($v as $j => $k) $RESULT[$i][$j] = round(100*$k/$TOTAL[$i]); } foreach ($RESULT as $i => $v) $db->sql_query("REPLACE INTO `activearea` VALUES ($i, '".serialize($v)."')"); /* THE ACTIVE AREA TABLE CREATE TABLE `activearea` ( `userid` int(11) NOT NULL auto_increment, `stats` text, PRIMARY KEY (`userid`) ) ENGINE=MyISAM AUTO_INCREMENT=816210 DEFAULT CHARSET=latin1 */
After that in member.php you must add the new class in arrayCode:/** * Profile Block for Mini Statistics * * @package vBulletin */ class vB_ProfileBlock_MiniStats extends vB_ProfileBlock { /** * The name of the template to be used for the block * * @var string */ var $template_name = 'memberinfo_block_ministats'; /** * Variables to automatically prepare * * @var array */ var $auto_prepare = array(); function prepare_output($id = '', $options = array()) { $USERID = $this->profile->userinfo['userid']; $RESULT = $this->registry->db->query_read_slave("SELECT * FROM activearea WHERE userid = $USERID"); $DATA = $this->registry->db->fetch_array($RESULT); $DATA = unserialize(trim($DATA['stats'])); $this->block_data['activearea'] = ''; $total = 0; $ACTIVEAREAS = array( "DotA Chat","Game Strategy","Advanced Mechanics","DotA Replays","Suggestions","DotA Media","DotA Tools & AI","DotA Chinese", "Competitive Scene","Member Service","Random Chat" ); foreach ($ACTIVEAREAS as $v) { if (!$DATA[$v]) $this->block_data['activearea'] .= $v.': 0%<br />'; else { $this->block_data['activearea'] .= $v.": {$DATA[$v]}%<br />"; $total += $DATA[$v]; } } $this->block_data['activearea'] .= "Others: ".(100-$total)."%"; } }
And in array $blocklist where you store the order of the blocksCode:$globaltemplates = array(..... 'memberinfo_block_infractions', 'memberinfo_block_ministats', 'memberinfo_block_profilefield', 'memberinfo_block_visitormessaging' ....);
And to show it you find template memberinfo_block_ministats and add:Code:$blocklist = array( 'stats_mini' => array( 'class' => 'MiniStats', 'title' => $vbphrase['mini_statistics'], ), 'friends_mini' => array( 'class' => 'Friends', 'title' => $vbphrase['friends'], ), ........);
Anyway, i dont know if this helps to much, this of course can be achieved using hooks and pluginsCode:<dt class="shade">Members Active area<dt> <dd>$block_data[activearea]</dd>
I don't know if it can't be implemented here but that's all I got.
So that's about it. I really want to know what you think about it. Let's see how this goes, shall we?