Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2007-11-26 13:15:14
- 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.
You couldn’ be more correct. I will be able to give you feedback later today. I apologize for the delay, but some unexpected things occurred which caused delays. Again, I apologize and I DO greatly appreciate the effort. I will respond with feedback later today.
progre55
Me again:
Jeff, I have a probably dumb question, but I want to make sure I do things properly for testing purposes and also do not want to effect the current site that I have using the plug in.
What is the easiest way to test your recent version without “messing” up the other version of the plug in just in case. I guess what I am saying is, do I need to uninstall the old version and then load the new version to test? Can I have two versions of the same plug in TXP loaded, but only activate the one I want to use or test? Just let me know your thoughts and I will test away …
Again, I truly apologize for the delay in looking at your code ….
Last edited by progre55 (2007-11-26 22:42:49)
Offline
#62 2007-11-29 19:56:06
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Jeff, is it possible that jk_neighbour takes the date of last modification into consideration, if the dates of creation of all articles concerned are equal down to the second? If so, could you please post the accordant line of code here for me to understand what it does? Thanks!
As I posted some months ago I’m using identical timestamps for some articles in order to hide them away from jk_neighbour. And I’m wondering which rule jk_neighbour uses to choose the picture article it accesses.
Last edited by uli (2007-11-30 23:50:03)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#63 2007-11-29 20:22:04
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Aah! Found it out: it’s got to be the article ID. Nevertheless, could you please point me to the line which causes this? There’s way to much occurences of ID in the code.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Just seeing this. I will take a look, and get back to you by the end of the day.
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Sorry, been really busy.
progre55, I don’t think TXP will let you install two versions of the same plugin. I think you have tio install the new version, test it, then reinstall the old one (link on first page) if it doesn’t work. I guess this assumes you aren’t testing it on a production site….
uli, To be honest, I never saw your original post. Good work! That looks cool! As far as how the posted date effects sorting, I am not exactly sure what you are asking. The main jist of the plugin happens with the jk_getNextPrev and jk_getneighbour functions. This could probably be totally cleaned up, but because it was just meant to be an addon to existing TXP code, I didn’t write the functions that way.
How are you sorting your articles? What is the code you are using to output the plugin?
Anyway, the pertinent lines in jk_getneighbour are:
$q = array(
"select ID, Title, url_title, unix_timestamp(Posted) as uposted
from ".PFX."textpattern where $sortby",
($s!='' && $s!='default') ? "and Section = '".doSlash($s)."'" : filterFrontPage(),
$cat,
"and Status=4 $posted order by $sortby",
($type=='<') ? 'desc' : 'asc',
'limit 1'
);
Offline
#66 2007-12-13 03:35:04
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Ah, OK, Jeff! I see where I could have been a little more precise. And thanks for posting the relevant part, though I think this is way to difficult for my current knowledge level.
But alright, I’ve asked the second part of my question for a non-tech user (the artist), in order to avoid any malfunction source.
I’m using sortby=“posted”: <txp:jk_link_to_next cat="current" sortby="posted">
.
If I give a group of articles exactly the same timestamp down to the second, then jk_neighbour does only display one article for this group [Edit: which is the desired behavior!]. If the visitor clicks “next”, the first article with a different timestamp is displayed, not another one of the group. That way the articles with identical timestamps seem to hide from jk_neighbour behind the “first in their row”.
My question is, which criterion does jk_neighbour use to choose the first in the row?If all dates match the displayed article’s date, is there a second criterion I could make use of? In most of all cases jk_neighbour seems to use the article ID as the second criterion, but sometimes there are results that are out of place of this rule: among a stack of five date-identical articles jk_neighbour then chooses f.i. the article with the second or fifth ID to display it.
In order to be understood: it never changes it’s behavior on the same group of articles, behavior only varies for different groups of articles, and I can’t predict where. Which I wish I could, of course.
I hope this is a little clearer, though I fear today I’m only placing english words around german sentences ;) Sorry for that.
Last edited by uli (2007-12-15 21:40:47)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#67 2008-04-23 00:04:25
- sethexis
- Member
- Registered: 2008-04-16
- Posts: 10
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Has anyone modified jk_neighbour to use the category information from rss_unlimited_categories instead of just polling the information in category1?
Would this be difficult to do?
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
How does rss_unlimited_categories store data?
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
In a separate table that contains article <=> category combinations.
Offline
#70 2008-04-28 18:52:16
- sethexis
- Member
- Registered: 2008-04-16
- Posts: 10
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Instead of querying rss_unlimited_categories, is there a way to get this plugin to search the keywords field?
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Can jk_neighbour take a class attribute? I’d like to style these next/previous links a bit differently…
I’d hack it myself, but I’m a little pressed for time. Ideas?
Offline
Re: [plugin] [ORPHAN] jk_neighbour: just like link_to_next/prev, only a bit better
Try http://jeffkhonsary.com/plugindev/jk_neighbour.php just add the atts attribute like <txp:link_to_next atts=’ class=“className”’ />. Let me know if that works for you. Too busy to test right now…
Offline