WordPress.org

Support

Support » Plugins and Hacks » Allow users to post images in comments?

Allow users to post images in comments?

Viewing 11 replies - 1 through 11 (of 11 total)
  • I would be interested in this too.

    I’d be very grateful if someone could address this, too. Or a clearly-spelled-out way to do it by altering a .php file, if there’s no such plugin.

    Please!! 🙂

    whooami

    @whooami

    Member

    you do NOT need a plugin to do this. Havent I said this before in another thread????

    1. Open wp-includes/kses.php

    2. Locate the following line:

    $allowedtags = array ('a' => array ('href' => array (), 'title' => array ()), 'abbr' => array ('title' => array ()), 'acronym' => array ('title' => array ()), 'b' => array (), 'blockquote' => array ('cite' => array ()),

    3. Change that line to read like so:

    $allowedtags = array ('a' => array ('href' => array (), 'title' => array ()), 'abbr' => array ('title' => array ()), 'acronym' => array ('title' => array ()), 'b' => array (), 'blockquote' => array ('cite' => array ()), 'img' => array ('alt' => array (), 'align' => array (), 'border' => array (), 'height' => array (), 'hspace' => array (), 'longdesc' => array (), 'vspace' => array (), 'src' => array ()),

    4. Save the changed file, and upload.

    The above change enables commenters to use <img src ... and several related tags within comments. It does NOT allow any user to upload an image. Consequently, the image must already be hosted soemwhere in order to be displayed successfully.

    The above change enables commenters to use <img src ... and several related tags within comments. It does NOT allow any user to upload an image. Consequently, the image must already be hosted soemwhere in order to be displayed successfully.

    Anyone know of an approach that would allow commenters to upload images?

    Actually, what I’d like is a plugin that auto-detects that a URL is an image and recodes the comment to add the <img src=” etc… My users sadly don’t know any HTML, and I don’t expect them to learn.

    Anyone heard of anything that does this?

    whooami’s suggested change to the kses.php file worked for me, allowing my commenters to post ONE image. Whenever a commenter posts more than one image, the whole comment gets stripped. If I, as an administrator, however, post 30 images in the commetns, they get through! I’d really like to give my commentors more freedom to post multiple images! Any help would be greatly appreciated.

    I’d rather just disable kses.php but haven’t found out how to do this yet. Possible??

    Thanks!!

    yes, please, me too…..

    I’d also love to enable this 🙂 I’ve been looking for something like for ages now – thinking I am just not finding it as it must exist… seems like it doesn’t after all ;(

    imagiscapeca

    @imagiscapeca

    yes, please, me too…..

    To echo some of the above posts:
    – whooami’s suggested change to the kses.php file worked for me, but only allowed my commenters to post ONE image …
    – would it help to disable kses.php?

    imagiscapeca

    @imagiscapeca

    Better yet:

    Can I give comments a visual editor so users can click a button that prompts for the image url and description – I don’t expect my users to use even simple code.

    Best of all, how can we enable users to:
    copy and paste images and videos from webpages into the comments?

    I think you’re better off using my-hacks.php than tweaking the code. my-hacks.php will survive an upgrade. Code tweaks won’t necessarily.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Allow users to post images in comments?’ is closed to new replies.
Skip to toolbar