php code in shortcode

Hello,

I am using buddypress and I am using formidable to replace the profile fields.  Each member has a personal profile page and I need to have the custom display show on each members profile.

<?php bp_displayed_user_username() ?> this displays the username which is used to identify the profile page that is being shown.

I need this added to the php version of the shortcode so it will display my form properly.  This can be done using the user_id=<?php bp_displayed_user_username() ?> in the shortcode.

I am not sure the exact code to make this work because this doesn’t work.

<?php echo do_shortcode(‘[display-frm-data id="2" filter="1" user_id=". $bp_displayed_user_username() ."]‘); ?>

This is another attempt.

Please help me.

Core

I have also tried:   <?php echo FrmProDisplaysController::get_shortcode(array(id => '2' , user_id => '.  bp_displayed_user_username() .' )); ?>

It's best to use the php version of the shortcode if you are inserting php into it.
http://formidablepro.com/knowledgebase/insert-a-custom-display/

echo FrmProDisplaysController::get_shortcode(array('id' => 2, 'filter' => 1, 'user_id' => bp_displayed_user_username_id()));

This is the entire file for the page... is there something that I am doing wrong?

 

<?php do_action( 'bp_before_profile_loop_content' ) ?>

<?php echo FrmProDisplaysController::get_shortcode(array('id' => 2, 'filter' => 1, 'user_id' => bp_displayed_user_username_id())) ?>
<?php do_action( 'bp_after_profile_loop_content' ) ?>

 

there is something breaking the code, the footer does not show up with this.

If I use this:

<?php echo FrmProDisplaysController::get_shortcode(array('id' => 2, 'filter' => 1, 'user_id' => bp_displayed_user_username() )); ?>

The username shows on 1 line.  Then the form results display below that, but for the wrong entry.

I ended up being able to solve this using:

<?php
echo FrmProDisplaysController::get_shortcode(array('id' => 2, 'filter' => 1, 'user_id' => bp_displayed_user_id())); ?>

 

 

Topic closed.