本文整理匯總了PHP中BP_Messages_Thread::get_total_threads_for_user方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Messages_Thread::get_total_threads_for_user方法的具體用法?PHP BP_Messages_Thread::get_total_threads_for_user怎麽用?PHP BP_Messages_Thread::get_total_threads_for_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BP_Messages_Thread
的用法示例。
在下文中一共展示了BP_Messages_Thread::get_total_threads_for_user方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bp_messages_template
function bp_messages_template($user_id, $box, $per_page, $max)
{
$this->pag_page = isset($_GET['mpage']) ? intval($_GET['mpage']) : 1;
$this->pag_num = isset($_GET['num']) ? intval($_GET['num']) : $per_page;
$this->user_id = $user_id;
$this->box = $box;
if ('notices' == $this->box) {
$this->threads = BP_Messages_Notice::get_notices();
} else {
$this->threads = BP_Messages_Thread::get_current_threads_for_user($this->user_id, $this->box, $this->pag_num, $this->pag_page);
}
if (!$this->threads) {
$this->thread_count = 0;
$this->total_thread_count = 0;
} else {
if (!$max) {
if ('notices' == $this->box) {
$this->total_thread_count = BP_Messages_Notice::get_total_notice_count();
} else {
$this->total_thread_count = BP_Messages_Thread::get_total_threads_for_user($this->user_id, $this->box);
}
} else {
$this->total_thread_count = (int) $max;
}
if ($max) {
if ($max >= count($this->threads)) {
$this->thread_count = count($this->threads);
} else {
$this->thread_count = (int) $max;
}
} else {
$this->thread_count = count($this->threads);
}
}
$this->pag_links = paginate_links(array('base' => add_query_arg('mpage', '%#%'), 'format' => '', 'total' => ceil($this->total_thread_count / $this->pag_num), 'current' => $this->pag_page, 'prev_text' => '«', 'next_text' => '»', 'mid_size' => 1));
}