Function code solving

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.