News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post and PM Inline Attachments

Started by dougiefresh, July 26, 2014, 09:14:08 PM

Previous topic - Next topic

Dave J

Hi GW,

I installed on my test site and it worked OK.

You were more than right about the left over of previous installs. I uninstalled v7.0 and tried to install v6.16 and had problems. So what I did then was deleted all site files and database and uploaded my backup from Monday night, including the database.

This should have resulted in the site going back to normal, however, because of the size of the 'attachments' folder I had omitted that from recent cron backups and after checking posts with images none of the images appeared. Still not realising the folder was missing, I uninstalled v6.16 and I went through evey file affect by all ILA versions, which included and old ILA-v1.21, I'd previously installed and found a lot of code that was still in the files.

Once I had done this I re-installed highslide and v7.0 and the install went OK except for one file which I then manually installed the code. This resulted in a good install but I still could not see the images only the place holders. Still not realising the missing folder I created a test post to see if it was a problem somewhere else and low and behold when I clicked on the post button the error came back saying the attachments folder was not writable, so that's when I found out the folder was missing.

At this moment I am waiting for my host to replace the folder from the server backups they do daily, it's going to cost me $25 but at least I'll have all the images back again, the most recent backup I had of that folder was 2019....that's a lot of missing images.

Needless to say I have now included the attachments folder in the next cron backup.

At this moment I think v7.0 will work OK. I haven't replaced the attachments folder yet because if I do that and the host looks they might think another engineer has done it and not bother, so everything is pending.

Thanks for all your replies and I will let you know if things are OK once I get the 'attachments' folder back. G'Day  ;)
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GL700Wing

Wow - what an experience!

My hosting provider provides 1-2 hourly backups of all my forum content which are then made available in a range of increments (eg, all backups for last 24 hours, one backup per day for the previous week, and then one backup a week for the last month) for all of which I can access/restore via cPanel.

However, and because I don't want to totally reliant on any hosting provider (and because I was a Unix SysAdmin for +20 years),  I've written my own backup scripts which I use to backup all my forums every night to a facility in the US (costs me US$5 per month for 50Gb of storage) as follows:
One copy of all attachments;
A week's worth of forum folder backups;
A month's worth of database backups.

Good luck with your hosting company - hopefully they'll have all your attachments restored quickly.

And G'Day to you too!!


Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
Wow - what an experience!

My hosting provider provides 1-2 hourly backups of all my forum content which are then made available in a range of increments (eg, all backups for last 24 hours, one backup per day for the previous week, and then one backup a week for the last month) for all of which I can access/restore via cPanel.

That must be a huge amount of storage they have for all those backups

Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
However, and because I don't want to totally reliant on any hosting provider (and because I was a Unix SysAdmin for +20 years),  I've written my own backup scripts which I use to backup all my forums every night to a facility in the US (costs me US$5 per month for 50Gb of storage) as follows:
One copy of all attachments;
A week's worth of forum folder backups;
A month's worth of database backups.

I have a Synology NAS drive at home and I run XCloner3.5 on my site via a cron job to back up via FTP, as the site is very quiet I only need to back it up once a week so the storage, which also houses my music collection, doesn't cost me anything, apart from the initail outlay for the drive itself.

Quote from: GL700Wing on February 05, 2021, 04:16:26 AM
Good luck with your hosting company - hopefully they'll have all your attachments restored quickly.

Thanks again
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GigaWatt

Question: Will the BB code work in 2.1 if I install this in 2.0?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

@rjen

Find attached the updated dutch language files for the latest version
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Uploaded v7.01 - February 06, 2021
o Fixed issue where images were not displayed in other topics for quoted 'attach', 'attachthumb' or 'attachmini' BBCodes.
o Minor bug fix relating to information displayed below 'attachurl' links.
o Bug fix relating to some thumbnail images not expanding as expected.
o Removed installation code introduced in v6.18 that allowed this mod to be installed after the Automatic Attachment Rotation (and Resize) mod.  The Automatic Attachment Rotation (and Resize) mod must be installed after this mod (and it must be removed prior to uninstalling this mod).



IMPORTANT NOTE: In order to fully support the Automatic Attachment Rotation (and Resize) mod you must install this mod first!!
Also, if you subsequently need to uninstall this mod you must uninstall the Automatic Attachment Rotation (and Resize) mod beforehand.



Many thanks to @rjen for the Dutch language files.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Hi GL,

Just to let you know that the attachments folders, yes there were 2, are now back and 7.01 is working fine.

Thanks for all the help
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GL700Wing

Quote from: Dave J on February 15, 2021, 04:06:08 AM
Hi GL,

Just to let you know that the attachments folders, yes there were 2, are now back and 7.01 is working fine.

Thanks for all the help
Great news - and thanks for letting me know!
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

I've just discovered a minor issue that was introduced with v7.01 which will prevent image attachments from expanding if they are inserted with the 'attach' or 'attachmini' options.

Note:  As the v7.01 installer file had only been downloaded 2-3 times since it was released I'm suggesting the following fix/workaround until such time as the next version is released.

Either of the following fixes can be applied without it affecting the ability of the mod to be uninstalled at a later time:

Fix One:
In ./Sources/Subs-InlineAttachments.php - Line 1005
Find:
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = false)
Replace With
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = true)

Fix Two:
Replace your /Sources/Subs-InlineAttachments.php file with the attached Subs-InlineAttachments.php file.

I've also updated the v7.01 mod installer file.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Quote from: GL700Wing on February 15, 2021, 05:24:17 PM
I've just discovered a minor issue that was introduced with v7.01 which will prevent image attachments from expanding if they are inserted with the 'attach' or 'attachmini' options.

Note:  As the v7.01 installer file had only been downloaded 2-3 times since it was released I'm suggesting the following fix/workaround until such time as the next version is released.

Either of the following fixes can be applied without it affecting the ability of the mod to be uninstalled at a later time:

Fix One:
In ./Sources/Subs-InlineAttachments.php - Line 1005
Find:
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = false)
Replace With
function ILA_subfunction($id, $full, $thumb, $name, $id_thumb = '', $style = '', $has_thumb = false, $expand = true)

Fix Two:
Replace your /Sources/Subs-InlineAttachments.php file with the attached Subs-InlineAttachments.php file.

I've also updated the v7.01 mod installer file.

Hi GL,

I have already posted 'attach' images and they expand fine, have a look for yourself

https://www.davejohnson.co.uk/index.php?topic=435.msg844#new

This is the box after the decorating had been done

[attach=0]    [attach=1]
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Sectomy

i dont read the whole last pages, but, is there a possibility to make an "highslide" Mod into this, too ?
i mean, i installed that mod, only, for little Images and if you click on it, it shows full size....

isnt that an "standard" feature on most Forum Softwares ? :D
would be nice.... if it could be, or is it possible to install that mod after this mod again ? or dont do they work ?

greets
andi

GL700Wing

Quote from: Sectomy on March 05, 2021, 11:00:20 AM
i dont read the whole last pages, but, is there a possibility to make an "highslide" Mod into this, too ?
i mean, i installed that mod, only, for little Images and if you click on it, it shows full size....

isnt that an "standard" feature on most Forum Softwares ? :D
would be nice.... if it could be, or is it possible to install that mod after this mod again ? or dont do they work ?

greets
andi
This mod supports three Highslide mods:
HS4SMF v0.8.1 (must be installed before ILA)
Highslide Image Viewer
JQLightBox

I use the Highslide Image Viewer mod (which can be installed either before or after this mod) on all my forums and it works perfectly.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

@rjen

On PHP 7.4 I am getting this error:

https://www.xxxx.xx/index.php?topic=16716.msg359904
8: Trying to access array offset on value of type null
File: /home/debxxxx/domains/xxxx.xx/public_html/Sources/Subs-InlineAttachments.php
Line: 280

It happen when a quote refers to a message with inline attachments and the original message has been deleted.

Seems to be a 7.4 issue, because the $row['id_board'] is returned with a FALSE...

SMF version 2.1.18
Mod version: 7.01
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

@rjen

Quick fix...


$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
$msg_board = (int) ($row['id_board'] ?? '0');
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Quote from: @rjen on July 13, 2021, 05:56:00 AM
Quick fix...


$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);
$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
$msg_board = (int) ($row['id_board'] ?? '0');

Many thanks @rjen for identifying the issue and the fix - I'll do some more testing with PHP 7.4 and then release an update.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

WolfJ

Sorry to be a bother but just setting up a fresh forum at the moment but seem to have run into a little issue. Even though I've set the attachment tag not to include the message at the end when I test and save the post to test it, it's still adding the msg part at the end adding the topic title on the right side of the image.

Did I do something wrong, I read the read me and did everything it asked. Checked the resizing and it's worked a treat just this one issue.

Chewing on Cyanide


GL700Wing

Quote from: Legosi on August 15, 2021, 04:54:13 AM
Even though I've set the attachment tag not to include the message at the end when I test and save the post to test it, it's still adding the msg part at the end adding the topic title on the right side of the image.
Please post a screen capture of the inline attachment settings you are using and a screen capture of the issue you are seeing.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

ryry46d9

Post and PM Inline Attachments Ver.7.01 
SMF Ver.2.0.18

I some how messed my forums up to where only the admin is able to (Insert Attachment) to a post.

I have looked over the board and member permissions but I am not seeing the issue.


You cannot view this attachment.
You cannot view this attachment.


GL700Wing

#898
Quote from: ryry46d9 on August 27, 2021, 12:18:34 AMPost and PM Inline Attachments Ver.7.01 
SMF Ver.2.0.18

I some how messed my forums up to where only the admin is able to (Insert Attachment) to a post.

I have looked over the board and member permissions but I am not seeing the issue.
There are no membergroup permissions for this mod - once the mod is installed anyone who can attach a file can also insert it inline.  Are non-admin members able to attach image/other files?

I have tested the mod and membergroup settings you are using on an SMF 2.0.18 forum with only version 7.01 of this mod installed (ie, no other mods installed) and I cannot reproduce the problem.

Please post an image of the 'Start new topic'/'Post reply' window with the 'Attachments and other options' section expanded.
You cannot view this attachment.

Please also post a list of any other mods and/or themes you have installed.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

ryry46d9

sorry for the delay, I got busy

You cannot view this attachment.

as you see everything looks fine but when I try to add the picture nothing happens
 
when I add [attach id=0 msg=new] myself like
You cannot view this attachment.

I get
You cannot view this attachment.


Advertisement: