bbPress

Simple, fast, elegant

bbPress Plugin Browser »

Image Resizer (0.2)

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(2)

Your Rating

Author: Rhys Wynne

Image Resizer is a BBPress plugin whereby images that are larger than the width of the forum are resized using CSS. Using the back end, you can set the maximum width of the image. No further configuration necessary.

It requires Allow Images plugin to work.

Compatible with RC-1!


  1. Thanks. Cool Plugin.

    Posted: 9 months ago #
  2. Dawormie

    Member

    Can you build it so that when an image that is linked is resized. You can click it to view the full-sized image? In a pop-up at least?

    Posted: 9 months ago #
  3. Dawormie

    Member

    Looking into this more, I think I know what I need to do.

    However I'm not sure what code to fully change in this last bit here:

    <snip>
    $post = str_replace('<img src="' .$imagearray[$i] , '<img style="width: ' . $maxwidth . 'px;" src="' . $imagearray[$i] , $post);
    </snip>
    ----------------------------------------

    I want to change that line so that it will replace the whole thing. As I'll be adding in a link in there too. So I can use lightbox.

    Just not 100% aware of the structure of it.

    Posted: 9 months ago #
  4. Dawormie

    Member

    This is what I have so far:

    <snip>
    $post = str_replace('<img src="' .$imagearray[$i] , '<a href="' .$imagearray[$i] , '<img style="width: ' . $maxwidth . 'px;" rel="lightbox.js" src="' . $imagearray[$i] , $post);
    </snip>

    I'm just missing how to tell it to pickup the end of whole line to do a replace on it.

    Posted: 9 months ago #
  5. Dawormie

    Member

    Ok - I got this to work now.

    GO ME!!

    Posted: 9 months ago #
  6. Glad to hear it! I wasn't ignoring you, just really busy in work today!

    Care to share? I'll see if I can link it in with admin menus etc. Of course, credit & links will be given :)

    Posted: 9 months ago #
  7. estebanrao

    Member

    hey man... I don't know why but the plugin isnt working for me. I'm using v0.9.0.4 integrated with wordpress but no luck...

    Posted: 8 months ago #
  8. @estebanrao are you using Allow Images? What template are you using? Have you activated the plugin in the Administration menu as well as in the plugins menu?

    Posted: 8 months ago #
  9. estebanrao

    Member

    Hey man... yes I'm using allow images, I'm using default template and I've activated the plugin in the plugins menu (I don't know what you mean with the Administration menu dough...).
    Checking the code in the forum with firebug I see that images code is not being modified by the plugin... D:

    Posted: 8 months ago #
  10. Okay. Go to your forum /bb-admin folder, and click on Plugins > Image Resizer (along the darker green bar along the top). You need to enable the plugin in that menu, as well as activate it (and also set the width you want to set the window too).

    Does that help? :)

    Posted: 8 months ago #
  11. citizenkeith

    Member

    I assume this error is due to my web host disabling something (getimagesize, perhaps?):

    Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /nfs/c04/h04/mnt/68418/domains/mydomain.com/html/forums/my-plugins/image-resizer/imageresizer.php on line 95

    Posted: 8 months ago #
  12. @citizenkeith can you post images without the image resizer plugin?

    I suspect that the getimagesize is troublesome because on your host you can't link to external images. Speak to your host to see if you can get any more information. I am afraid I'll be struggling, but they'll be able to give you more help (as will I if you have any questions).

    Posted: 8 months ago #
  13. citizenkeith

    Member

    I can post images, and I can post external images. I'm using Media Temple for hosting.

    I'll check with them and see what they say...

    Posted: 8 months ago #
  14. faen

    Member

    Thanks for the plugin. :)

    I'm trying to make some changes to it, so that the images actually will link to the original versjon. This is what I have so far, witch does not seem to work. I just can't understand why....

    $post = str_replace('<img src="' .$urltilbildet[$i].'" />' , '<a href="' . $urltilbildet[$i].'"><img style="width: ' . $maxwidth . 'px;" src="' . $urltilbildet[$i].'" /></a>' , $post);

    What happens is really nothing. All the images are still resized, but the link just don't show up..

    - Thanks for any help! :)

    Posted: 8 months ago #
  15. Have you got an example of the code produced?

    Posted: 8 months ago #
  16. faen

    Member

    Sorry about my last code up there. That was not what i ment to put in here in the forums. This is the code I now have in my imageresizer.php at the bottom:

    $post = str_replace('<img src="' .$imagearray[$i].'" />' , '<a href="' . $imagearray[$i].'"><img style="width: ' . $maxwidth . 'px;" src="' . $imagearray[$i].'" /></a>' , $post);

    This is not working. The images are still resized but no link.

    The funny part I just notised is that the images are still resized when I deactivate and remove the plugin. I can't find any way to actually deactivate the plugin after it's first activated... If I add new images in the forum after the plugin is deactivated, also these images is beeing resized.

    The code produced is:

    <img src="url-to-image"/> - that's all...

    The images I am testing with is about 1024px wide, and they are still resized with that code.

    I am using bbPress RC1 at the moment. Anyone else experiensing problems with deactivation of the plugin?

    Posted: 8 months ago #
  17. Hi Faen,

    Please forgive me for the delay in getting back to you.

    Not entirely sure what's wrong with the code. It looks fine to me.

    Previous images won't be reverted on quitting the plugin, this is because the HTML code is generated before being put into the post database. So when the plugin is deactivated, it is not removed (it'd be a rather too much hassle).

    I'm using RC1 at the moment, and can deactivate it no problem. I suspect this is causing images to be resized after being deactivated.

    Three things I can suggest:-

    a) What is the error given by the script on deactivation?

    b) have you tried backing up what you've done, redownloaded the plugin, and see if it works?

    c) Could you send the code to me (rhys at gospelrhys dot co dot uk)? If you want. I'm not promising I can sort the problems myself, my PHP isn't brill!

    Posted: 8 months ago #
  18. faen

    Member

    Hello again, rhyswynne. :)

    I understand that images allready added in the forums when the plugin is active won't go back to their original size. What I ment is that if I deactivate the plugin, and then delete it from my bb-plugins directory even new images added to the forum is beeing rezised. I just noticed that I cant even change the max-width of the images anymore.. If I do so from bb-admin nothing happens.

    Your questions.:

    a) What is the error given by the script on deactivation?

    I don't get any errors. Everything seems to work just fine.. It's just that if I deactivate the plugin and delete it from bb-plugins it's like the plugin is still there and all new images published are still beeing resized...

    b) have you tried backing up what you've done, redownloaded the plugin, and see if it works?

    Let me try this and get back to you with the results when I'm done. :)

    c) Could you send the code to me (rhys at gospelrhys dot co dot uk)? If you want. I'm not promising I can sort the problems myself, my PHP isn't brill!

    After I'm finished trying out "question" B, I can send you a little more information. Even if you can't find the problem I really do appreciate that you want to try. :)

    =
    Now, I guess I really should go get some sleep. I'll be back with more information tomorrow. :)

    Posted: 8 months ago #
  19. faen

    Member

    Uhm.... Sorry for my late comeback... To be quite honest I do feel some kind of stupid now.... :P (Please, just forget everything from me up here.)

    I just noticed that I some how had manged to put a max-width:200px; into the css for some reson, so it's no wonder no images actually was larger than 200px width. I don't know how drunk I must have been when putting that into css.

    Anyway, is this plugin compatibe with versjon 1 ? I took away my RC1, and installed V1 today, and it does not seem to work at all..

    Posted: 8 months ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.