News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

censor words but with exception!!

Started by wtfwtf, April 17, 2018, 05:27:25 AM

Previous topic - Next topic

wtfwtf

this is a tough one i admit,
i want to censor the goo.gl links , but
i want to keep the forms which start with goo.gl/forms
any idea how to do that ?

vbgamer45

Can't do it with the censor system but you could if you write custom code for it.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

wtfwtf

Quote from: vbgamer45 on April 17, 2018, 09:42:03 AM
Can't do it with the censor system but you could if you write custom code for it.

ok what and where to implement ?


drewactual

do you want to break the links other than g/forms? or do you want to hide them?

breaking some/not others is easy... hiding them is more of a chore.

this can be done with mod_rewrite outside of SMF and through use of some clever htaccess additions.  < that ought to be enough to googy for to find a solution.

this can also be done with use of a mod that allows for additions or custom BBC or BBC Button codes- appending the g/forms in places you'd want to use them by use of the  BBC and or button on the post form that adds it.

wtfwtf

Quote from: drewactual on April 18, 2018, 02:21:59 PM
do you want to break the links other than g/forms? or do you want to hide them?

breaking some/not others is easy... hiding them is more of a chore.

this can be done with mod_rewrite outside of SMF and through use of some clever htaccess additions.  < that ought to be enough to googy for to find a solution.

this can also be done with use of a mod that allows for additions or custom BBC or BBC Button codes- appending the g/forms in places you'd want to use them by use of the  BBC and or button on the post form that adds it.
can you clarify a bit more

drewactual

when someone types out a googy link, do you want that hidden (using the censor function to change it to something else) or do you want it gone altogether?

if you want to break the link, change the word using the censor function, right?  easy enough... but on some you want to retain the function, and those are googy/forms, right? 

using SMF's 'censor', and intent to simply break the URL, use the rewrite to make a decoy word (let's pretend that word is 'mydecoy') convert from googy.com to 'your-url/mydecoy.html  which can be a dead end page OR a simple redirect back to the index page... meanwhile, have the specific 'googy/forms', which will appear as 'mydecoy/forms' inside the forum, redirect via mod_rewrite in your htaccess, back to 'googy/forms' as you require...

or

to avoid the mod_rewrite in htaccess, add a rewrite in php and stick it in the display file.  this may be the 'right' way to do it, but it will create a lag most likely, that will frustrate users.  it avoids 'redirects' though.   that would be maybe three lines of code added in the display file.

or

find a mod (there is at least one though i can't recall it's name) that offers custom code BBC or custom buttons added to the posting function... add one that adds the googy/forms to the selected text before posting.


this topic reminds me of an old joke:  a programmer was asked by his wife to stop by the grocery store to"pick up a gallon of milk, and if they have banana's, get six" ... he comes home with six gallons of milk and she doesn't understand why... the point being- you're attacking this in one swipe, where if you break it down in steps it isn't that hard to come up with several ways to do it.

wtfwtf

Quote from: drewactual on April 18, 2018, 08:33:48 PM
when someone types out a googy link, do you want that hidden (using the censor function to change it to something else) or do you want it gone altogether?

if you want to break the link, change the word using the censor function, right?  easy enough... but on some you want to retain the function, and those are googy/forms, right? 

using SMF's 'censor', and intent to simply break the URL, use the rewrite to make a decoy word (let's pretend that word is 'mydecoy') convert from googy.com to 'your-url/mydecoy.html  which can be a dead end page OR a simple redirect back to the index page... meanwhile, have the specific 'googy/forms', which will appear as 'mydecoy/forms' inside the forum, redirect via mod_rewrite in your htaccess, back to 'googy/forms' as you require...

or

to avoid the mod_rewrite in htaccess, add a rewrite in php and stick it in the display file.  this may be the 'right' way to do it, but it will create a lag most likely, that will frustrate users.  it avoids 'redirects' though.   that would be maybe three lines of code added in the display file.

or

find a mod (there is at least one though i can't recall it's name) that offers custom code BBC or custom buttons added to the posting function... add one that adds the googy/forms to the selected text before posting.


this topic reminds me of an old joke:  a programmer was asked by his wife to stop by the grocery store to"pick up a gallon of milk, and if they have banana's, get six" ... he comes home with six gallons of milk and she doesn't understand why... the point being- you're attacking this in one swipe, where if you break it down in steps it isn't that hard to come up with several ways to do it.

thank you, for the remark and the joke,
it made me realize my error and the solution was much easier that i thought

what i did, is approached the problem in 2 steps, as recommended, and without any coding.

1- i changed the goo.gl > keyword through censorship option
2- i changed keyword/forms/ back to goo.gl/forms/ though censorship option,

as the censorship executes the changes in a successive way, allowed me to rely on the first change to implement second change

this said this technique will allow for any link to be excluded from censorship


Advertisement: