Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the Paging method #2

Closed
floki2020 opened this issue Apr 25, 2013 · 1 comment
Closed

modify the Paging method #2

floki2020 opened this issue Apr 25, 2013 · 1 comment

Comments

@floki2020
Copy link

case style == 2:
    if results_max > 0 {
        raw = "<div class='pagination pagination-centered'><ul>"
        count := pages + 1
        //begin page
        if (page != beginnum) && (page > beginnum) {
            raw = raw + "<li><a href='?" + keyword + "page=" + strconv.Itoa(page-1) + "'>&laquo;</a></li>"
        }
        for i := 1; i < count; i++ {
            //current page and loop pages
            if i == page {
                raw = raw + "<li class='active'><a href='javascript:void();'>" + strconv.Itoa(i) + "</a></li>"
            } else {
                raw = raw + "<li><a href='?" + keyword + "page=" + strconv.Itoa(i) + "'>" + strconv.Itoa(i) + "</a></li>"
            }
            //next page
            if (page != endnum) && (page < endnum) && (i == pages) {
                raw = raw + "<li><a href='?" + keyword + "page=" + strconv.Itoa(page+1) + "'>&raquo;</a></li>"
            }
        }
        raw = raw + "</ul></div>"
    }
@insionng
Copy link
Owner

Thank you for your contribution and I will update the new version in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants