Advertisement:

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

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 451
  • 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,820
  • 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,820
  • 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,519
  • 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,820
  • 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,820
  • 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,820
  • 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,820
  • 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: 1,946
  • 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: 1,946
  • 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,820
  • 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: 1,946
  • 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,820
  • 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.