vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Word Links FREE (Turn words into links) by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=263699)

BirdOPrey5 05-15-2011 10:00 PM

Word Links FREE (Turn words into links) by BOP5
 
1 Attachment(s)


Thank You for voting this June 2011 Mod of the Month!!!

The purpose of this mod is to automatically turn keywords or phrases you specify into links. You set a list of keywords and a list of URLs to link them to and let the mod do the rest.

This is the FREE Version. It allows you to auto-link words in:
  • Posts/Threads
  • Private Messages
  • Visitor Messages
  • Social Groups

The GOLD Version is available at Qapla.com It allows auto-linking words in:
  • Posts/Threads
  • Private Messages
  • Visitor Messages
  • Social Groups
  • Picture Comments
  • Blog Entries
  • Blog Comments
  • CMS Articles
  • CMS Comments

Live Demo at Qapla.com.

There are many options as you can see in the screenshot. You can choose to include the "nofollow" attribute, choose to open links in a new tab, choose to match whole words only or not, specify specific forums, enable in social groups and visitor messages, and disable completely for selected usergroups or styles.

Version: 2.0
  • New in 0.91: Limit the number of links created per keyword per post.
  • New in 0.92: Use CSS to customize the look of links created by this mod.
  • New in 0.93: Linked words now retain the same case as they were originally typed. Also a new option to specify whether linked words are case sensitive or not.
  • New in 0.935: Fixed conflict with VBSEO and possibly other mods. Upgrade if you are having problems.
  • New in 0.94: Made the "Custom CSS" an option to prevent unnecessary HTML if not needed.
  • New in 0.95: Enable or disable in PMs.
  • New in 0.96: Should fix conflicts with AME3 mod, restores same case change in 0.93.
  • New in 1.0: Additional code to prevent unintended linking. No new features.
  • New in 1.1: Set approximate number of max links per page.
  • New in 1.2: Fixed bug when Ampersands (&) were used in keywords.
  • New in 1.3: Added optional notice on posts with links and associated phrase.
  • New in 1.5: Two new features: 1) You can now use a csv data file for your links (and advanced features) if you prefer and 2) You can use a custom user profile field to allow users to disable the mod individually if you choose.
  • New in 1.5a: Updated German language file thanks to Igel1.
  • New in 1.6: Fixed bug if keyword was part of thread title and thread title was a link in the post. (VB4 Only)
  • New in 1.7: Added field to extend the regex easily through the mod settings. Included fix for bold/font color links.
  • New in 2.0: Rewritten more efficient code. Added option to disable by styleid. Added GOLD version.

Example... If someone types:

"I bought it on Amazon."

This mod can auto convert it to:

"I bought it on Amazon."

And you would presumably put your Amazon affiliate code, if you had one, in the link.

NOTE: This mod does not alter the actual posts or the database. Disabling or uninstalling the mod will remove all links.

There is a VB3 and VB4 version of this mod, please download the correct version.

Full instructions in zip file.

Notice:
Since the following words are used in HTML tags I would avoid them as keywords:
style, div, class, pre, href, img, html, meta, name, rel, nofollow, and link.

I would also avoid any single letter or two letter keywords since they could easily be used accidentally in places you weren't intending.

------------------------------------------------------

Please "Mark as Installed" if you use this. :)
Donations always appreciated. :up:
[s]Nominate MOTM if you LOVE it! ;)[/s] Thank You!

BirdOPrey5 05-16-2011 12:56 AM

Reserved

10giay 05-16-2011 07:56 AM

Good for SEO .

eh69 05-16-2011 10:40 AM

BirdOPrey5 thank You very much! Its working great! Showing links only for selected groups is very good idea - I set links only for guest (google spiders) :D

Nominated for mod of the month :)

For me its great mod, but if You want do more options I have some sugestions:
-limit for link in one post (or thread if its posibble) - too many links is not good for seo
-limit for using one phrase i one post/topic - then more phrases will be using
-You can add some text about SEO, internal linking in description of the mod on vbulletin.org forum - more poeple will be install this :)

ex.: internal linking is very important - wikipedia have strong seo because have good internal linking :)

BirdOPrey5 05-16-2011 11:40 AM

Quote:

Originally Posted by eh69 (Post 2196292)
BirdOPrey5 thank You very much! Its working great! Showing links only for selected groups is very good idea - I set links only for guest (google spiders) :D

