PDA

View Full Version : Usergroup Tags


filburt1
03-24-2003, 10:00 PM
This hack allows you to selectively display text to certain usergroups wherever BB code is parsed. For example, this tag:

Only guests will see this

...will only appear to guests. All other usergroups just won't see the text at all.

This is not meant to be secure! Anybody who quotes or edits a given post will see all the [ugidn] tags in plan text. This hack works for all usergroupids, including custom ones.

filburt1
03-25-2003, 06:10 PM
My signature (note the tags at the bottom):

filburt1
03-25-2003, 06:11 PM
What an admin sees:

filburt1
03-25-2003, 06:12 PM
What a guest sees:

Dean C
03-25-2003, 06:12 PM
Interesting :)

Xenon
03-25-2003, 06:25 PM
hey nice :)

assassingod
03-25-2003, 06:31 PM
Very cool hack turtle!!!

Xyphen
03-25-2003, 08:11 PM
Awesome work..

Chris M
03-25-2003, 08:20 PM
Great idea!:)

*installs:)

Satan

N9ne
03-25-2003, 08:24 PM
Couldn't you make it so it is secure? :D

filburt1
03-25-2003, 08:29 PM
I could pretty easily but it would require a lot more code editing and third-party hacks would have to be edited, too.

Chris M
03-25-2003, 08:31 PM
Well there is one way of making it secure that he has already pointed out...Disable the "quote post" option;):p

Satan

filburt1
03-25-2003, 08:32 PM
What about PMs, editing a post, etc.?

grog6
03-25-2003, 08:49 PM
Thx filburt1 !

/me cliks install, it could be fun to use :P

N9ne
03-25-2003, 09:02 PM
Filb, good point about the amount of editing required to do so, good hack nonetheless though :).

Davey
03-25-2003, 10:50 PM
Nice idea but what about in 'get all posts from this user'.
Wont it show them what they said? Or part of it?

Dave.

filburt1
03-25-2003, 10:51 PM
This is part of bbcodeparse2(). Whenever that is called, then ugid tags for all other usergroups will be stripped. Otherwise they'll be right there. So anytime BB code is parsed, this will be, too.

Davey
03-25-2003, 10:52 PM
Ah okay just checking :).

Dave.

VeoMorphine
03-26-2003, 10:21 AM
hrmmmm... Correct me if im wrong. Im taking this off the top of my head. Wouldn't this fix that quote problem?

Edit newreply.php and find

$posttime=vbdate($timeformat,$postinfo[dateline]);
$pagetext=htmlspecialchars($postinfo[pagetext]);


Below it put

$pagetext = preg_replace("/(\[)(ugid1)(])(\r\n)*([^\"]*)(\[\/ugid1\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid2)(])(\r\n)*([^\"]*)(\[\/ugid2\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid3)(])(\r\n)*([^\"]*)(\[\/ugid3\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid4)(])(\r\n)*([^\"]*)(\[\/ugid4\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid5)(])(\r\n)*([^\"]*)(\[\/ugid5\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid6)(])(\r\n)*([^\"]*)(\[\/ugid6\])/siU", "" ,$pagetext);
$pagetext = preg_replace("/(\[)(ugid7)(])(\r\n)*([^\"]*)(\[\/ugid7\])/siU", "" ,$pagetext);


And so on and so on, for each user group.

I think that may only work if its a real bbcode tag. Im not sure. I dont have access to my home pomputer so i cant try it just yet.

filburt1
03-26-2003, 02:11 PM
The whole point is that you don't have to have so much redundant code. That's why I invented loops :D

Yes it would fix it but the problem is there are so many other places in vB where you can see the raw BB code.

Slynderdale
03-26-2003, 05:29 PM
Theres a hack similar to this here, and its secure:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=48492

filburt1
03-26-2003, 05:30 PM
How is that one secure?

Slynderdale
03-26-2003, 05:39 PM
I have it so it removes any rouge php functions you dont allow and have it set to admin only and also have it so no one can view it unless they have permission too, it checks it during search, quoting, editing and so on. But nice hack filburt, yours is slightly esier to use to those who dont php santax.

Also I wasnt trying to put down your hack with my previous post, I respect all hackers. If you want, you can delete it.

g-force2k2
03-26-2003, 05:52 PM
i know i've tried somewhat of the same kind of hack a while back... didn't feel like bypassing so many different places that i just added in another field to the post table...

https://vborg.vbsupport.ru/showthread.php?s=&threadid=42444

thats just what i did to try to acheive the effects but it was only a user to user based and im sure it can be modified to a usergroup to usergroup based...

g-force2k2