Advertisement:

Author Topic: PM Attachments  (Read 101277 times)

Offline Kinsman

  • Semi-Newbie
  • *
  • Posts: 17
Re: PM Attachments
« Reply #280 on: February 24, 2017, 01:50:39 AM »
The forum changed one line, but skipped 2, without complaining about it, I only picked it up during uninstallation, so then edited the entire file manually.

Offline GL700Wing

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Female
Re: PM Attachments
« Reply #281 on: March 06, 2017, 05:33:22 PM »
I'm getting the following errors in the log file (I've removed my forum name details from the links below):

./forum/index.php?action=dlpmattach;pm=43468;attach=523
8192: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
File: ./forum/Sources/Subs-PMAttachments.php
Line: 679


I think the code to replace 'preg_replace' stataments with 'preg_replace_callback' in ./Sources/Subs-PMAttachments.php should be as follows:

Find
Code: [Select]
      // Different browsers like different standards...
      if ($context['browser']['is_firefox'])
         header('Content-Disposition: attachment; filename*="UTF-8\'\'' . preg_replace('~&#(\d{3,8});~e', '$fixchar(\'$1\')', $utf8name) . '"');

      elseif ($context['browser']['is_opera'])
         header('Content-Disposition: attachment; filename="' . preg_replace('~&#(\d{3,8});~e', '$fixchar(\'$1\')', $utf8name) . '"');

      elseif ($context['browser']['is_ie'])
         header('Content-Disposition: attachment; filename="' . urlencode(preg_replace('~&#(\d{3,8});~e', '$fixchar(\'$1\')', $utf8name)) . '"');

      else
         header('Content-Disposition: attachment; filename="' . $utf8name . '"');

Replace with:
Code: [Select]
      // Different browsers like different standards...
      if ($context['browser']['is_firefox'])
         header('Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)));

      elseif ($context['browser']['is_opera'])
         header('Content-Disposition: attachment; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"');

      elseif ($context['browser']['is_ie'])
         header('Content-Disposition: attachment; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"');

      else
         header('Content-Disposition: attachment; filename="' . $utf8name . '"');

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #282 on: March 07, 2017, 09:12:30 PM »
Uploaded v2.1 - March 7th, 2017
o Replaced code that used preg_match with preg_match_callback.  Thanks, GL700Wing!



@GL700Wing:  Thanks for the bug report!  It's been incorporated into the mod!

@Everybody:  Since nobody has reported any new issues (aside from GL700Wing) with the mod lately, I've decided to bump it to version 2.1.....
« Last Edit: March 07, 2017, 09:42:24 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 SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,795
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: PM Attachments
« Reply #283 on: March 09, 2017, 03:38:26 AM »
Looking good dougiefresh.  Glad to see some work on this mod, and you reduced the filesize dramatically as well.  The templating and modifications in the various xml files got a bit messy due to the many upgrades along the way, as I was aiming more towards compatibility and support with other mods, and not caring too much about the amount of files or code involved in making that happen.  And besides, I was still learning about all of the various hooks in SMF as well.

Haven't tested this mod yet, but look forward to giving it a test drive soon, just to see how things look and function and/or if you've added anything new besides restructuring the code base.

Cheers :)

Offline EdjKa

  • Newbie
  • *
  • Posts: 5
Re: PM Attachments
« Reply #284 on: March 10, 2017, 10:24:15 AM »
The forum changed one line, but skipped 2, without complaining about it, I only picked it up during uninstallation, so then edited the entire file manually.

Same here, is there a way to fix the installation process?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #285 on: March 10, 2017, 11:08:27 AM »
Please attach your Themes/default/PersonalMessage.template.php after you've installed the mod, so I can see what is being missed by Package Manager.  Can't really investigate without knowing what operations are failing....
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 EdjKa

  • Newbie
  • *
  • Posts: 5
Re: PM Attachments
« Reply #286 on: March 10, 2017, 01:20:03 PM »
Here you are!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #287 on: March 11, 2017, 10:33:53 PM »
@EdjKa:  I can't reproduce the missing operations that you reported.  The file you supplied uninstalls without errors on my localhost server using the version 2.1 mod.....
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 EdjKa

  • Newbie
  • *
  • Posts: 5
Re: PM Attachments
« Reply #288 on: March 13, 2017, 07:04:10 AM »
That's really strange, i've RE-installed mod again, all LOOKS good, but nothings attaches to PM's.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #289 on: March 15, 2017, 12:12:34 AM »
Assuming you haven't uninstalled the mod since your post, attach your CURRENT PersonalMessage.template.php.  I need to know what mods you are running as well....
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 EdjKa

  • Newbie
  • *
  • Posts: 5
Re: PM Attachments
« Reply #290 on: March 15, 2017, 05:38:30 AM »
Nothing actually changed there, here you are :)

