Please or Register to create posts and topics.

Insert images inside the post

PreviousPage 3 of 3

Does anyone know if there is a cap (limit) on the amount of data that our WP Media libraries can hold?  And if so, is there a way to increase the size if needed?

Yes, there should be no limit – until your database or harddrive is full. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

@ Ron Rollo, maybe u should consider, with yr, yr images – datasets 2 buy a NAS with sufficient memory of 2 – 6 TB, then u would have no problem, so BUY.

Thank you for the replies and answers everyone!  I will report back with the solution I go with.

 

TTYS,

Ron

Quote from Asgaros on January 25, 2018, 7:05 pm

Is it normal practice to upload the photo to WP and then insert the link in this dialog box?  If so, this is a solution for me as an administrator but how would a member go about posting photos without using a third party photo hosting site?  Would they use the “Upload Files” button and pull the link from there?

At the moment this is the way to go. The reason for this is: I only want to upload the files inside a new post when I can ensure that the post is created. Otherwise people could start to upload files on your server without ever creating the post. This would lead to hidden files somewhere on the server and the need for a clean-up script which has to run on a regular basis. But even this would be not a nice solution, because you can never be sure that people will upload some illegal stuff. You see, its a big problem. I hope, that I can find a better implementation one day.

Hi,

Like many others, I would love to see this feature implemented.

And I’m a bit surprised by your answer.
Of course, I share your concern to avoid files uploaded not even linked to any post.

But… on the other hand, you have already implemented the file attachment. So you’ve found an option as you must have had the exact same concern with this feature.

Now, what’s the difference in between file attachment and inserting images in a post?

In both cases:

  • you select files prior to submit the post,
  • you don’t upload them prior to submit the post,
  • but after the submit you upload the files,
  • and you display a preview (if attachment) or the full image.

Very, very similar. So the only difference I see in the specific case of inserting images, is that you also need to set the position of the image in the text.

Then IMO, the issue is limited to find a solution to this problem.

And I have an idea you can “maybe” investigate:

  • Use the same mechanism as the attachment
  • Once the file is selected ([Browse…] > [Open]) assign it an id (like post # – post image/file #)
  • Add a [Insert image in post] button in front of each selected image
  • This button will just add a kind of BBCode where the cursor is in the post, BBCode linked to the image id
    (like [inline image #2724-1], 2724 being the post# and 1 the 1st image/file of the post)
  • And once the post is submitted, parse the post code to replace the BBCode by the proper HTML code

Does it make sense? 🙂
(cf. image below to visually see how it could work)

Like this, no image is uploaded prior to create the post and we can set where we want the image to be displayed.

P.S.: BTW, it’s how phpBB works. You have a [Place inline] button that adds a [attachment=1]inline-image-asgaros.png[/attachment] BBCode where the cursor is.

Uploaded files:
  • inline-image-asgaros.png
Asgaros and FTP have reacted to this post.
AsgarosFTP

Hello @ftp

Actually this is a nice suggestion and I will link your post in my todo-list. A few other things to cover:

  • The generated ID can be manipulated so additional checks are required before parsing
  • What happens if a file got positioned inside of the posts-content? Still show a thumbnail at the end or only show thumbnails for non-inserted files?
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
Quote from Asgaros on June 2, 2019, 3:31 pm
  • The generated ID can be manipulated so additional checks are required before parsing
  • What happens if a file got positioned inside of the posts-content? Still show a thumbnail at the end or only show thumbnails for non-inserted files?

Well, my suggestion was just a draft. There’s of course few things to fine tune.

Regarding your first comment, it can be manipulated but it’s easy to block by a simple RegEx check: make sure it’s 2 int separated by a dash, int1 must be equal to the post#, int2 must match an uploaded file #. Anything else is rejected.
But you can also replace my suggestion by anything else you prefer. Like I said phpBB uses [attachment=1]file-name.png[/attachment]. Why not.

Regarding your question, I would say… if inline = no thumbnail; and vice versa, no inline = thumbnail.

Another thing that comes to my mind is you also need to consider managing the display of the [Insert image in post] button. If allowed file format (.png, .gif, .jpg, .jpeg…) then display the button in front of the file name, otherwise the button stays hidden.
And of course, after the submit you will also have to check that behind the .png, .gif, .jpg or .jpeg there’s an image and nothing else; but I’m sure you know how to do as you already display images thumbnails.

A very nice option would also be to allow controlling the image size. We see so many forums were image are badly displayed. Too small, too big, even enlarging the post div.

The way to do it is to add an option in the BBCode. Like [inline image #2724-1, width=500] (500 for 500px width). I did exactly that in a MOD for phpBB years ago: [img=500]url[/img]

IMO, inline images should be displayed like this:

  • if the image is larger than the post textarea div width and no width lower than the post textarea div width is set, then proportionally resize at the post textarea div width
  • else if the image is larger than the post textarea div width but a width lower than the post textarea div width is set, then proportionally resized at the image width set
  • else if the image is lower or equal to the post textarea div width and no width lower than the original image width is set, then display at the image original size
  • else if the image is lower or equal to the post textarea div width and a width lower than the original image width is set, then proportionally resized at the image width set
Asgaros and FTP have reacted to this post.
AsgarosFTP
Quote from radone on September 12, 2017, 2:21 pm

Hi Yworld,

i added this plugin (Remove Dashboard Access ) and now every thing is going ok but when i click the images on post its not enlarge .

Hi Radone

I have downloaded the plugin but what is the next step?

I want to insert the image in the post directly. Thank you very much.

on my website image uploader doesn’t work i don’t know why, i Increase image uploader size but shows me error mesege for can’t uploading file and don’t know the problem but last update fixes everything

Hi All. I have implemented the function code and also the plugin to restrict the users to see the other images.

This solution works well when the user is registered as EDITOR or ADMIN.

For participants, collaborators and authors, the bottom to upload the files does not appear.

What i am forgetting here?

Hello @llm

Can you show me the exact code which you are using?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
PreviousPage 3 of 3