Previous Thread
Next Thread
Print Thread
Hop To
Inline Image Embeds #263125 09/03/2019 1:38 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
I did a test photo upload and embed into a post, but they're only visible when I'm logged on.

https://www.electrical-contractor.net/forums/ubbthreads.php/topics/220154/3.html

Any ideas?

Re: Inline Image Embeds [Re: ECNet] #263126 09/03/2019 1:40 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
If your forum does not allow attachments to be viewed by guests (not logged in), guests will not be able to view embedded attachments.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: isaac] #263127 09/03/2019 2:14 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Originally Posted by isaac
If your forum does not allow attachments to be viewed by guests (not logged in), guests will not be able to view embedded attachments.

I had tried enabling attachment downloads for guests earlier, but it didn't seem to help me see the embeds at the bottom of page 2

Right now they are enabled for Guests and I can see the new one I did today on page 3, but not the older one at bottom of page 2.
Signing on as a member it is the same way.

If I sign on as Admin I can see them both.

Can you see embeds on bottom of page 2?

https://www.electrical-contractor.net/forums/ubbthreads.php/topics/220154/2.html

Last edited by ECNet; 09/03/2019 2:14 PM. Reason: added link
Re: Inline Image Embeds [Re: ECNet] #263128 09/03/2019 2:20 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
From post:
https://www.electrical-contractor.n...orum-updates-coming-soon.html#Post220213

I get:
"You do not have access to download this attachment."

The image linked is:
https://www.electrical-contractor.n...ownload/Number/605/filename/DCP_0004.JPG

Possible answers:
Check that the attached image embedded from a forum where GUESTS have permission to download from.
Check that the attached image was not deleted from your forum. It wont be displayed if it was deleted.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263129 09/03/2019 2:29 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
The images are both there. Attachment Downloads for Guests is enabled.
These are both in the same Forum/Thread

Image on page 2 is viewable only when I'm signed on as Admin: (not as Guest or Member)

https://www.electrical-contractor.n...ownload/Number/605/filename/DCP_0004.JPG

Image on page 3 can now be seen by all after enabling Attachment Downloads for Guests:

https://www.electrical-contractor.n...ownload/Number/608/filename/DCP_0009.JPG


Last edited by ECNet; 09/03/2019 2:30 PM.
Re: Inline Image Embeds [Re: ECNet] #263130 09/03/2019 2:37 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
edit the post and view the attachment in the attachment manager.

if you don't see the file attached to that post, then it doesnt exist. your browser is attempting to be helpful in showing your a cached version of it.

if you do see the file there, then attempt to embed it again. look at the file name of your new embed vs your old embed. im guessing that it will be different.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263131 09/03/2019 3:10 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
When I went to edit it showed no attachments. I embedded them again and now it works and shows a different Number:

https://www.electrical-contractor.n...ownload/Number/612/filename/DCP_0004.JPG

Where do the images get stored, and what would make them go away?

Re: Inline Image Embeds [Re: ECNet] #263132 09/03/2019 3:14 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Attachments are stored in the Attachment Storage Directory:
Control Panel > Paths & Database > Attachment Storage Directory

Attachments are deleted when:
If you click on the trashcan next to the attachment in the attachment manager, the attachment will be deleted.
If you do not save your post with the newly attached item, the attachment will be deleted.
If you delete the post, its attachments are also deleted.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263133 09/03/2019 4:47 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Could be wrong, but I didn't think I did anything to delete the attachment and that it did work for sometime after and then not.

It's working now, but still seems odd:

The original image is still there in the Attachment Directory:

https://www.electrical-contractor.net/forums/upload/attach/605.jpg

I created a new post with the old non-working link in img tags...

I updated the Forum Cache (in Chrome) opened a FireFox Browser, (which I rarely use), cleared the History and signed on as Admin.

I can see the original image in the new post I just made with the original link ( https://www.electrical-contractor.n...ownload/Number/605/filename/DCP_0004.JPG )




Last edited by ECNet; 09/03/2019 4:48 PM.
Re: Inline Image Embeds [Re: ECNet] #263134 09/03/2019 4:59 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
And...

After Logging out as Admin I can't see it as Member or Guest.
If I was seeing a cached Image as Admin wouldn't I still be able to see it ?

Re: Inline Image Embeds [Re: ECNet] #263135 09/03/2019 5:14 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Nothing really has changed in many years about how the attached files are handled, other than image compression, and image orientation via its exif data.

The embedding of post attachments in to the post body is nothing magical.
1/ the current code just takes the URL that would appear in the attachments section, and places it in to the post.
2/ upon display of the post, if there are links inside the post which are matched with attached file links, the attached file links will not be shown. this is done to prevent duplication of the same content on the screen.

Its really not magical at all. "If IMAGE00 is in the post, dont show IMAGE00 in the attachment group."

for example, you can have 10 attachments. embed 2 of them. have the remaining 8 show in the attachment group. it is basically what an article would be; attach all the relevant graphics, such as a lead image. then use 1 or 2 items as examples. and then followup with the attachment-grouping of the rest.

--

I see that you have hot-linked (posted a direct link) to your attachment directory, and a file within it.

When you bypass the UBB.threads attachments permission system by hot-linking to an attachment, you are hard-coding it in to your post.

Rather than hot-linking directly to the images within the server file system, UBB.threads uses a attachments permission system to control which member groups have permission to see the attachments.

By using the permission system, we can also move the storage directory around to wherever, and still have it function correctly in the post body because we are using the UBB.threads settings to grab the file name and directory. All that would be needed is to update UBB.threads's attachment storage directory path in the control panel.

Use .htaccess to secure your directory against hot-linking. But if you have several posts where you've already hot-linked to your files, those links will be blocked.

Last edited by isaac; 09/03/2019 5:23 PM. Reason: removed an editorial random clipboard copy/paste

Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263136 09/03/2019 5:42 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
I think we're missing each other here.

I direct linked to show the original file was still in the Attachments Directory.

If I understand you correctly a link going through the Forum Software with https://www.electrical-contractor.n...ownload/Number/605/filename/DCP_0004.JPG would be a permission based thing.

If I have Attachment Downloads enabled for Guest on Up why can only the Admin see it?

Re: Inline Image Embeds [Re: ECNet] #263137 09/03/2019 5:46 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Confirm the member group permission for that forum is set correctly.

You may also want to review:
Control Panel > Attachments > Max File Size for Displaying Attached Images Inline
I believe 5MB is the default for this.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263138 09/03/2019 6:10 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Here's the Permissions settings for that Forum:
[Linked Image]

Attachment Settings... I don't have anything that says Max Size. Is that what the second setting should say?
[Linked Image]

Do I even need to have a Maximum Attachment size for Guests as they're not permitted to upload any?

Last edited by ECNet; 09/03/2019 6:12 PM.
Re: Inline Image Embeds [Re: ECNet] #263139 09/03/2019 6:15 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
It looks like you are missing several language strings from an incomplete upgrade.

i sent you a PM


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263140 09/03/2019 6:21 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Here's another question...

The following are both the same image, but you can only see one of them:
If permissions were set wrong you shouldn't be able to see either, right?

https://www.electrical-contractor.n...ownload/Number/605/filename/DCP_0004.JPG

https://www.electrical-contractor.n...ownload/Number/612/filename/DCP_0004.JPG

Re: Inline Image Embeds [Re: ECNet] #263141 09/03/2019 6:27 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
I should've said copies of the same image. First one was uploaded about 2 weeks ago and the second today

Re: Inline Image Embeds [Re: ECNet] #263142 09/03/2019 6:59 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Code
https://www.electrical-contractor.net/forums/ubbthreads.php/ubb/download/Number/605/filename/DCP_0004.JPG

https://www.electrical-contractor.net/forums/ubbthreads.php/ubb/download/Number/612/filename/DCP_0004.JPG

They may both be the same photo, but they are not the same file.

One file is a file stored with "FILE_ID 605" and the other is a file stored with "FILE_ID 612".

Permissions for each FILE_ID are based on which forum the post lives in, and what the user's access is set to.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: isaac] #263143 09/03/2019 7:23 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Originally Posted by isaac


They may both be the same photo, but they are not the same file.

One file is a file stored with "FILE_ID 605" and the other is a file stored with "FILE_ID 612".

Permissions for each FILE_ID are based on which forum the post lives in, and what the user's access is set to.


I understand that, that's why I clarified they were copies of the same image. And, they were uploaded to the same thread, and attempted to be seen by the same person so if only one can be seen there must be something else going on. There must be somehow be different permissions for each image that is not overridden by the CP settings

Anyway, if you think what might be the cause of that let me know, otherwise I'll keep an eye on things to see if it happens again.

Re: Inline Image Embeds [Re: ECNet] #263144 09/03/2019 9:14 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
I took a look in the Database and noticed the Image that can't be seen (605) has a different Post ID (220211) than the newly uploaded one (Image File 605 with Post ID 220213)

Not sure how it happened, but somehow I had images associated with Post ID 220211 linked inside Post #220213

So uploaded attachments are tied to a specific Post?

As Admin I can still see a Post #220211 that has the older images. What am I looking at?

Re: Inline Image Embeds [Re: ECNet] #263145 09/03/2019 9:24 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Yes. post attachments are tied to the post they are attached to.

When a post is displayed, all attachments matching that post id are displayed with the post.
When the post is deleted, so are its attachments.

Attachment view/download permissions are granted based on what post they are attached to, and the post + its parent's permission settings.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263146 09/03/2019 9:57 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
If the Post was deleted and Forum Cache Updated why can I as Admin still see a Post #220211 that has the older images?
Are they never really deleted?

Re: Inline Image Embeds [Re: ECNet] #263147 09/03/2019 10:11 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
This is the file operation which happens when you delete a post:

Code
	$query = "
		select FILE_NAME,FILE_DIR
		from {$config['TABLE_PREFIX']}FILES
		where POST_ID = ?
	";
	$sth = $dbh->do_placeholder_query($query, array($Number), __LINE__, __FILE__);
	while (list($File, $dir) = $dbh->fetch_array($sth)) {
		if (!$dir) {
			unlink("{$config['ATTACHMENTS_PATH']}/$File");
		} else {
			unlink("{$config['FULL_PATH']}/gallery/$dir/full/$File");
			unlink("{$config['FULL_PATH']}/gallery/$dir/medium/$File");
			unlink("{$config['FULL_PATH']}/gallery/$dir/thumbs/$File");
		}
	}
SOURCE: scripts/deletepost.inc.php


unlink — Deletes a file
https://www.php.net/manual/en/function.unlink.php


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: ECNet] #263148 09/03/2019 10:28 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Okay...

I just figured this thing out facepalm

Post # 220211 is in a Forum only accessible to Moderators and Admin.
So, images associated with that post could not be seen by Members or Guests.

But... apparently images linked to posts in accessible forums can be embedded in other posts and in different threads (without uploading) using the img tags

wonder if it would work here too...

[Linked Image from electrical-contractor.net]

Re: Inline Image Embeds [Re: ECNet] #263149 09/03/2019 10:28 PM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Yup!

Re: Inline Image Embeds [Re: ECNet] #263152 09/09/2019 3:29 AM
Joined: Sep 2019
Posts: 1
sloger5 Offline
Stranger
Offline
Stranger
Joined: Sep 2019
Posts: 1
Same problem... Nothing helps. frown

Re: Inline Image Embeds [Re: sloger5] #263153 09/09/2019 8:45 AM
Joined: Mar 2007
Posts: 244
ECNet Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Mar 2007
Posts: 244
Originally Posted by sloger5
Same problem... Nothing helps. frown

sloger5,

In my case the referenced image was an attachment in a Private Forum. That's why general Membership and Guests weren't eligible to see it.
It was not a software issue like I had originally thought.

Re: Inline Image Embeds [Re: sloger5] #263154 09/09/2019 12:28 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Originally Posted by sloger5
Same problem... Nothing helps. frown

Seeing as this is your first post and you havent shared any details about your forum or your issue...

What version of UBB.threads do you have installed? What steps have you tried already?
Please describe the issue you are having, or post a link to it, so someone can further assist you with it.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: Inline Image Embeds [Re: sloger5] #263155 09/09/2019 5:39 PM
Joined: Dec 2003
Posts: 5,998
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,998
As isaac stated it would be helpful to state what version you are using and if it is a upgrade or new install.
As well as the url to the site.
Same problem does not mean same issues..
It can be many issues such as you tried to upload a file that is not supported in settings or exceeds the hosts php.ini setting which ubb will not supersede

For one example when you create the storage folder you must click on the test directory link., It creates a file in that folder that is needed..

There are several of us here willing to help by simple registering on your site and testing.

Last edited by Ruben; 09/09/2019 5:42 PM.

Blue Man Group
There is no such thing as stupid questions. Just stupid answers

Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Mobile app?
by Baldeagle - 12/06/2019 9:32 PM
How do you change Text Line spacing?
by jorb - 11/23/2019 12:14 AM
What happened to FAQ or Forum Help
by Ruben - 11/20/2019 11:58 AM
Search feature encountering an Error message
by jorb - 11/20/2019 12:06 AM
Followed List v7.7.2 Question
by Ruben - 11/12/2019 12:22 PM
Who's Online Now
1 registered members (JAISP), 84 guests, and 424 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191023)