Hide Links ?

General topics relating to phpBB3 to be posted in here.
  • Advertisement

Bookmark and Share

Hide Links ?

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

How can hide links in the code for unregistred users ?
User avatar
tzar
Forum Member
Forum Member
 
Posts: 3
Joined: October 2008
Has thanked: 0 time
Have thanks: 0 time

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
LDM
Site Admin
Site Admin
 
Posts: 1794
Joined: May 2008
Location: UK
Has thanked: 17 times
Have thanks: 122 times
Fine

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.
User avatar
Sewell
Forum Member
Forum Member
 
Posts: 113
Joined: July 2008
Has thanked: 1 time
Have thanks: 2 times

Re: Hide Links ?

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

Thanks :good:
User avatar
tzar
Forum Member
Forum Member
 
Posts: 3
Joined: October 2008
Has thanked: 0 time
Have thanks: 0 time

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
talicni
Forum Member
Forum Member
 
Posts: 1
Joined: December 2011
Has thanked: 0 time
Have thanks: 0 time

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
User avatar
cisco007
Staff
Staff
 
Posts: 496
Joined: October 2008
Has thanked: 13 times
Have thanks: 31 times
Daring



  • Advertisement

Return to PhpBB3 General



Who is online

Users browsing this forum: No registered users and 3 guests


Subscribe to the ModphpBB3 Forum RSS