X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsitemap.c;h=cab60d43ec01307ceef379db619a34fe0a22c485;hb=4b4dc864ede7c5d8d956febe4a0afb422b78e7c4;hp=fe6c68908db8fa3967fd2d60867dd06dae51cb18;hpb=1ce110cf28b819a127711a907f70256957cd7dd0;p=citadel.git diff --git a/webcit/sitemap.c b/webcit/sitemap.c index fe6c68908..cab60d43e 100644 --- a/webcit/sitemap.c +++ b/webcit/sitemap.c @@ -36,7 +36,7 @@ void sitemap_do_bbs(void) { Stat.maxload = INT_MAX; Stat.lowest_found = (-1); Stat.highest_found = (-1); - num_msgs = load_msg_ptrs("MSGS ALL", &Stat, NULL); + num_msgs = load_msg_ptrs("MSGS ALL", NULL, &Stat, NULL); if (num_msgs < 1) return; for (i=0; isumm); + if (Msg != NULL) { + struct bltr bltr = blogview_learn_thread_references(Msg->msgnum); + /* Show only top level posts, not comments */ + if ((bltr.id != 0) && (bltr.refs == 0)) { + WC->bptlid = bltr.id; + wc_printf("%s", ChrPtr(site_prefix)); + tmplput_blog_permalink(NULL, NULL); + wc_printf("\r\n"); + } + } + } +} + + /* * XML sitemap generator -- go through the message list for a wiki room */ @@ -67,7 +100,7 @@ void sitemap_do_wiki(void) { Stat.maxload = INT_MAX; Stat.lowest_found = (-1); Stat.highest_found = (-1); - num_msgs = load_msg_ptrs("MSGS ALL", &Stat, NULL); + num_msgs = load_msg_ptrs("MSGS ALL", NULL, &Stat, NULL); if (num_msgs < 1) return; for (i=0; iroomname = NewStrBufPlain(roomname_plain, -1); + ptr->defview = extract_int(buf, 6); + ptr->next = roomlist; + roomlist = ptr; + } + + return(roomlist); +} + + /* * Entry point for RSS feed generator */ void sitemap(void) { - HashList *roomlist; - HashPos *it; - long HKlen; - const char *HashKey; - folder *room; - + struct sitemap_room_list *roomlist = NULL; output_headers(0, 0, 0, 0, 1, 0); hprintf("Content-type: text/xml\r\n"); hprintf( @@ -115,28 +173,32 @@ void sitemap(void) { wc_printf("\r\n"); wc_printf("\r\n"); - roomlist = GetRoomListHashLKRA(NULL, NULL); - it = GetNewHashPos(roomlist, 0); + roomlist = sitemap_load_roomlist(); - while (GetNextHashPos(roomlist, it, &HKlen, &HashKey, (void *)&room)) + while (roomlist != NULL) { - gotoroom(room->name); + gotoroom(roomlist->roomname); /* Output the messages in this room only if it's a room type we can make sense of */ - switch(room->defview) { + switch(roomlist->defview) { case VIEW_BBS: sitemap_do_bbs(); break; case VIEW_WIKI: sitemap_do_wiki(); break; + case VIEW_BLOG: + sitemap_do_blog(); + break; default: break; } - } - DeleteHashPos(&it); - /* No need to DeleteHash(&roomlist) -- it will be freed when the session closes */ + struct sitemap_room_list *ptr = roomlist; + roomlist = roomlist->next; + FreeStrBuf(&ptr->roomname); + free(ptr); + } wc_printf("\r\n"); wDumpContent(0);