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)?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → 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)?
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
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.
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?
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.
I tried this code but it won't works with my current version 1.3.4
Can any one help?
@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>';
}
}
PunBB Forums → PunBB 1.2 troubleshooting → Hidden content for guest
Powered by PunBB, supported by Informer Technologies, Inc.