Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2005-11-16 22:40:05

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] zem_nav

How is this different than the built in tags then if it isn’t category aware?

Offline

#26 2005-11-17 08:35:46

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] zem_nav

I think it IS category aware if you use it properly, which we obviously aren’t!
Can anyone help on this one?

Offline

#27 2005-11-17 15:36:15

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] zem_nav

I don’t see how it could be used improperly you just use it in place of link_to_next and link_to_prev with attributes usecat and usesec to force it to ignore categories and sections.

Time to learn php so I can fix this myself.

Offline

#28 2005-11-17 15:53:30

grad
Member
From: Poznan, Poland
Registered: 2005-10-04
Posts: 24

Re: [plugin] [ORPHAN] zem_nav

pieman wrote:
I think it IS category aware if you use it properly, which we obviously aren’t!
Can anyone help on this one?

No, it’s not. It can’t use a single category thus it selects articles belonging to any category. I temporarily fixed it by changing the code to use the category I wanted.

Offline

#29 2005-11-17 16:09:21

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] zem_nav

grad, can you post those changes so I can do the same?

Offline

#30 2005-11-17 17:15:47

grad
Member
From: Poznan, Poland
Registered: 2005-10-04
Posts: 24

Re: [plugin] [ORPHAN] zem_nav

Here it goes.

I modified the script with this stamp:
Line 1: # $Id: zem_nav.php,v 1.7 2005/01/13 08:12:24 zem Exp $

At lines 61 and 90 find this code:
if ($usecat) $category = empty($c) ? '' : $c;

Comment them out (put // on beginnig of the line) so you could come back to them in case you change your mind and below add this line of code:
if ($usecat) $category = empty($thisarticle['category1']) ? $c : $thisarticle['category1'];

You have to add this code in for each of the two lines you comment out! Of course replace category1 with category2 depending on which category you want the link to stick to.

It’s not how it should be made but I didn’t bother to modify the plugin code. Besides, I’m not a programmer. At least not at the moment :)

Good luck.

Offline

#31 2005-11-17 17:59:18

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] zem_nav

Thanks, it works perfectly. Would you know how to modify it so that it doesn’t require the zem_link plugin? It seems that this line is what is causing the requirement for zem_link. <code>return formatHref($pfr, $link[‘section’], $link[‘thisid’], parse($thing), $t);</code>

Offline

#32 2005-11-17 19:28:49

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] zem_nav

Grad, if it doesn’t enable you to make it category aware then why are there usecat attributes?
And if you are right, in what way is it different from using the default tags?

Offline

#33 2005-11-17 20:13:19

grad
Member
From: Poznan, Poland
Registered: 2005-10-04
Posts: 24

Re: [plugin] [ORPHAN] zem_nav

tinyfly, it should be feasible to get rid of zem_link. However, as I mentioned before I’m not a programmer, I’m learning PHP right now and figured out what to change to make the plugin work my way. Actually, I gave up Textpattern mainly because of it’s inability to structure the site using sections. The problem here is related to this issue. More discussion on that you can find in subsections.

I read your request because I didn’t yet unsubscribe from this forum :).

Grad, if it doesn’t enable you to make it category aware then why are there usecat attributes?
And if you are right, in what way is it different from using the default tags?

As far as I’ve figured it, this plugin is aware of categories within a section. That’s the difference when compared to default tags which don’t care about the section a given article belongs to. If you switch ‘usesec’ to off it will behave exactly the same as default tags.

Last edited by grad (2005-11-17 20:14:35)

Offline

#34 2005-11-17 20:16:52

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [plugin] [ORPHAN] zem_nav

Well thanks grad, I know the whole sections thing is a big issue around here. It should work without zem_link however when I disable it I get the following error: <code>Fatal error: Call to undefined function formatHref() in D:\dev\sites\cdhc-dev\public_html\txp\textpattern\lib\txplib_misc.php(455) : eval()’d code on line 35</code>

Offline

#35 2007-01-02 11:38:41

minimal design
Member
Registered: 2006-10-15
Posts: 38

Re: [plugin] [ORPHAN] zem_nav

Since the posts on this thread seem kinda old, I’m just wondering if this plug-in is supposed to work out of the box with TxP 4.0.4 or if there’s an alternate solution to get next/prev to work within categories that people use.

I get this error if I just simply install/use without any tweaks:

Fatal error: Call to undefined function: formathref() in /home/minimald/public_html/textpattern/lib/txplib_misc.php(512) : eval()'d code on line 36

Thanks!

Offline

#36 2008-03-03 15:12:20

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [plugin] [ORPHAN] zem_nav

hello zem,

I have this page :
<code>
<txp:if_section name=”“>
<txp:article_custom section=“voorpagina” form=“default” />
</txp:if_section>
<txp:if_section name=“article”>
<txp:upm_date_archive section=“article” include_date=“yes” date_format=”%e %B” mode=“smart” form=“dagboek” />
</txp:if_section>
<txp:if_section name=”,article”>
<txp:else />
<txp:article /><!— this is for other sections than the front page or ‘article’ —>
</txp:if_section>
</code>

And then dagboek looks like this :
<code>
<div class=“date_box”>
<div class=“date_box_month”><txp:posted format=”%B” /></div>
<div class=“date_box_day”><txp:posted format= “%d” /></div>
</div>
<h3 class=“entry-title”><txp:title /></h3>
<div class=“entry-content”>
<txp:body />
<txp:zem_link_to_next>Volgende</txp:zem_link_to_next>
</div>
</code>

But no prev and no next is seen here ?

What went wrong here ?

Roelof

Offline

Board footer

Powered by FluxBB