Version Description
Download this release
Release Info
| Developer | freediver |
| Plugin | |
| Version | 1.7.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.7.5 to 1.7.6
- seo-links.php +29 -6
seo-links.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
/*
|
| 4 |
Plugin Name: SEO Smart Links
|
| 5 |
-
Version: 1.7.
|
| 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
|
|
@@ -86,10 +86,28 @@ function SEOLinks_process_text($text, $mode)
|
|
| 86 |
{
|
| 87 |
|
| 88 |
$kw_array = array();
|
|
|
|
|
|
|
| 89 |
foreach (explode("\n", $options['customkey']) as $line) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
list($keyword, $url) = array_map('trim', explode(",", $line, 2));
|
| 91 |
if (!empty($keyword)) $kw_array[$keyword] = $url;
|
| 92 |
-
}
|
| 93 |
|
| 94 |
foreach ($kw_array as $name=>$url)
|
| 95 |
{
|
|
@@ -305,6 +323,7 @@ function SEOLinks_comment_text_filter($text) {
|
|
| 305 |
$options = $this->get_options();
|
| 306 |
if ( isset($_POST['submitted']) ) {
|
| 307 |
|
|
|
|
| 308 |
|
| 309 |
$options['post']=$_POST['post'];
|
| 310 |
$options['postself']=$_POST['postself'];
|
|
@@ -355,6 +374,9 @@ function SEOLinks_comment_text_filter($text) {
|
|
| 355 |
$blanko=$options['blanko']=='on'?'checked':'';
|
| 356 |
$onlysingle=$options['onlysingle']=='on'?'checked':'';
|
| 357 |
|
|
|
|
|
|
|
|
|
|
| 358 |
|
| 359 |
$imgpath=trailingslashit(get_option('siteurl')). 'wp-content/plugins/seo-automatic-links/i';
|
| 360 |
echo <<<END
|
|
@@ -384,6 +406,7 @@ function SEOLinks_comment_text_filter($text) {
|
|
| 384 |
|
| 385 |
<div class="dbx-content">
|
| 386 |
<form name="SEOLinks" action="$action_url" method="post">
|
|
|
|
| 387 |
<input type="hidden" name="submitted" value="1" />
|
| 388 |
<h3>Overview</h3>
|
| 389 |
|
|
@@ -415,10 +438,10 @@ function SEOLinks_comment_text_filter($text) {
|
|
| 415 |
<input type="text" name="ignore" size="90" value="$ignore"/>
|
| 416 |
<br><br>
|
| 417 |
<h3>Custom Keywords</h3>
|
| 418 |
-
<p>Here you can enter manually the extra keywords you want to automaticaly link. Use comma to seperate
|
| 419 |
<p>Example:<br />
|
| 420 |
-
|
| 421 |
-
|
| 422 |
</p>
|
| 423 |
|
| 424 |
<textarea name="customkey" id="customkey" rows="15" cols="80" >$customkey</textarea>
|
|
@@ -440,7 +463,7 @@ function SEOLinks_comment_text_filter($text) {
|
|
| 440 |
<input type="checkbox" name="blanko" $blanko /><label for="blanko"> Open in new window</label> <br>
|
| 441 |
|
| 442 |
|
| 443 |
-
<div class="submit"><input type="submit" name="Submit" value="Update" /></div>
|
| 444 |
</form>
|
| 445 |
</div>
|
| 446 |
|
| 2 |
|
| 3 |
/*
|
| 4 |
Plugin Name: SEO Smart Links
|
| 5 |
+
Version: 1.7.6
|
| 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
|
| 86 |
{
|
| 87 |
|
| 88 |
$kw_array = array();
|
| 89 |
+
|
| 90 |
+
// thanks PK for the suggestion
|
| 91 |
foreach (explode("\n", $options['customkey']) as $line) {
|
| 92 |
+
$chunks = array_map('trim', explode(",", $line));
|
| 93 |
+
$total_chuncks = count($chunks);
|
| 94 |
+
if($total_chuncks > 2) {
|
| 95 |
+
$i = 0;
|
| 96 |
+
$url = $chunks[$total_chuncks-1];
|
| 97 |
+
while($i < $total_chuncks-1) {
|
| 98 |
+
if (!empty($chunks[$i])) $kw_array[$chunks[$i]] = $url;
|
| 99 |
+
$i++;
|
| 100 |
+
}
|
| 101 |
+
} else {
|
| 102 |
+
list($keyword, $url) = array_map('trim', explode(",", $line, 2));
|
| 103 |
+
if (!empty($keyword)) $kw_array[$keyword] = $url;
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/*foreach (explode("\n", $options['customkey']) as $line) {
|
| 108 |
list($keyword, $url) = array_map('trim', explode(",", $line, 2));
|
| 109 |
if (!empty($keyword)) $kw_array[$keyword] = $url;
|
| 110 |
+
}*/
|
| 111 |
|
| 112 |
foreach ($kw_array as $name=>$url)
|
| 113 |
{
|
| 323 |
$options = $this->get_options();
|
| 324 |
if ( isset($_POST['submitted']) ) {
|
| 325 |
|
| 326 |
+
check_admin_referer('seo-smart-links');
|
| 327 |
|
| 328 |
$options['post']=$_POST['post'];
|
| 329 |
$options['postself']=$_POST['postself'];
|
| 374 |
$blanko=$options['blanko']=='on'?'checked':'';
|
| 375 |
$onlysingle=$options['onlysingle']=='on'?'checked':'';
|
| 376 |
|
| 377 |
+
$nonce=wp_create_nonce( 'seo-smart-links');
|
| 378 |
+
|
| 379 |
+
|
| 380 |
|
| 381 |
$imgpath=trailingslashit(get_option('siteurl')). 'wp-content/plugins/seo-automatic-links/i';
|
| 382 |
echo <<<END
|
| 406 |
|
| 407 |
<div class="dbx-content">
|
| 408 |
<form name="SEOLinks" action="$action_url" method="post">
|
| 409 |
+
<input type="hidden" id="_wpnonce" name="_wpnonce" value="$nonce" />
|
| 410 |
<input type="hidden" name="submitted" value="1" />
|
| 411 |
<h3>Overview</h3>
|
| 412 |
|
| 438 |
<input type="text" name="ignore" size="90" value="$ignore"/>
|
| 439 |
<br><br>
|
| 440 |
<h3>Custom Keywords</h3>
|
| 441 |
+
<p>Here you can enter manually the extra keywords you want to automaticaly link. Use comma to seperate keywords and add target url at the end. Use a new line for new url and set of keywords. You can have these keywords link to any url, not only your site.</p>
|
| 442 |
<p>Example:<br />
|
| 443 |
+
vladimir prelovac, http://www.prelovac.com/vladimir<br />
|
| 444 |
+
cars, car, autos, auto, http://mycarblog.com/<br />
|
| 445 |
</p>
|
| 446 |
|
| 447 |
<textarea name="customkey" id="customkey" rows="15" cols="80" >$customkey</textarea>
|
| 463 |
<input type="checkbox" name="blanko" $blanko /><label for="blanko"> Open in new window</label> <br>
|
| 464 |
|
| 465 |
|
| 466 |
+
<div class="submit"><input type="submit" name="Submit" value="Update" class="button-primary" /></div>
|
| 467 |
</form>
|
| 468 |
</div>
|
| 469 |
|
