Quote:
Originally Posted by WetWired
Almost. Your code doesn't take into account the first visit of the day, where the data in userinfo may not be up to date yet. This code should handle that situation:
Code:
if(isset($WWU002activityPoints)){
$user['activity']=intval($WWU002activityPoints/$WWU002maxPoints*100).'%';
}else if($vbulletin->userinfo['userid']){
$user['activity']=intval($vbulletin->userinfo['wwu002activity']/$WWU002maxPoints*100).'%';
}else{//(isset($WWU002activityPoints))
$user['activity']='N/A';
}//endif(isset($WWU002activityPoints))
|
i tried using the code above to add to my welcome block, but it doesnt seem to work. It gives me a "0%"....
I set the code as a plugin in global_start hook and used the variable "$user[activity]" in my template but just only gives me 0%
anyone know why it doesnt work?