Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: FOxsis on May 13, 2025, 04:08:36 AM

Title: Show photos
Post by: FOxsis on May 13, 2025, 04:08:36 AM
hello. please tell me why the files attached to the comments when switching from smf 2.0 to smf 2.1.4 (standard template), the error File not found appears. Example: https://forum.expert-cm.ru/index.php?action=dlattach;attach=29249
Title: Re: Show photos
Post by: Doug Heffernan on May 13, 2025, 05:59:12 AM
Quote from: FOxsis on Yesterday at 04:08:36 AMhello. please tell me why the files attached to the comments when switching from smf 2.0 to smf 2.1.4 (standard template), the error File not found appears. Example: https://forum.expert-cm.ru/index.php?action=dlattach;attach=29249

Try running the script attached to the following post and see if it would help.

https://www.simplemachines.org/community/index.php?topic=583745.msg4135957#msg4135957
Title: Re: Show photos
Post by: FOxsis on May 13, 2025, 09:22:17 AM
and how do they use this file?
Title: Re: Show photos
Post by: Doug Heffernan on May 13, 2025, 11:57:53 AM
Quote from: FOxsis on Yesterday at 09:22:17 AMand how do they use this file?

Do you mean how to use that file? If so, download it from the post that I linked in my previous reply, upload it to your forum root folder and run it by pointing your browser to it.
Title: Re: Show photos
Post by: Sir Osis of Liver on May 13, 2025, 04:49:32 PM
Here is an updated version of the script.  It works on /attachments.  If you have more than one attachments directories I have additional scripts, or you can easily modify this one if you know how.


Title: Re: Show photos
Post by: FOxsis on May 14, 2025, 01:08:22 AM
I'm a kettle, please help me with running the script, I've changed the bat to jpg, uploaded it to the root, launched it, but no changes (
Title: Re: Show photos
Post by: FOxsis on May 14, 2025, 04:38:51 AM
Quote from: FOxsis on Today at 01:08:22 AMI'm a kettle, please help me with running the script, I've changed the bat to jpg, uploaded it to the root, launched it, but no changes (
help me please
Title: Re: Show photos
Post by: Aleksi "Lex" Kilpinen on May 14, 2025, 04:46:01 AM
We are all volunteers here, so please understand support may not be available in real time.

Then, it is a php file, not a bat or an image. A php file should be executable as is.
Title: Re: Show photos
Post by: FOxsis on May 14, 2025, 05:56:04 AM
Quote from: Aleksi "Lex" Kilpinen on Today at 04:46:01 AMWe are all volunteers here, so please understand support may not be available in real time.

Then, it is a php file, not a bat or an image. A php file should be executable as is.
it edit
if (strpos($file, '.jpg') === false) {
       rename($file, $file . ".jpg");
       $fixed = $fixed +1;
Title: Re: Show photos
Post by: Aleksi "Lex" Kilpinen on May 14, 2025, 07:47:59 AM
Well, it should be .dat - if that's what you ran, you probably just made things worse. Why did you edit it at all?
Title: Re: Show photos
Post by: FOxsis on May 14, 2025, 09:54:08 AM
Quote from: Aleksi "Lex" Kilpinen on Today at 07:47:59 AMWell, it should be .dat - if that's what you ran, you probably just made things worse. Why did you edit it at all?
I ran this file without changes, but nothing happened.
Title: Re: Show photos
Post by: Aleksi "Lex" Kilpinen on May 14, 2025, 10:32:19 AM
Before or after you ran the edited one?
Title: Re: Show photos
Post by: Sir Osis of Liver on May 14, 2025, 12:54:58 PM
Look in your /attachments directory, do all the files have a .dat extension?

Like this -

   03707e33f8bf1d1f347b671d7739a1bd90475c10.dat