Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 05 Jul 2013, 04:39
Revenga Revenga is offline
 
Join Date: Mar 2012
Create new BB Code only viewable by Super Moderators and Administrators

Hi, I'm running a vBulletin 3.8.7 forum and basically what I'm looking for is how to go about creating a code such as:

[restricted]this text here should only be viewable by Super Moderators and Administrators.[/restricted]

I want to be able to use that in posts to make comments to only my admins and super mods. I also want only the admin and super mod usergroups to have permission to use that BB Code - No one else. How do I accomplish this?

- Revenga

Last edited by Revenga; 05 Jul 2013 at 04:46.
Reply With Quote
  #2  
Old 05 Jul 2013, 05:49
nerbert nerbert is offline
 
Join Date: May 2008
Conditionals just don't work inside bb codes; they don't execute at all. Maybe what you could do is have something like this

<div style="display:none" name="restricted">{param}</div>

Then up in the <head> have a script that changes the display to "block" for admins and supers for window.onload. The trouble is this will be visible in the source code to anyone who looks.

Actually I don't think there's any direct way to do it with the bbcode system, you would have to do it with php in a plugin in showthread.php and have regular expression matching chop the text out for registered members

--------------- Added 05 Jul 2013 at 06:13 ---------------

I'm going to work on this. Check back in an hour or so.

--------------- Added 05 Jul 2013 at 07:19 ---------------

Make a plugin for showhread_complete and an identical one for showpost-complete with this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can play with the styling if mine is too obnoxious. I haven't tested this much so give it a good testing.

Last edited by nerbert; 05 Jul 2013 at 07:22.
Reply With Quote
  #3  
Old 05 Jul 2013, 15:52
Revenga Revenga is offline
 
Join Date: Mar 2012
Only problem is when someone quotes the post, they can see what's inside the restricted part.

- Revenga

Last edited by Revenga; 05 Jul 2013 at 16:00.
Reply With Quote
  #4  
Old 05 Jul 2013, 16:04
nerbert nerbert is offline
 
Join Date: May 2008
You mean they can see it in the reply editor or it shows up in the finished post? Or both?

I'll try to figure this out. Will get back later
Reply With Quote
  #5  
Old 05 Jul 2013, 16:27
Revenga Revenga is offline
 
Join Date: Mar 2012
They can see it in the reply editor. Also when you go to advanced reply and scroll toward the bottom where it has some of the previous posts, it shows up for them there too. That's all I noticed atm.

- Revenga
Reply With Quote
  #6  
Old 05 Jul 2013, 21:11
nerbert nerbert is offline
 
Join Date: May 2008
I'm not finished yet, I still have to work on quick editing but for now I think I have this fixed for new replies .

make a new plugin for newreply_form_complete with this code;


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

See if the restricted text is completely cut out for regular members. I'll get back later with more for quick editing.
Reply With Quote
  #7  
Old 05 Jul 2013, 21:44
Revenga Revenga is offline
 
Join Date: Mar 2012
Nope, still the same problem: the [restricted] tags are still showing up for regular members in the reply editor and where it shows the previous posts on the newreply.php page.

- Revenga
Reply With Quote
  #8  
Old 05 Jul 2013, 21:53
nerbert nerbert is offline
 
Join Date: May 2008
I'll transfer this project over to my dev site and see what I can do. I'm working in vB 4.2.0, I doubt there would be any major differences in any vB 3 version.

--------------- Added 05 Jul 2013 at 23:05 ---------------

When I moved the plugins over to my dev site I mistakenly put the last plugin in newthread_form_complete instead of newreply_form _complete. Is it possible you did the same?

And another correction: Move the plugin for showthread to showthread_complete.

Last edited by nerbert; 05 Jul 2013 at 23:17.
Reply With Quote
  #9  
Old 06 Jul 2013, 00:47
Revenga Revenga is offline
 
Join Date: Mar 2012
Nope, everything looks correct. Same issues exist.

- Revenga
Reply With Quote
  #10  
Old 06 Jul 2013, 02:56
nerbert nerbert is offline
 
Join Date: May 2008
OK, I found one error in the last plugin. The preview and reviewed posts were working right but the editor text wasn't. Here's the corrected code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #11  
Old 06 Jul 2013, 03:46
Revenga Revenga is offline
 
Join Date: Mar 2012
Thanks for fixing that. I did find another little part though: When you click on a user's profile and find all posts made by that user, you can see what's in the [restricted] tags. Also when you go to Today's Posts and hover over the thread title, you can see what's in the [restricted] tags as well when that little bubble pops up. How do I fix this?

I'll look around some more to see if there's anything else I might be missing too, but if you could help me with that little bit too that would be very helpful.

Thank you for all you've done already.

- Revenga
Reply With Quote
  #12  
Old 06 Jul 2013, 03:56
nerbert nerbert is offline
 
Join Date: May 2008
Well, I don't think I have even this much working. I had tested it just before I posted that corrected plugin but apparently I had accidentally double clicked the reply button and had gone to the advanced page. It works for the advanced page but not for the quick reply that's put into the thread list under the post. So it's leaking out there. There's just no way to intercept the AJAX to fix that and if it leaks out once the whole purpose is defeated. This just doesn't seem to work at all. I'll tinker around a little and if I can find a better way of doing this I'll PM you. Thanks for helping test this.
Reply With Quote
  #13  
Old 06 Jul 2013, 04:06
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
There's a Mod that does what you're asking for, I've seen it.
Reply With Quote
  #14  
Old 06 Jul 2013, 04:12
nerbert nerbert is offline
 
Join Date: May 2008
Originally Posted by Max Taxable View Post
There's a Mod that does what you're asking for, I've seen it.
I've been looking around for anything to do with conditionals in bbcodes and I found a thread where someone pointed out that posts are parsed and then cached. So everyone will see the last cached version. If it happens the last edit was by an admin the cached version is what admins see. This sounds impossible, but if you can find that mod I would be interested in looking it over.
Reply With Quote
  #15  
Old 06 Jul 2013, 04:23
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Originally Posted by nerbert View Post
I've been looking around for anything to do with conditionals in bbcodes and I found a thread where someone pointed out that posts are parsed and then cached. So everyone will see the last cached version. If it happens the last edit was by an admin the cached version is what admins see. This sounds impossible, but if you can find that mod I would be interested in looking it over.
There IS a mod that allows staff comments on posts in threads, it works similar to the "thanks" system, they are messages under posts like the "thanks" bit. These are not quotable and visible only to those permissioned to view.

I have been looking for it, I KNOW it is there, if I find it I will post a link.

BUT, this also gives the coders here some idea of the real, actual way to do this.

EDIT: Granted this is not a BB code, but why do you need one to accomplish the task? Seems like a gross overcomplication of a simple deal.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make invisible users visible to Super Moderators and Moderators. SWFans.net vBulletin 2.x Full Releases 76 04 Aug 2004 02:22



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:46.

Layout Options | Width: Wide Color: