move next and prev around

This commit is contained in:
Andrew Pamment 2018-05-31 14:00:18 +10:00
parent 5a1a834803
commit 0f6af49071

View File

@ -235,6 +235,15 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i
} }
strcat(page, buffer); strcat(page, buffer);
len += strlen(buffer); len += strlen(buffer);
if (skip + 50 <= mhrs->msg_count) {
sprintf(buffer, "<div class=\"msg-summary-next\"><a href=\"%smsgs/%d/%d/?skip=%d\">Next</a></div>\n", conf.www_url, conference, area, skip + 50);
if (len + strlen(buffer) > max_len - 1) {
max_len += 4096;
page = (char *)realloc(page, max_len);
}
strcat(page, buffer);
len += strlen(buffer);
}
if (skip > 0) { if (skip > 0) {
if (skip - 50 < 0) { if (skip - 50 < 0) {
@ -250,15 +259,6 @@ char *www_msgs_messagelist(struct user_record *user, int conference, int area, i
len += strlen(buffer); len += strlen(buffer);
} }
if (skip + 50 <= mhrs->msg_count) {
sprintf(buffer, "<div class=\"msg-summary-next\"><a href=\"%smsgs/%d/%d/?skip=%d\">Next</a></div>\n", conf.www_url, conference, area, skip + 50);
if (len + strlen(buffer) > max_len - 1) {
max_len += 4096;
page = (char *)realloc(page, max_len);
}
strcat(page, buffer);
len += strlen(buffer);
}
free_message_headers(mhrs); free_message_headers(mhrs);
return page; return page;
} }