Skip to content

Commit

Permalink
Remove nofollow on links which is don't the place to it
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Mar 2, 2013
1 parent 5786c0d commit 3849930
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Expand Up @@ -117,7 +117,7 @@ public static function categorylist($name, $parent, $options = array(), $params
* @param string $rel Link relationship, see: http://www.w3.org/TR/html401/types.html#type-links
* @param mixed $attributes Tag attributes as: 'accesskey="a" lang="en"' or array('accesskey'=>'a', 'lang'=>'en')
*/
public static function link($uri, $content, $title = '', $class = '', $rel = 'nofollow', $attributes = '') {
public static function link($uri, $content, $title = '', $class = '', $rel = null, $attributes = '') {
$list['href'] = KunenaRoute::_($uri);
if ($title) $list['title'] = $title;
if ($class) $list['class'] = $class;
Expand Down
17 changes: 15 additions & 2 deletions administrator/components/com_kunena/libraries/user/user.php
Expand Up @@ -282,19 +282,32 @@ public function getAvatarURL($sizex = 'thumb', $sizey = 90) {
return $avatars->getURL ( $this, $sizex, $sizey );
}

public function getLink($name = null, $title = null, $rel = 'nofollow', $task = '') {
public function getLink($name = null, $title = null, $rel = null, $task = '') {
if (!$name) {
$name = $this->getName();
}

$key = "{$name}.{$title}.{$rel}";
if (empty($this->_link[$key])) {
if (!$title) {
$title = JText::sprintf('COM_KUNENA_VIEW_USER_LINK_TITLE', $this->getName());
}
$uclass = $this->getType(0, 'class');
$link = $this->getURL (true, $task);
$list['href'] = $link;
if ($title) $list['title'] = $title;
if ($uclass) $list['class'] = $uclass;
if ($rel) $list['rel'] = $rel;

// Parse attributes
$attr = array();
foreach ($list as $key=>$value) {
$attr[] = "{$key}=\"{$value}\"";
}

$attributes = implode (' ', $attr);
if (! empty ( $link ))
$this->_link[$key] = "<a class=\"{$uclass}\" href=\"{$link}\" title=\"{$title}\" rel=\"{$rel}\">{$name}</a>";
$this->_link[$key] = "<a {$attributes}>{$name}</a>";
else
$this->_link[$key] = "<span class=\"{$uclass}\">{$name}</span>";
}
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_kunena/libraries/view.php
Expand Up @@ -225,7 +225,7 @@ public function formatLargeNumber($number, $precision = 3) {
public function getCategoryLink(KunenaForumCategory $category, $content = null, $title = null, $class = null) {
if (!$content) $content = $this->escape($category->name);
if ($title === null) $title = JText::sprintf('COM_KUNENA_VIEW_CATEGORY_LIST_CATEGORY_TITLE', $this->escape($category->name));
return JHtml::_('kunenaforum.link', $category->getUri(), $content, $title, $class, 'follow');
return JHtml::_('kunenaforum.link', $category->getUri(), $content, $title, $class);
}

public function getTopicLink(KunenaForumTopic $topic, $action = null, $content = null, $title = null, $class = null, KunenaForumCategory $category = NULL) {
Expand All @@ -250,7 +250,7 @@ public function getTopicLink(KunenaForumTopic $topic, $action = null, $content =
}
}
}
return JHtml::_('kunenaforum.link', $uri, $content, $title, $class, 'nofollow');
return JHtml::_('kunenaforum.link', $uri, $content, $title, $class);
}

public function addStyleSheet($filename) {
Expand Down

0 comments on commit 3849930

Please sign in to comment.