includes/stats.php
changeset 953 323c4cd1aa37
parent 801 eb8b23f11744
child 1012 d966be8d79a3
--- a/includes/stats.php	Mon May 04 23:07:00 2009 -0400
+++ b/includes/stats.php	Tue May 05 00:10:26 2009 -0400
@@ -65,25 +65,9 @@
   
   while ( $row = $db->fetchrow() )
   {
-    if ( isset($paths->pages[ $paths->nslist[ $row['namespace'] ] . $row['page_id'] ]) )
-    {
-      $page_data =& $paths->pages[ $paths->nslist[ $row['namespace'] ] . $row['page_id'] ];
-      $title = $page_data['name'];
-      $page_id = $page_data['urlname'];
-    }
-    else if ( !isset($paths->nslist[$row['namespace']]) )
-    {
-      $title = $row['namespace'] . ':' . $row['page_id'];
-      $page_id = sanitize_page_id($title);
-    }
-    else
-    {
-      $title = dirtify_page_id( $paths->nslist[$row['namespace']] . $row['page_id'] );
-      $title = str_replace('_', ' ', $title);
-      $page_id = sanitize_page_id($title);
-    }
+    $title = get_page_title_ns($row['page_id'], $row['namespace']);
     $data[] = array(
-        'page_urlname' => $page_id,
+        'page_urlname' => $paths->get_pathskey($row['page_id'], $row['namespace']),
         'page_title' => $title,
         'num_hits' => $row['num_hits']
       );