Not Solved Hide Links from Guests for mybb 1.6.8?
#1
Not Solved
Is this plugin available for mybb 1.6.8?
I installed it but it does not run with my version of mybb (1.6.8).

Thanks!
Reply
#2
Not Solved
This user has been denied support. This user has been denied support.
try this! http://mods.mybb.com/view/hide-links-2

or edit inc/class_parser.php

find:
if(!preg_match("#^[a-z0-9]+://#i", $url))
                {
                    $url = "http://".$url;
                } 
add above
global $mybb;
            if($mybb->user['uid'] != 0)
            { 

find:
$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
                return $link; 
add below:
}
            else
            {
                $link = "<a href=\"member.php?action=register\" target=\"_blank\">You can't view the links! Click here to register</a>";
                return $link;
            } 
<snip>Smile<snip>
<snip - warez>
Reply
#3
Not Solved
I will. Thanks!
Reply
#4
Not Solved
How about SEO problems whithout links for Google (that is a guest)?
Reply
#5
Not Solved
We need something like this, for Mybb. This mods are good but without any settings.
Reply
#6
Not Solved
You could try this.

http://mods.mybb.com/view/hide-links-to-guests-for-14
Reply
#7
Not Solved
The php mod sugested by tamnguyen949 work very good. I will consider to install a plugin, only for some options like "hide only external links". It's all about SEO...
Reply
#8
Not Solved
(2012-10-30, 08:21 PM)tamnguyen949 Wrote: try this! http://mods.mybb.com/view/hide-links-2

or edit inc/class_parser.php

find:
if(!preg_match("#^[a-z0-9]+://#i", $url))
                {
                    $url = "http://".$url;
                } 
add above
global $mybb;
            if($mybb->user['uid'] != 0)
            { 

find:
$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
                return $link; 
add below:
}
            else
            {
                $link = "<a href=\"member.php?action=register\" target=\"_blank\">You can't view the links! Click here to register</a>";
                return $link;
            } 


Can you explain in detail what changes we need to do in

inc/class_parser.php


I have done this change is this valid code

/**
* Parses URL MyCode.
*
* @param string The URL to link to.
* @param string The name of the link.
* @return string The built-up link.
*/
function mycode_parse_url($url, $name="")
{
global $mybb;
if($mybb->user['uid'] != 0)
{

if(!preg_match("#^[a-z0-9]+://#i", $url))
{
$url = "http://".$url;
}
$fullurl = $url;


$url = str_replace('&amp;', '&', $url);
$name = str_replace('&amp;', '&', $name);

if(!$name)
{
$name = $url;
}

$name = str_replace("\'", "'", $name);
$url = str_replace("\'", "'", $url);
$fullurl = str_replace("\'", "'", $fullurl);

if($name == $url && (!isset($this->options['shorten_urls']) || $this->options['shorten_urls'] != 0))
{
if(my_strlen($url) > 55)
{
$name = my_substr($url, 0, 40)."...".my_substr($url, -10);
}
}

$nofollow = '';
if(isset($this->options['nofollow_on']))
{
$nofollow = " rel=\"nofollow\"";
}

// 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
$link = "<a href=\"$fullurl\" target=\"_blank\"{$nofollow}>$name</a>";
return $link;
}
else
{
$link = "<a href=\"member.php?action=register\" target=\"_blank\">You can't view the links! Click here to register</a>";
return $link;
}

}

for me only in reply portion this text appears in RED color

You can't view the links! Click here to register

but the image is still shown
Reply
#9
Not Solved
looking for this one too for my forum..
Reply
#10
Not Solved
Hello, I do it like this:

Find:
			if(!preg_match("#^[a-z0-9]+://#i", $url))
			{
				$url = "http://".$url;
			}
Do like this
	   global $mybb;
           if($mybb->user['uid'] != 0)
           { 
			if(!preg_match("#^[a-z0-9]+://#i", $url))
			{
				$url = "http://".$url;
			}
		}


Find:
	$link = "<a href=\"$url\" target=\"_blank\"{$nofollow}>$name</a>";
Do like this:
           if($mybb->user['uid'] != 0)
		{
		$link = "<a href=\"$url\" target=\"_blank\"{$nofollow}>$name</a>";
		}
		else
		{
 		$link = "<a href=\"member.php?action=register\" target=\"_blank\">You can't view the links! Click here to register</a>";
		}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)