MyBB Community Forums

Full Version: Suggestion nofollow links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
New option in MyBB1.8
Follow links in our domain and approved

Nofollow links to the rest website

class_parser.php file:

		// Fix some entities in URLs
		$entities = array('$' => '%24', '$' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20');
		$fullurl = str_replace(array_keys($entities), array_values($entities), $fullurl);

		$name = preg_replace("#&amp;\#([0-9]+);#si", "&#$1;", $name); // Fix & but allow unicode
// wstawka modyfikująca zewnętrzne linki w postach oraz www stronach uzytkownika przy posyach na nofollow
		
		// $link = "<a href=\"$fullurl\" target=\"_blank\" rel=\"nofollow\">$name</a>";
                // nie zmieniamy na nofollow linków do nas!!!
                $_host = '://'.$_SERVER["HTTP_HOST"];
                // ://forum.moja_strona.org jest w URL-u
                // i zaczyna sie nie dalej niż na 5 miejscu (https ma 5 znaków)
                if((strpos($fullurl,$_host) !== FALSE) && (strpos($fullurl,$_host) < 6))
                {
                  // Parse internal URL
                  $link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
                } else {
                  // linki do mojej domeny!!! Chcemy miec follow!!!
                  $_host_moj = '://mysite.pl';
                  if((strpos($fullurl,$_host_moj) !== FALSE) && (strpos($fullurl,$_host) < 6))
                  {
                    // Parse internal URL
                    $link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
                  } else {
                    // Parse external URL deferred by anonym.to and with rel="nofollow"
                    // $link = "<a href=\"http://anonym.to/?$fullurl\" target=\"_blank\" rel=\"nofollow\">$name</a>";
                    $link = "<a href=\"$fullurl\" target=\"_blank\" rel=\"nofollow\">$name</a>";
                  }
                  unset($_host_moj);
                }
				
				unset($_host);
// koniec mojej wstawki
		return $link;
	}

	/**
	* Parses URL MyCode.


Huh Maybe?
new option in the ACP links open and closed links rel="nofollow" ?
This option is available with Google SEO plugin
yes but all links have the nofollow attribute

<a href="http://www.MyBB.com/" rel="nofollow">AAA BBB CCC</a>


our website and our links to our pages to be opened [mybb.com, mynewsite.com, myexample.com]

<a href="http://www.MyBB.com/" >AAA BBB CCC</a>
<a href="http://www.mynewsite.com/" > 2 links</a>
<a href="http://www.myexample.com/" >3 www</a>

blockade of external websites
<a href="http://www.pornoexample.com/" rel="nofollow">examples</a>
<a href="http://www.example.ru/" rel="nofollow"> putin putler</a>
<a href="http://www.putindziad.rus/" rel="nofollow">putin is idiots</a>