1

Topic: Hidden content for guest

Hellow again, is it possible hide links in post (for seperate forums) from geust (only members are able to see links in these forums)?

2 (edited by prit 2006-12-10 02:46)

Re: Hidden content for guest

yes it is possible.

Open ./include/parser.php

Find, line 278:

return '<a href="'.$full_url.'">'.$link.'</a>';

Replace with:

if ($pun_user['is_guest'] )
return '<span class="warntext">[guest will see what you write here]</span>';
else
return '<a href= "'.$full_url.'">'.$link.'</a>';

original thread from punbb turkish forums

http://www.langturk.com/forum/viewtopic … d=154#p154

3 (edited by rawrhythms 2006-12-12 07:35)

Re: Hidden content for guest

prit wrote:
if ($pun_user['is_guest'] )
return '<span class="warntext">[guest will see what you write here]</span>';
else
return '<a href= "'.$full_url.'">'.$link.'</a>';

This is great! Could you modify this so that it would filter a particular forum id for the links? Rather than all forums.

Edit:
Now that I think of it, could you filter for a specific user group? that would be even better. I'm trying to restrict forum content by user group or by guest.

4 (edited by Vanslyde 2006-12-22 17:10)

Re: Hidden content for guest

I know it's paradoxical and I doubt it can be done but I got to ask; how about having a small image instead of a warning text? Do you think its possible?

Re: Hidden content for guest

Vanslyde wrote:

I know it's paradoxical and I doubt it can be done but I got to ask; how about having a small image instead of a warning text? Do you think its possible?

Just replace the text with an <img> tag.

Re: Hidden content for guest

yup!, Thanks a lot! : )

Re: Hidden content for guest

I tried this code but it won't works with my current version 1.3.4

Can any one help?

8

Re: Hidden content for guest

@sakthi

for 1.3.4 find line 631 in ./include/parser.php and replace

this

    else
        return '<a href="'.$full_url.'">'.$link.'</a>';

with

    else {
        global $forum_user;
        if($forum_user['username'] == 'Anonymous') {
            return '<span class="warntext">[guest will see what you write here]</span>';
        } else {
            return '<a href="'.$full_url.'">'.$link.'</a>';
        }
    }
Eraversum - scifi browser-based online webgame