Portal Pagination
Sky Offline
Junior Member
**
Posts: 3
Joined: May 2011
Post: #1
Portal Pagination
Is there any portal pagination for 1.6?
05-27-2011 11:08 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Portal Pagination
There is a tutorial (for MyBB 1.2) here:
http://mybbhacks.zingaburga.com/showthread.php?tid=54
Maybe you can modify it.

If XThreads installed in your forum, I have a plugin for that (XThreads is required for this), based on the tutorial (attached).


Attached File(s)
.php  portal_pagination.php (Size: 2.75 KB / Downloads: 434)

(This post was last modified: 05-28-2011 02:45 AM by RateU.)
05-28-2011 02:45 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #3
RE: Portal Pagination
Hi RateU, I just downloaded your plugin and tried it out in my default templates. When I use the new paginate control added by the plugin then when I change pages the portal announcements lose their XThreads formatting and the pages don't move forward. You can see it on the mybb default templates of leefish.nl.


[Image: leelink.gif]
MYBB1.6 & XThreads
05-28-2011 04:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Portal Pagination
Works for me:
http://www.14.mynie.co.cc/portal.php

The threads in the first page comes from Brand Directory forum (even I use template prefix for that).
Threads in the second page comes from Article Gallery (using the default portal announcement template) and from Product Review (using template prefix).
The announcements rating works too.

But (again), because I'm not a coder and I'm still learning, probably it's better to modify the portal.php file directly than using the plugin Oops

(This post was last modified: 05-28-2011 06:06 AM by RateU.)
05-28-2011 06:00 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #5
RE: Portal Pagination
yes, I think I will. Thanks anyway RateU.


[Image: leelink.gif]
MYBB1.6 & XThreads
05-28-2011 06:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Portal Pagination
RateU's code looks good - do you happen to have manually edited portal.php at all leefish?

My Blog
05-29-2011 05:23 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #7
RE: Portal Pagination
(05-29-2011 05:23 PM)ZiNgA BuRgA Wrote:  RateU's code looks good - do you happen to have manually edited portal.php at all leefish?
Yes I do - and that is the "problem".

Nothing wrong with RateU's code - its using a preg_replace so yes, my manual edits are screwing it up. So I just added the required code direct to my already heavily edited portal.php.

I have a lot of plugins already (not that these plugins are causing any extra queries, its just cluttering my plugins list) and I am trying to tidy the list up.

On this pagination - its really neat, but its a full page reload (of course) and I think that means I am hitting the db every time I click to a new page. Thats not so good on the portal page Erf. I have a few queries already memcached so that helps, but I was actually looking around for an AJAX script so at least I only "reload" the announcements div.

I am also looking at a "select by news" type filter as well, jQuery should be easiest I think as I am already loading the jQuery library, so on the AJAX reload its probably also going to be jQuery based.


[Image: leelink.gif]
MYBB1.6 & XThreads
05-30-2011 02:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: Portal Pagination
(05-30-2011 02:51 AM)leefish Wrote:  On this pagination - its really neat, but its a full page reload (of course) and I think that means I am hitting the db every time I click to a new page. Thats not so good on the portal page Erf.
Unless you're hitting server limits, page loading too slow or otherwise, I really wouldn't worry about that...

(05-30-2011 02:51 AM)leefish Wrote:  I have a few queries already memcached so that helps
You modified some queries?

My Blog
05-30-2011 09:34 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Portal Pagination
(05-30-2011 09:34 AM)ZiNgA BuRgA Wrote:  You modified some queries?

Yes, I have some modified queries - on the latest threads. Those are not memcached though - I have three image galleries on my portal page and those results are memcached. It means that when the page loads I have 3 less queries.

My host is one of my friends and he is a compulsive cacher - he has a site with nearly one million members on a forum that has been running for the last seven years. I realise that we don't really need to do this caching so much on LeeFish, but its his server (and he hosts me for free) and he would like me to use these techniques. So.

I have the manual edits from the tutorial working fine on the portal page. When I put RateU's plugin on leefish when I clicked next page (and subsequent pages) on the portal it just showed the existing portal announcements from the first page but with no images or text in the post message.


[Image: leelink.gif]
MYBB1.6 & XThreads
05-30-2011 04:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #10
RE: Portal Pagination
If he's got a really high traffic site, I wouldn't be surprised if he has some sort of caching proxy installed.  IMO, I'd try taking advantage of that before doing anything else - it would net the most benefit in terms of load.

My Blog
05-30-2011 06:00 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: