Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to filter obscene /bad words from comments/posts in sharepoint

Status
Not open for further replies.

varshaaa

Programmer
May 25, 2011
10
IN
How to filter obscene /bad words from comments/posts in sharepoint
blogs.

I have created custom list to store the obscene/bad words .I am trying to compare custom list with comments using xslt to filter the posts/comments and display to admin in CQWP(content query web part)

 
Yes, msdn post is mine paranoid.
I dont want any replacement .
Once admin logins ,CQWP should show the posts/comments having abusive words..
Is it possible without any code..
Filter is supported in SP2010 any guidelines
 
you can filter in a DVWP, but i couldn't find a way to lookup the values in another list.

 
Yeah .. I tired with DVWP .. Its working fine ..
One question How to assing link for item of dataview ?
It can be done ?
 
I have used data view webpart applied filter on dataview for badwords . Now its displaying all the comments that contains bad words ..
Problem is i want edit option (link) to edit or delete the post
i.e link to an item of data view..
 
In the top right corner of your DVWP, click the small arrow icon > that will open the Common Data View Tasks window.

Click on Edit Columns...
From Available fields, select URL Path.
Click Ok.
Click on one of the URLs, an arrow > will appear, click on it.
Click on Hyperlink options...
The Edit Hyperlink window will open.
In the Address bar you will want to supply the URL of your Lists Display form (DispForm.aspx) and the ID field ( {ID} ) variable.

It will look something like this:

Click Ok.
Save your changes.
Open the page in a browser and check your work.


The Code view of the field looks like this:
<td class="ms-vb">
<a href=" select="@ID" /></a>
</td>




I wrote this blog post last month on how to replace a hyperlink with a button:

I did the demo in SP2010, but the logic will apply to SP2007.

 
Tons and tons of thank you so much...
Edit is working .. How to implement Delete for that item

Because those filtered comments needs to be deleted any option to delete all the filtered comments ?
 
Inline Edit Option is there in SPD2010 which is same as your article

Inline Edit and Delete for dataview is not working.
Any Additional info need to provided?
 
In SP2010, open the page you are working on in SharePoint Designer.

Click on your DVWP.
The List View Tools should display at the top of the screen.
Click on the Options tab.
In the Options tab, click on Inline Editing.

Save your changes.
Refresh your page.




 
You can also add another column with the delete function:

<td>
<a href="javascript: {ddwrt:GenFireServerEvent(concat('__cancel;__delete={',$ID,'=',$ID,'};__commit'))}">delete</a>
</td>

 
hmmm .. I tried with inline editing. Its not working.
But Atlast I created new column for DVWP and added following code to open Edit page for each item in DVWP.Its working :)
Thanks ehaze for your help.

<td class="ms-vb" style="width: 245px; height: 20px;">

<script type="text/javascript">
function open(Id) {
var options = {
url: &quot;../_layouts/listform.aspx?PageType=6&amp;ListId={24b92116-5f1f-4866-97f8-13693b75cc47}&amp;ID=&quot;+Id,
title: &quot;Edit&quot;,
allowMaximize: true,
showClose: true,
width: 625,
height: 525,

dialogReturnValueCallback: silentCallback};
SP.UI.ModalDialog.showModalDialog(options);}
function silentCallback(dialogResult, returnValue) {
}
function refreshCallback(dialogResult, returnValue) {
SP.UI.Notify.addNotification(&apos;Operation Successful!&apos;);
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
</script>

<a href="javascript:eek:pen({@ID})" target="_self">
<img border="0" src="/_layouts/images/edititem.gif"/>
</a>
</td>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top