Advertisement:

Author Topic: PM Attachments  (Read 101436 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #320 on: October 15, 2017, 10:52:15 AM »
I can't see the thread you linked to.....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,117
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: PM Attachments
« Reply #321 on: October 15, 2017, 01:25:08 PM »
neither can I. someone deleted my thread.
SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #322 on: October 17, 2017, 12:41:57 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!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,117
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: PM Attachments
« Reply #323 on: October 17, 2017, 01:46:29 PM »
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.
SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #324 on: October 18, 2017, 10:12:38 AM »
Okay, so not a mod-related solution....  Gotcha....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #325 on: November 19, 2017, 10:55:11 PM »
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"....
« Last Edit: November 19, 2017, 11:44:08 PM by dougiefresh »
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline aegersz

  • Sophist Member
  • *****
  • Posts: 1,117
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: PM Attachments
« Reply #326 on: November 23, 2017, 02:36:12 AM »
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            |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
SMF 2.0: 135+ mods installed (the full list can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Online GL700Wing

  • Jr. Member
  • **
  • Posts: 269
  • Gender: Female
Re: PM Attachments
« Reply #327 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.

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:
Code: [Select]
// Show the member's signature?
Add Before:
Code: [Select]
// 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>';

}

Online GL700Wing

  • Jr. Member
  • **
  • Posts: 269
  • Gender: Female
Re: PM Attachments
« Reply #328 on: November 30, 2017, 02:03:44 AM »
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:
Code: [Select]
<input type="file" size="38" name="attachment[]" class="input_file" />';Replace:
Code: [Select]
<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:
Code: [Select]
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:
Code: [Select]
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>
« Last Edit: November 30, 2017, 03:03:29 AM by GL700Wing »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #329 on: December 06, 2017, 12:17:05 PM »
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!

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....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Online GL700Wing

  • Jr. Member
  • **
  • Posts: 269
  • Gender: Female
Re: PM Attachments
« Reply #330 on: December 07, 2017, 01:17:55 AM »
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:
Code: [Select]
$smcFunc['db_insert']('replace',
Replace:
Code: [Select]
$smcFunc['db_insert']('ignore',

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,795
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: PM Attachments
« Reply #331 on: December 07, 2017, 12:14:28 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.

Online GL700Wing

  • Jr. Member
  • **
  • Posts: 269
  • Gender: Female
Re: PM Attachments
« Reply #332 on: December 07, 2017, 04:46:58 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.

Offline Rock Lee

  • Sophist Member
  • *****
  • Posts: 1,179
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: PM Attachments
« Reply #333 on: December 07, 2017, 07:30:23 PM »
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 © 2017
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #334 on: December 07, 2017, 11:31:06 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....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: PM Attachments
« Reply #335 on: December 08, 2017, 10:21:05 PM »
@Rock Lee:  Your translation has been included for the upcoming version!  Thank you!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!