函數代碼求解

來源:互聯網
上載者:User
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) : '';
}
請高手詳細解釋上段函數代碼的意義,謝謝!


回複討論(解決方案)

沒有上下文,無法解釋

函數相關上下文:
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$page=$_GET['page']?$_GET['page']:0;
$perpage = 30;

$start = ($page-1)*$perpage;
$statusarr=array(0=>'審核中',1=>'拍賣中',2=>'已結束');
$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['atnid'];
}
$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');



discuz分頁函數的multi的使用
在function_core檔案中的multi函數是分頁函數,原型如下:
multi($num, $perpage, $curpage, $mpurl, $maxpages = 0, $page = 10, $autogoto = FALSE, $simple = FALSE)
其中
$num 總記錄數,
$perpage 每頁顯示記錄數,
$curpage 當前頁碼數,
$mpurl 頁面的URL,如果url中存在"?"的,後面加上“&page=3”(3是頁碼數),不存在“?”的後面加上"?page=4"(4是頁碼數),
$maxpages = 0 位置三數,
$page = 10 每次顯示幾個頁面。
其他的三數可以不填。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.