Code:
//top views user
$fileviews=$DB_site->query_first('SELECT [high]SUM[/high]([high]profileviews[/high]) AS profileviews FROM user');
$totalprofileviews=$fileviews['profileviews']
$ppfileviews=$DB_site->query_first("SELECT [high]SUM[/high]([high]profileviews[/high]) AS profileviews FROM user WHERE [high]userid[/high]='$userinfo[userid]'");
$userproviews=$ppfileviews['profileviews']
$totalpercentviews = round(($userproviews / $totalprofileviews) * 100,2);
//end top views user