2

Together with https://www.codementor.io/@robertverdes

we fixed the activity stream compatibility issue between DIVI and BuddyBoss -- it was showing shortcodes. The change is to be made in the buddyboss-theme/buddypress/activity/entry.php file.

'''
<div class="activity-inner"><?php 
            $res=preg_replace('#\[[^\]]+\]#','',bp_get_activity_content_body());
            $pos=strpos($res,"[");
            if($pos>0){
                $posEnd = strpos($res,"&hellip;",$pos);
                if($posEnd>$pos){
                    $replaceStr=substr($res,$pos,$posEnd-$pos);
                    $res = str_replace($replaceStr,"",$res);
                }
            }
            echo $res;
            
            ?></div>
'''

2 Answers2

0

NOTE: there are likely better (cleaner/safer) ways, but it wasn't worth spending time to analyze the whole plugin to find the right spot...

Oh, also, the search feature still shows shortcodes, so that needs to be fixed as well

buddyboss-platform\bp-templates\bp-nouveau\buddypress\search\loop\activity.php

0

this is the new search activity.php file

'''
<li class="bp-search-item bp-search-item_activity <?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>" data-bp-activity-id="<?php bp_activity_id(); ?>" data-bp-timestamp="<?php bp_nouveau_activity_timestamp(); ?>">
    <div class="list-wrap">
        <div class="activity-avatar item-avatar">
            <a href="<?php bp_activity_user_link(); ?>">
                <?php bp_activity_avatar( array( 'type' => 'full' ) ); ?>
            </a>
        </div>

        <div class="item activity-content">
            <div class="activity-header">
                <?php echo bp_get_activity_action( [ 'no_timestamp' => true ] ); ?>
            </div>
            <?php if ( bp_nouveau_activity_has_content() ) : ?>
            
            
            <div class="activity-inner"><?php 
            $res=preg_replace('#\[[^\]]+\]#','',bp_get_activity_content_body());
            $pos=strpos($res,"[");
            if($pos>0){
                $posEnd = strpos($res,"&hellip;",$pos);
                if($posEnd>$pos){
                    $replaceStr=substr($res,$pos,$posEnd-$pos);
                    $res = str_replace($replaceStr,"",$res);
                }
            }
            echo $res;
            
            ?></div>
            
            
            
            <?php endif; ?>
            <div class="item-meta">
                <a href="<?php bp_activity_thread_permalink(); ?>">
                    <time>
                        <?php echo human_time_diff( bp_nouveau_get_activity_timestamp() ) . '&nbsp;' . esc_html__( 'ago', 'buddyboss' ) ?>
                    </time>
                </a>
            </div>
        </div>
    </div>
</li>
'''