Skip to Content Skip to Menu

Plugin API Newbie/How To Get MultiSelect Values

18 years 1 month ago #20182 by Weatherangel
So I've been going through the CB API, and at least the version that I have (CBRC2b10-bb_API.pdf) leaves a bit to be desired, especialy in the area of integrating with other components...

I currently have a component that I am moving from PHPNuke over to Joomla, and thought that CB would be the perfect way to integrate the needed fields for ease of management. I already have the fields and values set up in Community Builder under their own tab(s), HOWEVER, I am at a loss for the "right way" to find the values of a multi-select field. I see the delimiter is |*|, however, is there already a function which would pull the values for me? I don't even know where to start looking for that information other than the documentation which did not seem to carry my answer. 1.10.2 says Prefered way: clean API -- which is also my prefered way...

I'm trying to convert this, using the API:
[code:1]
SELECT nuke_users.*, gs_troop_member_types.type_id, gs_troop_reference.user_id
FROM nuke_users, gs_troop_member_types, gs_troop_reference
WHERE gs_troop_member_types.type_code = 'SUSSM'
AND gs_troop_reference.member_type_id = gs_troop_member_types.type_id
AND nuke_users.user_id = gs_troop_reference.user_id
[/code:1]

If I hardcoded it, my new query would probably look like this:
[code:1]
$memberType = $database->setQuery("
SELECT #__comprofiler.cb_sumembertype
FROM #__comprofiler
WHERE #__comprofiler.user_id = ".$my->id);

// -- loadObjectList goes here --

$ids = array();
($ids) = split('|*|',$memberType);

if (in_array('SUSSM',$ids)) { ... }

[/code:1]

I could easily hardcode the queries to just call the data that I need from the CB tables, but I want to be able to release this when I'm done converting it over. For the curious, this is a Cooke Sale/Site Sale management system that I wrote for the Girl Scouts 4 years ago now which could actually be used for other types of sales, and incentive programs for NFP organizations.

Anyway, any help would be greatly appreciated!

Thanks!

1 4M N0T 4 G33K!
1 4M N0T 4 G33K!
1 4M N0T 4 G33K!
--
0K 1 4M

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum