Version Description
Download this release
Release Info
| Developer | freediver |
| Plugin | |
| Version | 1.8.1 |
| Comparing to | |
| See all releases | |
Code changes from version 1.8.0 to 1.8.1
- seo-links.php +6 -6
seo-links.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
/*
|
| 4 |
Plugin Name: SEO Smart Links
|
| 5 |
-
Version: 1.8.
|
| 6 |
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
|
| 7 |
Author: Vladimir Prelovac
|
| 8 |
Author URI: http://www.prelovac.com/vladimir
|
|
@@ -117,8 +117,8 @@ function SEOLinks_process_text($text, $mode)
|
|
| 117 |
$name= preg_quote($name, '/');
|
| 118 |
|
| 119 |
$replace="<a title=\"$1\" href=\"$url\">$1</a>";
|
| 120 |
-
|
| 121 |
-
|
| 122 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
| 123 |
if ($newtext!=$text) {
|
| 124 |
$links++;
|
|
@@ -150,7 +150,7 @@ function SEOLinks_process_text($text, $mode)
|
|
| 150 |
{
|
| 151 |
$name = preg_quote($postitem->post_title, '/');
|
| 152 |
|
| 153 |
-
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))(
|
| 154 |
|
| 155 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 156 |
|
|
@@ -180,7 +180,7 @@ function SEOLinks_process_text($text, $mode)
|
|
| 180 |
if ((!$maxlinks || ($links < $maxlinks)) && !in_array( strtolower($cat->name), $arrignore) && strstr($text, $cat->name) )
|
| 181 |
{
|
| 182 |
$name= preg_quote($cat->name, '/');
|
| 183 |
-
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))(
|
| 184 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 185 |
|
| 186 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
|
@@ -211,7 +211,7 @@ function SEOLinks_process_text($text, $mode)
|
|
| 211 |
if ((!$maxlinks || ($links < $maxlinks)) && !in_array( strtolower($name), $arrignore) && strstr($text, $tag->name))
|
| 212 |
{
|
| 213 |
$name = preg_quote($tag->name, '/');
|
| 214 |
-
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))(
|
| 215 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 216 |
|
| 217 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
| 2 |
|
| 3 |
/*
|
| 4 |
Plugin Name: SEO Smart Links
|
| 5 |
+
Version: 1.8.1
|
| 6 |
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
|
| 7 |
Author: Vladimir Prelovac
|
| 8 |
Author URI: http://www.prelovac.com/vladimir
|
| 117 |
$name= preg_quote($name, '/');
|
| 118 |
|
| 119 |
$replace="<a title=\"$1\" href=\"$url\">$1</a>";
|
| 120 |
+
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU"; // this didnt work with unicode
|
| 121 |
+
//$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))(?<!\p{L})($name)(?!\p{L})/imsU";
|
| 122 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
| 123 |
if ($newtext!=$text) {
|
| 124 |
$links++;
|
| 150 |
{
|
| 151 |
$name = preg_quote($postitem->post_title, '/');
|
| 152 |
|
| 153 |
+
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
|
| 154 |
|
| 155 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 156 |
|
| 180 |
if ((!$maxlinks || ($links < $maxlinks)) && !in_array( strtolower($cat->name), $arrignore) && strstr($text, $cat->name) )
|
| 181 |
{
|
| 182 |
$name= preg_quote($cat->name, '/');
|
| 183 |
+
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
|
| 184 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 185 |
|
| 186 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
| 211 |
if ((!$maxlinks || ($links < $maxlinks)) && !in_array( strtolower($name), $arrignore) && strstr($text, $tag->name))
|
| 212 |
{
|
| 213 |
$name = preg_quote($tag->name, '/');
|
| 214 |
+
$regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
|
| 215 |
$replace='<a title="$1" href="$$$url$$$">$1</a>';
|
| 216 |
|
| 217 |
$newtext = preg_replace($regexp, $replace, $text, $maxsingle);
|
