We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 170
    • 3 Posts
    thank’s, please can i get only the first word linked in the page ? rolleyes
      • 23714
      • 13 Posts
      Most Useful Enchancement Recommendations (in order of value).

      1. Option to disable link to self: I use this plugin to internal link on my site; and in most cases, a link ends up pointing to itself. E.g. i am on page abc.html, and in the content, it generates a link to abc.html.

      2. As the other posted mentioned, a way to better control keword overlap. E.g. If i have defined to phrases, such as "red shoes" and "big red shoes" which one should be used? In my case, whichever is longer. Maybe there are other ways to do this though.

      3. Ability to control number of repeated links on a page. If I mention "google" 100 times on my page, should it really link it 100 times?

      4. Since i use it for internal linking, using the doc id format would be preferred. E.g. Current Value: [~123~]
        • 17048
        • 4 Posts
        80giga, this works for me, try to replace:
        				foreach ($tokens as $token) {
        					if (++ $j % 2 && $token != '') //-- this token is (non-markup) text
        						{
        						if ($anchor_level == 0 && $tag_level == 0) // linkify if not inside anchor tags
        							{
        
        							//-- test for encoded keyword
        							if (preg_match($match, $token, $kmatch)) {
        								//-- ensure that the substitute replaces value with the case-sensitive match
        								if ($match_replace == 1) {
        									$substitute = preg_replace('/\b' . htmlentities($keyword) . '\b/', $kmatch[0], $substitute);
        								}
        								//-- replace keyword with the substitute
        								$token = preg_replace($match, $substitute, $token);
        								$must_tokenize = TRUE; //-- re-tokenize next time around						
        
        								//-- test for non-encoded keyword
        							}
        							elseif (preg_match($match_noencode, $token, $kmatch)) {
        								//-- ensure that the substitute replaces value with the case-sensitive match
        								if ($match_replace == 1) {
        									$substitute = preg_replace('/\b' . $keyword . '\b/', $kmatch[0], $substitute);
        								}
        								//-- replace keyword with the substitute
        								$token = preg_replace($match_noencode, $substitute, $token);
        								$must_tokenize = TRUE; //-- re-tokenize next time around
        							}
        						}
        
        					} else //-- this token is markup
        						{
        						if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { //-- found <a ...>
        							$anchor_level++;
        						}
        						elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { //-- found </a>
        							$anchor_level--;
        						}
        						elseif (preg_match("#<($blocked_tags)>#i", $token)) { //-- found excluded tags
        							$tag_level++;
        						}
        						elseif (preg_match("#<\/($blocked_tags)>#i", $token)) { //-- found excluded closing tags
        							$tag_level--;
        						}
        					}
        					$filtered .= $token; //-- this token has now been filtered
        				}
        
        


        with
                        $isfound[$match] = 0;
                        foreach ($tokens as $token) {
                            if (++ $j % 2 && $token != '') //-- this token is (non-markup) text
                                {
                                if ($anchor_level == 0 && $tag_level == 0 && $isfound[$match] == 0) // linkify if not inside anchor tags
                                    {
        
                                    //-- test for encoded keyword
                                    if (preg_match($match, $token, $kmatch)) {
                                        //-- ensure that the substitute replaces value with the case-sensitive match
                                        if ($match_replace == 1) {
                                            $substitute = preg_replace('/(\PL|\A)(' . htmlentities($keyword) . ')(\PL|\Z)/i', $kmatch[0], $substitute,1);
                                        }
                                        //-- replace keyword with the substitute
                                        $token = preg_replace($match, $substitute, $token, 1);
                                        $must_tokenize = TRUE; //-- re-tokenize next time around                            
                                        $isfound[$match]++;
                                        //-- test for non-encoded keyword
                                    }
                                    elseif (preg_match($match_noencode, $token, $kmatch)) {
                                        //-- ensure that the substitute replaces value with the case-sensitive match
                                        if ($match_replace == 1) {
                                        
                                            preg_replace('/(\PL|\A)(' . $keyword . ')(\PL|\Z)/u', $kmatch[0], $substitute, 1);
                                        }
                                        //-- replace keyword with the substitute
                                        $token = preg_replace($match_noencode, $substitute, $token,1);
                                        $must_tokenize = TRUE; //-- re-tokenize next time around
                                        $isfound[$match]++;
                                    }
                                }
        
                            } else //-- this token is markup
                                {
                                if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { //-- found <a ...>
                                    $anchor_level++;
                                }
                                elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { //-- found </a>
                                    $anchor_level--;
                                }
                                elseif (preg_match("#<($blocked_tags)>#i", $token)) { //-- found excluded tags
                                    $tag_level++;
                                }
                                elseif (preg_match("#<\/($blocked_tags)>#i", $token)) { //-- found excluded closing tags
                                    $tag_level--;
                                }
                            }
                            $filtered .= $token; //-- this token has now been filtered
                        }