2015-07-21, 07:05 PM
I am using MyCodes with myBB word filtering (bad words) to create a type of internal 'smart linking'.
Here is what I have:
MyCodes:
Regular Expression: \[mylink\]
Replacement: <a href="mylink.wherever"><i>MYLINK</i></a>
Regular Expression: \[mylink2\]
Replacement: <a href="mylink.wherever2"><i>MYLINK2</i></a>
BadWords:
Bad Word: mylink
Replacement: [mylink]
Bad Word: mylink2
Replacement: [mylink2]
This works absolutely wonderful:
MESSAGE:
"Mylink takes a user to a specific information page."
OUTPUT:
MYLINK takes a user to a specific information page.
MESSAGE:
"Mylink takes a user to a specific information page. Whereas mylink2 goes to a different page."
OUTPUT:
MYLINK takes a user to a specific information page. Whereas MYLINK2 goes to a different page.
This is the problem: when "mylink" (or 'mylink2' etc.) is used multiple times in the same entry, brackets are placed around the link that was used more than once:
MESSAGE:
"Mylink takes a user to a specific informaton page. Whereas mylink2 goes to a different page. Users like mylink."
OUTPUT:
[MYLINK] takes a user to a specific information page. Whereas MYLINK2 goes to a different page. Users like [MYLINK].
I just learned that "MyCode" will do this all on its own without needing "BadWords" to replace the text with a link.
In MyCodes do the following:
Regular Expression: mylink
Replacement: <a href="mylink">mylink</a>
Works like a charm. For some reason I thought that MyCode required brackets in order to work.
Here is what I have:
MyCodes:
Regular Expression: \[mylink\]
Replacement: <a href="mylink.wherever"><i>MYLINK</i></a>
Regular Expression: \[mylink2\]
Replacement: <a href="mylink.wherever2"><i>MYLINK2</i></a>
BadWords:
Bad Word: mylink
Replacement: [mylink]
Bad Word: mylink2
Replacement: [mylink2]
This works absolutely wonderful:
MESSAGE:
"Mylink takes a user to a specific information page."
OUTPUT:
MYLINK takes a user to a specific information page.
MESSAGE:
"Mylink takes a user to a specific information page. Whereas mylink2 goes to a different page."
OUTPUT:
MYLINK takes a user to a specific information page. Whereas MYLINK2 goes to a different page.
This is the problem: when "mylink" (or 'mylink2' etc.) is used multiple times in the same entry, brackets are placed around the link that was used more than once:
MESSAGE:
"Mylink takes a user to a specific informaton page. Whereas mylink2 goes to a different page. Users like mylink."
OUTPUT:
[MYLINK] takes a user to a specific information page. Whereas MYLINK2 goes to a different page. Users like [MYLINK].
I just learned that "MyCode" will do this all on its own without needing "BadWords" to replace the text with a link.
In MyCodes do the following:
Regular Expression: mylink
Replacement: <a href="mylink">mylink</a>
Works like a charm. For some reason I thought that MyCode required brackets in order to work.