Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-04-13 03:19:31

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff:

Just following up. Hoping you were able to locate something that may be causing the issue.

Thanks.

progre55

Offline

#14 2007-04-16 05:15:06

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

I noticed a slight error in the code, which I have corrected with a new version (v.0.3). See the initial post above, and let me know if it solves the problems you have been having.

Offline

#15 2007-04-25 20:19:21

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff:

I tested the updated version, but now I have another issue. The articles are not being restricted to the assigned category. In this case a category called “home”

Here is the code below:

<txp:jk_link_to_prev cat=“home" showalways="1">
<IMG SRC="/core_images/listing_prev.jpg" ALT="schembra_real_estate" align=top border=0>
</txp:jk_link_to_prev>
<txp:jk_link_to_next cat=“home" showalways="1">
<IMG SRC="/core_images/listing_next.jpg" align=top border=0></txp:jk_link_to_next>

What is happening is that it is displaying all the articles assigned to the section, not the category. Now this may still work for me, but I wanted to give you a heads up.

Let me know if you need more info on my end.

progre55

Offline

#16 2007-04-25 21:42:32

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

And its not working for both previous and next? Can you turn on debugging and paste the mysql queries it is returning in your source code? Thanks!

Offline

#17 2007-04-25 21:50:09

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff

It IS working for the previous and next. Sorry if I implied in the earlier email that it was not.

Now the only issue appears to be what the plug in is using to restrict (ie cat or section)

Do you still want me to shoot you are the queries?

progre55

Offline

#18 2007-04-25 21:51:38

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Sorry, I meant to ask if it is not restricting by Category for BOTH prev and next?

Last edited by Jeff_K (2007-04-25 21:52:34)

Offline

#19 2007-04-25 21:56:27

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff_K:

I have to step out, but hopefully this helps:

textpattern/lib/txplib_misc.php:1332 trigger_error()
textpattern/publish.php:688 fetch_form()
textpattern/publish.php:805 doarticles()
textpattern/publish.php:795 parsearticles()
textpattern/publish.php:959 article_custom()
processtags()
textpattern/publish.php:918 preg_replace_callback()
textpattern/publish.php:453 parse()
index.php:34 textpattern()

Let me know if you need any additional information. Not sure if this is the code you were looking for.

progre55

Offline

#20 2007-04-25 23:46:19

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Hey, I have tried to duplicate this behavior, but can’t. If you turn debugging on, you should get a bunch of code in the source code of your document, at the end. Can you paste the MySql code that is returned for the plugin?

For example, when I run it, I get something like:

<txp:jk_link_to_prev cat="test" />
[SQL (0.003709): select ID, Title, url_title, unix_timestamp(Posted) as uposted from textpattern where title > 'article-title' and Section = 'txp' and category1 = 'test' and Status=4 and Posted < now() order by title asc limit 1]

Last edited by Jeff_K (2007-04-25 23:46:58)

Offline

#21 2007-04-26 17:00:04

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff:

Hope this helps:

<txp:jk_link_to_prev cat=“home" showalways="1">
		[SQL (0.001756): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where title > '9 East Wind' and Section = 'real-estate-listings-homes'  and Status=4 and Posted < now() order by title asc limit 1]
		[SQL (0.001795): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where title < '9 East Wind' and Section = 'real-estate-listings-homes'  and Status=4 and Posted < now() order by title desc limit 1]
		[SQL (0.001851): select *,ID as thisid, unix_timestamp(Posted) as posted from textpattern where ID=29]
	</txp:jk_link_to_prev>
	<txp:jk_link_to_next cat=“home" showalways="1">
		[SQL (0.001849): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where title > '9 East Wind' and Section = 'real-estate-listings-homes'  and Status=4 and Posted < now() order by title asc limit 1]
		[SQL (0.001591): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where title < '9 East Wind' and Section = 'real-estate-listings-homes'  and Status=4 and Posted < now() order by title desc limit 1]
	</txp:jk_link_to_next>

Let me know what else you may need.

Funny, looking at the code ift defnitely is using section although the code I put in is:

<txp:jk_link_to_prev cat=“home" showalways="1">
<IMG SRC="/core_images/listing_prev.jpg" ALT="" align=top border=0>
</txp:jk_link_to_prev><txp:jk_link_to_next cat=“home" showalways="1">
<IMG SRC="/core_images/listing_next.jpg" ALT="" align=top border=0></txp:jk_link_to_next>

Thanks.

progre55

Last edited by progre55 (2007-04-26 17:04:23)

Offline

#22 2007-04-26 17:33:00

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Okay. I think I tracked down the error. Try version .35 (posted above).

Also, just to clarify, the plugin filters by section by default, and there is, at present, no way to override this behaviour. If you want it to show results from all sections, I would have to modify the code.

Offline

#23 2007-04-30 14:23:52

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Jeff:

Jeff:

Thanks for the update. One more (hopefully minor item) … is it possible to sort by a custom field … I would like the previous/next not to be limited to Title or date entered, but to be sorted by a custom field …

I tried sortby=“custom_1” with no success and also the same thing, but replacing the custom field with the actual name.

Any assistance would be greatly apprreciated.

Thanks.

progre55

Offline

#24 2007-05-01 07:30:00

Jeff_K
Archived Plugin Author
From: Vancouver, British Columbia
Registered: 2005-08-19
Posts: 202
Website

Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better

Hm.. sortby=“custom_1” should work. Does the field always have a value? Can you turn back on debugging and post the SQL queries again. Thanks.

Last edited by Jeff_K (2007-05-01 07:30:37)

Offline

Board footer

Powered by FluxBB