本文整理汇总了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));
}