Function code solving function multi ($ num, $ perpage, $ curpage, $ mpurl, $ maxpages = 0, $ page = 10, $ autogoto = FALSE, $ simple = FALSE, $ jsfunc = FALSE)
{
Return $ num> $ perpage? Helper_page: multi ($ num, $ perpage, $ curpage, $ mpurl, $ maxpages, $ page, $ autogoto, $ simple, $ jsfunc ):'';
}
Please explain in detail the significance of the previous function code. thank you!
Reply to discussion (solution)
No context, cannot be explained
Function context:
If (! Defined ('in _ discuz ')){
Exit ('Access Denied ');
}
$ Page = $ _ GET ['Page']? $ _ GET ['Page']: 0;
$ Perpage = 30;
$ Start = ($ page-1) * $ perpage;
$ Statusarr = array (0 => 'under review ', 1 => 'auction in Progress', 2 => 'closed ');
$ Mpurl = 'home. php? Mod = auction & ac = auctions ';
$ Perpages = array ($ perpage => 'selected ');
$ Bidauc = C: t ('Auction _ bidden ')-> fetch_distinct_atnid ('uid = '. $ _ G ['uid'], 'Order BY inputtime desc ', $ start, $ perpage );
Foreach ($ bidauc AS $ key => $ value)
{
$ Warr [] = $ value ['attrid'];
}
$ Aucclouse = implode (',', $ warr );
// Die ($ aucclouse. "aaa ");
$ Auclist = C: t ('Auction _ inauctions ')-> fetch_all_by_ SQL ('Id in ('. $ aucclouse .')');
$ Count = C: t ('Auction _ bidden ')-> fetch_distinct_atnid ('uid = '. $ _ G ['uid'], '', 1 );
$ Multipage = multi ($ count, $ perpage, $ page, $ mpurl );
Include template ('Home/auction_bidauctions ');
Use of discuz paging function multi
The multi function in the function_core file is a paging function. the prototype is as follows:
Multi ($ num, $ perpage, $ curpage, $ mpurl, $ maxpages = 0, $ page = 10, $ autogoto = FALSE, $ simple = FALSE)
Where
$ Num total number of records,
$ Perpage: number of records displayed on each page,
$ Number of current curpage pages,
$ Mpurl: The URL of the page. if the url contains "? ", Followed by" & page = 3 "(3 is the number of page numbers), does not exist"?" Add "? Page = 4 "(4 is the number of page numbers ),
$ Maxpages = 0-position parameter,
$ Page = 10 displays several pages each time.
Other parameters can be left empty.