Skip to:
Content

bbPress.org

Opened 12 years ago

Last modified 16 hours ago

#2313 new defect (bug)

Allow users to upload/insert images using TinyMCE

Reported by: tbermudas's profile tbermudas Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.6.11
Component: Component - Topics Keywords:
Cc: jared@…, pericam@…, robkk17@…

Description

Member can insert an image by URL like now and: uploading from their computer via uploader to insert the image in the content. Possibility to set size and align.

Change History (19)

#1 follow-ups: @jaredatch
12 years ago

  • Cc jared@… added
  • Keywords visual editor images removed
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Upload and insert images from visual editor to Allow users to upload/insert images using TinyMCE
  • Version trunk deleted

I've talked to jjj about this a long time ago. I know it's something we like to do at some point, but it just isn't high priority compared to the moderation/performance features.

We also discussed how it would be an interesting challenge. The uploader would need to be locked down to only allow a small subset of file types. Additionally, it would be hard to use the WP media gallery/uploader because you do not want the user to be able to see the contents of your entire media gallery.

So we'd need to customize and lock down the WP media uploader or come up with our own, both which are no small task :)

#2 @tbermudas
12 years ago

Thanks, I don't know how it works... but there was a plugin, the U buddypress forum editor, I never used it because is not working, but maybe it is a good starting point.

#3 @jaredatch
12 years ago

For those who find this ticket, the best known third party alternative is http://wordpress.org/extend/plugins/gd-bbpress-attachments/

#4 @Stagger Lee
10 years ago

  • Cc pericam@… added

Is it not possible with this ?
Limit users to see only own uploaded files (doesnt apply to Admins):

function filter_my_attachments( $wp_query ) {
    if (is_admin() && ($wp_query->query_vars['post_type'] == 'attachment')) {
        if ( !current_user_can( 'activate_plugins' ) ) {
            global $current_user;
            $wp_query->set( 'author', $current_user->id );
        }
    }
}
add_filter('parse_query', 'filter_my_attachments' );

Then activate media button in reply form with this:

add_filter( 'bbp_after_get_the_content_parse_args', 'tp_bbpress_upload_media' );
 
function tp_bbpress_upload_media( $args ) {
$args['media_buttons'] = true;
 
return $args;
}

Seems it is all needed. Insert image inline in reply with text and visual editor. Size, styling and captions are easy to do and style.

#5 @Robkk
10 years ago

  • Cc robkk17@… added

There is a plugin that piggybacks off of BuddyPress, but it does the exact functionality of what we expect.

https://wordpress.org/plugins/bp-forum-editor/

#6 follow-ups: @jimmyupwp
5 weeks ago

The functionality you're describing can be implemented effectively. By leveraging the WordPress media uploader, users would have the option to upload images and insert them directly into their content. Here’s a summary of the proposed implementation steps:

Image Insertion from URL and Uploader: Users should be able to insert images both via URL and by uploading directly from their device using the WordPress media uploader. This dual capability offers greater flexibility for users when adding media to their posts.


Size and Alignment Options: By utilizing the WordPress editor's built-in functionalities, users can set image size and alignment easily. This can be achieved through the visual editor, enabling users to customize their content layout effectively.

Restricting Access to Uploaded Files


Your provided code snippet for limiting users to view only their uploaded files is a practical approach. The filter_my_attachments function you shared will ensure that non-admin users can only see their attachments in the media library. This enhances privacy and helps maintain a cleaner user experience.

Enabling Media Buttons in Reply Form

The second part of your implementation, which activates media buttons in the reply form, is also well outlined. The tp_bbpress_upload_media function you shared will ensure that users have the media upload option available when replying, making it easier to insert images inline with their text.
Conclusion

With the combination of these functionalities, users will be able to:

Insert images from both URLs and local uploads.
Set size and alignment for better content presentation.
Ensure privacy by restricting access to their uploaded files.

This comprehensive approach not only enhances user engagement but also keeps the interface intuitive and user-friendly.

If you have any further questions or need assistance in implementing this functionality, feel free to reach out!

Best regards,
jim

Last edited 5 weeks ago by jimmyupwp (previous) (diff)

#7 @anrmlx1
4 weeks ago

To enable image uploads in TinyMCE, include TinyMCE via CDN and initialize it with the following settings: set plugins to 'image code', and in the toolbar, include 'image' to allow image uploads. Use images_upload_url for the upload endpoint (e.g., /upload) and images_upload_handler to handle custom uploads. Within images_upload_handler, create a FormData object, append the image blob (blobInfo.blob()) to it, and send it to your server’s upload endpoint using fetch.

On the server side (e.g., Node.js), handle the upload by saving the file and responding with its URL in JSON format ({ location: '/uploads/filename' }). This setup allows images to be uploaded and inserted directly into TinyMCE's editor.

#8 in reply to: ↑ 6 @outloiiksmewp
4 weeks ago

The functionality you're describing can be implemented effectively. By leveraging the WordPress media uploader, users would have the option to upload images and insert them directly into their content. Here’s a summary of the proposed implementation steps:

Image Insertion from URL and Uploader: Users should be able to insert images both via URL and by uploading directly from their device using the WordPress media uploader. This dual capability offers greater flexibility for users when adding media to their posts.

#9 in reply to: ↑ 6 @vertosbrwp
4 weeks ago

La funcionalidad que estás describiendo puede implementarse de manera efectiva. Al aprovechar el cargador de medios de WordPress, los usuarios tendrían la opción de subir imágenes e insertarlas directamente en su contenido. Aquí tienes un resumen de los pasos propuestos para la implementación:

