Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on November 07, 2011, 04:18:00 AM

Title: Show User Posts By Certain Boards
Post by: live627 on November 07, 2011, 04:18:00 AM
[Link to the mod](https://custom.simplemachines.org/index.php?mod=3240)

# Show User Posts By Certain Boards

A simple modification which allows users to filter results as shown by show posts/topics/attachments in the profile section of a user to specific boards.

[View changelog](https://github.com/live627/smf-mods/blob/main/profile-boards-filter/CHANGELOG.md)
Title: Re: Show User Posts By Certain Boards
Post by: 4Kstore on November 07, 2011, 01:16:53 PM
Nice mod!
Thanks for share!
Title: Re: Show User Posts By Certain Boards
Post by: MiY4Gi on November 10, 2011, 11:07:50 AM
Would it be possible to use board titles instead of board id's, even if I have to hard-code it into my forum?
Title: Re: Show User Posts By Certain Boards
Post by: ascaland on November 10, 2011, 04:33:14 PM
Quote from: MiY4Gi on November 10, 2011, 11:07:50 AM
Would it be possible to use board titles instead of board id's, even if I have to hard-code it into my forum?

Im actually going to be doing that with the built-in SMF dropdown feature. Should be up this weekend if I can get my customization site up!
Title: Re: Show User Posts By Certain Boards
Post by: digger on November 10, 2011, 05:24:56 PM
What about specific topic id(s)?
Title: Re: Show User Posts By Certain Boards
Post by: ascaland on November 10, 2011, 05:37:45 PM
Quote from: digger on November 10, 2011, 05:24:56 PM
What about specific topic id(s)?

I COULD, but im thinking thats more along the lines of a different sort of modification.
Title: Re: Show User Posts By Certain Boards
Post by: danielwmoore on November 12, 2011, 08:47:17 PM
Quote from: Project Evolution on November 10, 2011, 04:33:14 PM
Quote from: MiY4Gi on November 10, 2011, 11:07:50 AM
Would it be possible to use board titles instead of board id's, even if I have to hard-code it into my forum?

Im actually going to be doing that with the built-in SMF dropdown feature. Should be up this weekend if I can get my customization site up!

That's the one I want.  I've had moderators at my site requesting this ability.
Title: Re: Show User Posts By Certain Boards - 1.1
Post by: ascaland on November 12, 2011, 11:17:36 PM
Version 1.1 is now up and features the awaited dropdown suggestion menu! Please report any issues you have with it.
Title: Re: Show User Posts By Certain Boards - 1.1
Post by: oove on November 14, 2011, 02:33:35 AM
The new version works a bit weird. Firstly, it needs first 3 characters for droplist even to show, which doesn't work with some of my 2 char. boards (for example, IT, PE, etc.). Secondly, I can't just type "board_title", I have to select it from the list, and when I do that - it transforms to integer (board id), which is a bit confusing.

It would be much better just to type in board title, press filter, and get the results, IMO.
Title: Re: Show User Posts By Certain Boards - 1.1
Post by: ascaland on November 14, 2011, 08:11:46 AM
The dropdown only works after you type 3 characters for each board, it doesnt make much sense to query the entire database just to get an extra character in the text field. As for the integer, this is to avoid having to match entire strings in the database, which is more efficient especially if you have a lot of boards and big names (not to mention avoiding special characters).
Title: Re: Show User Posts By Certain Boards - 1.1
Post by: hcfwesker on November 15, 2011, 03:35:45 PM
Just want to tell you this MOD is awesome, and very much appreciated.   I had a member request a feature like this months ago and could finally get this added.  thank you very much. :)

And, I would also like the suggestion to search topics, as well, even if you do make a separate MOD, that would be greatly appreciated.

The only thing I would like added to this MOD, is if boards are Ignored by members, they don't show in the search, even for admins.
Title: Re: Show User Posts By Certain Boards - 1.1
Post by: ascaland on November 15, 2011, 04:37:21 PM
Quote from: hcfwesker on November 15, 2011, 03:35:45 PM
Just want to tell you this MOD is awesome, and very much appreciated.   I had a member request a feature like this months ago and could finally get this added.  thank you very much. :)

