Author |
Topic |
|
-gary
Development Team Member
406 Posts |
Posted - 30 June 2005 : 23:03:27
|
You might not consider this a bug since the install ships with default badword entries.
If you have 0 entries in the badwords table, calls to formatstr() will always produce a DB hit since the STRBADWORDWORDS app variable will always be blank. This can produce dozens of uneeded, albeit small, DB calls on a typical page view.< |
KawiForums.com
|
Edited by - Davio on 26 September 2006 05:44:17 |
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 01 July 2005 : 00:11:05
|
if you have 0 entries, why not just turn the feature off?
If you leave it with no entries, then there is still going to have to be a call to check if there aren't any entries. Don't really see a way around that.< |
|
|
-gary
Development Team Member
406 Posts |
Posted - 01 July 2005 : 10:34:50
|
quote: Originally posted by RichardKinser
if you have 0 entries, why not just turn the feature off?
Because someone might forget or not even realize that they should.
The fix is simple.
Else txtBadWordWords = "0" txtBadWordReplace = "0" end if
Application.Lock Application(strCookieURL & "STRBADWORDWORDS") = txtBadWordWords Application(strCookieURL & "STRBADWORDREPLACE") = txtBadWordReplace Application.UnLock end if txtBadWordWords = Application(strCookieURL & "STRBADWORDWORDS") txtBadWordReplace = Application(strCookieURL & "STRBADWORDREPLACE") If Not (txtBadWordWords = "0" And txtBadWordReplace ="0") Then if fString = "" or IsNull(fString) then fString = " " arrBWords = split(txtBadWordWords, ",") arrBReplace = split(txtBadWordReplace, ",") for i = 0 to ubound(arrBWords) fString = Replace(fString, arrBWords(i), arrBReplace(i), 1, -1, 1) Next End if
The new badwords would have to be reloaded into the app variable if an update occurs since the function wil not keep checking for new entries every pass, but that's trivial.< |
KawiForums.com
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 06 August 2006 : 00:09:34
|
We could easily turn the bad word feature off when the last badword is deleted from the list. And automatically turn it back on when the admin adds at least 1 badword to the list.
If anyone has a better idea, let me know soon.< |
Support Snitz Forums
|
Edited by - Davio on 06 August 2006 03:04:38 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 07 August 2006 : 01:35:50
|
quote: Originally posted by Davio
We could easily turn the bad word feature off when the last badword is deleted from the list. And automatically turn it back on when the admin adds at least 1 badword to the list.
Brilliant in simplicity!< |
portfolio - linkshrinker - oxle - twitter |
|
|
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 13 August 2006 : 00:04:08
|
Is there any reason why we have a "Are you sure?" confirmation before an admin deletes a bad word entry? Is deleting a bad word entry so critical that we need to ask for confirmation?
Following code in green has been added to admin_config_badwords.asp after line 309. Shortened long lines of code for this post.Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ & _
size=""" & strHeaderFontSize & """><b>Bad Word Filter Configuration</b></font></p>" & vbNewLine
if iBadwordCount = "" then
if strBadWordFilter = 1 then
'If no badwords found, turn off Bad Word Filter option
strDummy = SetConfigValue(1, "strBadWordFilter", "0")
Application(strCookieURL & "ConfigLoaded") = ""
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ color=""" & _
strForumFontColor & """ size=""" & strDefaultFontSize & """ valign=""top"">Bad Word Filter feature & _
is turned <b>Off</b>.</font></p>"
end if
elseif iBadwordCount = 0 then
if strBadWordFilter = 0 then
'Turn on Bad Word Filter option
strDummy = SetConfigValue(1, "strBadWordFilter", "1")
Application(strCookieURL & "ConfigLoaded") = ""
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ color=""" & _
strForumFontColor & """ size=""" & strDefaultFontSize & """ valign=""top"">Bad Word Filter feature & _
is turned <b>On</b>.</font></p>"
end if
end if Included the inc_func_admin.asp file also after line 38, to use the SetConfigValue() function.< |
Support Snitz Forums
|
Edited by - Davio on 13 August 2006 00:09:50 |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 13 August 2006 : 17:49:53
|
Removed confirmation when deleting a bad word.
Included in 3.4.06.< |
Support Snitz Forums
|
|
|
|
Topic |
|