Nominated for mod of the month :)

For me its great mod, but if You want do more options I have some sugestions:
-limit for link in one post (or thread if its posibble) - too many links is not good for seo
-limit for using one phrase i one post/topic - then more phrases will be using
-You can add some text about SEO, internal linking in description of the mod on vbulletin.org forum - more poeple will be install this :)

ex.: internal linking is very important - wikipedia have strong seo because have good internal linking :)

Limiting to 1 link per post should be fairly easy I will try and get an update soon.

For your second suggestion- not sure I follow- are you saying to scan the post for all keywords and then only link the keyword that is used the most in that post?

As for SEO benefits I'm happy to see it discussed in this thread but my goal was to make a mod for people who wanted it, not to convince people they needed it- that's up to them. :)

eh69 05-16-2011 11:50 AM

1. 'one' link is only example. settings to X link will be pretty :)
2. I have 6 phrases for 1 link.
Alfa Romeo 156
Alfy Romeo 156
Alfa 156
156
etc.

Its will be nice when I can set in script that phrase '156' will be using only one time in one post/thread.

Ex:
I have text:
Alfa Romeo 156 to fajne auto, rzadko się psuje i jest super, bomba, hiper, fajne. Alfa 156 jest super, bo jest fajna i w og?le. Kupując Alfa Romeo 156 zyskujesz prestiż i nie wiadomo co jeszcze :) Kup Alfa romeo 156, a będziesz wielki jak Kubuś Puchatek i będziesz jeździł 230 km/h!

And script replacing one phrase on link only one time in this text, ex:
Alfa Romeo 156 to fajne auto, rzadko się psuje i jest super, bomba, hiper, fajne. Alfa 156 jest super, bo jest fajna i w og?le. Kupując Alfa Romeo 156 zyskujesz prestiż i nie wiadomo co jeszcze :) Kup Alfa romeo 156 (here is not link, because is using before in text), a będziesz wielki jak Kubuś Puchatek i będziesz jeździł 230 km/h!

Ofcourse this will be settins X times can be used in post, not only 1 :D

Do You understand now? :) My english is bad - I know :D

BirdOPrey5 05-16-2011 03:06 PM

Updated to version 0.91-

Added the ability to limit the number of links per keyword per post.

beduino 05-16-2011 03:12 PM

Thank you Sir :)
all the best
joao barroca

BirdOPrey5 05-17-2011 12:12 PM

Updated to 0.92- Added ability to customize the look of links via CSS.

Class: boplink

See top thread or instructions for full details.

Kolbi 05-17-2011 12:56 PM

Have 2 notices:

The number of keyword replaces seems not to work. Tried 1 or 2 replaces but all keywords (3 times) were replaced...

Another little question perhaps you make it case sensitive?

Because the first word in a sentence is written in big letters for example, but the word in a senctence is written in small letters:
"The school is over! So the pupil are on the way home."
If I now want to replace "the" with "<a hre="/">the</a>" it will be:
"<a hre="/">the</a> school is over! So <a hre="/">the</a> pupil are on <a hre="/">the</a> way home."
So the first word is now written in small letters...

Kolbi 05-17-2011 12:59 PM

Third notice (just saw the update):

Why not using the class attribut instead of adding a span?

Instead of:
Code:

<span class="boplink"><a href="'.trim($boplink).'"' . $boptarg . $bopnofollow . ' >' . $bop_find_array[$bopi] .'</a></span>
try:
Code:

<a class="boplink" href="'.trim($boplink).'"' . $boptarg . $bopnofollow . ' >' . $bop_find_array[$bopi] .'</a>
I guess the span tag may be xhtml invalid... (not tested but I guess it can be...)

BirdOPrey5 05-17-2011 01:17 PM

Quote:

Originally Posted by Kolbi (Post 2196756)
Have 2 notices:

The number of keyword replaces seems not to work. Tried 1 or 2 replaces but all keywords (3 times) were replaced...

Another little question perhaps you make it case sensitive?

Because the first word in a sentence is written in big letters for example, but the word in a senctence is written in small letters:
"The school is over! So the pupil are on the way home."
If I now want to replace "the" with "<a hre="/">the</a>" it will be:
"<a hre="/">the</a> school is over! So <a hre="/">the</a> pupil are on <a hre="/">the</a> way home."
So the first word is now written in small letters...