And, I would also like the suggestion to search topics, as well, even if you do make a separate MOD, that would be greatly appreciated.

The only thing I would like added to this MOD, is if boards are Ignored by members, they don't show in the search, even for admins.

Thanks! Definitely going to be reworking the query this weekend.
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on November 18, 2011, 05:10:09 PM
I have just updated the mod with a little bug fix, it would show board names that are supposed to be set for them not to see. This has been fixed.
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: hcfwesker on November 18, 2011, 07:33:04 PM
Quote from: Project Evolution on November 18, 2011, 05:10:09 PM
I have just updated the mod with a little bug fix, it would show board names that are supposed to be set for them not to see. This has been fixed.

I didn't even think to test that ... Very nice update!  Any chance you can show the edit that needs to be done manually.  I get 2 uninstall errors, but when I click to see what they are, it shows two blanks in the box.
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on November 18, 2011, 09:27:47 PM
In Subs-Editor.php I changed the query,
Code (From) Select
// Find the board(s).
$request = $smcFunc['db_query']('', '
SELECT id_board, name
FROM {db_prefix}boards
WHERE name LIKE {string:search}
LIMIT ' . ($smcFunc['strlen']($_REQUEST['search']) <= 2 ? '100' : '800'),
array(
'search' => $_REQUEST['search'],
)
);


Code (To) Select
// Find the board(s).
$request = $smcFunc['db_query']('', '
SELECT id_board, name
FROM {db_prefix}boards AS b
WHERE {query_see_board} AND name LIKE {string:search}
LIMIT ' . ($smcFunc['strlen']($_REQUEST['search']) <= 2 ? '100' : '800'),
array(
'search' => $_REQUEST['search'],
)
);
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: hcfwesker on November 18, 2011, 11:49:41 PM
Thank you so much!  Look forward to future updates :)
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: samurai-lupin on December 27, 2011, 11:09:45 PM
Hello, this looks like a great mod! Could you please also do a version for SMF 1.1 ? Thank you
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on December 28, 2011, 02:19:47 PM
Quote from: samurai-lupin on December 27, 2011, 11:09:45 PM
Hello, this looks like a great mod! Could you please also do a version for SMF 1.1 ? Thank you

To be honest im not very fond of updating mods for legacy versions of SMF. :-\
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: Jeff B on January 02, 2012, 10:42:44 PM
Everything looks good on my board, it installed without flaw, but it doesn't do anything when you click filter, no matter what board you choose, the results remain the same. Something I may be missing?
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on January 02, 2012, 10:44:32 PM
Quote from: Jeff B on January 02, 2012, 10:42:44 PM
Everything looks good on my board, it installed without flaw, but it doesn't do anything when you click filter, no matter what board you choose, the results remain the same. Something I may be missing?

Odd... Did it install properly? Were there any errors during installation? Anything in error log?
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: Jeff B on January 02, 2012, 10:49:50 PM
It installed without error.   I just checked the error log. Yup, all kinds of them

2: Wrong parameter count for array_unique()
Apply Filter: Only show the errors from this file
File: /var/www/virtual/XXXXXXXXX.com/htdocs/board/Sources/Profile-View.php
Line: 277
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on January 02, 2012, 10:54:54 PM
Which version of PHP is running?
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: Jeff B on January 03, 2012, 05:26:19 AM
PHP Version 5.2.6-1+lenny9
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on January 03, 2012, 12:29:16 PM
Quote from: Jeff B on January 03, 2012, 05:26:19 AM
PHP Version 5.2.6-1+lenny9

A fix you can try is going to Profile-View.php and replacing this,
$context['boards'] = empty($board_list) ? 0 : array_unique(explode(',', str_replace(' ', '', $board_list)), SORT_NUMERIC);

