includes/log.php
changeset 1152 e3fb74e3e74e
parent 1081 745200a9cc2a
child 1175 1e2c9819ede3
equal deleted inserted replaced
1151:8f0cbce6d5f3 1152:e3fb74e3e74e
   161     else
   161     else
   162       $limit = ( $page_size > 0 ) ? "\n  LIMIT $offset, $page_size" : '';
   162       $limit = ( $page_size > 0 ) ? "\n  LIMIT $offset, $page_size" : '';
   163     $columns = ( $just_page_count ) ? 'COUNT(*)' : 'log_id, action, page_id, namespace, CHAR_LENGTH(page_text) AS revision_size, author, time_id, edit_summary, minor_edit';
   163     $columns = ( $just_page_count ) ? 'COUNT(*)' : 'log_id, action, page_id, namespace, CHAR_LENGTH(page_text) AS revision_size, author, time_id, edit_summary, minor_edit';
   164     $sql = 'SELECT ' . $columns . ' FROM ' . table_prefix . "logs AS l\n"
   164     $sql = 'SELECT ' . $columns . ' FROM ' . table_prefix . "logs AS l\n"
   165          . "  WHERE log_type = 'page' AND is_draft != 1$where_extra\n"
   165          . "  WHERE log_type = 'page' AND is_draft != 1$where_extra\n"
   166          . ( $just_page_count ? '' : "  GROUP BY log_id, action, page_id, namespace, page_text, author, time_id, edit_summary, minor_edit\n" )
   166          . "  GROUP BY log_id, action, page_id, namespace, page_text, author, time_id, edit_summary, minor_edit\n"
   167          . "  ORDER BY time_id DESC $limit;";
   167          . "  ORDER BY time_id DESC $limit;";
   168     
   168     
   169     return $sql;
   169     return $sql;
   170   }
   170   }
   171   
   171