- if (bbs_reverse) {
- for (b=nummsgs-1; b>=0; b = b - maxmsgs) {
- hi = b + 1;
- lo = b - maxmsgs + 2;
- if (lo < 1) lo = 1;
-
- Msg = GetMessagePtrAt(lo-1, WCC->summ);
- n = (Msg==NULL)? 0 : Msg->msgnum;
- selected = ((n == startmsg) ? "selected" : "");
-
- StrBufAppendPrintf(Selector,
- "<option %s value="
- "\"%s"
- "&startmsg=%ld"
- "&maxmsgs=%d"
- "&is_summary=%d\">"
- "%d-%d</option> \n",
- selected,
- oper,
-
-
- maxmsgs,
- is_summary,
- hi, lo);
- }
- }
- else {
- for (b=0; b<nummsgs; b = b + maxmsgs) {
- lo = b + 1;
- hi = b + maxmsgs + 1;
- if (hi > nummsgs) hi = nummsgs;
-
- Msg = GetMessagePtrAt(b, WCC->summ);
- n = (Msg==NULL)? 0 : Msg->msgnum;
- selected = ((n == startmsg) ? "selected" : "");
- Msg = GetMessagePtrAt(lo-1, WCC->summ);
- StrBufAppendPrintf(Selector,
- "<option %s value="
- "\"%s"
- "&startmsg=%ld"
- "&maxmsgs=%d"
- "&is_summary=%d\">"
- "%d-%d</option> \n",
- selected,
- oper,
- (Msg==NULL)? 0 : Msg->msgnum,
- maxmsgs,
- is_summary,
- lo, hi);
- }
- }
-
- StrBufAppendBuf(BBViewToolBar, Selector, 0);
-
- Msg = GetMessagePtrAt(0, WCC->summ);
-
- StrBufAppendPrintf(BBViewToolBar, "<option value=\"%s?startmsg=%ld"
- "&maxmsgs=9999999&is_summary=0\">",
- oper,
- (Msg==NULL)? 0 : Msg->msgnum);
- StrBufAppendPrintf(BBViewToolBar, _("All"));
-
- StrBufAppendPrintf(BBViewToolBar, "</option>");
- StrBufAppendPrintf(BBViewToolBar, "</select> ");
- StrBufAppendPrintf(BBViewToolBar, _("of %d messages."), nummsgs);
-
- /** forward/reverse */
- StrBufAppendPrintf(BBViewToolBar, "<input type=\"radio\" %s name=\"direction\" value=\"\""
- "OnChange=\"location.href='%s?sortby=forward'\"",
- (bbs_reverse ? "" : "checked"),
- oper
- );
- StrBufAppendPrintf(BBViewToolBar, ">");
- StrBufAppendPrintf(BBViewToolBar, _("oldest to newest"));
- StrBufAppendPrintf(BBViewToolBar, " ");
-
- StrBufAppendPrintf(BBViewToolBar, "<input type=\"radio\" %s name=\"direction\" value=\"\""
- "OnChange=\"location.href='%s?sortby=reverse'\"",
- (bbs_reverse ? "checked" : ""),
- oper
- );
- StrBufAppendPrintf(BBViewToolBar, ">");
- StrBufAppendPrintf(BBViewToolBar, _("newest to oldest"));
- StrBufAppendPrintf(BBViewToolBar, "\n");
-
- StrBufAppendPrintf(BBViewToolBar, "</p></form>\n");