After about 3 days, I've accumulated about 60 spam trackbacks. The quick fix is in SQL below, and a delete statement follows that to clean what's there already...
I shouldn't have to say: it's a good idea to backup your db before futzing with it.
Very easy, just a quick adjustment to the blog_InsertEntry sproc...
Be sure to replace {user} with the qualified username. Add the bolded text below into the sproc to wrap up the INSERTs:
blog_InsertEntry
CREATE Proc {user}.blog_InsertEntry
(
@Title nvarchar(255),
@TitleUrl nvarchar(255),
@Text ntext,
@SourceUrl nvarchar(200),
@PostType int,
@Author nvarchar(50),
@Email nvarchar(50),
@SourceName nvarchar(200),
@Description nvarchar(500),
@BlogID int,
@DateAdded datetime,
@ParentID int,
@PostConfig int,
@EntryName nvarchar(150),
@ID int output)
as
if(@EntryName is not null)
Begin
if exists(Select EntryName From blog_Content where BlogID = @BlogID and EntryName = @EntryName)
Begin
RAISERROR('The EntryName you entry is already in use with in this Blog. Please pick a unique EntryName.',11,1)
RETURN 1
End
End
if(Ltrim(Rtrim(@Description)) = '')
set @Description = null
if not(
@PostType = 4 and (
@Title like ('%casino%') or
@Title like ('%gambling%') or
@Title like ('%holdem%') or
@Title like ('%hold em%') or
@Title like ('%poker%') or
@Title like ('%roulette%') or
@Title like ('%slot machines%') or
@Title like ('%blackjack%'))
)
Begin
INSERT INTO blog_Content
(Title, TitleUrl, [Text], SourceUrl, PostType, Author, Email, DateAdded,DateUpdated, SourceName, [Description], PostConfig, ParentID, BlogID, EntryName )
VALUES
(@Title, @TitleUrl, @Text, @SourceUrl, @PostType, @Author, @Email, @DateAdded, @DateAdded, @SourceName, @Description, @PostConfig, @ParentID, @BlogID, @EntryName)
Select @ID = @@Identity
if(@PostType = 1 or @PostType = 2)
Begin
exec blog_UpdateConfigUpdateTime @blogID, @DateAdded
End
Else if(@PostType = 3)
Begin
Update blog_Content
Set FeedBackCount = FeedBackCount + 1 where [ID] = @ParentID
End
End
GO
And of course a quick script to clean out the crap:
delete from {user}.blog_content where
title like ('%casino%') or
title like ('%gambling%') or
title like ('%holdem%') or
title like ('%hold em%') or
title like ('%poker%') or
title like ('%roulette%') or
title like ('%slot machines%') or
title like ('%blackjack%')
Print | posted on Tuesday, June 21, 2005 11:44 PM