Advertisement:

Author Topic: Filter Messages By Poster  (Read 1425 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Filter Messages By Poster
« on: May 20, 2018, 03:11:32 PM »
Link to Mod


FILTER MESSAGES BY POSTER v1.4
By Dougiefresh -> Link to Mod


Introduction
This mod allows the user to restrict the displaying of messages by any poster by using the filter icon in the poster area in the messages display.  The filtering can be stopped using the unfilter icon in the poster area in the messages display (or using the back button, naturally).

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

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

Related Discussion
o Toggle replies to show OP replies only

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2018 - 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.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,824
  • 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: Filter Messages By Poster
« Reply #1 on: May 20, 2018, 07:16:44 PM »
Great contribution, as always :D. I leave the translation to Latin Spanish!

Regards!
¡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: Filter Messages By Poster
« Reply #2 on: May 21, 2018, 09:48:30 PM »
Uploaded v1.1 - May 21st, 2018
o Added support for SMF 2.1 Beta 3.
o Added Spanish Latin translation, courtsey of Rock Lee.



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

Offline stoneageman

  • Semi-Newbie
  • *
  • Posts: 16
Re: Filter Messages By Poster
« Reply #3 on: May 26, 2018, 06:17:01 AM »
What a great feature addition. Thanks very muchly Dougie  :)

Offline digger

  • Sr. Member
  • ****
  • Posts: 761
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Filter Messages By Poster
« Reply #4 on: May 26, 2018, 11:42:51 AM »
Russian translation

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Filter Messages By Poster
« Reply #5 on: October 16, 2018, 12:11:20 PM »
Uploaded v1.2 - October 15th, 2018
o No functionality change.
o Updated documentation to point to new website.
o Added Russian translation, courtsey of digger!

Offline ORIONzitos

  • Semi-Newbie
  • *
  • Posts: 12
  • Gender: Male
  • PT-BR voluntary Translator
Re: Filter Messages By Poster
« Reply #6 on: October 17, 2018, 01:07:41 PM »
PT-BR translate AGAIN  :D
Total of translations: 10

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Filter Messages By Poster
« Reply #7 on: October 18, 2018, 09:01:20 PM »
Uploaded v1.3 - October 18th, 2018
o Added Brazilian Portugese translation, courtsey of ORIONzitos!



@ORIONzitos:  Thanks for the translation!  It's been included in this version!

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 862
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Filter Messages By Poster
« Reply #8 on: October 21, 2018, 09:05:12 PM »
Does this replace / include the functionality of the Show only OP replies mod you previously created?
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

No hack nor blackhats, just persistent asshats.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Filter Messages By Poster
« Reply #9 on: October 22, 2018, 10:15:38 AM »
Does this replace / include the functionality of the Show only OP replies mod you previously created?
It replaces that mod.  Somehow it evolved into the mod it is now.....

For an idea how/why it changed, please read the Toggle replies to show OP replies only thread.  It'll give you a better idea why/how it changed.....

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 862
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Filter Messages By Poster
« Reply #10 on: January 01, 2019, 11:43:47 PM »
Cool, cheers dougie.
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

No hack nor blackhats, just persistent asshats.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Filter Messages By Poster
« Reply #11 on: May 22, 2019, 06:21:03 PM »
Uploaded v1.4 - May 22nd, 2018
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 Beta 3.
o Fixed line of code to make sure element is set before checking it's value.
o SMF 2.1: Added new query to get number of posters when member ID not specified.



@Everybody:  In SMF 2.1 RC2, I came upon a strange error message.  It was:
Quote
Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
File: D:\Website\clean21\Sources\Display.php
Line: 177
It referenced this query, with the offending line in bold (and arrow before it):
Quote
   $request = $smcFunc['db_query']('', '
      SELECT
         ' . (isset($_GET['member']) ? 'COUNT(msgs.id_msg) AS ' : 't.') . 'num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll,
         t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts, t.id_redirect_topic,
         COALESCE(mem.real_name, ms.poster_name) AS topic_started_name, ms.poster_time AS topic_started_time,
         ' . ($user_info['is_guest'] ? 't.id_last_msg + 1' : 'COALESCE(lt.id_msg, lmr.id_msg, -1) + 1') . ' AS new_from
         ' . (!empty($board_info['recycle']) ? ', id_previous_board, id_previous_topic' : '') . '
         ' . (!empty($topic_selects) ? (', ' . implode(', ', $topic_selects)) : '') . '
         ' . (!$user_info['is_guest'] ? ', COALESCE(lt.unwatched, 0) as unwatched' : '') . ',
-->            COUNT(DISTINCT msgs.id_member) AS num_posters
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}messages AS msgs ON (msgs.id_topic = t.id_topic' . (isset($_GET['member']) ? ' AND msgs.id_member = {int:filter_by}' : '') . ')
         INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
         LEFT JOIN {db_prefix}members AS mem on (mem.id_member = t.id_member_started)' . ($user_info['is_guest'] ? '' : '
         LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = {int:current_topic} AND lt.id_member = {int:current_member})
         LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})') . '
         ' . (!empty($topic_tables) ? implode("\n\t", $topic_tables) : '') . '
      WHERE t.id_topic = {int:current_topic}
      LIMIT 1',
      $topic_parameters
   );
The only way I could get rid of this irritating error message was to seperate the query getting the topic information from the query getting the number of posters in that topic.  If you know of a way to merge the queries back together without triggering that error message, please drop me a line.  Thanks for assisting!