includes/namespaces/default.php
changeset 1173 b5b8e7ab0914
parent 1168 277a9cdead3e
child 1227 bdac73ed481e
equal deleted inserted replaced
1172:db6b116b8ea7 1173:b5b8e7ab0914
  1003     }
  1003     }
  1004     
  1004     
  1005     $row = $db->fetchrow();
  1005     $row = $db->fetchrow();
  1006     
  1006     
  1007     // Get comment counts
  1007     // Get comment counts
       
  1008     // FIXME: Apparently there's a bit of recursion in here. Fetching permissions depends on this cdata function.
       
  1009     // Perhaps we should eliminate session's dependency on cdata? (What is it used for?)
  1008     $q = $db->sql_query('SELECT approved FROM ' . table_prefix . "comments WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';");
  1010     $q = $db->sql_query('SELECT approved FROM ' . table_prefix . "comments WHERE page_id = '$page_id_db' AND namespace = '$namespace_db';");
  1009     // yay parallel assignment
  1011     // yay parallel assignment
  1010     $row['comments_approved'] = $row['comments_unapproved'] = $row['comments_spam'] = 0;
  1012     $row['comments_approved'] = $row['comments_unapproved'] = $row['comments_spam'] = 0;
  1011     while ( $commentrow = $db->fetchrow() )
  1013     while ( $commentrow = $db->fetchrow() )
  1012       switch($commentrow['approved'])
  1014       switch($commentrow['approved'])