Quote:
Originally Posted by EmilGH
Hey -- GREAT mod -- it's become the lifeblood of a site I co-run. Two quick questions:
1. Is there a way to modify the "Top Activity" page to show last login instead of join date?
2. Is there a way to modify the "Top Activity" page to hide banned users (or users that are in a specific usergroup)?
We have an activity-based site, and when people fall below a certain activity level they get put into an inactive group. I'd like to be able to hide those folks from the top activity page so we see only the actives.
Thanks!
|
The problem with mucking with the top activity is that when you do it, the optimization to prevent checking everyone's activity breaks... since you are interested in the activity of a limited group of people, perhaps that is something you can deal with.
in the plugin marked "Top Activity" (for forumhome), find
Code:
//****************************************
// How old are we? how many users do we need to process?
if(MAX_NUM==0){
$querylimit=1;
}else{//(MAX_NUM==0)
$daysold=($WWU002startOfDay-$statdata[0])/WWU002_ONE_DAY;
if(($daysold>=($vbulletin->options['WWU002weeks']*3.5))||($_REQUEST['oldway'])){
//A complete reversal of activity is possible in this time period, we must check everyone
$querylimit='1';
}else{//($daysold>=($vbulletin->options['WWU002weeks']*3.5))
//What is the lowest activity that could surpass the lowest activity on the old list?
$acc=0;
DEVDEBUG('Days old='.$daysold);
for($i=1;$i<=$daysold;$i++){
$acc+=$WWU002maxDay*$WWU002weekWeights[floor($i/7)];
}//endfor($i=1;$i<$daysold;$i++)
$temp=$statdata[1];
$temp=array_pop($temp);
DEVDEBUG('Activity lower limit='.$temp[3].'-'.($acc*2).'='.($temp[3]-($acc*2)));
$acc=$temp[3]-($acc*2);
if($acc<=0){
//just use the simple where clause
$querylimit='1';
}else{//($acc<=0)
$querylimit='wwu002activity>='.$acc;
}//endif($acc<=0)
}//endif($daysold>=($vbulletin->options['WWU002weeks']*3.5))
}//endif(MAX_NUM==0)
replace with
Code:
$querylimit='usergroupid<>100';
This should (I'm not testing any of this) remove the optimization and instead only include people whose primary group is not group 100.
For the date thing, I think you should be able to
find (in the same plugin)
Code:
$longresult=$db->query_read('SELECT userid,username,joindate FROM '.TABLE_PREFIX.'user WHERE userid IN ('.$ids.')');
and replace with
Code:
$longresult=$db->query_read('SELECT userid,username,lastvisit AS joindate FROM '.TABLE_PREFIX.'user WHERE userid IN ('.$ids.')');