Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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