1) It's 1 match per keyword. If your keywords are red, blue, green and your limit is 1, the sentence: "I like red, blue, and green." will still see 3 links. The sentence "I have a red hat, a red coat, and red shoes." will have only 1 link.

2) I can probably get it to match the case of the word it was linking, keeping the original case format. It would still be case insensitive when finding words. Actually I can make that an option too.

Quote:

Originally Posted by Kolbi (Post 2196757)
Third notice (just saw the update):

Why not using the class attribut instead of adding a span?

Instead of:
Code:

<span class="boplink"><a href="'.trim($boplink).'"' . $boptarg . $bopnofollow . ' >' . $bop_find_array[$bopi] .'</a></span>
try:
Code:

<a class="boplink" href="'.trim($boplink).'"' . $boptarg . $bopnofollow . ' >' . $bop_find_array[$bopi] .'</a>
I guess the span tag may be xhtml invalid... (not tested but I guess it can be...)

Mostly because putting the class in the a tag didn't work in my test. Does it work for you? :confused:

Kolbi 05-17-2011 01:27 PM

1) Is the limitation per post or page? Tried it with several posts on one page. Not with the same word mulitple in one post.

2) The solution with the original case format would propably be the best.

3) Normally it should work. Will try it later on.

BirdOPrey5 05-17-2011 01:32 PM

1) per post

2) Will post when I update the mod

3) I thought so too but it didn't. This site suggested spans were needed: http://www.echoecho.com/csslinks.htm

Brandon Sheley 05-17-2011 01:50 PM

great mod, I know it's one that's been asked for years

for5up 05-17-2011 02:27 PM

not working on my 4.1.3

BirdOPrey5 05-17-2011 02:33 PM

Quote:

Originally Posted by for5up (Post 2196779)
not working on my 4.1.3

I'm going to need more info then that to help... What isn't working?
Did it install?
Did you set "enable" to Yes?
Can you paste here a list of the keywords and URL's you are using?
What actually happens- nothing? Bad links? Error code?

Link to a post if possible?

BirdOPrey5 05-17-2011 02:53 PM

Updated to 0.93

New in 0.93: Linked words now retain the same case as they were originally typed. Also a new option to specify whether linked words are case sensitive or not.

Kolbi 05-17-2011 04:00 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2196767)
1) per post

2) Will post when I update the mod

3) I thought so too but it didn't. This site suggested spans were needed: http://www.echoecho.com/csslinks.htm

1) Maybe you can add a setting to define the replaced keywords per page?
How many times of each keyword shall be replaced per page?
How many keywords (whole keywords added above) shall be replaced on one page?
2) Thank you, will try it out.

3) Can't test it, it seems that your new version isn't working anymore? Can't get it working on vB 4.1.2. It doesn't replaces the keywords with the links?

BirdOPrey5 05-17-2011 04:50 PM

Very weird... I just re-uploaded the exact code I just tested on a 4.1.2 forum. Please try again. Also I uploaded the older version just in case.

Please let me know.

fishmaster 05-17-2011 06:47 PM

installed and testing. Looks good.

fishmaster 05-17-2011 07:47 PM

Not working? Wonder if xchache affects it?

fishmaster 05-17-2011 07:48 PM

Quote:

Originally Posted by for5up (Post 2196779)
not working on my 4.1.3

Same for me..

BirdOPrey5 05-17-2011 10:10 PM

As I said to the other guy who said it's not working, if you want help I need more info.

What isn't working?
Did it install?
Did you set "enable" to Yes?
Can you paste here a list of the keywords and URL's you are using?
What actually happens- nothing? Bad links? Error code?

Link to a post if possible?

fishmaster 05-17-2011 10:35 PM

Bird,

What isn't working?

It is not replacing selected words and turning them into links..

Did it install?

Installed fine, no error messages or db error codes.

Did you set "enable" to Yes?

Sure did, did it twice to make sure.

Can you paste here a list of the keywords and URL's you are using?

What actually happens- nothing? Bad links? Error code?

Nothing happens, no keywords selected in the admin area are converted to links.

Link to a post if possible?

Will shoot you credentials if you like?

BirdOPrey5 05-17-2011 11:53 PM

Please PM me the info, I will take a look. :up:

fishmaster 05-18-2011 12:19 AM

Gimme a sec to set you up with an admin account.

