CB content module and user not retrieved

12 years 5 months ago - 12 years 5 months ago #185205 by activha
Well this time I am trying to use the CB content module to retrieve the content of a tab displaying a user which is not the logged in user.

I have written [cb:usertab tab="62" user="694" /] but the module does only show the content of the logged in user and not the 694 one.

Our remote developer wrote the plugin code using this :
$CB = new CB;
         $userid = JRequest::getVar('user');         
         $sUsername = CB::getUsernameByID($userid);
         if(!$sUsername){
             $sUsername = JFactory::getUser()->username;
         }

With this function in CB.class.php :
function getUsernameByID($iUid) {
        $oDB = JFactory::getDBO();

        $sQuery = 'SELECT username FROM #__users WHERE id = ' . $iUid;
        $oDB->setQuery($sQuery);
        $sUsername = $oDB->loadResult();

        return $sUsername;
    }

so I changed the line
$userid = JRequest::getVar('user');         
         }
for
$cbUser =&	CBuser::getInstance( $user->id );
 			if ( ! $cbUser ) {
			$cbUser	=&	CBuser::getInstance( null );
			}
			$user =&	$cbUser->getUserData();
        	$userid = $user->id;
and now everything seems better, is that correct ?

Please Log in to join the conversation.

12 years 5 months ago #185209 by activha
Replied by activha on topic Re: CB content module and user not retrieved
I follow on the first question with a second one:

Would it be possible to add a php request in the substitution like
[cb:usertab tab="62" user="<?php something here ?>" /]

We will use this module within a Facebook page iframe and we need to find out the userid by testing the Facebook id being displayed

Please Log in to join the conversation.

12 years 5 months ago #185246 by krileon
Replied by krileon on topic Re: CB content module and user not retrieved

I have written [cb:usertab tab="62" user="694" /] but the module does only show the content of the logged in user and not the 694 one.

Please try the below to render the tab as substitution.

[cb:usertab tab="62" user_id="694" /]

Our remote developer wrote the plugin code using this :


Don't know where the PHP is coming from, did you edit the module? Please do not implement hacks to the module, they're not necessary.

Would it be possible to add a php request in the substitution like
[cb:usertab tab="62" user="<?php something here ?>" /]

No.

We will use this module within a Facebook page iframe and we need to find out the userid by testing the Facebook id being displayed

I recommend you develop a custom landing page that has no integration with Joomla expect through database queries. Keep in mind your canvas page will have access to Facebooks JS API, which is ideally what you should only be utilizing. They did not design canvas pages to load iframes of websites into them. They were designed for loading Facebook applications off-site (reduces load on their server).

Based off previous thread understood you wanted to just load your site as iframe and be done with it. Interacting with Facebook as well is going to require you to do a lot of edits to your site and probably breaking it when outside of Facebook. Canvas pages grant the page being loaded access to Facebooks JS API, which is what your landing page would utilize to get Facebook user information.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 5 months ago #185251 by activha
Replied by activha on topic Re: CB content module and user not retrieved
Ok do you know where we could hire someone with such skills ?
this would go way beyond our abilities :-)

Please Log in to join the conversation.

12 years 5 months ago #185257 by krileon
Replied by krileon on topic Re: CB content module and user not retrieved

Ok do you know where we could hire someone with such skills ?

As it isn't really Joomla related I've no idea. Joomlancers is typically what I recommend, but you need someone specifically skilled in PHP, JS, and Facebook API and not so much in Joomla.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.236 seconds

Facebook Twitter LinkedIn