vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Usergroup Tags (https://vborg.vbsupport.ru/showthread.php?t=50809)

filburt1 03-24-2003 10:00 PM

Usergroup Tags
 
This hack allows you to selectively display text to certain usergroups wherever BB code is parsed. For example, this tag:

[ugid1]Only guests will see this[/ugid1]

...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
PHP Code:

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

Below it put
PHP Code:

$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/showthrea...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/showthrea...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


All times are GMT. The time now is 07:29 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01828 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete