solved Exclude an item from jrCore_list using search param

SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
I'm trying to list things but exclude a specific id:
{jrCore_list module="jrAudio" template="jrAudio_item_list.tpl" limit="3" search1="_profile_id = `$item.profile_id`" search2="_item_id != `$_post['_1']`"}

But that gives the error:
Quote: CRI: Query Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '29'' LIMIT 3' at line 3

search2="_item_id != `$_post['_1'] `" is the problem.

I've tried many ways but always get an error if I try excluding a specific id. Should this be working (the dev site is a couple of releases behind current), or is there another way?

Thanks


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 03/31/14 03:07:22AM
michael
@michael
11 years ago
7,772 posts
The problem is that this:
{jrCore_list module="jrAudio" limit="3" search1="_item_id != 1"}
translates into this:
SELECT SQL_SMALL_RESULT DISTINCT(a.`_item_id`) AS _item_id FROM jr_jraudio_item_key a
WHERE a.`key` = '_item_id' AND (a.`value` != '1' OR a.`value` IS NULL)
LIMIT 3 

running that in phpmyadmin returns no results. The reason is _item_id is not a key

If you pick any of the keys it should work.
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Thanks Michael, so it isn't possible to exclude specific items?


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
11 years ago
7,772 posts
currently no. but it does seam like it should work. For right now you can use any of these:
(screenshot)
updated by @michael: 02/05/14 02:46:53AM
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Maybe I can search and check the item id in the image name and require an image.

It would be very useful to be able to exclude an id. I wanted to load a list of other songs by the profile (ie not the song being displayed) but that doesn't seem an easy possibility.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,148 posts
Yeah this seems like it should work, and in a way is a bit of an oversight. I'll see about getting support added for _item_id into the core.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
OK, Thanks Brian and Michael!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Just wondering if support for _item_id is likely to arrive in the next couple of weeks or if it's likely to take longer.

My usage ajaxes a next item on request using jrCore_list, but will need to be changed if it's just going to ajax in the same item again.

It's not urgent, but I need to say something to the client if the current design isn't going to work.

Thanks


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,148 posts
Sorry - I should have updated this that with testing I'm not seeing any issues searching by _item_id - i.e.:

{jrCore_list module="jrAudio" search="_item_id = 120" limit="1"}

This is working for me.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,148 posts
Re-reading this is it that it's not working with != ?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Yes, it's when trying to exclude an item:
 ... search1="_profile_id = `$item.profile_id`" search2="_item_id != `$item._item_id`"

Quote: CRI: Query Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2''
AND c.`value` < 1393434953
LIMIT 10' at line 4



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,148 posts
Sorry Steve - I've got this on my todo list now - for some reason I never added this earlier so it got overlooked. I'll get it fixed up here.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Wonderful! Thanks Brian :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,148 posts
This should be working now in jrCore 5.1.25. Let me know if you see any issues.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Looks good, Thanks Brian!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,148 posts
SteveX:
Looks good, Thanks Brian!

Right on - glad to hear it.

Thanks Steve!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
11 years ago
1,022 posts
you guys are good!!

Tags