Jorge
Here is a real easy solution for the spam problem. I hope this can help other FCS developers. This solution can help in three ways. First it stops the unwanted advertising of another website by replacing the spamed website name with TEXT that the developer chooses (defines). Secondly, it will replaces the actually URL link with a URL link that the FCS developer chooses (defines). This is good because if any chatters do click on the link it will take them to a website or page that can be serve a purpose. For example.... my URL link will open a new window and take the chatter to a page that clearly outlines our policy on spam and bad language. Thirdly, it shows your chatters that you are serious about protecting your application, well as protecting them against unwanted spam, advertising and bad language.
So here is how it works and how you can impliment it.
Step One:
1) Goto your server side script called chat.asc
2) Open the chat.asc file and scroll all the way to bottom. Locate the following code >>
Code:
if ( url_end != -1 )
trailer = this.hiliteURLs( msg.substring(url_end) );
hilited += "<font color=\"#0000FF\"><u><a href=\"" + urlref + "\" target=\"_blank\">" + urlstr + "</a></u></font>" + trailer;
//hilited += "<font color=\"#0000FF\"><u><a href=\"" + urlstr + "\">" + urlstr + "</a></u></font>" + trailer;
return hilited;
}
3) Edit the above code so it looks like the code below. You can use your own text and you can name your new VAR's (variables) what ever you like.
Edited Code:
if ( url_end != -1 )
trailer = this.hiliteURLs( msg.substring(url_end) );
//ADDED CODE: These two lines of code have been added in order to help reduce the amount spam and unwanted advertising taking place in the chat room.
//the new VARS will redefine the text and URL lINK prior to the FCS server sending the information to the chat room text area.
//Date Added: October 23, 2005
urlref = replacement_LINK = "noSpam.html";
urlstr = replacement_TEXT = "NO SPAM: Please click here to read our No Spam TOS Rules";
//-------------END ADDED CODE HERE-------------\\
hilited += "<font color=\"#0000FF\"><u><a href=\"" + replacement_LINK + "\" target=\"_blank\">" + replacement_TEXT + "</a></u></font>" + trailer;
//hilited += "<font color=\"#0000FF\"><u><a href=\"" + urlstr + "\">" + urlstr + "</a></u></font>" + trailer;
return hilited;
}
Well, I hope this can help someone. It is a very simple solution, but it pretty much does the job when someone tries to post links into your web chat room.
Goodluck everyone....
Jay