Changeset 186

Show
Ignore:
Timestamp:
06/16/06 16:21:04 (2 years ago)
Author:
eadiaz
Message:

change on sort functions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/public_html/stats.php

    r13 r186  
    2121  function infl($pa, $pb) 
    2222  { 
    23           return $pb->rank - $pa->rank; 
     23          if ($pb->influece == $pa->influence) 
     24                  return 0; 
     25          return $pb->influence > $pa->influence ? 1 : -1; 
    2426  } 
    25  
    2627 
    2728  function pop($pa, $pb) 
    2829  { 
    29           return $pb->popularity - $pa->popularity; 
     30          if ($pb->popularity == $pa->popularity) 
     31                  return 0; 
     32          return $pb->popularity > $pa->popularity ? 1 : -1; 
    3033  } 
    3134 
     
    3942  $smarty->assign('votes', $stats->count_votes()); 
    4043  $posters = $stats->top_posters(50);  
     44 
     45  $sort=$_GET['sort']; 
    4146  if (!empty($sort)) { 
    4247          usort($posters, $sort);