Only registered users are able to see [URL][/URL]

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Get Involved
User avatar
Artuurins
Registered User
Posts: 202
Joined: Sun Jul 05, 2009 12:52 pm

Only registered users are able to see [URL][/URL]

Post by Artuurins »

Is there any mod wich can do it ? :)
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Only registered users are able to see [URL][/URL]

Post by Oyabun1 »

Search is your friend. Disallow links before x posts
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
manic2
Registered User
Posts: 435
Joined: Thu Jun 12, 2008 9:16 pm

Re: Only registered users are able to see [URL][/URL]

Post by manic2 »

You can do it with a custom BBCode:-
chien wrote:Here's what you need

Step 1.
Place this in the "BBCode usage" textarea.

Code: Select all

[hideurl={URL}]{SIMPLETEXT}[/hideurl]
Step 2.
Place this in the "HTML " textarea.

Code: Select all

<a href="{URL}" id="guest" name="guest">{SIMPLETEXT}</a>
<span name="guest" id="guest">&nbsp;</span>
<script>
var lks = document.links;
for(i=0; i<lks.length;i++){
if(lks[i].href.indexOf('mode=register')!=-1)
{
document.getElementsByTagName('A').guest.style.display="none";
document.getElementsByTagName('SPAN').guest.innerHTML="You must be a registered user to see links.";
}
else{
document.getElementsByTagName('A').guest.style.visibility="visible";
}}
</script>
And now when you have that BBCode you can hide Links From Guest.
example

Code: Select all

[hideurl=http://yahoo.com]Yahoo[/hideurl]
Logged in user will see the link
Guests will see this message "You must be a registered user to see links"
manic
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

manic2 wrote:You can do it with a custom BBCode:-
chien wrote:Here's what you need

Step 1.
Place this in the "BBCode usage" textarea.

Code: Select all

[hideurl={URL}]{SIMPLETEXT}[/hideurl]
Step 2.
Place this in the "HTML " textarea.

Code: Select all

<a href="{URL}" id="guest" name="guest">{SIMPLETEXT}</a>
<span name="guest" id="guest">&nbsp;</span>
<script>
var lks = document.links;
for(i=0; i<lks.length;i++){
if(lks[i].href.indexOf('mode=register')!=-1)
{
document.getElementsByTagName('A').guest.style.display="none";
document.getElementsByTagName('SPAN').guest.innerHTML="You must be a registered user to see links.";
}
else{
document.getElementsByTagName('A').guest.style.visibility="visible";
}}
</script>
And now when you have that BBCode you can hide Links From Guest.
example

Code: Select all

[hideurl=http://yahoo.com]Yahoo[/hideurl]
Logged in user will see the link
Guests will see this message "You must be a registered user to see links"

I'm the beginner in all this, can you please explain where do I have to add this? Do I have to change it in some file or I have to create it? :(
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

I figured it out, but that's not what I want. I don't want people to manually hide it. I want that automatically all links are visible only to registered users.

I found the MOD "Hide Links" here http://www.phpbbhacks.com/download/4543
but I can't install it....first I don't have file admin_board.php and that's where I'm supposed to start. I'm using Lucid Lime theme. Can anybody help?
GeorgeXV
Registered User
Posts: 6
Joined: Sun Jan 09, 2011 8:43 pm

Re: Only registered users are able to see [URL][/URL]

Post by GeorgeXV »

That mod is made for PhpBB v2 so it's unlikely it'll work at all with the current PhpBB3. You need to find mods which work with PhpBB3 first.

You should be able to put something quite simple into the view_topic.php file, though I have no confidence in writing mods yet. :P
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

I'm new in all this, so I don't have a clue how to write a mod or how to add something!! ;)
User avatar
robra
Registered User
Posts: 147
Joined: Thu Dec 09, 2010 2:09 am
Location: Brazil

Re: Only registered users are able to see [URL][/URL]

Post by robra »

Artuurins wrote:Is there any mod wich can do it ? :)
Hi, Artuurins.
You can hide automatically links and URL's for guest with the "Hide links for guest v 1.0.3" MOD, in page http://www.mssti.com/phpbb3/viewtopic.php?f=31&t=335, without to use the BBcode "Hide" to each message.
If you want hide e-mail address for guest too, then, you are will need to do some changes in code, on link upstairs. See how can you do that in page http://www.mssti.com/phpbb3/viewtopic.php?f=94&t=1331.
Only users registered could see the links, urls and e-mails address.

[ ]s. :)
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

robra wrote:
Artuurins wrote:Is there any mod wich can do it ? :)
Hi, Artuurins.
You can hide automatically links and URL's for guest with the "Hide links for guest v 1.0.3" MOD, in page http://www.mssti.com/phpbb3/viewtopic.php?f=31&t=335, without to use the BBcode "Hide" to each message.
If you want hide e-mail address for guest too, then, you are will need to do some changes in code, on link upstairs. See how can you do that in page http://www.mssti.com/phpbb3/viewtopic.php?f=94&t=1331.
Only users registered could see the links, urls and e-mails address.

[ ]s. :)

Your MOD is quite hard to understand for the beginners...
User avatar
jsoni
Registered User
Posts: 355
Joined: Mon Aug 02, 2010 3:55 pm
Location: Mauritius
Contact:

Re: Only registered users are able to see [URL][/URL]

Post by jsoni »

It is very simple to modify, you need to follow only installation guide.
PM me for phpbb modification
Not phpbb or php master but can help you to gain my knowledge.
On your own risk :)
For graphics and animation PM me.
Forum:http://www.pixelandgrain.in/
User avatar
robra
Registered User
Posts: 147
Joined: Thu Dec 09, 2010 2:09 am
Location: Brazil

Re: Only registered users are able to see [URL][/URL]

Post by robra »

Lana105 wrote:
Your MOD is quite hard to understand for the beginners...
Hi, Lana105.

I'm beginner too and I only follow step by step the instructions of install.xml file and did the changes to hide e-mails address too. It was very easy.
The problem is that many people haven't patience to read all file and to follow step by step the instructions.
Unfortunately, these people always will be "beginners".

[ ]s. ;)
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

Actually Robra, I'm really the beginner and that instruction is quite confusing for me. I can't tell the difference between codes and between his instructions because everything is written in the same way. I found several MODs and I had no problems with them, but this one.... :?

For example this part

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="./contrib/modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>

		<title lang="en"><![CDATA[MSSTI Hide links for guest]]></title>

		<description lang="en"><![CDATA[This MOD change your posted links with a warning text, for guest.]]></description>

		<author-notes lang="en"><![CDATA[
What is this?? Instruction or part of the code? I can't tell the difference. And I asked here for help. If anybody can help me to decode this MOD and to use it correctly, please help. And if you don't have patience and don't want to help, then don't. It's ok, I'll find a way somehow to do it.
User avatar
jsoni
Registered User
Posts: 355
Joined: Mon Aug 02, 2010 3:55 pm
Location: Mauritius
Contact:

Re: Only registered users are able to see [URL][/URL]

Post by jsoni »

open installation xml file into opera or any other browser and will look in order you can see everything so clear.. if you still getting any issue and need help from my side pls give me your live or gmail id i i wll add you in IMs
PM me for phpbb modification
Not phpbb or php master but can help you to gain my knowledge.
On your own risk :)
For graphics and animation PM me.
Forum:http://www.pixelandgrain.in/
User avatar
robra
Registered User
Posts: 147
Joined: Thu Dec 09, 2010 2:09 am
Location: Brazil

Re: Only registered users are able to see [URL][/URL]

Post by robra »

Hi, Lana105.

First, you need to read "[Tutorial] How to install a MOD", in page http://www.phpbb.com/community/viewtopic.php?t=61611.
There, all you doubts about to install any MOD will be clarified. Okay ?
Now, about your specif doubt, the install_MSSTI_HideLinks.xml file has been opened with Internet Explorer.
When you to open the install_MSSTI_HideLinks.xml file with Internet Explorer, a message will display about permission of the "activeX controls". Choice "Enable Content Blocked" in Internet Explorer and the instructions page will be opened correct to you.

[ ]s. ;)
Lana105
Registered User
Posts: 15
Joined: Wed Jan 19, 2011 9:42 am

Re: Only registered users are able to see [URL][/URL]

Post by Lana105 »

Thanks to both of you, I read it all carefully and I started from the beginning. Just one question.

I have to do this for example
Find

Tip: This may be a partial find and not the whole line.

Code: Select all

$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
Add after

Tip: Add these lines on a new blank line after the preceding line(s) to find.

Code: Select all

// MOD : MSSTI Hide links - Start
		if ($user->data['user_id'] == ANONYMOUS)
		{
			$user_cache[$poster_id]['sig'] = hide_link($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], 'sig', 0, 0, $row['post_id']);
		}
// MOD : MSSTI Hide links - End
I found it and it looks like this

Code: Select all

// End signature parsing, only if needed
	if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
	{
		$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);

		if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
		{
			$bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
		}

		$user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
		$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
		$user_cache[$poster_id]['sig_parsed'] = true;
	}
Do I have to it after this whole part or after just this line

Code: Select all

{
		$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
Locked

Return to “[3.0.x] MOD Requests”