Auto insert photo/media attachments into post
#1
If this exists, I can't seem to find it, nor know how to code it myself.

I am trying to find a way to either have the attachemnts (images/photos/media) be automatically inserted into the post after uploading, OR a button to automatically add multiple attachments into the post. When I upload a handful of images or more into posts, it would be nice to not have to click "insert into post" after each one. I tend to miss a few here and there and then have to start all over after posting as that option disappears when editing the post.

Thanks!
Reply
#2
This is for Firebase ...

https://community.mybb.com/mods.php?acti...w&pid=1092
Reply
#3
And ABP Imgur allows to add multiple picture in one time
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#4
Is there anything that doesn't use an external image hosting service? We have a lot of proprietary information in screenshots and such that can't be hosted externally from our servers.

Is there a way to just add a button that would "add all to post" to insert all the attachments into the post? The upload process for myBB is suffice if we can just add all to post instead of inserting one at a time.
Reply
#5
Might be possible, I'll have a try

Small POC:
Add the following script:
<script>function insertall() {
	$('[id^="attachment_"]').each(
		function(i, el) {
			$('#message').sceditor('instance').insertText('['+el.id.replace('_', '=')+']');
		}
	)
}</script>

And add a button: <input class="button" type="button" name="insertallbtn" value="Insert all into post" onclick="insertall(); return false;" />
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#6
Sorry, where exactly do I put the script? I've been poking around and can't seem to find where
Reply
#7
The button code can be in template post_attachments, and the javascript function in template post_javascript
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#8
When hitting the button, nothing happens.

(2021-09-29, 07:18 PM)clb68forums Wrote: When hitting the button, nothing happens.

UPDATE: It turns out we're using the "RinĀ Editor" plugin. Is there a way to get it to work with that plugin? If I disable that plugin, it worked. How can I add a break when it inserts them? They're showing side by side.

From
[attachment][attachment2]

To
[attachment]
[attachment2]

Thanks! Great help so far!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)