Contextual Linking

Started by Drover, February 17, 2012, 08:49:59 PM

Previous topic - Next topic

Drover

If there's not something that already does this then there should be.  I'm looking for a mod that provides contextual linking.  For example I could place a link so that every time someone uses the word toothpaste, my link to crest.com would be inserted.


Sorck

I believe that this is possible through using the word censor.

e.g.
word
replace with
[url=http://some.relevant.site.com]word[/url]

It won't affect people who have the censor turned off, but from experience the vast majority of members keep the word censor turned on.

Adrek

But word censor affect also words in topic titles and there BBC is not parsed
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Drover

I'm really surprised this isn't already available.  It would probably be a top-10 mod almost immediately.  Looking through what's available, maybe the glossary mod would work?

4Kstore

Quote from: phantomm on February 18, 2012, 06:29:11 AM
But word censor affect also words in topic titles and there BBC is not parsed

Just need a few changes on MessageIndex.php to delete the censor in the titles.....
I use the censor words feature for this purpose and works fine!

¡¡NEW MOD: Sparkles User Names!!!

Adrek

Quote from: 4Kstore on February 20, 2012, 04:26:31 AM
Just need a few changes on MessageIndex.php to delete the censor in the titles.....
Can you share this with us? :)
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Drover

Can y
Quote from: phantomm on February 20, 2012, 05:49:53 AM
Quote from: 4Kstore on February 20, 2012, 04:26:31 AM
Just need a few changes on MessageIndex.php to delete the censor in the titles.....
Can you share this with us? :)
Or just attach an edited version, please?  Thanks in advance!

Or just attach an edited version, please?  Thanks in advance!

Or just attach an edited version, please?

Thanks in advance!

Sorck

The following files would need editing:
Display.template.php
MessageIndex.template.php
BoardIndex.template.php
UnreadTopics.template.php*

*might not be the right name
Also, I'm not sure if it's the template files or source files where censortext() is called.

4Kstore

Quote from: Sorck on February 21, 2012, 06:38:18 PM
The following files would need editing:
Display.template.php
MessageIndex.template.php
BoardIndex.template.php
UnreadTopics.template.php*

*might not be the right name
Also, I'm not sure if it's the template files or source files where censortext() is called.


Sources files, no templates...
Then search for something like this:
censorText($row['subject']);

And replace for:
$row['subject'];

Cheers

¡¡NEW MOD: Sparkles User Names!!!

Drover

4Kstore, I don't get what you're doing there.  Replace it with what?

4Kstore

this:
censorText($row['subject']);

Should be:
$row['subject'];

remove the censorText function in the subjects...

¡¡NEW MOD: Sparkles User Names!!!

Ricky.

Quote from: phantomm on February 18, 2012, 06:29:11 AM
But word censor affect also words in topic titles and there BBC is not parsed

Just in case you need, I was working on a mod which works in similar situation : Selective word censoring in SMF.

scriptster

Quoteevery time someone uses the word toothpaste, my link to hxxp:crest.com [nonactive] would be inserted.
If this is for SEO purposes (sounds like it but if it's not, maybe OP can elaborate), I would be very weary about rolling out a site-wide change like this. Especially if the links are not internal and go to another site. Enabling what could potentially be thousands of "same anchor, same destination" links in an instant is just asking for trouble for both the source site as well as the destination.

If this really is for SEO, a much more subtle approach would be needed and I don't think word censoring would work. This looks like a custom, one-off mod and the OP would have to explain to the developer very carefully what is the actual end result that s/he's looking for. But I would not recommend doing it the way OP wants, most especially not  "every time someone uses the word ..."

Drover

I'll play with this on my new board.  But if it's pretty simple to create, someone should just create a separate mod for it as this is a nice way to monetize a forum.  I'd bet it would become one of the more popular. 

Drover

Quote from: scriptster on February 22, 2012, 11:05:15 AMIf this is for SEO purposes...

Not for SEO, for monetization.  The idea is that keywords will automatically become links in posts. 

For example, if I designate the term "Whitney Houston" as a keyword on my forum and someone makes a post that contains that keyword, it would then automatically become a link within the post to a site I choose, which would usually be my affiliate link to buy her albums from Amazon or iTunes or wherever. 

Drover

#15
Ricky's mod worked great for the message title issue.  But, what about the BBC issue mentioned by phantomm?  Any fixes?

Thanks again!

Drover

Quote from: phantomm on February 18, 2012, 06:29:11 AM
But word censor affect also words in topic titles and there BBC is not parsed

Here's my workaround for the BBC issue.  Instead of putting the word by itself in the censor, put the word with a space after it.  People don't put spaces after words inside BBC so it won't affect it there.

Drover

Quote from: Drover on February 26, 2012, 09:42:21 PM
Quote from: phantomm on February 18, 2012, 06:29:11 AM
But word censor affect also words in topic titles and there BBC is not parsed

Here's my workaround for the BBC issue.  Instead of putting the word by itself in the censor, put the word with a space after it.  People don't put spaces after words inside BBC so it won't affect it there.

Bah!  That isn't working! When I save the censor words, it removes the extra spaces.  Anyone know how to stop it from removing the spaces?

Advertisement: