Thanks Krileon, I've gone through those api's and am able to pull the actual field using the api setup, but still just for the logged in user, it still shows the logged in user's values on other profiles as well. I guess what I was asking before is how to get the field values to show for the profile owner instead of the logged in user.
I'm assuming the problem here lies in the fact that I'm using a jquery pagination script to put these fields in. Even though it's sitting in a tab on the user's profile I'm guessing the issue lies with it being external from the actual profile and therefore when it does a user check it just pulls the logged in user's values, but maybe I'm wrong on that. The way I read it in the api the $cbuser check should determine if the profile you're viewing is your own or someone else's and then serve up the appropriate values in a normal situation but in this case there is no way to associate the content in the script with the actual user id of the profile owner. Or I could just be using the wrong method to define the $cbuser. Here's how I'm doing this with the api method:
[code:1]
<?php global $_CB_framework, $_CB_database, $ueConfig, $mainframe, $_SERVER;
$myId = $_CB_framework->myId();
$cbUser =& CBuser::getInstance( $myId );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$user = $cbUser->getUserData();
if ( ! $user ) {
return;
}
$query = "SELECT username FROM jos_users WHERE id = ". (int) $_CB_framework->myId();
$_CB_database->setQuery( $query );
$username = htmlspecialchars( cbUnHtmlspecialchars( $_CB_database->loadResult() ) );
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' );
}
cbimport( 'cb.database' ;
function getField( $fieldName, $defaultValue = null, $output = 'html', $formatting = 'none', $reason = 'profile', $list_compare_types = 0 ) {};
$cb_aboutme = $cbUser->getField( 'cb_aboutme', null, 'html', 'none', 'list' );
$cb_interests = $cbUser->getField( 'cb_interests', null, 'html', 'none', 'list' );
$cb_edhs = $cbUser->getField( 'cb_edhs', null, 'html', 'none', 'list' );
$cb_edhsclass = $cbUser->getField( 'cb_edhsclass', null, 'html', 'none', 'list' );
$cb_ed = $cbUser->getField( 'cb_ed', null, 'html', 'none', 'list' );
$cb_eddegree = $cbUser->getField( 'cb_eddegree', null, 'html', 'none', 'list' );
$cb_activities = $cbUser->getField( 'cb_activities', null, 'html', 'none', 'list' );
$cb_books = $cbUser->getField( 'cb_books', null, 'html', 'none', 'list' );
$cb_music = $cbUser->getField( 'cb_music', null, 'html', 'none', 'list' );
$cb_movies = $cbUser->getField( 'cb_movies', null, 'html', 'none', 'list' );
$cb_tv = $cbUser->getField( 'cb_tv', null, 'html', 'none', 'list' );
?>
[/code:1]
Maybe what I should really be asking here is how to identify the jquery script content with the profile that it's showing in? Maybe I need to include some extra stuff in the php to link it to the profile url it's being viewed in? I've gone through the cb api pdf as well but haven't really found anything regarding this.
I did glance at the cb content bot but wasn't sure if that would work in this situation since it's not actually a content section piece, however I thought I would ask u about it.
Post edited by: sfraise, at: 2010/11/27 20:12