- fprintf(out, "<td>%s</td>\n", db_email_get(e.item));
- if(extra_column >= 0)
- fprintf(out, "<td>%s</td>\n",
- safe_str(db_fget_byid(e.item, extra_column)));
- fprintf(out, "</tr>\n\n");
+ db_enumerate_items(e) {
+ fprintf(out, "<tr>");
+ for(cur = index_elements; cur; cur = cur->next) {
+ if(cur->type != INDEX_FIELD)
+ continue;
+
+ get_list_field(e.item, cur, &f);
+
+ if(f.type == FIELD_EMAILS) {
+ fprintf(out, "<td>");
+ html_print_emails(out, &f);
+ fprintf(out, "</td>");
+ continue;
+ } else {
+ fprintf(out, "<td>%s</td>", safe_str(f.data));
+ }
+ }
+ fprintf(out, "</tr>\n");