• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Vbadvanced Recent Thread pagination

Admin

Well-Known Member
Staff member
Administrator
This is one modification I made to recenthread.php to display a pagination as news.php


I'm no expert on this, in fact. I do not know anything. I'm sure someone with more knowledge, can upgrade.


Sorry my bad english


Modules/recentthreads.php
Find
Code:
if ($mod_options['portal_threads_maxthreads'])
{
Add after
Code:
/////PAGINATION By Felixthekat////////////
$perpage = 10;
$itemcount = $db->query_first("SELECT count(thread.threadid) as itemcount FROM " . TABLE_PREFIX . "thread as thread
$rthread_join
WHERE open != 10
AND thread.visible = 1 " .
iif($mod_options['portal_threads_cutoffdate'],
'AND thread.lastpost > ' . (TIMENOW - $mod_options['portal_threads_cutoffdate'] * 86400)
) .
iif($ignusers,
' AND thread.postuserid NOT IN(' . $ignusers . ')'
) . "$vba_threads_condition");


$pagenumber = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT);
sanitize_pageresults($itemcount['itemcount'], $pagenumber, $perpage,$perpage,$perpage); 
$limitlower = ($pagenumber - 1) * $perpage + 1; 
$limitupper = $pagenumber * $perpage; 


if ($limitupper > $itemcount['itemcount'])
{
$limitupper = $itemcount['itemcount'];
if ($limitlower > $itemcount['itemcount'])
{
$limitlower = $itemcount['itemcount'] - $perpage;
}}


if ($limitlower <= 0)
{
$limitlower = 1;
}


$pagenav = construct_page_nav($pagenumber, $perpage, $itemcount['itemcount'], 'index.php?');
/////////////////////////////////


Find
Code:
LIMIT $mod_options[portal_threads_maxthreads]
Replace
Code:
LIMIT " . ($limitlower - 1) . ", $perpage


Go to Admincp > Styles and Templates > Your template > Templates of vbadvanced CMPS > adv_portal_recthreads_exp_head
add to the end
Code:
<tr>
<td>
$pagenav
</td>
</tr>


Enjoy!!
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top