Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Adding Paging to the Portal Page
incadude Offline
Member
***
Posts: 52
Joined: Jan 2008
Post: #11
RE: Adding Paging to the Portal Page
place it somewhere else. Like the bottom of the page.
02-05-2008 11:54 AM
Find all posts by this user
Animal Offline
Junior Member
**
Posts: 3
Joined: Feb 2008
Post: #12
RE: Adding Paging to the Portal Page
nice mod will tr this out thanks Zing ....
02-05-2008 11:02 PM
Find all posts by this user
snAke Offline
Banana-Presi
**
Posts: 19
Joined: Feb 2008
Post: #13
RE: Adding Paging to the Portal Page
done,...same on the first side the other sites are a little better now,...but the same,...heres my tempelate,...i tried to change it but,...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<center><a href="http://msig.msgshit.com/mypage/w2m/snAke_LeAder/" target="_blank"><img src="http://msig.msgshit.com/userbar/w2m/snAke_LeAder.png" alt="My Messenger Status"></a></center>
<sf_shoutbox>
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="200">
<tr><td valign="top">
{$announcements}
</td>
<td valign="top" width="100">
{$welcome}
{$pms}
<!-- SCP_1_0 -->{$search}
{$stats}<!-- ASOIP_2_0_P -->
{$whosonline}
{$latestthreads}
</td>
</tr>
</table>
{$multipage}
{$footer}
</body>
</html>


if ( $Idea == 'none' ) { read (FAQ) && search (search) }
else if ($answer == 0) { post->question }
02-06-2008 03:21 AM
Visit this user's website Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #14
RE: Adding Paging to the Portal Page
^ Try placing it under {$announcements}

My Blog
02-06-2008 01:02 PM
Find all posts by this user
goindex Offline
Junior Member
**
Posts: 23
Joined: Jan 2008
Post: #15
RE: Adding Paging to the Portal Page
ZiNgA BuRgA Wrote:To do this, open up portal.php
Find:

PHP Code:
1
2
3
4
5
6
7
8
$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 (".$mybb->settings['portal_announcementsfid'].") 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']
);

Replace with:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
$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'].'?paged=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 (".$mybb->settings['portal_announcementsfid'].") 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
);



But if we use PreParser Cache (beta) I think this must to be replaced with:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$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'].'?paged=1');
$query = $db->query("
	SELECT p.pid, p.message, p.tid, pp.parsedmessage
	FROM ".TABLE_PREFIX."posts p
	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
	LEFT JOIN ".TABLE_PREFIX."parsed_posts pp ON (p.pid=pp.pid)
	WHERE t.fid IN (".$mybb->settings['portal_announcementsfid'].") 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
);


Right !?

It's about this 2 lines:

PHP Code:
	SELECT p.pid, p.message, p.tid, pp.parsedmessage

and

PHP Code:
	LEFT JOIN ".TABLE_PREFIX."parsed_posts pp ON (p.pid=pp.pid)

Whistle


My Site | My Posts | My Profil | My Favorites Plugins
(This post was last modified: 02-09-2008 04:52 PM by goindex.)
02-09-2008 04:47 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #16
RE: Adding Paging to the Portal Page
Something like that.
Does it work?  I haven't tried it.

If it works, then you're fine Tongue

My Blog
02-09-2008 06:34 PM
Find all posts by this user

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: