PM Attachments

Started by SoLoGHoST, August 20, 2009, 09:08:18 AM

Previous topic - Next topic

dougiefresh

I can't see the thread you linked to.....

aegersz

neither can I. someone deleted my thread.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

Quote from: aegersz on October 15, 2017, 01:25:08 PM
neither can I. someone deleted my thread.
Hmmm....  Unfortunate.  Perhaps I can come up with something....  Or you could share your solution in this thread?

BTW, if moderators have a problem with this, please speak up!

aegersz

sure. I run a VPS and when I started I didn't know much about Linux so I installed almost everything I could.

I also had to configure a mail server, Postfix.

Postfix has an option to (BCC) blind carbon copy ALL mail both in and out to a nominated account ... I simply set that and then I could see the PM notification emails and their attachments. I am worried about people sending password protected zip file attachments in an attempt to solicit as well as normal PMs to do the same.

so now I can read each PM and can audit them as they appear. simple.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

Okay, so not a mod-related solution....  Gotcha....

dougiefresh

#325
Quote from: aegersz on October 14, 2017, 07:47:10 AM
Hi dougie, how/where i can access the attachments sent in PMs ?

I know in which directory you have them but i'd like to audit them (encryption is ON, also) ... is this possible ?
Just so that you know, SMF's official response to the question of allowing admin to read other member's PMs not addressed to admin can be read in this thread.  I strongly suggest you read the thread.  And, yes, I realize that you already figured a solution to your needs....

Personally, I would be hesitant to add such capability to this mod, as doing so might get the mod rejected from the customization site.  While I share the ability to update the mod with SoLoGHoST, it is NOT my mod....  (I still consider it MINEO:) )

EDIT:  Fixed the very first statement to read "to read other member's PMs not addressed to admin"....

aegersz

thanks, I read the topic and it makes sense to almost every forum except mine. The only thing i can add is that I use the PM Warning mod to let members know that;

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
|  Note: All PMs are visible to staff and may be subject to an audit at any time            |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

GL700Wing

I've found an anomaly and a minor display bug with this mod in relation to PM attachments.

The anomaly is the permission to prevent people viewing attachments that have been sent to them with a PM.  I understand the need to manage who can actually send attachments but surely if someone has received an attachment with a PM they should be always be allowed to see it.  As such I think the permission to allow/disallow/deny viewing attachments sent with a PM should be removed.

The minor display bug is the attachment row has a horizontal scroll bar - a small adjustment to the installation code (ie, reduce width from 100% to 98%) for ./Themes/default/PersonalMessage.template.php removes the horizontal scroll bar.

Find:
// Show the member's signature?

Add Before:
// Assuming there are attachments...
if (allowedTo('pm_view_attachments') && !empty($message['attachment'])) {


echo '
<div id="post_', $message['id'], '_footer" class="attachments">';

echo '
<hr width="98%" size="1" class="hrcolor" />
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', '; width: 98%;">';

foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> ';

echo '
(', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
echo '
</div></div>';

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

GL700Wing

#328
I discovered another minor bug with this mod - there is no option to clear/remove attachments while composing a PM unless you start a new message.

In the mod installer file for ./Themes/default/PersonalMessage.template.php (the value for 'size' has also been made consistent with the 'size' value in ./Themes/default/Post.template.php)

Find:
<input type="file" size="38" name="attachment[]" class="input_file" />';
Replace:
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';


Find:
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[
var allowed_attachments = ', $context['num_allowed_attachments'], ' - 1;

function addAttachment()
{
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="38" name="attachment[]" class="input_file" /><\' + \'/dd><dd class="smalltext" id="moreAttachments"><a href="javascript:void(0);" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');

allowed_attachments = allowed_attachments - 1;

return true;
}
// ', ']', ']></script>


Replace:
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[
var allowed_attachments = ', $context['num_allowed_attachments'], ';
var current_attachment = 1;

function addAttachment()
{
allowed_attachments = allowed_attachments - 1;
current_attachment = current_attachment + 1;
if (allowed_attachments <= 0)
return alert("', $txt['more_attachments_error'], '");

setOuterHTML(document.getElementById("moreAttachments"), \'<dd class="smalltext"><input type="file" size="60" name="attachment[]" id="attachment\' + current_attachment + \'" class="input_file" /> (<a href="javascript:void(0);" onclick="cleanFileInput(\\\'attachment\' + current_attachment + \'\\\');">', $txt['clean_attach'], '</a>)\' + \'</dd><dd class="smalltext" id="moreAttachments"><a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')<\' + \'/a><\' + \'/dd>\');

return true;
}
// ', ']', ']></script>
Life doesn't have to be perfect to be wonderful ...

dougiefresh

Uploaded v2.6 - December 6th, 2017
o Per GL700Wing: Horizontal scroll bar beneath PM attachments has been fixed.
o Per GL700Wing: Added missing functionality to clear/remove attachments.




@GL700Wing:  Thank you for both the bug fixes that you provided!  The changes you suggested have been incorporated into the mod for this version!

Quote from: GL700Wing on November 29, 2017, 11:24:32 PM
The anomaly is the permission to prevent people viewing attachments that have been sent to them with a PM.  I understand the need to manage who can actually send attachments but surely if someone has received an attachment with a PM they should be always be allowed to see it.  As such I think the permission to allow/disallow/deny viewing attachments sent with a PM should be removed.
Let me think about this one....

GL700Wing

Found one other minor annoyance/issue - every time I install this mod it overwrites the PM Attachment settings I had previously saved with the default settings.

In the db_install.php in the mod:
Find:
$smcFunc['db_insert']('replace',

Replace:
$smcFunc['db_insert']('ignore',
Life doesn't have to be perfect to be wonderful ...

SoLoGHoST

Quote from: GL700Wing on November 29, 2017, 11:24:32 PM
I've found an anomaly and a minor display bug with this mod in relation to PM attachments.

The anomaly is the permission to prevent people viewing attachments that have been sent to them with a PM.  I understand the need to manage who can actually send attachments but surely if someone has received an attachment with a PM they should be always be allowed to see it.  As such I think the permission to allow/disallow/deny viewing attachments sent with a PM should be removed.

I disagree.  The site administrator should have complete control over who views/downloads what on their site.  Also, it is possible that some groups of people may not wish to receive attachments via PM, for whatever reason.  The admin can than simply add these people to a group and just disable viewing attachments for these members by setting the permission on this.  The ability to view attachments could also be post related, for example, when a user has a certain amount of posts on the site.  This can help to increase traffic on the site, and help to encourage activity, instead of people just registering on the site for the ability to use up the sites bandwidth in downloading an attachment that someone wants to share with them.  Also, prevents people from sharing illegal files to unknown members with no activity.  There could be many other reasons as well.

GL700Wing

Quote from: SoLoGHoST on December 07, 2017, 12:14:28 PM
Quote from: GL700Wing on November 29, 2017, 11:24:32 PM
I've found an anomaly and a minor display bug with this mod in relation to PM attachments.

The anomaly is the permission to prevent people viewing attachments that have been sent to them with a PM.  I understand the need to manage who can actually send attachments but surely if someone has received an attachment with a PM they should be always be allowed to see it.  As such I think the permission to allow/disallow/deny viewing attachments sent with a PM should be removed.

I disagree.  The site administrator should have complete control over who views/downloads what on their site.  Also, it is possible that some groups of people may not wish to receive attachments via PM, for whatever reason.   The admin can than simply add these people to a group and just disable viewing attachments for these members by setting the permission on this.  The ability to view attachments could also be post related, for example, when a user has a certain amount of posts on the site.  This can help to increase traffic on the site, and help to encourage activity, instead of people just registering on the site for the ability to use up the sites bandwidth in downloading an attachment that someone wants to share with them.  Also, prevents people from sharing illegal files to unknown members with no activity.  There could be many other reasons as well.
My reasoning for thinking this is an anomaly is that PMs are private/personal and as such I believe a site administrator shouldn't be able to prevent members who are allowed to read PMs from being able to see attachments that have been sent with them.  That said, I hadn't thought about the situation where some members may not want to receive attachments via PMs.

Currently if a member isn't allowed to Read PMs a warning message is displayed if you try to send them a PM.  However, there is no similar warning message displayed if you try to send an attachment to a member who isn't allowed to view it - in retrospect this is what is actually needed.
Life doesn't have to be perfect to be wonderful ...

-Rock Lee-

I leave the translation to normal Latin Spanish and utf-8, I have some technical doubts in some lines but try to translate it as well as possible any problem let me know :-[ I think I did not miss any line but equally anything tells me...


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

dougiefresh

Quote from: GL700Wing on December 07, 2017, 04:46:58 PM
Currently if a member isn't allowed to Read PMs a warning message is displayed if you try to send them a PM.  However, there is no similar warning message displayed if you try to send an attachment to a member who isn't allowed to view it - in retrospect this is what is actually needed.
I will see what I can do about this feature request....

dougiefresh

@Rock Lee:  Your translation has been included for the upcoming version!  Thank you!

landyvlad

What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

dougiefresh

Quote from: landyvlad on December 18, 2017, 07:28:05 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)
First, Package Manager won't allow you to install a newer version of a mod while an older version is installed.  If the package supports upgrading, Package Manager will give you the option to upgrade to the new version.  Most of my mods do not support upgrades in that fashion, mostly because some servers have issues with multiple install XML files and aren't smart enough to make it work....

The proper way to upgrade any mod that doesn't give the option through Package Manager is to uninstall the current version of the mod, then install  the new version.  Immediately deleting the old version is not mandatory at any stage of the upgrade process, although if you are happy with the new version, deletion of the old version is recommended.

dougiefresh

Uploaded v2.7 - December 8th, 2017
o Added Spanish Latin translation, courtsey of Rock Lee!

Uploaded v2.8 - January 10th, 2017
o Added checks to make sure everybody involved can see the attached files in the PM.




@Rock Lee:  Your translation has been included in version 2.7, which (I think) made it to my server, but not the mod download page.  Thank you!

@GL700Wing:  Sorry it took forever to get the feature request done, but done it finally is!

GL700Wing

Quote from: dougiefresh on January 11, 2018, 10:32:38 AM
Uploaded v2.8 - January 10th, 2017
o Added checks to make sure everybody involved can see the attached files in the PM.


@GL700Wing:  Sorry it took forever to get the feature request done, but done it finally is!
Many thanks - will check it out late next or early the following week (currently away on holidays).
Life doesn't have to be perfect to be wonderful ...

Advertisement: