Hide Links ?

General topics relating to phpBB3 to be posted in here.
tzar
Forum Member
Forum Member
Posts: 3
Joined: Thu Oct 30, 2008 5:32 pm
Your Forum/Website URL: http://

Hide Links ?

Postby tzar » Thu Oct 30, 2008 6:14 pm

How can hide links in the code for unregistred users ?

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.


User avatar
LDM
Site Admin
Site Admin
Posts: 1794
Joined: Thu May 29, 2008 6:51 pm
Your Forum/Website URL: http://
Location: UK
Contact:

Re: Hide Links ?

Postby LDM » Thu Oct 30, 2008 6:29 pm

You can try this courtesy of This Author.

Open viewtopic.php

Find:

Code: Select all

$rowset[$row['post_id']] = array(


Before add:

Code: Select all

// Mod for members bbcode
if ($user->data['user_id'] == ANONYMOUS)
    {

    $offset = 0;
    $newstring = $row['post_text'];
    $strpos = strpos($newstring ,'[members:', $offset);
    $strcnt = substr_count($newstring ,'[members:');
   
    while ($strcnt <> false):

          $endpos = strpos($newstring, '[/members', $offset);
          $strpos = $strpos + 18;
          $strlen = $endpos - $strpos;
          $newstring = substr_replace($newstring, 'You must be a Registered Member to view this content', $strpos, $strlen);
           $offset = $strpos + 53;
   
            if ($offset < strlen($newstring))
                {
                         $strrem = substr($newstring, $offset);
                         $strcnt = substr_count($strrem ,'[members:');
                 $strpos = strpos($newstring, '[members:', $offset);
                }
            else
                  {
                   $strcnt = false;
                  }         
    endwhile;
   
    $row['post_text'] = $newstring;
    }
// End Mod for members bbcode


In ACP / Posting / BBcodes add the new bbcode
BBCode Usage:

Code: Select all

[members]{TEXT}[/members]


HTML:

Code: Select all

<div style="margin:20px; margin-top:5px"><div class="quotetitle"><b>Registered Members Only:</b> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';        this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>


Helpline:

Code: Select all

Hide :[members]your content[/member]


You could then add the code tags in the middle of member tags and add the coded url in the middle.
Image

Image

User avatar
Sewell
Forum Member
Forum Member
Posts: 113
Joined: Mon Jul 28, 2008 11:40 am

Re: Hide Links ?

Postby Sewell » Thu Oct 30, 2008 7:14 pm

Or you could try this one though a little different to what you want.

tzar
Forum Member
Forum Member
Posts: 3
Joined: Thu Oct 30, 2008 5:32 pm
Your Forum/Website URL: http://

Re: Hide Links ?

Postby tzar » Thu Oct 30, 2008 10:45 pm

Thanks :good:

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.


talicni
Forum Member
Forum Member
Posts: 1
Joined: Tue Dec 27, 2011 4:14 pm
Your Forum/Website URL: http://nadaljforum.serbianforum.info

Re: Hide Links ?

Postby talicni » Tue Dec 27, 2011 4:16 pm

Can I use this tags for my forum?I have forum on forumotion servis and its created in phpbb 3code.If i can,where to put it?

User avatar
cisco007
Staff
Staff
Posts: 501
Joined: Tue Oct 07, 2008 3:44 am
Your Forum/Website URL: http://phpbbmexico.com

Re: Hide Links ?

Postby cisco007 » Thu Dec 29, 2011 9:44 pm

this is an old topic, what are you trying to hide? the code tag to guests or links to guests!?
Image
Image

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider to support the site.



Return to “PhpBB3 General”



Who is online

Users browsing this forum: No registered users and 23 guests