XCentric
Here's one way I have done this...
Edit the Stored Procedure "AddSearchItem"
Enclose both insert and update in an IF statement:
-- Temporarily disable inputs for selected modules
IF (@ModuleID NOT IN (672,682,673,675))
BEGIN
SQL Statement...
END
If you don't have Sequel Server Management Studio you can run this from the Host SQL page:
Make sure to set the actual Module ID's you want to exclude (You can get that by going to each module's settings and look at the URL for /ModuleID/###/, that's the module id.) and "dbo" to your DNN database instance qualifier (usually dbo)...
ALTER PROCEDURE [dbo].[AddSearchItem]
@Title NVARCHAR(200),
@Description NVARCHAR(2000),
@Author INT,
@PubDate DATETIME,
@ModuleId INT,
@SearchKey NVARCHAR(100),
@Guid NVARCHAR(200),
@ImageFileId INT
AS
DECLARE @ID INT
SELECT @ID = SearchItemId
FROM dbo.SearchItem
WHERE ModuleId = @ModuleID
AND SearchKey = @SearchKey
IF @ID IS NULL
BEGIN
-- Excluded selected modules from search
IF (@ModuleID NOT IN(0,0,0))
BEGIN
INSERT INTO dbo.SearchItem
([Title],
[Description],
[Author],
[PubDate],
[ModuleId],
[SearchKey],
[guId],
[HitCount],
[ImageFileId])
VALUES (@Title,
@Description,
@Author,
@PubDate,
@ModuleId,
@SearchKey,
@Guid,
0,
@ImageFileId)
SELECT Scope_identity()
END
END
ELSE
BEGIN
-- Excluded selected modules from search
IF (@ModuleID NOT IN(0,0,0))
BEGIN
UPDATE dbo.SearchItem
SET [Title] = @Title,
[Description] = @Description,
[Author] = @Author,
[PubDate] = @PubDate,
[ModuleId] = @ModuleId,
[SearchKey] = @SearchKey,
[guId] = @Guid,
[HitCount] = [HitCount] + 1,
[ImageFileId] = @ImageFileId
WHERE SearchItemId = @ID
SELECT @ID
END
END
And then to remove those that are already in the search items you could run:
DELETE FROM dbo.SearchItem
WHERE ModuleID IN (0,0,0)
Keep in mind that updates to the site "could" overwrite your changes so you may have to run these again later.
Hope this helps.
Josh
|