Customizing SMF > SMF Coding Discussion
Automatically link certain words?
MrPhil:
--- Quote from: MrMike on May 31, 2012, 01:06:15 AM ---1) The "swapthis" entries are just static spans, they're just text. Double-clicking is just like clicking on any other text. What you're seeing is normal, expected behavior.
--- End quote ---
If other "censored word" links only take a single click to activate the link, I think that users will find it confusing to have to double click to do anything.
--- Quote ---2) The image of the cake should be visible with no interaction (no clicking required). The tag "cake_here" is replaced with an image of a cake when the post is processed. I see the image of the cake in both Firefox and IE...what browser are you using?
--- End quote ---
I see the cake too (FF 12) but I want to eat it and have it too! Isn't the whole point of this to have text in your post (highlighted in some way to hint that something can be done with it), that you click on to have something special happen? If you're just going to have a picture of a cake, why not use an [img] tag? You could certainly have the image as a clickable link, and get "cake here" when you click on it, but that seems backwards. The whole idea, as I understand it, is to have a smooth flow of text, with clickable text for a side trip to doing something else.
MrMike:
--- Quote from: MrPhil on May 31, 2012, 10:05:07 AM ---If other "censored word" links only take a single click to activate the link, I think that users will find it confusing to have to double click to do anything.
--- End quote ---
That particular example just shows the tag "swapthis" being swapped with a span containing the words "Replaced Block", and the span is styled with a green background and white text. It's not meant to be clicked on.
Another example shows the tag "button_here" being replaced with a javascript-enabled button. That one can be clicked on.
--- Quote from: MrPhil on May 31, 2012, 10:05:07 AM ---Isn't the whole point of this to have text in your post (highlighted in some way to hint that something can be done with it), that you click on to have something special happen?
--- End quote ---
Yes and no. The point of this mod is to either add predefined links to selected words (link mode), or to replace selected words (tags) with whatever you want (swap mode).
--- Quote from: MrPhil on May 31, 2012, 10:05:07 AM ---The whole idea, as I understand it, is to have a smooth flow of text, with clickable text for a side trip to doing something else.
--- End quote ---
I think you misunderstand the purpose of the mod. It's just a text replacer. What the text gets replaced with is up to you. In the "link" mode it links the word with a URL you define and (optionally) applies some styling.
In the "swap" mode it replaces the word (perhaps a predefined tag) with whatever you want- another word, a button, an image, a form, a table...whatever you put in the replace string.
To be clear, I developed this mod to auto-link specific words or phrases so that people in the forum would be able to drill down to find related pages for those words or phrases. I added the free-form replacing feature because I thought it might be useful to people in other applications.
I don't plan on using the "swap" feature myself, but it could be used to do a *lot* of tricky stuff in posts. :)
beanflying:
Just what I am looking for, the word censor isn't really doing what I want.
Even if your not going to package this as a full mod any chance you can put the code here or in a PM.
cheers. :)
STRONGHOLD:
Hi,
Can you please share the codes with us? :)
Sciamano:
Did anyone manage to get their hands on this very useful piece of code?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version