db join filter current user

Status
Not open for further replies.

prophoto

Active Member
I am having trouble getting the databasejoin element to filter the current user's records from another table. I have one list with a business listing to be submitted by a user. I've now setup a second list to be used in a calendar view. I want the calendar record to link to the business record. I've tried a few where clauses but get errors on all of them, can you help?

guide is table, User is field storing user id.

WHERE guide.User = {$my->id}
 
guide is the table the dbjoin is pointing to?
Try WHERE {thistable}.User ={$my->id}
(see tooltip of the "Joins Where...." field)
 
Ok one hiccup in WHERE {thistable}.User ={$my->id}. How do I apply this ONLY to Registered NOT Special users?
 
Hi
How do I make this show up as a link to the details page in the other list instead of just a name?
Not sure what you mean here, could you expand somewhat?
Ok one hiccup in WHERE {thistable}.User ={$my->id}. How do I apply this ONLY to Registered NOT Special users?
Set the 'apply where to' option to registered.
 
Not sure what you mean here, could you expand somewhat?
Yes. I have two lists, the user must enter data into list1 before they can enter it into list2. I want list2 to reference list1 in a field, hence this db join. Currently I have this set to the title field in list1, but instead of just listing the title I want a link to the details page of the list1 record.

Set the 'apply where to' option to registered.
I have it set as specified but it still filters the results. I want admins or special groups to be able to link any list1 record but registered users only able to link to their own list1 records. I just tested the code below and SA can only see records in list1 created by that user, none from other users.

whereto.JPG
 
but instead of just listing the title I want a link to the details page of the list1 record.
Hmm, not sure the best way of doing that - you could write some js to observe the change event on the dropdown and then redirect the browser using the dropdown value as part of the URL
I have it set as specified but it still filters the results
I would imagine then that your Joomla Access control levels are set so that the Special acl has public selected. This isn't the case for my typical set up - see http://screencast.com/t/tFpS5vYsCVY2
 
Hmm, not sure the best way of doing that - you could write some js to observe the change event on the dropdown and then redirect the browser using the dropdown value as part of the URL
Is that included in my subscription :). Obviously this would only apply to the details page, not the edit page.

I would imagine then that your Joomla Access control levels are set so that the Special acl has public selected. This isn't the case for my typical set up - see http://screencast.com/t/tFpS5vYsCVY2
I don't remember changing this - the issue was registered users had Managers and SU selected, hopefully this doesn't mess anything else up too.
 
Is that included in my subscription :). Obviously this would only apply to the details page, not the edit page.
What if we ADDED the link next to the business name (in another field?) instead of REPLACING the name, would that make it easier?
 
It would really help if we could log in to your site. These kinds of discussions get really hard to track from our side of the fence, when we're having to just picture it all in our heads, and most of the time rebuild that mental picture every time we come back to any given thread (by reading through the entire thread again), instead of being able to just fire up a browser and see it on your site. And then quite often we find that evertyone in the discussion has a completely different mental picture.

So for instance, I'm now confused because Rob is talking about a change event in a dropdown, and you are talking about a detail view ... which wouldn't have a dropdown with a change event ... because ... well, it's not a form ...

-- hugh
 
Not sure where he got the idea of form page...I guess I wasn't clear. Its only for the details page.

How do I send a pm?
 
Not sure where he got the idea of form page...I guess I wasn't clear. Its only for the details page.

Yup, that''s why it makes it a lot simpler if can all be looking at the same thing.

Can you fill in your My Sites, rather than sending PM's? That way, the details are where we need them, when we need the, so we can just click on that link by your name in your posts, and don't have to go hunting through mailboxes to find the details.

-- hugh
 
Hello
THe mysites section is not public - its only visible to you, Hugh and myself
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top