includes/stats.php
changeset 108 1c7f59df9474
parent 73 0a74676a2f2f
child 142 ca9118d9c0f2
equal deleted inserted replaced
107:4042c4dd5ba4 108:1c7f59df9474
    58   {
    58   {
    59     return false;
    59     return false;
    60   }
    60   }
    61   
    61   
    62   $data = array();
    62   $data = array();
    63   $q = $db->sql_query('SELECT COUNT(hit_id) AS num_hits, page_id, namespace FROM hits GROUP BY page_id, namespace ORDER BY num_hits DESC LIMIT ' . $num . ';');
    63   $q = $db->sql_query('SELECT COUNT(hit_id) AS num_hits, page_id, namespace FROM '.table_prefix.'hits GROUP BY page_id, namespace ORDER BY num_hits DESC LIMIT ' . $num . ';');
    64   
    64   
    65   while ( $row = $db->fetchrow() )
    65   while ( $row = $db->fetchrow() )
    66   {
    66   {
    67     if ( isset($paths->pages[ $paths->nslist[ $row['namespace'] ] . $row['page_id'] ]) )
    67     if ( isset($paths->pages[ $paths->nslist[ $row['namespace'] ] . $row['page_id'] ]) )
    68     {
    68     {