BTW Getting this error with installed mod: /home/hsghpmfx/public_html/smf/Themes/default/GenericControls.template.php (send sub template - eval?)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #291 on: March 15, 2017, 03:28:39 PM »
Uploaded v2.2 - March 15th, 2017
o Fixed PersonalMessage.template.php so that Send screen attaches files properly (again).



@EdjKa:  Thank you for providing enough to work with.  The issue you are seeing is the result of the addition not being put in the right spot.  There are two possibilities that it could go into, and the first just doesn't work for this operation.  I've fixed it to make sure it is placed on the second operation in your file.

As for the second part of your bug report (aka: GenericControls.template.php), you haven't provided enough information for me to diagnose this bug report.  I've seen many reports where the file specified that the error originates from is wrong, usually due to another mod making a change in the menus....
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 EdjKa

  • Newbie
  • *
  • Posts: 5
Re: PM Attachments
« Reply #292 on: March 15, 2017, 04:01:14 PM »
Replaced PersonalMessage with the original one, RE-installed the mod with 2.2 version and it works now! Thank you very much!

Offline DarkAngel612

  • Sophist Member
  • *****
  • Posts: 1,007
  • Gender: Female
Re: PM Attachments
« Reply #293 on: May 05, 2017, 07:02:05 PM »
smf 2.0.13
various mods installed


see this thread for the problem please, I forgot to come to this thread since it is the specific mod.

the gist: allowed pm attachments no longer show in the pm area, regardless of theme

https://www.simplemachines.org/community/index.php?topic=553678.0
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Offline SoLoGHoST

  • SMF Hero
  • ******
  • Posts: 1,795
  • Gender: Male
  • Real coders do not need to comment their code!
    • Dream Portal
Re: PM Attachments
« Reply #294 on: June 02, 2017, 10:18:32 PM »
@DarkAngel612 - Yes, the allowed attachment types should be showing up as I saw in the pic via that topic you posted, it was not there.  This was there before dougiefresh took over this mod and released a few more versions of it.  It's possible this was overlooked during the crunching of the mod filesize...  Seems like a valid design flaw to me... just my 2 cents.  Have you tried reinstalling the mod, after fully uninstalling it?  Or installing this mod on a fresh install of SMF with no other modifications installed?  If so, and same thing happens, than definitely a design flaw.

Offline DarkAngel612

  • Sophist Member
  • *****
  • Posts: 1,007
  • Gender: Female
Re: PM Attachments
« Reply #295 on: June 02, 2017, 11:46:33 PM »
@DarkAngel612 - Yes, the allowed attachment types should be showing up as I saw in the pic via that topic you posted, it was not there.  This was there before dougiefresh took over this mod and released a few more versions of it.  It's possible this was overlooked during the crunching of the mod filesize...  Seems like a valid design flaw to me... just my 2 cents.  Have you tried reinstalling the mod, after fully uninstalling it?  Or installing this mod on a fresh install of SMF with no other modifications installed?  If so, and same thing happens, than definitely a design flaw.

Yes I sure did, several times since I know 3/4 of my errors are operator trouble...can't type from time to time and then sometimes server eats files but claims they are there...LOL

No difference at all, it is still not showing up. I think I have an older version that I can look at the code to see if I can tell what is missing, then add it in there.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Offline GL700Wing

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Female
Re: PM Attachments
« Reply #296 on: June 03, 2017, 12:46:23 AM »
No difference at all, it is still not showing up. I think I have an older version that I can look at the code to see if I can tell what is missing, then add it in there.
Have you confirmed that "Check attachment's extension" is checked in Administration Center -> Attachments and Avatars -> PM Attachment Settings?  If it isn't checked 'Allowed file types' isn't displayed.

Offline DarkAngel612

  • Sophist Member
  • *****
  • Posts: 1,007
  • Gender: Female
Re: PM Attachments
« Reply #297 on: June 03, 2017, 05:18:10 AM »
No difference at all, it is still not showing up. I think I have an older version that I can look at the code to see if I can tell what is missing, then add it in there.
Have you confirmed that "Check attachment's extension" is checked in Administration Center -> Attachments and Avatars -> PM Attachment Settings?  If it isn't checked 'Allowed file types' isn't displayed.

Bless your sweet little heart sugar...you hit it on the head, not as hard as I was clobbering my own noggin though...LOL

When it got deselected I'll never know but now they show up again.

Thanks and have a great weekend.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Offline GL700Wing

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Female
Re: PM Attachments
« Reply #298 on: June 03, 2017, 05:21:39 AM »
Bless your sweet little heart sugar...you hit it on the head, not as hard as I was clobbering my own noggin though...LOL

When it got deselected I'll never know but now they show up again.

Thanks and have a great weekend.

;)


Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,422
    • XPtsp.com Community
Re: PM Attachments
« Reply #299 on: July 05, 2017, 07:07:49 PM »
@DarkAngel612:  Glad you got your issue straightened out!
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!