Hello everyone,
I have on my page as homepage the portal page. In the settings of the portal page you can set how manny messages thats showing up on the page, but I want a option and I don't know if this is possible??
Is it possible to make it that you see onderneed the messages a navigation button with
[previous], [1], [2], [3], [next] (like in a topic of there is a lot of messages)
So that you see the messages on the portal like you have set and if you click on [2] you get a second page with messages and [3] etc, etc until there are no messages.
Is this option available??
(2012-03-16, 01:56 PM)Leefish Wrote: [ -> ]You mean you want to add pagination to your portal page?
You can try this plugin from RateU (requires XThreads to be installed)
http://mybbhacks.zingaburga.com/showthread.php?tid=872
is there any other way because once I have 100 extra plugins for using diffrent plugins.. Now I need to install the XThreads and I have installed allready the PHP and Template Conditionals plugin...... So is there no <if> </if> code for this
And I have search on the link and not realy found to use or install the XThreads good for using the plugin.
I have found a link on that page for edit the portal.php but this is not working annymore for 1.6xx the editing was for 1.2
So do you know the working code for editing the portal.php or do you have a diffrent way please
(2012-03-16, 04:56 PM)Leefish Wrote: [ -> ]My own board is using a paginated portal - I did not use the plugin, I made it myself following the tutorial for 1.2
http://mybbhacks.zingaburga.com/showthread.php?tid=54
You I had found the tutorial but it's not working here, if I edit the portal.php I reseave a error
This is the error:
Quote:MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1146 - Table 'debewone_galaxyfreaks_mybb.mybb_mybb_threads' doesn't exist
Query:
SELECT COUNT(*) AS numann FROM mybb_mybb_threads WHERE fid IN (41) AND visible='1' AND closed NOT LIKE 'moved|%'
Please contact the MyBB Group for support.
well the error tells you what is wrong with it - it is saying mybb table prefix twice. So you need to change that line
If you look in the code you will see this:
$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');
so remove the TABLE_PREFIX. and see what happens.
(2012-03-16, 06:42 PM)Leefish Wrote: [ -> ]well the error tells you what is wrong with it - it is saying mybb table prefix twice. So you need to change that line
If you look in the code you will see this:
$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');
so remove the TABLE_PREFIX. and see what happens.
EDIT:
Works no error annymore but now the navigation option is still not visible I have put {$multipage} in the portal page
No, my own portal.php is heavily customised for leefish so I won't give you that as it will probably make it worse. Also, if I make it for you then you don't get anywhere or learn. You will be asking people forever - if you try and figure this out you will have made it yourself (and that feels really good) or there is a plugin to do it.
You need to look inside the portal.php file in a reliable editor (Notepad ++ ) and figure out what is wrong on line 423
my code for the pagination is :
$pids = '';
$tids = '';
$comma = '';
$page = intval($mybb->input['page']);
if($page < 1) $page = 1;
$numann = $db->fetch_field($db->simple_select('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 you need to do all the edits to make it work - make sure you catch them all.
(2012-03-16, 07:14 PM)Leefish Wrote: [ -> ]No, my own portal.php is heavily customised for leefish so I won't give you that as it will probably make it worse. Also, if I make it for you then you don't get anywhere or learn. You will be asking people forever - if you try and figure this out you will have made it yourself (and that feels really good) or there is a plugin to do it.
You need to look inside the portal.php file in a reliable editor (Notepad ++ ) and figure out what is wrong on line 423
my code for the numann is :
$numann = $db->fetch_field($db->simple_select('threads', 'COUNT(*) AS numann', "fid IN (".$mybb->settings['portal_announcementsfid'].") AND visible='1' AND closed NOT LIKE 'moved|%'"), 'numann');
But you need to do all the edits to make it work - make sure you catch them all.
I think I had to manny deleted because now I have don everything again and use your
Quote:$numann = $db->fetch_field($db->simple_select('threads', 'COUNT(*) AS numann', "fid IN (".$mybb->settings['portal_announcementsfid'].") AND visible='1' AND closed NOT LIKE 'moved|%'"), 'numann');
its works great now!!!
Thanks for your help and I gonna hit the reputation button