solved jcore Lists that only show logged in users material?

alt=
@tettlingen
8 years ago
93 posts
Hi! A question:

Is it possible to make a jcore list (Via template code in site builder) and LIMIT the search results to ONLY show materials that belongs to a SPECIFIC LOGGED IN USER ?

I dont mean writing the user id number in the search parameters ,

BUT instead make the jamroom system aware of WHO is logged in and what quota they belong to.

So different lists on the same page, dependning on who is logged in - For the logged in users eyes only so to speak. (Like how the profile page is working.)

Can I just add some code before and after the site builder widges or in the template code and make this work? Kinda like: { if user is logged in} and {user id items] etc... (pardon my code)

Btw, I´m trying to make a NEW overview profile page in cooperation with the existing profile page. Thats whats this is all about. One official and one for the users eyes only.

Kindest regards

BTW, I am sorry for all the forum requests the past couple of days, I´m really trying to go live really soon with my site, and I hope I´m not forcing you guys to work overtime... Sorry, ;/ Thank you....


updated by @tettlingen: 12/22/16 11:55:59AM
paul
@paul
8 years ago
4,331 posts
Unfortunately, searching for items of online users isn't supported directly in Jamroom. I can only suggest some custom template code that would first detect all online users then add them specifically to the search jrCore_list call. The code below isn't very elegant but works and in this example searches for the videos of logged in users -

{$_online = jrUser_session_online_user_info()}
{$pids = ''}
{if is_array($_online) and count($_online) > 0}
    {$_tmp = array()}
	{foreach $_online as $online}
        {$_tmp[] = $online['session_profile_id']}
    {/foreach}
    {$pids = implode(',', $_tmp)}
{/if}
{jrCore_list module="jrVideo" search="_profile_id IN `$pids`"}
hth


--
Paul Asher - JR Developer and System Import Specialist
alt=
@tettlingen
8 years ago
93 posts
Wow Paul! Thanks a million, that was exactly what I was looking for! :)

This is gonna work perfectly
Thanks
Regards

Tags