BirdOPrey5 05-18-2011 02:15 AM

Thanks to fishmaster I found a conflict with VBSEO. I have uploaded a new version 0.935 to fix this conflict. If you were having problems with the mod not working at all I suggest you upgrade to 0.935 whether you run VBSEO or not.

If you use xcache or other caching software it may take several minutes for the affects of the mod to show up. Turn it on and wait 5 to 10 minutes if you don't see the links immediately- they will come eventually.

fishmaster 05-18-2011 02:29 AM

Awesome addition, used correctly, will benefit any forum.

Nominated MOTM.

Kolbi 05-18-2011 10:51 AM

Quote:

Originally Posted by Kolbi (Post 2196794)
1) Maybe you can add a setting to define the replaced keywords per page?
How many times of each keyword shall be replaced per page?
How many keywords (whole keywords added above) shall be replaced on one page?
2) Thank you, will try it out.

3) Can't test it, it seems that your new version isn't working anymore? Can't get it working on vB 4.1.2. It doesn't replaces the keywords with the links?

3) Incredible the class tag seems not to work for links? Although it might be good, if you make the span tag as an option, because for example me I don't want to use it ;)

Your new version is now working ;) Although it was a clean vB 4.1.2 installation.


Suggestions:
  • Optional span tag
  • Option: Links per page

Kolbi 05-18-2011 10:54 AM

Nominated ;)

BirdOPrey5 05-18-2011 01:28 PM

Quote:

Originally Posted by Kolbi (Post 2197107)
3) Incredible the class tag seems not to work for links? Although it might be good, if you make the span tag as an option, because for example me I don't want to use it ;)

Your new version is now working ;) Although it was a clean vB 4.1.2 installation.


Suggestions:
  • Optional span tag
  • Option: Links per page

I hear you on the span tags... for now you can, and probably have, remove(d) them from the plugin code by changing the line:
PHP Code:

       $boplink '<span class="boplink"><a href="'.trim($boplink).'"' $boptarg $bopnofollow ' >$1</a></span>'

to:

PHP Code:

       $boplink '<a href="'.trim($boplink).'"' $boptarg $bopnofollow ' >$1</a>'

In all 3 plugins.

I'll make the span tags optional in the next release.

Appreciate the nominations. :cool:

iglow 05-18-2011 02:33 PM

what if the word is already anchored i nthe post
will this mod override the link somebody gave, or it leaves such links alone?

BirdOPrey5 05-18-2011 04:07 PM

It leaves existing links alone.

iglow 05-18-2011 05:52 PM

notminated for mod of month. this is great i was waitign for that

BirdOPrey5 05-19-2011 03:06 PM

Updated to 0.94- Adds the new feature to disable the <span> tags if not using custom css. Will prevent generating unnecessary HTML code.

Kolbi 05-19-2011 06:40 PM

Do you know how this mod influences performance?
For example if you have a lot of keywords to be replaced?

BirdOPrey5 05-19-2011 08:24 PM

Quote:

Originally Posted by Kolbi (Post 2197684)
Do you know how this mod influences performance?
For example if you have a lot of keywords to be replaced?

I don't have any statistics but it's fair to say the longer a post is and the more keywords you have the bigger affect on performance it will be. At what point it may become noticeable I don't know.

The bulk of the work here is being done by php's preg_replace function if that means anything to you.

Kolbi 05-20-2011 06:22 AM

Okay, thank you. ;)

A little suggestion, is it possible to disable it on PMs? I know the postbit is used there, too. But perhaps you can use the this_script attribut?


//Edit:

Found a good test about pre_replace and str_replace: http://blog.rvi-media.de/php/perform...e-ist-langsam/
Seems that str_replace is a little bit faster... :D

BirdOPrey5 05-20-2011 11:35 AM

Quote:

Originally Posted by Kolbi (Post 2197900)
Okay, thank you. ;)

A little suggestion, is it possible to disable it on PMs? I know the postbit is used there, too. But perhaps you can use the this_script attribut?


//Edit:

Found a good test about pre_replace and str_replace: http://blog.rvi-media.de/php/perform...e-ist-langsam/
Seems that str_replace is a little bit faster... :D

Good idea on the PM Disable option, I can work that into the next release.

str_replace is faster but not possible to use in this mod.


All times are GMT. The time now is 06:30 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01657 seconds
  • Memory Usage 1,856KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete