Activity Plus - is there a way to resize images?

I've been using this plugin for quite awhile. When someone links to an image that is larger than the size of the activity stream column, the image typically cuts itself off and won't fully embed. It cuts off at my sidebar column.

My question is: regardless of that, even filling in the entire activity stream column is too much. I'd like it to be more like facebook where the images are like thumbnails or a bit bigger, and the user must click it to see it in full size. Is this possible to do? I'd love them to re-size to no larger than 400k wide, and the height should auto-adjust proportionally. Is this possible?

Also a feature request: are you familiar with the Wordpress plugin Status? I downloaded it from this site, I'm not sure if the developers are the same, but Status works MUCH better in that it looks nearly identical to the facebook status update plugin, doesn't use icons (to me, less is more) and the embedding seems to work more flawlessly, especially with links. If I link to a CNN article using Activity Plus, I'm lucky if it grabs a thumbnail for me, but I certainly can't scroll through a list of them. With "Status" when I link to an article, I can scroll through all the thumbnails just like you can on facebook. Wondering if there is a way to merge these two plugins? The more I type this out, the more I think perhaps this is a message I should be addressing to the "Status" forum, but I thought maybe the developers were the same people. I just wanted to express that I'd love it if this one was more like that one, as I'm using both... I use status on my personal blogs, and use Activity Plus on Buddypress. It is a great example of how I wish images, videos, and links would get displayed.

I'm using Buddypress 1.5.1 and Wordpress 3.2.1 ... checked and all my plugins are updated. Theme is Frisco for BuddyPress 1.5.04 by David Carson

Akismet version 2.5.3 All-in-One Event Calendar Plugin Version 1.0.9 bbPress Version 2.0 BuddyBar Widget Version 0.15 BuddyPress v. 1.5.1 BuddyPress Activity Comment Notifier Version 1.0.3 BuddyPress Activity Plus Version 1.2.1 BuddyPress Album Version 0.1.8.11 BuddyPress Docs Version 1.1.15 BuddyPress Like Version 0.0.8 BuddyPress Mobile Version 1.5.2.3 BuddyPress Private Messages for Friends Only Version 1.1 BuddyPress Template Pack Version 1.2 BuddyPress Usernames Only Version 0.58 Custom Login Version 0.9.4 Flash Video Player with HTML5 Version 1.2 MediaElement.js - HTML5 Audio and Video Version 2.2.5 oEmbed for BuddyPress Version 0.6-beta oEmbed for Comments Version 0.6 podPress Version 8.8.10.12 Private BuddyPress Version 1.0.4 RS Buddypress Activity Refresh Version 1.5 W3 Total Cache Version 0.9.2.4 WordPress Hashcash Version 4.6 WP-DBManager Version 2.63 WP-Polls Version 2.62 WP Best Practices Version 1.2 WP Widget Cache Version 0.25.4

    derusion

    Okay here is an example. I'm now using the latest Buddypress Fun theme. I have Activity Plus working fine. I decided to embed this image: http://www3.pcmag.com/media/images/321709-facebook-fail-infographic.jpg?thumb=y

    I clicked the camera icon, inserted that image, clicked submit, and now part of it is chopped off.

    Would be nice if I could resize it within the plugin. As it is, everything shows up full size, no resizing is done within the plugin. I saw a hack for this for youtube videos where you could go into the plugin php files and alter them to allow resizing in those cases, but can this be done for photos? if not, I fear many of my members are going to make my site look very ugly in short order.

    DavidM

    Hi derusion,

    BuddyPress Activity plugin actually accesses a constant which you can define in your wp-config.php file like so:
    define('BPFB_OEMBED_WIDTH', 400, true);

    Perhaps that'll take care of it for ya?

    Thanks also for your feedback and thoughts regarding the Status plugin and this one. They're both by the same awesome developer over here and if you'd like to create a thread in the feedback and feature suggestion forum, we'll tag him on that so he can have a look once he gets a moment.
    https://premium.wpmudev.org/forums/forum/feature-suggestions

    Thanks,
    David

    Mason

    Hiya derusion,

    I'm not able to reproduce this error on my test install. Using the image you linked to a small thumbnail is created and placed in the activity stream. Click on the thumbnail produces the full-size image in a lightbox. My hunch is that one of your other plugins is causing an issue with the thumbnail creation or your uploads directory inside wp-content isn't writeable.

    Can you check on these? Also, the developer of both these plugins, is in fact the same person. They were designed for different purposes, but I'll make the above a feature request and prod him to take a look at what could be done to improve on this one.

    Thanks!

    Vladislav

    Hi,

    Images embedded from URLs are not resized - they're taken as-is. This is so because the remote image has only one (physical) size we can count on. However, the images you upload from your computer do get resized, according to your image thumbnail size settings ("Settings" > "Media"). In the latest release, you can also set your preferred thumbnail sizes for Activity Plus plugin separately from your media thumbnail size settings, if you wish to do so. You can do that by adding this line to your wp-config.php:

    define('BPFB_THUMBNAIL_IMAGE_SIZE', '200x200');

    Where "200x200" are width and height (in that order), in pixels.

    As for the images fetched over from the link, Status actually uses a bit modified algorithm from Activity Plus, although it did got slightly updated. So, link image detection algorithms were pretty similar for both plugins - and in the latest Activity Plus release they're virtually the same.

    derusion

    I just updated to 1.3

    a couple of comments

    one, still went someone pastes a video link in (without actually using your video button to insert the video) the video still shows up very large, even though my wp-config specifies nothing should be larger than 300 pixels wide. This happens with all the other plugins disabled.

    Another issue is that the background went from white to gray (I changed it to white, not sure how... I checked the CSS of your plugin and switched all background references to "ffffff" and it hasn't helped.

    One last thing you might want to be aware of, the icons look like they're repeating. I can't explain it but I'll show a picture.

    derusion

    Please note, after clearing the cache, going through all the css and changing everything I could find to "fff" or "ffffff" both problems were resolve with the icons and background colors.

    Still remaining is the image embedding size (linked offsite images) and the video size when someone just pastes in any video URL without using your plugin to do it. Meaning, they just paste in a youtube URL as their status.

    My apologies, these issues were on my end.

    Does buddypress have a method of auto-embedding these into the activity stream without your plugin that I'm not aware of?

    Mason

    Hiya derusion,

    Does buddypress have a method of auto-embedding these into the activity stream without your plugin that I'm not aware of?

    The 1.5+ versions do have oembed support. I just did a quick check of the BuddyPress plugin and though I can see a way to dictate the size of the video you can disable it in the activity stream. This means a link would be displayed rather than a video preview - unless they used the proper video link through activity+

    To disable the automatic embed for BuddyPress activity stream add the following to wp-config.php:
    define( 'BP_EMBED_DISABLE_ACTIVITY', true );

    Hope that helps. Thanks!

    derusion

    masonjames, I tried what you suggested as that would be fine by me to have just a link show up, but alas, a video still embeds (and it embeds way oversized.)

    Here is my wp-config

    <?php
    /** Enable W3 Total Cache */
    define('WP_CACHE', true); // Added by W3 Total Cache
    
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
     //Added by WP-Cache Manager
    define('DB_NAME', 'livingroomsalon_com_1');
    
    /** MySQL database username */
    define('DB_USER', 'censored);
    
    /** MySQL database password */
    define('DB_PASSWORD', 'censored');
    
    /** MySQL hostname */
    define('DB_HOST', 'censored);
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    defines censored
    
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * Limits total Post Revisions saved per Post/Page.
     * Change or comment this line out if you would like to increase or remove the limit.
     */
    define('WP_POST_REVISIONS',  10);
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress. A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
     * language support.
     */
    define('WPLANG', '');
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', false);/* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    define( 'BP_EMBED_DISABLE_ACTIVITY', true );
    Vladislav

    Hi,

    You may want to move that line to anywhere *before* it says "/* That's all, stop editing! Happy blogging. */". So, for an example, you could to something like this (most lines omitted):

    ...

    define('WPLANG', '');
    
    define( 'BP_EMBED_DISABLE_ACTIVITY', true );
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', false);/* That's all, stop editing! Happy blogging. */

    ...

    This is because after that line, WordPress performs the initialization and, once that is finished, it is likely that the define you're setting up after the "Happy blogging" line will show a bit late to the party and will get ignored.

    derusion

    Okay, I forgot to clean my cache. Did it, and this line:

    'define( 'BP_EMBED_DISABLE_ACTIVITY', true );

    worked! Wow, thank you! +1 to you! (anyone who wants to do this, please take note this solution WORKED! Just make sure it's not located at the very end of the wp-config, lol)

    Now, you said there is a way to dictate the video size if I wanted... how is this done? If I wanted to affect the video sizing in wp-config, what should I copy/paste in place of the bp_embed_disable-activity line above?

    derusion

    For the record, I tried replacing the disable_activity line with the following in my wp-config:

    define('BPFB_THUMBNAIL_IMAGE_SIZE', '200x200');
    define('BP_OEMBED_ACTIVITY_STREAM_WIDTH', '200');
    define('BP_OEMBED_ACTIVITY_PERMALINK_WIDTH', '400');
    define('BP_OEMBED_FORUM_POST_WIDTH', '300');
    define('BP_OEMBED_GROUP_DESC_WIDTH', '200');
    define('BP_OEMBED_XPROFILE_WIDTH', '200');

    This made NO difference in the size of the videos in my activity stream. They still show up oversized. However, if I put the disable_activity line of code back, then it properly disables it... the video shows up as a URL again.

    Is it even a question of BP_OEMBED? Is there such a thing as BP_EMBED_ACTIVITY_STREAM_WIDTH ?

    I do have the oembed plugins enabled, and was sure to clear the cache.

    Looking for an update to the plugin, seems like it's been on the backburner for awhile so a lot of people are writing in their own hacks. I might have to do the same? Would love to make the video embedding work properly. It embeds, but way too large...outsizes the activity stream width.

    I'd be happy to privately send the admin login / FTP login to anyone who'd like to take a whack at this... it's been nagging me for weeks.

    Vladislav

    Hi,

    BuddyPress automatic oEmbeds should respond to your "Maximum embed size" WordPress settings (in "Settings" > "Media", under "Embeds"). Note that this will be applied sitewide, for all auto-discovered embeds.

    You could enforce different settings for BuddyPress activities too, but that would be a bit more complex then just setting up a define - i.e. would require some coding.

    Sarah Gooding

    I'm getting this same issue too - when adding a Link, it resizes the thumbnail up to the maximum width of the activity column. When I look at it with firebug, I see that the thumbnail is getting some inline style added (not from my theme) - which says width=612px;" whereas it also shows in firebug that the natural width of the element is 50 x 50px. So, I think the plugin is doing something to size up those thumbnails...

    Here's my wp-config.php file:

    'define('BPFB_OEMBED_WIDTH', 400, true);
    define('BPFB_THUMBNAIL_IMAGE_SIZE', '200x200');
    define('BP_OEMBED_ACTIVITY_STREAM_WIDTH', '200');
    '

    WordPress media settings are set to 520px max width for auto-embeds.

    Sarah Gooding

    Okay I figured out my situation. When looking at the source, I find that the bpfb_interface.css file from the plugin was not being loaded at all. I'm not sure why - but it's that CSS that helps make everything normal sizes instead of taking up full width of the activity stream. So, for now, I just copied the CSS from that file into the bpfb_toolbar.css file since that one IS being loaded. I'm not sure if this is a bug or if something about my particular install is preventing bpfb_interface.css from getting loaded. However, for now the issue seems to be fixed. I wanted to post that here in case it helps anyone else.

    Vladislav

    Hi,

    Just a quick check, is it possible that your theme is overriding the default plugin interface style? If that is the case you'd have something like this in your theme's functions.php:

    add_theme_support('bpfb_interface_style');

    If a theme supports the plugin interface style, the plugin assumes the theme already has the needed interface styles and doesn't load the defaults at all. Typically, a theme would do that to provide its own styling for the plugin output.