external component integration

13 years 1 month ago - 13 years 1 month ago #160454 by rplc
external component integration was created by rplc
Hi guys,

I'm devoloping a component for Joomla 1.6. At the moment I've got two problems with the Community Builder integration.

1. I want to create links in my component to userprofiles with help of the userid.
Is there any way to do this?
I just found the solution to link a userlist in the menu an link the userprofile with the alias of the menu element. But I want to use the link universal, without any menualias.
E.G.: .../index.php/menualias/userprofile/42

2. I've got to modify the userprofile. I've to add a php/mysql query with the help of the profile-userid.

Can anyone help me with these problems?

Thx for reading
Greetz Alex

Please Log in to join the conversation.

13 years 1 month ago - 13 years 1 month ago #160463 by krileon
Replied by krileon on topic Re: external component integration

1. I want to create links in my component to userprofiles with help of the userid.
Is there any way to do this?

Yes, first please review tutorials within my signature concerning including CB API externally. Once done you can use the below to obtain a user profile URL.
$specific_view	=	$_CB_framework->viewUrl( TASK, HTMLSPECIALCHARS );
$profile_view	=	$_CB_framework->userProfileUrl( USER_ID, HTMLSPECIALCHARS );
$profile_edit	=	$_CB_framework->userProfileEditUrl( USER_ID, HTMLSPECIALCHARS );
$userlist	=	$_CB_framework->userProfilesListUrl( LIST_ID, HTMLSPECIALCHARS );

Replace TASK with thing such as login, register, logout, etc.. Replace HTMLSPECIALCHARS with true or false if you want the URL htmlspecialed. Replace USER_ID with the actual users ID. Replace LIST_ID with the lists actual ID.

2. I've got to modify the userprofile. I've to add a php/mysql query with the help of the profile-userid.

This can be done by utilizing CB triggers after loading CB API. See triggers tutorial for details on trigger usage.


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.

13 years 1 month ago #160490 by rplc
Replied by rplc on topic Re: external component integration
Hi,

I've tried to include the code like this:
global $_CB_framework, $mainframe;
 
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
	if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
		echo 'CB not installed!';
		return;
	}
 
	include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
	if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
		echo 'CB not installed!';
		return;
	}
 
	include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
and this:
$_CB_framework->userProfileUrl( $rows[$i]->autorid, true )

Is this the right way?
But I've got the following Error Message:
Fatal error: Call to a member function setQuery() on a non-object in C:\www\xampp\htdocs\joomla-16\administrator\components\com_comprofiler\plugin.foundation.php on line 53

Please Log in to join the conversation.

13 years 3 weeks ago - 13 years 3 weeks ago #161637 by rplc
Replied by rplc on topic Re: external component integration
Can you please help me one more time?

I don't get where my error is...


Thanks
Greetz rplc

Edit:
Sry I solved my problem...
I forgot to import the cbplugin...
cbimport( 'cb.plugins' );

Thx for helping greetz rplc

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.429 seconds

Facebook Twitter LinkedIn