MyBB Community Forums

Full Version: Pagination in portal page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey yumi, it doesn't work. It needs to be modified to be compatible with version mybb 1.4.8.

Can anyone take a look at this and see if they can come up with a fix? I know there is a release of the advance portal with pagination; however, it has to many uneccessary boxes/ clusters. I just need a simple modification in order to have pagination at the bottom of the portal page.

Would someone kindly look at this *AND* reply with a fix. Thanks.
i think i can gave updated one with regarding zinga (yumi)
open portal.php and find:

$query = $db->query("
	SELECT p.pid, p.message, p.tid
	FROM ".TABLE_PREFIX."posts p
	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
	WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
	ORDER BY t.dateline DESC 
	LIMIT 0, ".$mybb->settings['portal_numannouncements']
);

than replace with:

/*
$query = $db->query("
	SELECT p.pid, p.message, p.tid
	FROM ".TABLE_PREFIX."posts p
	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
	WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
	ORDER BY t.dateline DESC 
	LIMIT 0, ".$mybb->settings['portal_numannouncements']
);*/

(backing up is a good thing xD .)

4- add below:
$page = intval($mybb->input['page']);
if($page < 1) $page = 1;
$numann = $db->fetch_field($db->simple_select(/*TABLE_PREFIX.*/'threads', 'COUNT(*) AS numann', "fid IN (".$mybb->settings['portal_announcementsfid'].") AND visible='1' AND closed NOT LIKE 'moved|%'"), 'numann');
$perpage = intval($mybb->settings['portal_numannouncements']);
$multipage = multipage($numann, $perpage, $page, $_SERVER['PHP_SELF'].'?sayfalar=1');
$query = $db->query("
	SELECT p.pid, p.message, p.tid
	FROM ".TABLE_PREFIX."posts p
	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
	WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
	ORDER BY t.dateline DESC 
	LIMIT ".(($page-1)*$perpage).", ".$perpage
);

save and close.

5- after that open portal template and put
{$multipage}
somewhere for Pagination.

all credits goes to Zinga (Yumi).

P.S if you have suggestions about advanced portal feel free to tell =)
this dont´s work on mybb 1.4.10 T_T


please update the tutorial
still useful in 1.60. Thanks Smile
Works on MyBB 1.6.8 ..??
(2012-07-10, 01:20 AM)InfraWorld Wrote: [ -> ]Works on MyBB 1.6.8 ..??

Looking at the code, I highly doubt it. Does anyone have a working version of this for 1.6?
I am using almost exactly this in my own portal.php. I will get a copy for you.

That is my personal portal - it includes avatars on latest threads if you can figure it out Big Grin
Pages: 1 2