Advertisement:

Author Topic: Search Sent Personal Messages (PMs)  (Read 12078 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Search Sent Personal Messages (PMs)
« on: July 06, 2014, 09:21:50 PM »
Link to Mod


SEARCH SENT PERSONAL MESSAGES v2.9
By Dougiefresh -> Link to Mod


Introduction
This mod allows the users of the Personal Messaging (PM) system to search sent PMs in addition to the core Inbox PMs.  With the Search Sent Personal Messages (PMs) mod installed, you also get the ability to choose between read and unread outgoing PMs.

Version 2.0 introduces the concept of taking action on searched-for PMs.  (Not available on the Core theme!)

Admin Settings
There are no admin settings.  To disable it, you must remove this mod.

Related Discussions
o Search by Sent PMs
o Perform Actions on Searched-For PMs

Compatibility Notes
This mod was tested on SMF 2.0.15, but should work on SMF 2.1 RC2, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2019, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: January 19, 2015, 09:43:42 AM by dougiefresh »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #1 on: July 18, 2014, 03:41:51 AM »
Uploaded v1.2 - July 17, 2014
o Added ability to search Sent Items by user/username
o Added ability to hide the labels when selecting Sent Items to avoid confusion


Offline skeletonkiss

  • Jr. Member
  • **
  • Posts: 103
Re: Search Sent Personal Messages (PMs)
« Reply #2 on: August 23, 2014, 05:16:57 PM »
I installed this, and for some reason, the submit button has disappeared from the search page...

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #3 on: August 24, 2014, 08:25:51 AM »
 :o That's not good....  I'll fix it...

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #4 on: August 24, 2014, 08:39:39 AM »
Uploaded v1.3 - August 24th, 2014
o Moved the submit button so that it is visible without labels being created.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #5 on: January 19, 2015, 09:43:56 AM »
Uploaded v1.4 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #6 on: April 27, 2015, 07:19:57 PM »
Uploaded v1.5 - April 27th, 2015
o Updated for SMF 2.1 Beta 1

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #7 on: September 25, 2015, 10:18:47 AM »
Uploaded v1.6 - August 29th, 2015
o Removed support for SMF 2.1 Beta 1
o Added support for SMF 2.1 Beta 2

Uploaded v1.7 - September 25th, 2015
o Added support for SMF 2.0.11

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #8 on: March 16, 2017, 09:50:18 PM »
Uploaded v2.0 - March 13th, 2017[
o Rebuilt mod to work with Separate Unread PMs mod.

Offline James Gryphon

  • Semi-Newbie
  • *
  • Posts: 63
  • Gender: Male
Re: Search Sent Personal Messages (PMs)
« Reply #9 on: March 28, 2017, 07:52:59 PM »
Hi Doug,
I've been looking into installing some of these mods (Search Sent, Separate Unread PMs, and also Edit Unread) to replace the older Enhanced PM System mod. Unfortunately, some things haven't been going so well.

Search Sent and Separate each generate errors when attempting to install when the other one is already installed; Edit Unread also chokes when attempting to install after Search (I haven't seen whether it installs with Separate). It also gives me a "Modification parse error" when testing whether it can modify the language_english_20x.xml file.

Also, all of them pretty universally report a multitude of errors with the Core theme's template file.

Unfortunately I don't have time to go through right now and check to see what each of these errors are right now for you, but I thought I'd ask whether these errors are known and if the mods actually work fine in spite of the error reports. If you hadn't heard of any of this before and need more info, I'll provide it ASAP; I just thought I'd get this post on right now before I leave for a few hours, so you might have a chance to hear about it earlier.

I haven't done a lot of testing to see how well they work with the PM Attachments mod. I mean to look into that sometime soon, though.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #10 on: March 28, 2017, 10:20:00 PM »
Search Sent and Separate each generate errors when attempting to install when the other one is already installed;

Also, all of them pretty universally report a multitude of errors with the Core theme's template file.
Thank you for notifying me of these issues!  I am working to resolve these issues that you raised!  I try to make sure everything will play nice with everything else....  Guess I missed something  O:)

Edit Unread also chokes when attempting to install after Search (I haven't seen whether it installs with Separate). It also gives me a "Modification parse error" when testing whether it can modify the language_english_20x.xml file.

Also, all of them pretty universally report a multitude of errors with the Core theme's template file.
Fixed these issues with the Edit Unread PMs mod....

Offline James Gryphon

  • Semi-Newbie
  • *
  • Posts: 63
  • Gender: Male
Re: Search Sent Personal Messages (PMs)
« Reply #11 on: March 29, 2017, 03:42:26 PM »
All right!

Now that my schedule is more free, do you want me to post up the error messages I get when attempting to install, or do you have that under control?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #12 on: March 30, 2017, 09:41:16 AM »
Now that my schedule is more free, do you want me to post up the error messages I get when attempting to install, or do you have that under control?
I'm working on it.  The only operation in conflict that I'm aware of is operation 6 in PersonalMessages.php.....  Do you have more?

EDIT:  As well as the core theme issue....
« Last Edit: March 30, 2017, 10:03:54 AM by dougiefresh »

Offline James Gryphon

  • Semi-Newbie
  • *
  • Posts: 63
  • Gender: Male
Re: Search Sent Personal Messages (PMs)
« Reply #13 on: March 30, 2017, 06:29:41 PM »
Not counting the Core theme stuff…

With "Separate Unread PMs" installed, attempting to install Search Sent PMs.

1. Replace failed (PersonalMessage.php)
Code: (Find) [Select]
$pmbox = $context['folder'] != 'sent' ? $txt['inbox'] : $txt['sent_items'];
Code: (Replace) [Select]
$context['folder_pmbox'] = $pmbox = ($context['folder'] != 'sent' ? ($context['folder'] != 'unread' ? $txt['inbox'] : $txt['unread_items']) : $txt['sent_items']);
With Separate Unread PMs installed, attempting to install Edit Unread PMs 1.2.

4. Add after failed (PersonalMessage.php)
Code: (Find) [Select]
$context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent';
Code: (Replace) [Select]
$context['folder'] = !isset($_GET['sa']) || $_GET['sa'] == 'edit' || $_GET['sa'] == 'edit' ? 'sent' : $context['folder'];

15. Add after failed ("Ignore errors")
16. Add before failed ("Ignore errors")

With Search Sent PMs installed, attempting to install Separate Unread PMs.

6. Replace failed (PersonalMessage.php)
Code: ("Find") [Select]
$pmbox = $context['folder'] != 'sent' ? $txt['inbox'] : $txt['sent_items'];
Code: ("Replace") [Select]
$pmbox = $context['folder'] == 'sent' ? $txt['sent_items'] : $context['folder'] == 'unread' ? $txt['unread_items'] : $txt['inbox'];
No apparent main errors when attempting to install Edit Unread PMs onto Search Sent PMs, except Core theme errors.

With Edit Sent PMs installed, attempting to install Separate Unread PMs.

No errors!

With Edit Sent PMs installed, attempting to install Search Sent PMs.

No main errors, except for Core theme errors.

At a quick glance, I don't think PM attachment mod impacts whether any of these mods install properly, although if someone wants to uninstall it after installing one of these mods, they need to uninstall the other mods first.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #14 on: August 04, 2017, 02:36:25 PM »
@James Gryphon:  I've made changes to both this mod, as well as uploaded version 1.6 of the Separate Unread PMs mod, which contains related install-compatibility fixes.  I've going to work on the Core theme compatibility (as well as compatibility with SMF 2.1 Beta 3) before uploading the fixed version of this mod....

I haven't tested the PM Attachment mod in with this mix, though.  I can't see how it affects either of these two mods, although I really haven't dug deep into that mod, either....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #15 on: August 04, 2017, 11:06:27 PM »
Uploaded v2.1 - August 4th, 2017
o Removed support for SMF 2.1 Beta 1 & 2.
o Added support for SMF 2.1 Beta 3.
o Added almost-complete support for SMF 2.0's Core theme.
o Compatibilty changes for Separate Unread PMs.



@James Gryphon:  Hopefully this update fixes the compatibility issues you reported earlier.  Thank you for the report!

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 460
  • Gender: Female
Re: Search Sent Personal Messages (PMs)
« Reply #16 on: October 01, 2017, 06:56:21 AM »
I've encountered a couple of 'Undefined Index' issues with v2.2 of this mod - fixes as follows:

Error Message: Undefined index: is_selected
Cause: Installation code missing.

./Sources/PersonalMessage.php
Find:
Code: [Select]
'counter' => ++$counter,
Add After:
Code: [Select]
'is_selected' => '',

Error Message: Undefined index: icon
Cause: Installation code incorrect.

./Themes/default/PersonalMessage.template.php
Find:
Code: [Select]
<td>', $message['time'], '</td>
<td>', $message['link'], '</td>
<td>', $message['member']['link'], '</td>

Replace with:
Code: [Select]
<td align="center">
<script type="text/javascript"><!-- // --><![CDATA[
currentLabels[', $message['id'], '] = {';

if (!empty($message['labels']))
{
$first = true;
foreach ($message['labels'] as $label)
{
echo $first ? '' : ',', '
"', $label['id'], '": "', $label['name'], '"';
$first = false;
}
}

echo '
};
// ]]></script>
', $message['is_replied_to'] ? '<img src="' . $settings['images_url'] . '/icons/pm_replied.gif" style="margin-right: 4px;" alt="' . $txt['pm_replied'] . '" />' : '<img src="' . $settings['images_url'] . '/icons/pm_read.gif" style="margin-right: 4px;" alt="' . $txt['pm_read'] . '" />', '</td>
<td>', $message['time'], '</td>
<td>', $message['link'], '</td>
<td>', ($context['folder'] == 'inbox' ? $message['member']['link'] : implode(', ', $message['recipients']['to'])), '</td>
<td align="center" width="4%"><input type="checkbox" name="pms[]" id="deletelisting', $message['id'], '" value="', $message['id'], '"', $message['is_selected'] ? ' checked="checked"' : '', ' onclick="if (document.getElementById(\'deletedisplay', $message['id'], '\')) document.getElementById(\'deletedisplay', $message['id'], '\').checked = this.checked;" class="input_check" /></td>

However, despite fixing these errors and installing v2.2 on an SMF 2.0.14 forum without any other mods, this mod does not return *any* results when searching 'Sent Items' ...

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 460
  • Gender: Female
Re: Search Sent Personal Messages (PMs)
« Reply #17 on: October 01, 2017, 08:43:00 AM »
It took me a while to work out why the mod was still not working but I did find it and it's also due to an installation error:

Error Condition: No Messages Found
Cause: Installation code incorrect ('Add Before' used instead of 'Replace With').

./Sources/PersonalMessage.php
Find:
Code: [Select]
$context['folder'] = 'inbox';
Replace With:
Code: [Select]
$folder = (int) (isset($_REQUEST['search_what']) ? $_REQUEST['search_what'] : 1);
$context['folder'] = ($folder == 1 ? 'inbox' : (!isset($context['sup_folder']) || $folder == 2 ? 'sent' : 'unread'));


Finally, and even though I was now getting search results from 'Sent Items', the links provided did not work but after further investigation I found the cause and worked out the fix.

Error Message: You are not allowed to access this section
Cause: Installation code incorrect (the folder was always being set to 'unread' instead of using $context['folder'] when applicable).

./Sources/PersonalMessage.php
Find:
Code: [Select]
$href = $scripturl . '?action=pm;f=' . $context['folder'] . (isset($context['first_label'][$row['id_pm']]) ? ';l=' . $context['first_label'][$row['id_pm']] : '') . ';pmid=' . ($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']) . '#msg' . $row['id_pm'];
Replace With:
Code: [Select]
$href = $scripturl . '?action=pm;f=' . ($context['folder'] != 'unread' && empty($context['message_read'][$row['id_pm']]) ? $context['folder'] : 'unread') . ';kstart;start=0;sort=date;pmid=' . ($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']) . '#msg' . $row['id_pm'];

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 460
  • Gender: Female
Re: Search Sent Personal Messages (PMs)
« Reply #18 on: October 02, 2017, 06:06:53 AM »
One last 'Undefined Index' error caused by a text string missing from a language file.

Error Message: Undefined index: sent
Cause: Missing text string

./Themes/default/languages/PersonalMessage.english.php
Find (at the end of the file):
Code: [Select]
?>
Add Before:
Code: [Select]
$txt['pm_search_what'] = 'Search group';
$txt['pm_search_to_user'] = 'To user';
$txt['sent'] = 'Sent Items';

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #19 on: October 09, 2017, 09:10:03 AM »
Uploaded v2.3 - October 9th, 2017
o Added missing string, as noted by GL700Wing in this post.



@GL700Wing:  Thank you for reporting the missing string!  I've got in this update!

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 460
  • Gender: Female
Re: Search Sent Personal Messages (PMs)
« Reply #20 on: November 11, 2017, 12:20:05 AM »
Uploaded v2.3 - October 9th, 2017
o Added missing string, as noted by GL700Wing in this post.



@GL700Wing:  Thank you for reporting the missing string!  I've got in this update!
I've just installed v2.3 but it does not contain the fixes I suggested on 1 October for the issues I found in ./Sources/PersonalMessage.php and ./Themes/default/PersonalMessage.template.php.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #21 on: November 13, 2017, 11:22:25 AM »
Uploaded v2.4 - November 13th, 2017
o Made code corrections suggested by GL700Wing several posts back...



@GL700Wing:  Sorry!  I really don't know how I managed to miss the posts you made on October 1st.  The changes you suggested are included in this version!  Thank you!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #22 on: November 19, 2017, 10:34:52 PM »
Hi Doug,
I've been looking into installing some of these mods (Search Sent, Separate Unread PMs, and also Edit Unread) to replace the older Enhanced PM System mod. Unfortunately, some things haven't been going so well.

Search Sent and Separate each generate errors when attempting to install when the other one is already installed; Edit Unread also chokes when attempting to install after Search (I haven't seen whether it installs with Separate). It also gives me a "Modification parse error" when testing whether it can modify the language_english_20x.xml file.

Also, all of them pretty universally report a multitude of errors with the Core theme's template file.
Okay, I need to address the part of the "complaint" (for lack of a better phrase ATM) addressed in bold, since I haven't addressed it (yet) earlier in this thread.  All the code changes for the Core theme are present in each of the mod installers, so you don't have to tick the box to install any of these mods on the Core theme.  It'll be done automatically, since the Code theme is quite different from the Curve theme at some points.

Unfortunately, as advanced as SMF's 2.0.x's Package Manager is, it ain't perfect, in that it still misses the fact that the Core theme has it's own set of changes....  ATM, I haven't been able to test to see if the same issue exists in SMF 2.0 Beta 3...

I haven't done a lot of testing to see how well they work with the PM Attachments mod. I mean to look into that sometime soon, though.
I'm aware of only one incompatibility, that being with the Edit Unsent PMs mod.  PM Attachments should be installed before the Edit Unsent PMs mod.  They all should play nicely together....

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,955
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Search Sent Personal Messages (PMs)
« Reply #23 on: November 19, 2017, 11:00:23 PM »
As always here doing some spam :P ... I hope I can be active again soon translating into Spanish 8) and many things to enjoy your good works!


Regards!

PD: I leave you the normal Latin Spanish versión and utf8 ;D
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #24 on: November 19, 2017, 11:14:16 PM »
Uploaded v2.5 - November 19th, 2017
o SMF 2.0.x: Fixed installation error for PersonalMessage.template.php.
o Added Spanish Latin translation, courtsey of Rock Lee!



@Rock Lee:  Thank you for the translation!!  It's been included in this version!

Offline Kinsman

  • Semi-Newbie
  • *
  • Posts: 17
Re: Search Sent Personal Messages (PMs)
« Reply #25 on: November 25, 2017, 06:18:05 PM »
Just a note that this mod is preventing a find/replace in the 2.0.1.5 update. In Sources/personalmessage.php.

Find

Code: [Select]
// Who matches those criteria?
// !!! This doesn't support sent item searching.
$request = $smcFunc['db_query']('', '
SELECT id_member
FROM {db_prefix}members
WHERE real_name LIKE {raw:real_name_implode}',
array(
'real_name_implode' => '\'' . implode('\' OR real_name LIKE \'', $possible_users) . '\'',
)
);
// Simply do nothing if there're too many members matching the criteria.
if ($smcFunc['db_num_rows']($request) > $maxMembersToSearch)
$userQuery = '';
elseif ($smcFunc['db_num_rows']($request) == 0)
{
$userQuery = 'AND pm.id_member_from = 0 AND (pm.from_name LIKE {raw:guest_user_name_implode})';
$searchq_parameters['guest_user_name_implode'] = '\'' . implode('\' OR pm.from_name LIKE \'', $possible_users) . '\'';
}
else
{
$memberlist = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$memberlist[] = $row['id_member'];
$userQuery = 'AND (pm.id_member_from IN ({array_int:member_list}) OR (pm.id_member_from = 0 AND (pm.from_name LIKE {raw:guest_user_name_implode})))';
$searchq_parameters['guest_user_name_implode'] = '\'' . implode('\' OR pm.from_name LIKE \'', $possible_users) . '\'';
$searchq_parameters['member_list'] = $memberlist;
}
$smcFunc['db_free_result']($request);

Replace

Code: [Select]
if (!empty($possible_users))
{
// We need to bring this into the query and do it nice and cleanly.
$where_params = array();
$where_clause = array();
foreach ($possible_users as $k => $v)
{
$where_params['name_' . $k] = $v;
$where_clause[] = '{raw:real_name} LIKE {string:name_' . $k . '}';
if (!isset($where_params['real_name']))
$where_params['real_name'] = $smcFunc['db_case_sensitive'] ? 'LOWER(real_name)' : 'real_name';
}

// Who matches those criteria?
// !!! This doesn't support sent item searching.
$request = $smcFunc['db_query']('', '
SELECT id_member
FROM {db_prefix}members
WHERE ' . implode(' OR ', $where_clause),
$where_params
);

// Simply do nothing if there're too many members matching the criteria.
if ($smcFunc['db_num_rows']($request) > $maxMembersToSearch)
$userQuery = '';
elseif ($smcFunc['db_num_rows']($request) == 0)
{
$where_params['real_name'] = 'pm.from_name';
$searchq_parameters = array_merge($searchq_parameters, $where_params);
$userQuery = 'AND pm.id_member_from = 0 AND (' . implode(' OR ', $where_clause) . ')';
}
else
{
$memberlist = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$memberlist[] = $row['id_member'];

$where_params['real_name'] = 'pm.from_name';
$searchq_parameters = array_merge($searchq_parameters, $where_params);
$searchq_parameters['member_list'] = $memberlist;
$userQuery = 'AND (pm.id_member_from IN ({array_int:member_list}) OR (pm.id_member_from = 0 AND (' . implode(' OR ', $where_clause) . ')))';
}
$smcFunc['db_free_result']($request);
}
else
$userQuery = '';


Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #26 on: November 27, 2017, 11:25:46 AM »
@Kinsman:  I know that this mod installs just fine after the SMF 2.0.15 upgrade mod.  I would suggest uninstalling this mod first (and any other conflicting mods), then installing the SMF 2.0.15 upgrade mod.  Only then should you reinstall any mods you uninstalled to get the 2.0.15 update to install....

Yup, it is a pain in the butt, but what do ya do?  :-[

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #27 on: December 08, 2017, 11:23:25 PM »
@Kinsman:  Evidentally, my locahost forum was a little damaged by an incorrectly uninstalled mod.  Your bug report is reproducible on my end....  I will fix it as soon as I can....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #28 on: December 08, 2017, 11:33:39 PM »
Uploaded v2.6 - December 8th, 2017
o Added new installer to deal with SMF 2.0.15 and up.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Search Sent Personal Messages (PMs)
« Reply #29 on: May 15, 2018, 08:22:28 PM »
If I right click --> open in new tab on the message, it doesn't redirect me to the message. The message URL is as follows:

Code: [Select]
http://elektronika-mk.net/index.php?action=pm;f=inbox;kstart;start=0;sort=date;pmid=38403#msg38403
I did some testing and it seems the kstart command/function is the problem. If I load the URL without it, it redirects me to the PM I've sent.

Code: [Select]
http://elektronika-mk.net/index.php?action=pm;f=inbox;start=0;sort=date;pmid=38403#msg38403
There is no entry in the error log about it.

I'm using the 2.5 version, but as I've seen the change log I don't think it matters, right ???.
"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?"..."

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Search Sent Personal Messages (PMs)
« Reply #30 on: May 15, 2018, 08:38:29 PM »
Hmmmm... it seems the problem wasn't with the mod. I just deleted kstart before start=0 from the following code in PersonalMessage.php and everything is working fine.

Before:

Code: [Select]
// Parse out any BBC...
$row['body'] = parse_bbc($row['body'], true, 'pm' . $row['id_pm']);

$href = $scripturl . '?action=pm;f=' . ($context['folder'] != 'unread' && empty($context['message_read'][$row['id_pm']]) ? $context['folder'] : 'unread') . ';kstart;start=0;sort=date;pmid=' . ($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']) . '#msg' . $row['id_pm'];

After:

Code: [Select]
// Parse out any BBC...
$row['body'] = parse_bbc($row['body'], true, 'pm' . $row['id_pm']);

$href = $scripturl . '?action=pm;f=' . ($context['folder'] != 'unread' && empty($context['message_read'][$row['id_pm']]) ? $context['folder'] : 'unread') . ';start=0;sort=date;pmid=' . ($context['display_mode'] == 2 && isset($real_pm_ids[$head_pms[$row['id_pm']]]) ? $real_pm_ids[$head_pms[$row['id_pm']]] : $row['id_pm']) . '#msg' . $row['id_pm'];

So what does kstart actually do?
"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?"..."

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #31 on: May 21, 2018, 10:43:03 PM »
Uploaded v2.7 - May 21st, 2018
o Fixed an issue where right click, open in new tab on the message doesn't open the PM properly.



@GigaWatt:  Thanks for the bug report, as well as the solution.  I'll be honest with ya: I'm not really sure what the kstart parameter does off the top of my head, as it's been a few years since I wrote the mod.   :P  But I've integrated your solution into the mod.  Thanks again!
« Last Edit: May 21, 2018, 11:16:30 PM by dougiefresh »

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Search Sent Personal Messages (PMs)
« Reply #32 on: May 22, 2018, 07:24:46 PM »
Thanks for the quick update ;).

I'm glad I could help out ;).

PS: You'll have to add the new changelog to XPtsp.com :P :).

PPS: Just installed it, works like a charm ;).
"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?"..."

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #33 on: November 01, 2018, 10:32:02 PM »
Uploaded v2.8 - November 1st, 2018
o No functionality change.
o Updated documentation to point to new website.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Search Sent Personal Messages (PMs)
« Reply #34 on: June 19, 2019, 11:18:15 AM »
Uploaded v2.9 - June 19th, 2019
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 Beta 3.

Offline Leszko

  • Semi-Newbie
  • *
  • Posts: 18
    • swietageometria.info on Facebook
    • forum.swietageometria.info
Re: Search Sent Personal Messages (PMs)
« Reply #35 on: September 01, 2019, 07:56:53 AM »
This mod also allows you to search in received messages, but there is one critical exception:
if you want to find any text in received messages, it is impossible when you search entering the username.
In this case you will receive fatal error message:
"The database value you're trying to insert does not exist: guest_user_name_implode"
Can it be fixed?

Analogous searching (by username) in outgoing messages works very well.


I use SMF 2.0.15 and PMs 2.7


SMF 2.0.15