Filter by JomSocial Profile Being Viewed?

Presale questions & requests related to RAXO modules
forceacademy
Posts: 4
Joined: Mar 01, 2020 10:11 pm

Filter by JomSocial Profile Being Viewed?

Post by forceacademy »

Hello,

I'm trying to create a RAXO listing of articles submitted by one author as part of their JomSocial profile page. The idea is to show articles by the user of the profile being viewed. Is there a variable I can plug into RAXO to select that profile? Note: it should not display articles by the current logged in user; got that. It should display articles by the users whose profile is being viewed by another user. Any hope of this being possible?
Admin
Site Admin
Posts: 1523
Joined: Jan 31, 2010 9:53 pm
Joomla! version: 4.0.5
PHP version: 8.0

Re: Filter by JomSocial Profile Being Viewed?

Post by Admin »

I'm trying to create a RAXO listing of articles submitted by one author as part of their JomSocial profile page.
The idea is to show articles by the user of the profile being viewed.
I already did several approaches and thought about how to help solve your problem.

So far I want to say this:
1) Here you definitely have to seriously modify the module and add to it the ability to obtain information about the author from the JomSocial profile page.
2) The RAXO Related Articles module is much better suited for this task. In this module, a list of other articles is shown depending on the information on the current page being viewed.
3) In RAXO Related Articles there is already a function for determining the author of an article (Joomla Content Component). And then a search is made for other articles by this author and their display.
Note: it should not display articles by the current logged in user; got that. It should display articles by the users whose profile is being viewed by another user. Any hope of this being possible?
Here's the key point to understand how to get the author ID when viewing the JomSocial profile page. Perhaps you know how to do this or you have examples.
forceacademy
Posts: 4
Joined: Mar 01, 2020 10:11 pm

Re: Filter by JomSocial Profile Being Viewed?

Post by forceacademy »

Yeah, it seems like there needs to be a variable from Jomsocial or perhaps some way to parse the URL to pull out the profile name. I didn't see anything in source that would help that. There is a variable in the page source for the ID, but I didn't see a way to pass that to the RAXO module as a user name for listing articles.

Code: Select all

joms_base_url = 'https://www.forceacademy.us/';
joms_assets_url = '/components/com_community/assets/';
joms_script_url = '/components/com_community/assets/_release/js/';
joms_my_id = 41;
joms_user_id = 389;
joms_page = 'profile';
joms_prev_comment_load = +'10';
joms_use_tfa = false;
joms_gmap_key = '';
joms_maps_api = 'googlemap';
joms_videoplayer_native = 1;
joms_current_url = "https://www.forceacademy.us/index.php/user-tools/activity-stream/389-v/profile";
jQuery(function($){ initTooltips(); $("body").on("subform-row-add", initTooltips); function initTooltips (event, container) { container = container || document;$(container).find(".hasTooltip").tooltip({"html": true,"container": "body"});} });
jQuery(function($){ initPopovers(); $("body").on("subform-row-add", initPopovers); function initPopovers (event, container) { $(container || document).find(".hasPopover").popover({"html": true,"trigger": "hover focus","container": "body"});} });
This seems to be the chunk of code on the page where Jomsocial works out the profile and builds the URL containing the user name. There's a user ID there but not sure that can be used by RAXO.

I'll check the Related Articles, but would it parse the profile properly or does it search the whole article on the page for related words, which would cause it to pick up articles by other users?

Thanks for the help! Definitely a cool use case but not sure how to make it work.
forceacademy
Posts: 4
Joined: Mar 01, 2020 10:11 pm

Re: Filter by JomSocial Profile Being Viewed?

Post by forceacademy »

Hi there. Any further help on getting this to work? Is there a post-sales way to request help, as I purchased this package?
Admin
Site Admin
Posts: 1523
Joined: Jan 31, 2010 9:53 pm
Joomla! version: 4.0.5
PHP version: 8.0

Re: Filter by JomSocial Profile Being Viewed?

Post by Admin »

Is there a post-sales way to request help, as I purchased this package?
Yes, of course, you can count on our support within the declared capabilities of the module and its current functionality.

You must understand that your current request is beyond the scope of standard customer support.
Since it concerns the addition of new features to it and a serious revision of the module to your needs.

In this case, I can give you some recommendations, advice, my vision of how your task can be solved.
But do not rely on the fact that I will give you a ready-made solution, or a modified module for your task.
Be prepared to make the modifications you need yourself.
Admin
Site Admin
Posts: 1523
Joined: Jan 31, 2010 9:53 pm
Joomla! version: 4.0.5
PHP version: 8.0

Re: Filter by JomSocial Profile Being Viewed?

Post by Admin »

forceacademy wrote: May 15, 2020 2:09 pm Yeah, it seems like there needs to be a variable from Jomsocial or perhaps some way to parse the URL to pull out the profile name...
This seems to be the chunk of code on the page where Jomsocial works out the profile and builds the URL containing the user name. There's a user ID there but not sure that can be used by RAXO.
I looked at how similar is implemented in other JomSocial extensions. Here's some how to do it:

Code: Select all

<?php
jimport('joomla.filesystem.file');

// Include JomSocial Core Libraries only if they exist
$JSCore = JPATH_ROOT .'/components/com_community/libraries/core.php' ;
if (!JFile::exists($JSCore))
{
	return;
}
require_once($JSCore);


// Get JomSocial User
$JSUser = CFactory::getUser();

// Than provide JomSocial User ID to RAXO Related Module
$JSUser->id;
I'll check the Related Articles, but would it parse the profile properly or does it search the whole article on the page for related words, which would cause it to pick up articles by other users?
No RAXO Related Articles does not interact with the JomSocial profile yet. But this is not necessary, use the code above to get the JomSocial user ID and then it can be used in the module to search for Content Articles created by this user.
forceacademy
Posts: 4
Joined: Mar 01, 2020 10:11 pm

Re: Filter by JomSocial Profile Being Viewed?

Post by forceacademy »

Ok, great, and understood. I wasn't sure of direction to modify from the initial reply, and your help in the one above does get me going. Thanks, will try and report how it goes for info only!
Post Reply