Jump to content

Download: (SOS31) Block Forums from Search Results


Adriano Faria

Recommended Posts

Posted

File Name: (SOS31) Block Forums from Search Results
File Submitter: Adriano Faria
File Submitted: 12 Jun 2010
File Updated: 22 Mar 2011
File Category: Modifications

By default, IP.Board shows the topics/posts from all forums when the user uses the search. With this MOD, you give the user the option to select which forums he wants to see in searchs results (REGULAR SEARCH, VIEW NEW CONTENT, USER CONTENT and TODAY'S ACTIVE CONTENT). It's very nice to be used on forums with many categories/forums. For example: a user that uses ASP may not want to see the posts from PHP forum or maybe user didn't want to see topics from RSS forum, etc.

Affected Files:

  • adminapplicationsforumsextensionssearchenginessql.php
  • adminapplicationsforumsextensionssearchenginessphinx.php (optional)

Compatibility:

  • IP.Board 3.1.3 & 3.1.4


Click here to download this file
Posted

Thanks :)
Assume he can only see the forums that he has permission to view?

In other-words he will not see admin forums in the list to block if he is not an admin?

Posted

Assume he can only see the forums that he has permission to view?



In other-words he will not see admin forums in the list to block if he is not an admin?


Yes, he only see forums that he has permission to view.

However, it doesn't work with Sphinx. I'm more than willing to assist in getting to work with Sphinx as well.


I'll make the edits in Sphinx file and you can test, since I don't use it. Tomorrow I'll send you a PM with attached file.
  • 2 weeks later...
  • 2 weeks later...
Posted

Great mod - thanks.

Any news on the support for Sphinx?

I converted from vB over the weekend and am using Sphinx for search and my members are used to having the "ignore forums" feature so it would be great if I could get this working.

I've no problem testing updates on my own forums if you need a site to test it on.

Cheers,
Shaun :D

  • 2 weeks later...
Posted

To Adriano or whoever might need this, I helped someone recently with Sphinx stuff for this mod, and he said it seemed to work fine. Let me share what I gave him, here:


OK, I think these are the only steps you need. Note, though, I don't have a Sphinx environment to test this in, nor do I really know how to debug Sphinx issues if this is wrong. But here goes...



Open /admin/applications/forums/extensions/search/engines/sphinx.php, find:



			/* Contextual */

			if ( $cType == 'forum' AND $cId AND in_array( $cId, $forumIdsOk ) )

			{

				$this->sphinxClient->SetFilter( 'forum_id', array( $cId ) );

			}

			else

			{

				$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );

			}

Add below:

			/* (SOS31) Block Forums from 'View New Content' v2.0.0 */

			if( $this->settings['sos30_blockforums_on'] AND in_array( $this->member->getProperty('member_group_id') , explode(',', $this->settings['sos30_blockforums_groups'] ) ) AND $this->memberData['blocked_forums'] != '' )

			{

				$this->sphinxClient->SetFilter( 'forum_id', explode( ',', $this->memberData['blocked_forums'] ), TRUE );

			}

Find:

		/* Get list of good forum IDs */

		$forumIdsOk	= $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );


		$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );

Add below:

		/* (SOS31) Block Forums from 'View New Content' v2.0.0 */

		if( $this->settings['sos30_blockforums_on'] AND in_array( $this->member->getProperty('member_group_id') , explode(',', $this->settings['sos30_blockforums_groups'] ) ) AND $this->memberData['blocked_forums'] != '' )

		{

			$this->sphinxClient->SetFilter( 'forum_id', explode( ',', $this->memberData['blocked_forums'] ), TRUE );

		}


Save and upload.


Hope this helps :)
Posted

To Adriano or whoever might need this, I helped someone recently with Sphinx stuff for this mod, and he said it seemed to work fine.



I appreciate, Michael. I can't test it since I don't use it. :)
Posted

Michael, works, but it blocks forums for all search results
If i try search in the blocked forum, it shows zero result.

  • 2 weeks later...
Posted

A suggestion for a future version. The ability to prevent a forum from being blocked. It could be something simple like a check to see if the admin has made a particular forum immune to being blocked with a message to the user if they attempt to block it.

Posted

Ran into a snag with this one. All the file edits were accomplished and it works wonderfully for the Administrator and Moderator usergroup. But that's it. It doesn't even appear in the UserCP for all other usergroups that were assigned. This is with 3.12.

Posted

OK. This is driving me absolutely nuts. The usergroups allowed to use the modification are listed in the database, but yet, any usergroup other than Administrator or Moderator cannot see the option in the UserCP.

Posted

Did you read the README.HTML file and chose the ALLOWED GROUPS IN ADMIN CP to use this feature ?


Step 3: Admin CP Settings


Log in to your IP.Board Admin CP and visit the System tab -> System Settings -> Hooks. You'll see (SOS31) Block Forums from 'View New Content'. Configure the hook as you wish.


This mod works fine for me.
Posted

Yes. I even went through the DB to ensure the appropriate usergroups are listed. They are, yet, it only works for 2 usergroups. Administrators and Moderators.

Posted

Did you read the README.HTML file and chose the ALLOWED GROUPS IN ADMIN CP to use this feature ?





This mod works fine for me.






Yes. I even went through the DB to ensure the appropriate usergroups are listed. They are, yet, it only works for 2 usergroups. Administrators and Moderators.




Stating the mod works fine when there are issues going on doesn't exactly give me warm fuzzies on using this modification, or ANY modification from this author. I think I've waited patiently, and have provided the requested information when asked in a timely manner.

If this modification is "unsupported", the author should have stated so when it was released.
Posted

Stating the mod works fine when there are issues going on doesn't exactly give me warm fuzzies on using this modification, or ANY modification from this author. I think I've waited patiently, and have provided the requested information when asked in a timely manner.



If this modification is "unsupported", the author should have stated so when it was released.



Really! Oh god!

[size="4"]This and all other modifications are not supported![/size]


Is that good for you ?

Just don't use it and be happy! :lol:

Ah, by the way, I don't support anymore. I won't post new mods here.
  • 1 month later...
Posted

What a bummer that drama has killed your passion for doing the community projects.

This is a great idea, I am having problems with getting it to load up for us but a good mod to start with.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...