With,
$context['boards'] = empty($board_list) ? 0 : array_unique(explode(',', str_replace(' ', '', $board_list)));

What I did is I removed the second optional parameter of array_unique. Please give this a try and start using the mod, and let me know if you get any problems!
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: Jeff B on January 07, 2012, 01:37:48 PM
Sorry for the long delay in responding as I was out of town.  I had uninstalled the mod, but reinstalled it this morning and did the edit suggested and things seem to work so far.  :)

Thank you.  I'll keep you posted if I find any issues.
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: littlenicki on July 28, 2012, 12:42:02 PM
Hello, this sounds like a great mod. Could it be backported to SMF 1.1 please? Thank you!
Title: Re: Show User Posts By Certain Boards - 1.1.1
Post by: ascaland on July 28, 2012, 02:40:06 PM
Quote from: littlenicki on July 28, 2012, 12:42:02 PM
Hello, this sounds like a great mod. Could it be backported to SMF 1.1 please? Thank you!

Sorry, I don't backport to unsupported/legacy versions anymore.

1.1.2 is now under the GNU/GPL.
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: Arantor on July 28, 2012, 05:37:20 PM
And you can't actually legitimately backport that to 1.1.x - GNU GPL is incompatible with SMF 1.1.x's licence.
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: stylusss on November 18, 2012, 08:26:25 PM
Was this previous done on 1.x? I would like this mod.
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: littlenicki on December 18, 2012, 08:10:33 AM
Hello, I also really would appreciate a SMF 1.1 version of this great mod
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: cereleus on August 14, 2013, 10:06:01 AM
seamless mode is established
  active, but not a kind of

Where is the active mode?
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: live627 on January 30, 2014, 01:14:33 AM
This mod is now back from the dead!
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: IP_Board_Rules on May 28, 2023, 10:57:32 PM
Hello, I'm having two issues with this handy mod.

1. The place of the code is not working well for my layout and I could not figure how to change the code for loading its functions at a different place

2. The autocomplete works for me but it does not parse the values. I only get the posts filtered if I really type the fullboard name into the field. If I just on the (multiple) found board names put underneath the input field then the sent querry is empty.
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: IP_Board_Rules on September 05, 2023, 03:53:42 PM
Bump
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: live627 on September 06, 2023, 05:08:41 PM
Quote from: atanua on May 28, 2023, 10:57:32 PM1. The place of the code is not working well for my layout and I could not figure how to change the code for loading its functions at a different place
Can you upload a screenshot?
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: IP_Board_Rules on September 07, 2023, 10:07:33 AM
Quote from: live627 on September 06, 2023, 05:08:41 PM
Quote from: atanua on May 28, 2023, 10:57:32 PM1. The place of the code is not working well for my layout and I could not figure how to change the code for loading its functions at a different place
Can you upload a screenshot?

Hello John, please see attached. Thank you
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: live627 on September 07, 2023, 11:01:38 PM
Can you try the older version 1.1.2? I just checked the code, and it appears to add the same functionality as 2.0, but without magic integration hooks.
Title: Re: Show User Posts By Certain Boards - 1.1.2
Post by: live627 on September 08, 2023, 02:51:00 AM
New version released which fixes a very annoying bug where board names would transform into their corresponding ids. New filename is profile-boards-filter_1-1-3.tar.gz Full changelog on GitHub.
Title: Re: Show User Posts By Certain Boards
Post by: IP_Board_Rules on September 08, 2023, 08:52:32 AM
Quote from: live627 on September 07, 2023, 11:01:38 PMCan you try the older version 1.1.2? I just checked the code, and it appears to add the same functionality as 2.0, but without magic integration hooks.

Thank you for letting me know. Does it still have pull down menues available? I think itz is difficult having tzhe user selecting the board names by typing them in there as they may not know all the names rather than to select them from a pull down list