BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 56

    Here is an example URL for my site.

    https://gn95.com/jcrb/blog/posts/gn95-spring-2021-update/

    As you’ll see, the Page Title is as followed.

    Blog Name – Posts – Blog – Author – Site Name.

    Thx

  • Participant
    Level: Enlightened
    Posts: 56

    This is how to limit the number of characters, while ensuring the thumbnail remains present.

     function 5_activity_content_body( $content, $activity ) {
        $content_length = 42;
        if ( 'new_blog_post' == $activity->type ) {
            $images = extractImageFromContent($content);
            $_content = (strlen($content) > $content_length) ? substr($content, 0, $content_length).'...' : $content;
            
            if(!empty($images)) {
                $_content .= implode("", $images);
            }
            return $_content;
        }
        return $content;
    }
    add_filter( 'bp_get_activity_content_body', '5_activity_content_body', 10, 2 );
     
     function extractImageFromContent($html) {
        preg_match_all('/<img.*?src=[\'"](.*?)[\'"].*?>/i', $html, $matches);
        return ($matches[0]) ? $matches[0] : array();
    }
     
  • Participant
    Level: Enlightened
    Posts: 56

    Your link worked on my phone. I will revisit my theme.

    Thank you for looking into this.

  • Participant
    Level: Enlightened
    Posts: 56

    Will you please re-visit this issue? It is still present.

    I recorded this video from my Android phone to show you what I’m experiencing.

    https://www.youtube.com/watch?v=5IjR4Jsnzro&feature=youtu.be

    Basically, the Report button isn’t centering correctly on Android devices. The issue is present in Chrome Mobile, Firefox Mobile and the built in Samsung Web Browser.

    Thx

  • Participant
    Level: Enlightened
    Posts: 56

    That fixed it. Thank you!!!!!!!!!!!!

  • Participant
    Level: Enlightened
    Posts: 56
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 56

    Thank you!!

  • Participant
    Level: Enlightened
    Posts: 56

    When you have time, will you please revisit this issue?

    https://www.youtube.com/watch?v=5IjR4Jsnzro&feature=youtu.be

    On Android with a viewport width of 360px wide the modal popup doesn’t appear centered.

    Thx, JC

  • Participant
    Level: Enlightened
    Posts: 56

    I’m just trying to move the Report button so that it doesn’t appear below the comment. I’d like for it to appear to the right of the comment as shown here.

    https://youtu.be/GVRRytZHK2Y

    Here is the complete code that I’m using on my entry.php page to display the hover-over menu that displays the Report and Delete button. The menu and code work as expected with just one issue. Users are able to report their own content.

    <div class="dropdown-menu">
                            
                <button class="dropbtn-menu-a"> 
                    
                    <svg version="1.1" id="iconmonstr" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
    	 width="18px" height="24px" viewBox="0 0 18 24" enable-background="new 0 0 18 24" xml:space="preserve">
    <path id="menu-11" display="none" fill="#E4E4E4" d="M9,18c1.656,0,3,1.344,3,3s-1.344,3-3,3c-1.657,0-3-1.344-3-3S7.343,18,9,18z
    	 M9,9c1.656,0,3,1.343,3,3c0,1.656-1.344,3-3,3c-1.657,0-3-1.344-3-3C6,10.343,7.343,9,9,9z M9,0c1.656,0,3,1.343,3,3s-1.344,3-3,3
    	C7.343,6,6,4.657,6,3S7.343,0,9,0z"/>
    <rect x="6.575" fill="#E4E4E4" width="4.849" height="6"/>
    <rect x="6.575" y="9" fill="#E4E4E4" width="4.849" height="6"/>
    <rect x="6.575" y="18.018" fill="#E4E4E4" width="4.849" height="6"/>
    </svg>         
                </button>
      
      <div class="dropdown-content-menu-r">
        
          <?php echo bpmts_get_report_button( array(
    			    'item_id'     => bp_get_activity_id(),
    				'item_type'   => 'bp_activity',
    				'context'     => bp_get_activity_object_name(),
    				'context_id'  => bp_get_activity_item_id(),
                    'link_class'  => 'report-pop',) ); 
              ?> 
          <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
          
                      </div>
                     
                  </div>

    Thx, JC

  • Participant
    Level: Enlightened
    Posts: 56

    Thanks for helping with this.

    I tried the code above as I know how. I’ve never seen 2 if statements before so that may be the issue. I’m pasting this code and adding <?php at the beginning and ?> at the end. I just cant get it to work properly. Here is what I’m using.

    <?php if ( is_user_logged_in() && bpmts_is_me( bp_get_activity_user_id() ) ) {
    			return;
    		}
    
    		if ( bpmts_user_can_report() ) {
    			bpmts_report_button( array(
    				'item_id'     => bp_get_activity_id(),
    				'item_type'   => 'bp_activity',
    				'context'     => bp_get_activity_object_name(),
    				'context_id'  => bp_get_activity_item_id(),
    				'use_wrapper' => false,
    				'link_class'  => 'button item-button bp-secondary-action bpmts-activity-report-button',
    			) );
    		} ?>

    Can you please tell me what I’m doing wrong here?

    Thanks again.