Disable Search Indexing

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
1
100%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 1

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28009
Joined: Sat Aug 16, 2003 7:36 am

Disable Search Indexing

Post by Extensions Robot » Sat Sep 02, 2006 4:25 pm

MOD Name: Disable Search Indexing
Author: albosky
MOD Description: Enables administrators to selectively turn off posts from being indexed in the search tables on a per forum basis. Indexing will be adjusted accordingly when posts are moved between forums that have indexing enabled or disabled.

MOD Version: 1.0.0
Tested on phpBB Version: 2.0.21

Download File: disable_indexing-1.zip
mods overview page: View
File Size: 24638 Bytes



Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version listed in the topic. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:27 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Tue Sep 19, 2006 3:33 pm

MOD Validated/Released

Notes:

albosky
Registered User
Posts: 463
Joined: Sun Apr 09, 2006 7:13 pm

Post by albosky » Tue Sep 19, 2006 4:32 pm

Thanks to the MOD team for validating this :)

Just a note I would like to add that if this is installed to an existing forum , it will not make any changes to existing posts , until they are moved , or edited.

joebert
Registered User
Posts: 224
Joined: Mon Jan 24, 2005 5:50 am
Location: Kenneth City, FL USA
Name: Joe

Post by joebert » Tue Nov 21, 2006 7:32 pm

Awesome !

I had to add one tiny thing though.
Keeps the disabled forums & categories (when no forums are available for the category) from showing up in the list on the search page.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, f.index_posts
#
#-----[ FIND ]------------------------------------------
#
	if ( $is_auth_ary[$row['forum_id']]['auth_read']
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 &&($row['index_posts'] == 1)

User avatar
Dogs and things
Registered User
Posts: 2114
Joined: Fri Sep 01, 2006 9:04 am
Location: Spain
Contact:

Re: Disable Search Indexing

Post by Dogs and things » Mon Mar 31, 2008 6:27 pm

Very nice MOD indeed,

It keeps my search tables nicely empty. ;)

Allthough maybe a bit late, thanks a lot for writing it, it´s a very handy MOD for my board.
For phpBB2 support visit phpBB2refugees.

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Re: Disable Search Indexing

Post by stevemagruder » Tue Oct 28, 2008 7:47 pm

I just discovered a major bug in this mod that is amazing to me, as validation nor any user of the mod has caught it to date.

Here's the fix you can apply:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
          while ( $row2 = $db->sql_fetchrow($result) )
#
#-----[ BEFORE, ADD ]------------------------------------------
#
          $sql = "SELECT *
            FROM " . POSTS_TABLE . "
            WHERE topic_id = $topic_id";
          if ( !($result = $db->sql_query($sql)) )
          {
            message_die(GENERAL_ERROR, 'Could not select from posts table', '', __LINE__, __FILE__, $sql);
          }
The $result variable in the while statement was referring to a previous SQL result that had been freed, and what's worse, there was no subsequent executed SQL that pulled the posts from the topic, as would be expected if you are referring to all the post_id fields from the topic's posts in the while section.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Re: Disable Search Indexing

Post by stevemagruder » Tue Oct 28, 2008 9:17 pm

And here's a fix for yet another bug in this mod:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
            if ((!$index_post) && (index_posts))
#
#-----[ REPLACE WITH ]------------------------------------------
#
            if ((!$index_post) && ($index_posts))
This code tests to see if the forum the topic was in wasn't indexed, and if the forum it's moving to is indexed.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Re: Disable Search Indexing

Post by stevemagruder » Tue Oct 28, 2008 9:21 pm

I would advise everyone using this mod to apply the last two fixes, and then rebuild your search indexes using the mod Rebuild Search.

Make sure you make Rebuild Search compatible with Disable Search Indexing first, as follows:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
admin_rebuild_search.php
#
#-----[ FIND ]------------------------------------------
#
	// get the post subject/text of each post
	$sql = "SELECT post_id, post_subject, post_text
		FROM " . POSTS_TEXT_TABLE . "
			WHERE post_id >= $start
			ORDER BY post_id ASC
			LIMIT $post_limit";
#
#-----[ REPLACE WITH ]------------------------------------------
#
	// get the post subject/text of each post
	$sql = "SELECT t.post_id, t.post_subject, t.post_text
		FROM " . POSTS_TEXT_TABLE . " t, " . POSTS_TABLE . " p, " . FORUMS_TABLE . " f 
			WHERE t.post_id >= $start
	          AND t.post_id = p.post_id
	          AND p.forum_id = f.forum_id
	          AND f.index_posts = 1
			ORDER BY t.post_id ASC
			LIMIT $post_limit";
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

Post Reply

Return to “[2.0.x] MOD Database Releases”