Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Gandalf in Februar 11, 2005, 03:36:00 NACHMITTAGS

Titel: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 11, 2005, 03:36:00 NACHMITTAGS
hello
i need this modification (well at least where to do it) I'll explain below:
when we post something like this [*url=http://www.siemens-mobiles.org/forum/index.php][*img]http://membres.lycos.fr/redouane171/Resize%20of%20wael.jpg[/*img][*/url]
it give the following image which is assigned to an URL like this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fmembres.lycos.fr%2Fredouane171%2FResize%2520of%2520wael.jpg&hash=6e209e5ec0e9dab17b9b201c9310d0d396b02100) (http://www.siemens-mobiles.org/forum/index.php)

i need to disallow guest from viewing URLs but they still can view the images which i mean the above code will be visible to guests like this (an image without a link)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fmembres.lycos.fr%2Fredouane171%2FResize%2520of%2520wael.jpg&hash=6e209e5ec0e9dab17b9b201c9310d0d396b02100)
, in other world the guests view the message just like if we typed ONLY [*img]http://membres.lycos.fr/redouane171/Resize%20of%20wael.jpg[*img] so how to do it???
thanks
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in Februar 12, 2005, 03:25:04 VORMITTAG
Find, Sources/Subs.php:

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'' : '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'',
'~\[url=(.+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '\'$2 ($1)\'' : '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'',
'~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i' => isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>',


Replace:
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => $context['user']['is_guest'] ? '\'$2\'' : (isset($disabled['url']) ? 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'' : '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\''),
'~\[url=(.+?)\](.+?)\[/url\]~ie' => $context['user']['is_guest'] ? '\'$2\'' : (isset($disabled['url']) ? '\'$2 ($1)\'' : '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\''),
'~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i' => $context['user']['is_guest'] ? '' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>'),


How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 13, 2005, 10:17:20 VORMITTAG
thanks man i'll try it and i'll tell you :D
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 13, 2005, 10:57:03 VORMITTAG
it works perfect just like i want
Respect to you [Unknown]  :)
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 13, 2005, 08:32:21 NACHMITTAGS
[unknown] i've removed this patch because i need to install Faster Parse Code mod so the new (original code) is // Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';
if(isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>';
}
so how to patch in this case??? thanks
Titel: Re: do not allow guest to view URLs
Beitrag von: niko in Februar 15, 2005, 03:19:37 NACHMITTAGS

if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';
if(isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}
if(isset($context['user']['is_guest'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}
else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>';
}

this may work
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 15, 2005, 09:31:51 NACHMITTAGS
thanks i'll try it
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 21, 2005, 04:44:16 VORMITTAG
that one didn't work!!!
i get under the image the URL in text, in case if you ask i added $context to the global instruction of theis function,so there's something worg with [*url=http://..][*img]..[*/img][*/url]

and nothing happens with [*url]...[*/url]
any other suggestions???
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in Februar 21, 2005, 06:04:14 NACHMITTAGS
no answer??? please guys come on....
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in März 11, 2005, 06:30:12 NACHMITTAGS
Try:

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
$arr2[] = '$2';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}


-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 11, 2005, 07:41:39 NACHMITTAGS
thank you i'll try it now
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 11, 2005, 08:26:16 NACHMITTAGS
i get the following error

Parse error: parse error, unexpected '[' in /var/www/virtual/siemens-mobiles.org/htdocs/slash/Sources/Subs.php(1237) : regexp code on line 1

Fatal error: Failed evaluating code: [img]http://www.siemens-mobiles.org/patchgen/patchgen.jpg[/img] in /var/www/virtual/siemens-mobiles.org/htdocs/slash/Sources/Subs.php on line 1237


test forum url : http://www.siemens-mobiles.org/slash/index.php
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 11, 2005, 08:31:10 NACHMITTAGS
i made a .mod file so i can install and test easly without having to do it manually, i'll include the file in case you want to test it/verify it

.mod contents

<id>
Disable URL from guests
</id>

<version>
1.0
</version>

<mod info>
This mod will disable URL from guests
</mod info>

<author>
Gandalf code givin by [Unknown]
</author>

<homepage>
http://www.siemens-mobiles.org/
</homepage>


<edit file>
Sources/Subs.php
</edit file>

<search>
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';
if(isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>';
}
</search>

<replace>
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
$arr2[] = '$2';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}
</replace>
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in März 18, 2005, 11:33:24 NACHMITTAGS
I think you want this, then:

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
$arr2[] = '\'$2\'';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}


-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 19, 2005, 12:27:41 VORMITTAG
exactly, in fact i repaired it two days ago the problem was

$arr2[] = '\'$2\'';

instead of

$arr2[] = '$2';


but there's something weird that i couldn't figure out myself, when viewing an url with spaces before and after it, it works, but if there's an url with letter before or after it, without spaces, it doesn't work and i couldn't figure out why
see those two topics to know what i mean
http://www.siemens-mobiles.org/forum/index.php/topic,1255.0.html where the weird thing is
http://www.siemens-mobiles.org/forum/index.php/topic,1657.0.html where it works

login with smf as username, programming as password if you need to see the topics as a user

the code that i used

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
$arr2[] = '\'$2\'';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}


