bbPress

Simple, Fast, Elegant

bbPress plugin browser »

bbPress Attachments (0.1.12)

Download

Version: 0.1.12

Last Updated: 2008-9-17

Requires bbPress Version: 0.9 or higher

Compatible up to: trunk

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

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

Your Rating

Author: _ck_


  1. You can already adjust the type types and sizes allowed for admin via $bb_attachments['allowed']['extensions']['administrate'] $bb_attachments['allowed']['mime_types']['administrate'] and $bb_attachments['max']['size']['administrate']

    Posted: 4 months ago #
  2. jasonistaken

    Member

    I apologize if this is a very stupid question...

    I've installed your plugin, and it works great. What exactly does the Upload button do? In my particular install, it does the exact same thing as the regular Send Post.

    i.e. It uploads the images and posts the post.

    Is it supposed to just upload the attachments? Or is this what it is supposed to do? In which case, can I safely remove it? I don't really want two buttons that do the same thing with different names.

    Posted: 4 months ago #
  3. Because of a limitation in bbPress, the upload button has to send the post so it has a post to attach to. However the upload button is also there because it is possible to edit attachments when the edit post button is not available at all.

    Also given that people think in different ways, it may not be obvious to someone to enter a filename and then push the edit post button. Most other forum systems have an "upload" button as well.

    Posted: 4 months ago #
  4. Like jeffwong and kthomman I have the database problem. I am running WampServer (i.e. Apache, MySQL. PHP under Windows). This is my staging server. The actual production server is LAMP.

    Nothing special about my database. It is called 'bbpress'. Here is the error:

    bbPress database error: [Table 'bbpress.bb_attachments' doesn't exist]
    SELECT * FROM bb_attachments WHERE post_id IN (20735) ORDER BY id DESC

    I can see that the database table is created in bb_attachments_install(), but I don't know why this fails. My config sets the db user to root (which has all privileges as you would expect).

    Posted: 3 months ago #
  5. Hello,

    I have installed this plugin and followed every instruction there is and still can't get it to work. The process stops with a failed status of 2 ($status=2), the records for the attached files appear in the table, but in the post I just get this:

    1. [txt] [failed] Text1.txt (0 KB)

    Please help,

    I really need attachments to be working on this forum.

    Regards,

    Frank

    Posted: 3 months ago #
  6. I am investigating the windows database problem.
    falp are you on windows too? I need more info from you.

    update: okay this is a bbPress bug dealing with windows file paths - I am coding a work around - actually a few of my plugins should be suffering from this bug...

    Posted: 3 months ago #
  7. Okay, everyone who is unable to make the plugin work, try 0.1.10 when you see it here. I put in some workaround code for bbPress's buggy activation hook under Windows.

    NOTE: YOU *MUST* deactivate and re-activate the plugin after re-uploading. Otherwise it will not fix the problem. Please report success or failure afterwards.

    Posted: 3 months ago #
  8. _ck_, this works for me. Thanks a ton for getting to this so quickly (and on a public holiday no less).

    Posted: 3 months ago #
  9. I've now added auto-insert in 0.1.11

    There is only one small bug in this method that I will have to address later. If you edit an existing post and upload a new image while ALSO changing the post text, it cannot save the post text AND upload the image (it will only upload the new image). This situation should be the least likely, though it could happen and I will have to deal with when I have more time.

    All other auto-inserts should work correctly however, new posts and adding more images to a post.

    Posted: 2 months ago #
  10. I am having a problem with this great plugin - when I try and upload anything, it uploads, saves locally - inserts correctly into the database, but displays this in my forum template:

    [attachment=2149,26]

    Now, its thread 2149 and the image 26.whatever exists on the filesystem, so im not sure why its not showing?

    Im running 0.1.11 on bbpress 0.9.2

    Posted: 2 months ago #
  11. Never mind, found the problem. In my theme, im not using post_text() to display the text, im using get_post_text and then displaying it after that. So the regex doesnt apply when that function is called. The solution was changing the following code from :

    if (isset($_GET["new"]) || is_topic() || is_forum()) {
    	add_action( 'bb_topic.php', 'bb_attachments_cache' );
    	add_filter('post_text', 'bb_attachments_post_footer',4);
    	add_filter('post_edit_uri', 'bb_attachments_link');

    To:

    if (isset($_GET["new"]) || is_topic() || is_forum()) {
    	add_action( 'bb_topic.php', 'bb_attachments_cache' );
    	add_filter('post_text', 'bb_attachments_post_footer',4);
    	add_filter('get_post_text', 'bb_attachments_post_footer', 4);
    	add_filter('post_edit_uri', 'bb_attachments_link');

    And then adding this line:
    add_filter('get_post_text', 'bb_attachments_bbcode', 250);
    Before:
    bb_register_activation_hook(str_replace(array(str_replace("/","\\",BB_PLUGIN_DIR),str_replace("/","\\",BB_CORE_PLUGIN_DIR)),array("user#","core#"),__FILE__), 'bb_attachments_install');

    :)

    Posted: 2 months ago #
  12. I have found a couple more problems with the image resize function. They are:

    Change the following code:

    case IMAGETYPE_JPEG:
    		$img = imagecreatefromjpeg($filename); 	$save= 'imagejpeg'; break;
    	case IMAGETYPE_GIF:
    		$img = imagecreatefromgif($filename); $save = 'imagegif';  break;
    	case IMAGETYPE_PNG:
    		$img = imagecreatefrompng($filename); 	$save_img = 'imagepng';  break;

    To:

    case IMAGETYPE_JPEG:
    		$img = imagecreatefromjpeg($filename); 	$save= (string)'imagejpeg'; break;
    	case IMAGETYPE_GIF:
    		$img = imagecreatefromgif($filename); $save = (string)'imagegif';  break;
    	case IMAGETYPE_PNG:
    		$img = imagecreatefrompng($filename); 	$save = (string)'imagepng';  break;

    Note the (string) before each string, php will complain that the function is not a string when $save() is called. Also note that png was saving to a $save_img variable and not the $save one.

    Posted: 2 months ago #
  13. Thanks BarnRacoon, I will repair those.

    post_text uses get_post_text so it shouldn't be necessary to use both, I'll try just replacing it.

    Posted: 2 months ago #
  14. Update: no, using get_post_text instead of post_text is a very bad idea. post_text is meant for the final display on the page and get_post_text can be uses internally, which means things like javascript get inserted into the post editing when that should never happen.

    BarnRacoon, your templates MUST use post_text and not get_post_text for the final display, otherwise you are going to have other problems (sooner or later).

    Posted: 2 months ago #
  15. Thats all good and well except I need to use the get_post_text function for my templates :/

    What are the new problems that I will run into ?

    Posted: 2 months ago #
  16. Are you processing the post_text right within your templates?
    You should be using a filter instead.
    Then you could just use post_text(); which self-echos.

    I should be able to make it work with get_post_text I just don't have the time right now.

    Posted: 2 months ago #
  17. musnake

    Member

    This works great in WP2.6.2 + bbPress 1.0a2.

    Thanks.

    It was easy to add file types (kml, gpx etc).
    A note to testers: Your file can't be an empty dummy file!

    Posted: 1 month ago #
  18. myu

    Member

    Great plugin. :)
    Uploading image to photo site then linking is too hard for some users and even if it's not, it's a bit of hassle, so it is excellent.

    I wonder, though, is it possible to make it so that clicking on an inline image doesn't go to download, but possibly go to original size image..?
    (Too complicated or defeats the purpose, maybe.. But would be great if possible!)

    Posted: 2 weeks ago #

RSS feed for this topic

Add a Comment

You must log in to post.

Code is Poetry.