Discuz paging function is changed to jQueryd Ajax Patency Functions

/ ** * ajax page * $ NUM is a total of 15 articles in this category * $ perpage for each page * $ CURPAGE for the current page Number * $ URL for the request path, * $ OBJ is an HTML object, returned to jQery handle * $ page for $ multipage this string to display the number of variables * $ maxPages for the largest page value This function is last There is a $ maxpage = $ realpages; * / function multi ($ NUM, $ PERPAGE, $ CURPAGE, $ URL, $ OBJ, $ MAXPAGES = 0, $ Page = 10, $ Autogoto = true, $ Simple = False) {Global $ MAXPAGE; $ AjaxTarget =! EMPTY ($ _ get [‘AjaxTarget’)? “AjaxTarget = \” “. DHTMLSPECIALCHARS ($ _ get [‘AjaxTarget’).” \ “: ”; $ multipage = ‘; // $ mpurl. = STRPOS ($ mpurl, ‘?’)? ‘&’: ‘?’; $ realpages = 1; // Decades whether the number of strips is greater than the number of rods to display each page set ($ Num > $ Perpage) {// Set the number of pages in $ Multipage to output a few pages $ OFFSET = 2; $ REALPAGES = @ceil ($ Num / $ perpage); / / Total number of pages (do not know $ MAXPAGES Meaning), here assumptions are 15 $ upes = $ maxpages && $ maxpages
 $ upes) {$ from = 1; $ to = $ pages; // If you are greater than, you have to output $ PAGE pages (the 15 we assume meet this condition)} else {$ from = $ CURPAGE - $ OFSET; $ to = $ from + $ page - 1; // Hypothesis Curpage is 4, so far, from 2, To 11 // Saves Curpage is 1 IF ($ from  $ PAGES) {// TO is not greater than the total number of $ from = $ pages - $ page + 1; $ multipage = ($ CURPAGE - $ OFFSET> 1 && $ page? '  1 ... < 1) {
            $to = $curpage + 1 - $from;
            $from = 1;
            //目前为止from为1,to为3
            if($to - $from  ':'). ($ CURPAGE> 1 &&! $ SIMPLE? '  Previous 
  • ': '); for $ I = $ from; $ I "$ I. '
  • <= $to; $i++) {          $multipage .= $i == $curpage ? '
  • ': ' '. $ I. '
  • ';} $ Multipage. = ($ CURPAGE Next page
  • < $pages && !$simple ? '
  • ':');} $ maxpage = $ realpages; return $ Multipage;}

  • Function AjaxPage (Obj, URL, PAGE) {$ .ajax ({Type: “Get”, URL: URL + “& CURPAGE =” + Page, SUCCESS : Function (data) {$ (obj) .html (data);}}}

      Call  



                        
    © Copyright Notice
    THE END
    Just support it if you like
    like0
    share
    comment Grab the couch

    Please log in to comment