Inserción de Imágenes desde URL y Cargador de Archivos: Los usuarios deberían poder insertar imágenes tanto mediante una URL como subiéndolas directamente desde su dispositivo usando el cargador de medios de WordPress. Esta doble capacidad ofrece una mayor flexibilidad para los usuarios al agregar medios a sus publicaciones.

This ticket was mentioned in Slack in #bbpress by sirlouen. View the logs.


9 days ago

#13 in reply to: ↑ 1 @hemak
8 days ago

Replying to jaredatch: Glad i have solved it!

I've talked to jjj about this a long time ago. I know it's something we like to do at some point, but it just isn't high priority compared to the moderation/performance features.

We also discussed how it would be an interesting challenge. The uploader would need to be locked down to only allow a small subset of file types. Additionally, it would be hard to use the WP media gallery/uploader because you do not want the user to be able to see the contents of your entire media gallery.

So we'd need to customize and lock down the WP media uploader or come up with our own, both which are no small task :)

#14 @seoalii
8 days ago

  • Keywords has-dev-note needs-refresh 2nd-opinion removed

<a style="padding:0; border:none" href="https://hometime.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://reflex24.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://strategie24.sk"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://strategie24.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://zpravyzradnice.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://homeanddecor.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://bydleniinspirace.cz"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://inspravy.sk"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://idealnybyt.sk"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://mavuika.co.uk"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://mistyseveri.net"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://famous-parenting.com"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://abegibarta.com"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://diytipshome.com"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="https://1xify.com"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a>
<a style="padding:0; border:none" href="http://www.kz-express-microcredit.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><br />
A possible solution is to create a custom plugin or use an existing one (like the one you mentioned) to integrate the logo directly into <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a>’s email templates. If you are comfortable with coding, you could add a default logo by modifying the email template files in the /wp-content/plugins/buddypress/bp-templates/ directory, or use a plugin to add dynamic logo support for emails.<br />
</p>
<p>
You can pull dynamic content into the email templates (e.g., user name, site title, etc.) by modifying the email templates to include <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> template tags or shortcodes. For example, you can use <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> or <a class="wiki" href="/wiki/WordPress">WordPress</a> functions to pull user-specific data into the header/footer dynamically.<br />
</p>

#15 @aliiirazamalik
7 days ago

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Currently, <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> does not provide a built-in option to upload and display a custom logo in email templates by default. However, <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> email templates are customizable, and you can add a logo by modifying the template files manually or using a plugin that extends <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> email functionality.<br />

</a><a style="padding:0; border:none" href="http://xxphim.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="http://hero4d2win.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="https://slot303-lgo4d.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="https://sonarcon.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="http://borkdaysal.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="https://elvecino.store"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a></a><a style="padding:0; border:none" href="https://cn12.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://cn11.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://cn19.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="http://cn02.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="http://cn03.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://cn04.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://raden1.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://ibyk.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://brooklyn666.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://stworca.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://websdecitas.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://globalfoundation.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://guru83.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://diablica.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://filmehdonline.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://bangladeshcasino.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://xverts.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://jokerwin77.site"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://krishtv.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://minyanalfaki.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://mebosgrazie.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://metoacshaykh.online"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><a style="padding:0; border:none" href="https://afdah.store"><img width="0px" src="/raw-attachment/ticket/9135/Untitled.jpg" /></a><br />A6
A possible solution is to create a custom plugin or use an existing one (like the one you mentioned) to integrate the logo directly into <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a>’s email templates. If you are comfortable with coding, you could add a default logo by modifying the email template files in the /wp-content/plugins/buddypress/bp-templates/ directory, or use a plugin to add dynamic logo support for emails.<br />
</p>
<p>
You can pull dynamic content into the email templates (e.g., user name, site title, etc.) by modifying the email templates to include <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> template tags or shortcodes. For example, you can use <a class="wiki" href="/wiki/BuddyPress">BuddyPress</a> or <a class="wiki" href="/wiki/WordPress">WordPress</a> functions to pull user-specific data into the header/footer dynamically.<br />
</p>

#17 @hemnfor22
41 hours ago

Thanks, I don't know how it works... but there was a plugin, the U buddypress forum editor, I never used it because is not working, but maybe it is a good starting point.

#18 in reply to: ↑ 1 @lorismicxs11
23 hours ago

function filter_my_attachments( $wp_query ) {

if (is_admin() && ($wp_query->query_varspost_type? == 'attachment')) {

if ( !current_user_can( 'activate_plugins' ) ) {

global $current_user;
$wp_query->set( 'author', $current_user->id );

}

}

}
add_filter('parse_query', 'filter_my_attachments' ); Replying to jaredatch:

I've talked to jjj about this a long time ago. I know it's something we like to do at some point, but it just isn't high priority compared to the moderation/performance features.

We also discussed how it would be an interesting challenge. The uploader would need to be locked down to only allow a small subset of file types. Additionally, it would be hard to use the WP media gallery/uploader because you do not want the user to be able to see the contents of your entire media gallery.

So we'd need to customize and lock down the WP media uploader or come up with our own, both which are no small task :)

#19 in reply to: ↑ description @venzonedwp
16 hours ago

Replying to tbermudas:

Member can insert an image by URL like now and: uploading from their computer via uploader to insert the image in the content. Possibility to set size and align.

It is good

Note: See TracTickets for help on using tickets.