Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • @commium

    Participant

    God daaaaamn it work !!!!!!

    function dashboardStats($member_group_ids = NULL) {
    
    	$member_group_ids = groups_get_user_groups(get_current_user_id());
    	
    	foreach( $member_group_ids["groups"] as $id ) { 
      	$group = groups_get_group( array( 'group_id' => $id) );	
      	echo '<pre>';		
      	var_dump( $id );	
      	echo '</pre>';
    	}
    
    	$setting = groups_get_groupmeta( $id, 'entreprise_statistiques_setting' );
    	$setting2 = groups_get_groupmeta( $id, 'entreprise_statistiques_setting2' );
    	
    
    	?>
    
    	<div id="stats">
    		<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    	</div>
    
    	<?php
    			if ($setting == NULL) {
    			echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    		}
    
    	if (isset($setting))
    	{
    		echo ("test");
    		} else {
    			echo ("notest");
    		}
    		var_dump($setting);
    		var_dump($setting2);
    	}

    I added new function, you touched me by saying “You should probably hire a developer”, so i searched 😀
    Thanks again my friend for your help ! it’s soooo peaceful to solve a problem..

    @commium

    Participant

    Ok i understand now ! problem solved thanks 😉

    @commium

    Participant

    i used this code on an other page (dashboard) to display the stats functionnality but it didn’t worked..

        function display2( $member_group_ids = NULL ) {
    		$setting = groups_get_groupmeta( $member_group_ids, 'entreprise_statistiques_setting' );
    		$setting2 = groups_get_groupmeta( $member_group_ids, 'entreprise_statistiques_setting2' );
            $member_group_ids = groups_get_user_groups(bp_loggedin_user_id());
    		?>
    		<div id="stats">
    		<script>StatHatEmbed.render({s1: '<?php echo($setting); ?>', w: 760, h: 235, tf:'month_compare', style:'fill', title:'<?php echo($setting2); ?>'});</script>
    		</div>
    
    		<?php
    		
    		if ($setting == NULL) {
    			echo ("Aucun site internet détecté, merci de contacter l'équipe COMMIUM.");
    		}
        }
    echo display2();

    @commium

    Participant

    Thanks @shanebp for informations, i tried with $member_group_ids, it’s take the good user group id but it’s didn’t take the $setting and $setting2 variable, they are empty but in group page they aren’t.. i don’t know why.

Viewing 4 replies - 1 through 4 (of 4 total)
Skip to toolbar