WordPress.org

Support

Support » Plugins and Hacks » Regular expression not working for GD bbPress Attachments with recent versions?

Regular expression not working for GD bbPress Attachments with recent versions?

Viewing 1 replies (of 1 total)
  • jeffacubed
    Participant

    @jeffacubed

    Hi petrockblog,

    If you ever happen to figure this out, in terms of making this ‘topic Thumbnails’ work w/ GD bbPress attachments I’d be curious to hear you solution. I keep meaning to dig into the ‘topic thumbnails’ code deeper, but from what I can decipher:

    /*Function that retrieves the first image associated with the topic*/
    function bee_catch_image() {
      global $post, $posts;
      $first_img = '';
      ob_start();
      ob_end_clean();
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
      $first_img = $matches [1] [0];
      return $first_img;
    }

    Topic Thumbnails looking for the first ‘inline’ image (which GD Attachments does not produce…) so the plugin fails to find an image. In bbPress 2.3, you can manually add an inline image (& the thumbnails plugin then picks it up) but the sol’n is kinda awkward to explain to bbPress forum users.

    If you have any suggestions/idea let me know, as otherwise this thumbnails plugin is rather slick for bbPress topics/forums/etc.

    -Jeff

Viewing 1 replies (of 1 total)
  • The topic ‘Regular expression not working for GD bbPress Attachments with recent versions?’ is closed to new replies.