BTW thanks master [Unknown] so nice from you to help...
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in März 19, 2005, 12:43:45 VORMITTAG
Try changing this:

$arr2[] = '\'$2\'';

To:

$arr2[] = '\'[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]\'';

-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 19, 2005, 12:53:19 VORMITTAG
nope same thing http://www.siemens-mobiles.org/slash/index.php/topic,1255.0.html
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in März 19, 2005, 12:58:36 VORMITTAG
Sorry, sorry, I see where I'm misunderstanding that code.  Replace this one too with the same:

$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';

-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 19, 2005, 01:12:48 VORMITTAG
again not working :'(
http://www.siemens-mobiles.org/slash/index.php/topic,1255.0.html

code that i used

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\')';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}


in case you need the original code to compare

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';
if(isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>';
}
Titel: Re: do not allow guest to view URLs
Beitrag von: [Unknown] in März 19, 2005, 01:48:16 VORMITTAG
No, no, you did it backwards.  I meant to replace that with this:

$arr2[] = '\'[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]\'';

Meaning, both lines should be that.

-[Unknown]
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 19, 2005, 01:53:50 VORMITTAG
Zitat von: [Unknown] in März 19, 2005, 01:48:16 VORMITTAG
No, no, you did it backwards.  I meant to replace that with this:

$arr2[] = '\'[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]\'';

Meaning, both lines should be that.

-[Unknown]
nope that didn't work and now it's not a good idea
compare these two topics (from two version of the forum, same topic)
http://www.siemens-mobiles.org/slash/index.php/topic,1524.0.html
http://www.siemens-mobiles.org/forum/index.php/topic,1657.0.html

see? the images which supposed to have an url, when a guest visit it he must see the image without an url like the above topic, but replacing the code as you said it just replaced both and it don't work also http://www.siemens-mobiles.org/slash/index.php/topic,1255.0.html

but really thanks, i'm sorry to disturbe you again

code used now:

// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
if(isset($add['[url='])){
$arr1[] = '~\[url=([^\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie';
$arr1[] = '~\[url=(.+?)\](.+?)\[/url\]~ie';

if ($context['user']['is_guest'])
{
$arr2[] = '\'[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]\'';
$arr2[] = '\'[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]\'';
}
elseif (isset($disabled['url'])){
$arr2[] = 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'';
$arr2[] = '\'$2 ($1)\'';
}else{
$arr2[] = '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'&#64;\'))) . \'</a>\'';
$arr2[] = '\'<a href="$1" target="_blank">\' . strtr(\'$2\', array(\'@\' => \'&#64;\')) . \'</a>\'';
}
}
if(isset($add['[url]'])){
$arr1[] = '~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~i';
$arr2[] = $context['user']['is_guest'] ? '[URL REMOVED BECAUSE YOU ARE VISITING THE SITE AS A GUEST, PLEASE LOGIN TO SEE THE URLs]' : (isset($disabled['url']) ? '$1' : '<a href="$1" target="_blank">$1</a>');
}
Titel: Re: do not allow guest to view URLs
Beitrag von: Gandalf in März 19, 2005, 02:04:09 VORMITTAG
man i'm really sorry it's my mistake i just discovered the error now, and i appreciate also if you tell me how to bypass it
in fact that topic is posted with html not with bbcode like this :

<a href="http://www.siemens-mobiles.org/forum/index.php/topic,302.0.html">Available firmware</a>

i'm really sorry it's my mistake, i apologise again

can you give me please the code to bypass html code also if it's possible if not i just disable html and edit this unique post like this

thank you man again
Titel: do not allow guest to view URLs RC2
Beitrag von: Du! in Januar 22, 2006, 11:24:56 VORMITTAG
And how to do the same in SMF 1.1 RC2?
Titel: Re: do not allow guest to view URLs
Beitrag von: Du! in Januar 23, 2006, 01:35:35 NACHMITTAGS
Any idea for my last post?
Thanks.
Titel: Re: do not allow guest to view URLs
Beitrag von: profile in Februar 27, 2006, 05:57:40 NACHMITTAGS
Does this work for 1.1 RC2?  Anyone?
Titel: Re: do not allow guest to view URLs
Beitrag von: Gobo in Mai 22, 2006, 03:46:21 VORMITTAG
it dosent work for RC2

can someone do a conversion?

this is a really cool feature to have!
Titel: Re: do not allow guest to view URLs
Beitrag von: Farmacija in Juni 02, 2006, 05:03:55 VORMITTAG
Does it work just for picture links or for any kind of urls?
Titel: Re: do not allow guest to view URLs
Beitrag von: Gobo in Juni 02, 2006, 04:35:17 NACHMITTAGS
Zitat von: Farmacija in Juni 02, 2006, 05:03:55 VORMITTAG
Does it work just for picture links or for any kind of urls?

there is a mod available for this now which works with links and linked pictures

check the mod forum

sorry in a bit of a hurry or i would have provided u with a link
Titel: Re: do not allow guest to view URLs
Beitrag von: sanax in Mai 02, 2007, 01:17:07 VORMITTAG
..any recent updates for this code?
Titel: Re: do not allow guest to view URLs
Beitrag von: metallica48423 in Mai 02, 2007, 03:57:05 VORMITTAG
http://custom.simplemachines.org/mods/index.php?mod=342