Home › Forums › Legacy Support › Support queries › Other issues › Add custom user field in Administration Download Reports course stats
- This topic has 11 replies, 3 voices, and was last updated 3 years, 6 months ago by Veronica.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
September 6, 2020 at 3:22 pm #301233JMG-Solutions_828ParticipantHello, I’ve followed the following thread https://wplms.io/support/knowledge-base/add-custom-user-field-in-download-course-stats/ But when I download the report it comes without the "custom user fields". Please, how can I solve this? The Code I used in customizer_class.php
Thank you again. Best regards, George<?php if(!class_exists('WPLMS_Customizer_Plugin_Class')){ class WPLMS_Customizer_Plugin_Class{ public function __construct(){ function add_custom_course_stat($list){ $new_list = array( 'user_field4'=>'4', 'user_field1'=>'1', 'user_field10'=>'10', 'user_field11'=>'11', 'user_field13'=>'13', 'user_field15'=>'15', 'user_field16'=>'16', 'user_field18'=>'18', 'user_field2'=>'2' //add another element like same above 'user_field3'=>'Gender' ); $list=array_merge($list,$new_list); return $list; } function process_custom_course_stat(&$csv_title, &$csv,&$i,&$course_id,&$user_id,&$field){ if( strpos($field, 'user_field1') === false && strpos($field, 'user_field2') === false)//if another field please include it here like this if( strpos($field, 'user_field1') === false && strpos($field, 'user_field2') === false && strpos($field, 'user_field3') === false) return; if($field == 'user_field4'){ $title=__('Name','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '4'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field1'){ $title=__('Code','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '1'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field10'){ $title=__('Degree','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '10'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field11'){ $title=__('Unit','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '11'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field13'){ $title=__('Title','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '13'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field15'){ $title=__('Manager Number','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '15'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field16'){ $title=__('Manager Name','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '16'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } if($field == 'user_field18'){ $title=__('Job Name','vibe'); if(!in_array($title,$csv_title)) $csv_title[$i]=$title; $ifield = '18'; if(bp_is_active('xprofile')) $field_val= bp_get_profile_field_data( 'field='.$ifield.'&user_id=' .$user_id ); if(isset($field_val) && $field_val) $csv[$i][]= $field_val; else $csv[$i][]= 'N.A'; return; } } // END public function __construct } // END class WPLMS_Customizer_Class } // END if(!class_exists('WPLMS_Customizer_Class')) ?>
September 6, 2020 at 3:23 pm #301234JMG-Solutions_828ParticipantThis reply has been marked as private.September 7, 2020 at 7:38 am #301331JMG-Solutions_828ParticipantHello, Also when I download the report the Arabic is coming in stranger language. ThanksSeptember 7, 2020 at 1:36 pm #301466Anshuman SahuKeymasterThis reply has been marked as private.September 15, 2020 at 3:09 am #310765JMG-Solutions_828ParticipantThis reply has been marked as private.September 15, 2020 at 11:56 am #311015VeronicaModeratorThis reply has been marked as private.September 16, 2020 at 7:44 am #311276JMG-Solutions_828ParticipantThis reply has been marked as private.September 17, 2020 at 11:46 am #311686VeronicaModeratorThis reply has been marked as private.September 26, 2020 at 8:02 am #314136JMG-Solutions_828ParticipantThis reply has been marked as private.September 28, 2020 at 2:20 pm #314575VeronicaModeratorThis reply has been marked as private.September 28, 2020 at 4:52 pm #314610JMG-Solutions_828ParticipantThis reply has been marked as private.September 29, 2020 at 10:42 am #314802VeronicaModeratorhi, as I have mentioned your theme is on version 4 but the plugins are on version 3 site is not configured properly and also pdf certificate version is very old the theme version is version4! and plugins are not on version4! please complete the setup first http://prntscr.com/upvm5g this is the main part to activate the version 4 for that you need to disbale the plugins as shown in the notice and activate the plugins which are necessary for version 4 that is vibebp and wplms plugin no more need to activate the plugins which are shown in the notice please check this if installing fresh wplms4:https://www.youtube.com/watch?v=KTT2a-L3F8o if you are updating the theme then follow: https://www.youtube.com/watch?v=Q_x-HOMItL8 please make sure that you have followed the tip properly NOTE: we never suggest any user go for such a big update on the running site with live users -
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)
- The topic ‘Add custom user field in Administration Download Reports course stats’ is closed to new replies.