Welcome, Guest
Username: Password: Remember me
Feature requests for JEM 2.0 - initial public release

TOPIC:

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27351

  • sepp25
  • sepp25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 2
@bluefox
Thank you in advance.
This field cb_stimme is a custom field (text) in table comprofiler.
Sorry I skiped a line in the SQL: it is a field of type "select" in CB but it contains text.

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

Last edit: by sepp25.

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27355

did see you had a post here in the forum a while back: www.joomlaeventmanager.net/forum/feature...40-list-of-attendees so will try to work something out this weekend.
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

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

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27370

Hi Sepp,

not sure if i did understand it correctly but is it correct that you're adding users as attendees in backend and that you want the vocal to appear? Attachend an image of vocal column in backend.

It's with JEM 2.3.0 and Joomla 3
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
Attachments:

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

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27371

For the exampel above i didn't use community builder. This as i don't want to subscribe for it.

So i tried the custom fields and then in particularly the fields that can be added to users.
  • A field type was added as List and then the values were added
  • withen the user-profile the value was selected
  • the some code in jemhelper and attendees table to display the value



Attendees-view
/views/attendees/tmpl/default.php (backend)
<th><?php echo 'Vocal'?></th>  // better to use a text string
...........
<td><?php echo JemHelper::getAttendeeVocal($row->uid); ?></td>


As you see it will call the jem helper

JEM Helper
components/com_jem/helpers/helper.php (frontend)
	static public function getAttendeeVocal($userId) 
	{
	    if (empty($userId)) {
	        return false;
	    } else {
	        JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
	        $currentUserFields = FieldsHelper::getFields('com_users.user', null , true);
	        
	        $vocalField = array();
	        $fieldId = null;
	        foreach ($currentUserFields AS $field) {
	            
	            if ($fieldName = "vocals") {
	                $vocalField[] = $field->id;
	                $fieldId = $field->id;
	            }
	        }
	        
	        $model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true));
	        
	        $vocalValue = $model->getFieldValues($vocalField,$userId);
	        $vocalValue = implode(', ', $vocalValue);
	        return $vocalValue;
	    }
	}


As you see in the code it's checking for a specifc fieldttype "vocal". Ofcourse you can name it to anything you want.


This solution is maybe a bit tricky and maybe a bit need to change. it's not using data by CB but well it's a solution.
Not sure if all users in comprofiler are stored in Joomla users table?. If you have a lot users i guess it might be a problem to fill in the value for every user but well.


Will take a further look in the weekend.
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
Attachments:

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

Last edit: by Bluefox. Reason: typo

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27372

As it's custom added there probably won't be any info send by mail.

Do you want to have it visible in front? and should something be send by mail?
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

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

[SOLVED] Getting Information of Attendee from Community Builder (comprofiler) 2 years 8 months ago #27373

@Bluefox: can you PM me why you don't want to subscribe for CB? I am interested.
Jojo

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

Time to create page: 0.529 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......