]> git.mjollnir.org Git - s9y.git/commitdiff
Make target="" optional
authorgarvinhicking <garvinhicking>
Thu, 7 Jul 2005 15:16:59 +0000 (15:16 +0000)
committergarvinhicking <garvinhicking>
Thu, 7 Jul 2005 15:16:59 +0000 (15:16 +0000)
plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php

index faf6c717addf4702a3e74174b1c349e4bc2147c9..3fcd0287679beb5999ddd648b038f60f4492297e 100644 (file)
@@ -292,7 +292,7 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
         $propbag->add('description',   PLUGIN_REMOTERSS_BLAHBLAH);
         $propbag->add('stackable',     true);
         $propbag->add('author',        'Udo Gerhards, Richard Thomas Harrison');
-        $propbag->add('version',       '1.1');
+        $propbag->add('version',       '1.2');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -425,10 +425,6 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
             $dateformat = '%A, %B %e. %Y';
         }
 
-        if (!$target || strlen($target) < 1) {
-            $target = '_blank';
-        }
-
         if (!$cachetime || !is_numeric($cachetime)) {
             $cachetime = 10800; // 3 hours in seconds
         }
@@ -448,7 +444,7 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
                         if (empty($item['title'])) {
                             continue;
                         }
-                        $content .= '<a href="' . $this->decode($item['link']) . '" target="'.$target.'">';
+                        $content .= '<a href="' . $this->decode($item['link']) . '" ' . (!empty($target) ? 'target="'.$target.'"' : '') . '>';
                         if (!empty($bulletimg)) {
                             $content .= '<img src="' . $bulletimg . '" border="0" alt="*" /> ';
                         }
@@ -511,13 +507,13 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
                             }
 
                             if ($blogrolling === true && (!empty($text) || !empty($url))) {
-                                $content .= '&bull; <a href="' . $url . '" target="' . $target . '" title="' . $text . '">' . htmlspecialchars($text) . "</a>";
+                                $content .= '&bull; <a href="' . $url . (!empty($target) ? 'target="'.$target.'"' : '') . ' title="' . $text . '">' . htmlspecialchars($text) . "</a>";
                                 if (isset($item['isRecent'])) {
                                     $content .= ' <span style="color: Red; ">*</span>';
                                 }
                                 $content .= "<br />";
                             } elseif ((isset($item['type']) && $item['type'] == 'url') || !empty($url)) {
-                                $content .= '&bull; <a href="' .$url . '" target="' . $target . '" title="' . $text . '">' . $text . "</a>";
+                                $content .= '&bull; <a href="' .$url . (!empty($target) ? 'target="'.$target.'"' : '') . ' title="' . $text . '">' . $text . "</a>";
                                 $content .= "<br />";
                             }
                             ++$i;