Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2008-06-03 13:02:00

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I think I’m probably SOL on this one, but it never hurts to ask. Is there a way to have a numbered list paginate without starting over at 1? For example on my book list page the list currently goes into the 500s and so I’d like to paginate it. Problem is that if I do that, the list starts over at 1 when I get to each new page. Is there a way around this? like to have page 1 be 1-100, page 2 be 101-200 etc?

Edit: I found a way to manually do it by setting the start number on each page… bleah. I doubt there is going to be a good way to automate this, is there…

Last edited by OpalCat (2008-06-03 13:09:58)



WebKat

Offline

#134 2008-08-04 05:30:09

davidsess
Member
From: New York, NY
Registered: 2008-01-02
Posts: 20
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I got the plugin to work after switching to clean URLs, but am still having a couple of problems:

Every article displays a random “&nb” before the pagination controls.

(ie, http://www.patrolmag.com/times/503/a-drop-in-the-bucket)

Also, if an article is NOT paginated, it displays an unnecessary, extra “>” at the end of the body.

(ie, http://www.patrolmag.com/times/496/test-article-number-three)


http://www.patrolmag.com

Offline

#135 2008-11-13 21:06:27

juicevb10
New Member
Registered: 2006-01-24
Posts: 6

Re: [plugin] [ORPHAN] etz_pg for paginated articles

When you scroll through my sites “Older Articles” each time a user comes across an article that uses etz_pg it shows “Invalid page number!” instead of the body text.

I assume this is because the code for etz_pg somehow sees the pg=X in the address and thinks it’s paginated.

Scroll down to Ultimate Beach Volleyball Workout 4 and others on this site to see what I’m talking about.

This doesn’t happen to anyone else?
Does anyone have a solution for this?

I’m going to look at the php for this plug-in and see what I can figure out, but any help with this issue will be greatly appreciated.

Thanks.

Offline

#136 2008-12-01 18:57:36

magzalez
Member
From: Gainesville, FL, USA
Registered: 2008-09-09
Posts: 16
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

What were you able to figure out juicevb10?

Offline

#137 2008-12-01 19:32:05

juicevb10
New Member
Registered: 2006-01-24
Posts: 6

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I got a bit of help from a good programmer, and just implemented a ‘quick hack.’ We replaced the last ‘else’ in etz_pg_body($atts) with:

else {
$newindex = (isset($pages[$pg-1])) ? $pg-1 : 0;
if (isset($pages[$newindex])) {
$pagecontent = $pages[$newindex];
if (($newindex+1 > 1) && (!($notrim))) $pagecontent = substr($pagecontent, 4);
if (($newindex+1 < $max) && (!($notrim))) $pagecontent = substr($pagecontent, 0, -3);
return $pagecontent;
}

This fixes the problem I was having, but doesn’t fix the problem I still have with multiple paginated articles on the index – if you have more than one paginated article on the main blog loop on the front page, all additional articles’ “read onward” links only link to the first article instead of the article they belong to. As far as I can tell, it has something to do with $thisarticle always referring to the latest post on the front page.

Not sure what to do about that, so our current fix is to be sure to only have the most recent article paginated. Not very elegant, and annoying. I’m planning on rebuilding the site, so I haven’t put much work into figuring it out, but to do so it looks like we’ll need to understand both how Textpattern works and how this plugin works with $thisarticle to solve it.

Offline

#138 2008-12-01 19:36:00

magzalez
Member
From: Gainesville, FL, USA
Registered: 2008-09-09
Posts: 16
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Perfect, I’ll give this a try. I don’t have lengthy paginated articles all on one page, so this should do just the trick. Thanks for the quick response.

Offline

#139 2008-12-01 19:58:24

magzalez
Member
From: Gainesville, FL, USA
Registered: 2008-09-09
Posts: 16
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Worked like a charm, just had to remember to close the else { } bracket.

Offline

#140 2008-12-01 20:10:08

juicevb10
New Member
Registered: 2006-01-24
Posts: 6

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Oh, I’m sorry, I typed wrong. We didn’t replace the “last” else, but the 2nd to last one.
We replaced the one that starts with:

if (isset($pages[$pg-1])) {

You’ll probably want to keep this one:

else {
return '<p>'.$pgerr.'</p>';
}

Offline

#141 2009-10-13 16:37:23

jpeacock
New Member
Registered: 2008-08-26
Posts: 7

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I know I’m digging up an old school thread here, but I installed the plugin and it works great for pagination. The problem that I’m having is that I’m also using Mary’s upm_image plugin to display images in each article, but since it’s a technically a “plugin within a plugin”, it’s not parsing the upm_image tag correctly. Any ideas on how to get this to work? I know php pretty well, but the only solution I though of was to use preg_match in the etz_pg plugin and parse out the upm_image tags/parameters and edit the etz_pg_body tag to grab the proper images and put the result in a new body variable when I output it to the page. I have the upm_image tags in about 2000 articles so I don’t really want to go back in and change them to just regular image tags. Any ideas?

Offline

Board footer

Powered by FluxBB