Skip to content
Snippets Groups Projects
Commit 544c04b7 authored by deuce's avatar deuce
Browse files

dont generate any page links of only one page exists.

parent 04fbc062
Branches
Tags
No related merge requests found
...@@ -56,19 +56,21 @@ while(currpage>firstpage+(max_pages/2) && lastpage<total_pages) { ...@@ -56,19 +56,21 @@ while(currpage>firstpage+(max_pages/2) && lastpage<total_pages) {
/* Build the links now */ /* Build the links now */
template.pagelinks=''; template.pagelinks='';
for(var page=firstpage;page<=lastpage;page++) { if(total_pages>1) {
if(currpage==page) for(var page=firstpage;page<=lastpage;page++) {
template.pagelinks += '<b>'+(page+1)+'</b> '; if(currpage==page)
else template.pagelinks += '<b>'+(page+1)+'</b> ';
template.pagelinks += "<a href=\""+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(page*max_messages)+'">'+(page+1)+'</a> '; else
} template.pagelinks += "<a href=\""+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(page*max_messages)+'">'+(page+1)+'</a> ';
}
if(offset+max_messages < msgarray.length) { if(offset+max_messages < msgarray.length) {
template.pagelinks+='<a href="'+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(offset+max_messages)+'">NEXT</a>'; template.pagelinks+='<a href="'+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(offset+max_messages)+'">NEXT</a>';
} }
if(offset>0) { if(offset>0) {
template.pagelinks='<a href="'+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(offset-max_messages)+'">PREV</a> '+template.pagelinks; template.pagelinks='<a href="'+path+'?msg_grp='+g+'&amp;msg_sub='+encodeURIComponent(sub)+'&amp;offset='+(offset-max_messages)+'">PREV</a> '+template.pagelinks;
}
} }
if(sub=='mail') { if(sub=='mail') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment