Previous Thread
Next Thread
Print Thread
Hop To
#263125 09/03/2019 2:38 PM
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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?

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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 3:14 PM. Reason: added link
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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 3:30 PM.
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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?

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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 5:48 PM.
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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 ?

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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 6:23 PM. Reason: removed an editorial random clipboard copy/paste

Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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?


Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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 7:12 PM.
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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


Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
I should've said copies of the same image. First one was uploaded about 2 weeks ago and the second today

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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.

ECNet #263144 09/03/2019 10:14 PM
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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?


ECNet #263145 09/03/2019 10:24 PM
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
ECNet #263146 09/03/2019 10:57 PM
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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?

ECNet #263147 09/03/2019 11:11 PM
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
ECNet #263148 09/03/2019 11:28 PM
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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]

ECNet #263149 09/03/2019 11:28 PM
Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
Yup!

Joined: Sep 2019
Posts: 1
S
Stranger
Stranger
S Offline
Joined: Sep 2019
Posts: 1
Same problem... Nothing helps. frown

Joined: Mar 2007
Posts: 285
Likes: 1
E
Enthusiast
Enthusiast
E Offline
Joined: Mar 2007
Posts: 285
Likes: 1
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.

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
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 6:42 PM.

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

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Havenofsobriety, rootman), 624 guests, and 106 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)