vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Advanced [YOU] BB Code (with options) by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=254373)

BirdOPrey5 11-27-2010 10:00 PM

Advanced [YOU] BB Code (with options) by BOP5
 
1 Attachment(s)


Just in time for April Fools Day!

Update - 11/28/2010 - Updated to 0.91 - Added 1 plugin for Breadcrumbs
Update - 12/7/2010 - Updated to 0.92 - Added 2 plugins to work in Polls (Questions and Options)
Update - 3/25/2012 - Updated to 0.97 - Completely re-coded, Now works virtually everywhere in a VB4 forum and suite (blogs, CMS, groups, etc...) - No longer compatible with VB 3.x.
Update - 3/26/2012 - Fixed a couple of bugs relating to blogs and thread titles.
Update - 4/28/2012 - FIxed bug for user title's in profiles
Update - 4/29/2012 - FIxed usertitle's on member's list

[B]Live Demo: (Retired)

An all new version of my "Advanced [YOU] BBCode" mod, now completely compatible with the blogs, cms, and all other parts of the forum.

This mod creates the [YOU] BB-like-code. When someone types [YOU] in a post or thread or virtually anywhere else on the forum (if enabled) it gets changed to the username of the user currently viewing the page.


The mod allows you to specify a replacement to use for guests and users not logged in. The default is simply "you."

There are setting to allow the admin to enable and disable in the following areas:
  • Specific Forums (or all forums)
  • PMs
  • Visitor Messages
  • (Social) Groups
  • Picture Comments
  • Blogs
  • CMS
  • Widgets
  • Sidebar
  • Breadcrumbs
  • Signatures (when viewed in posts or PMs)
  • User Titles (when viewed in the postbit)

You can also specify "Immune" usergroups who will always see [you] so as not to get confused, if you wish..

If you need the older version for some reason it is still available as the VB 3.8 mod:
https://vborg.vbsupport.ru/showthread.php?t=254371

Please Mark as Installed if you use this. :)
Donations Always Appreciated. :up:

Juggernaut 11-28-2010 07:10 PM

I love it. rated 5 stars :D

TrigZu 11-28-2010 07:26 PM

I'd like to see an option so [you] only works in X threads.

TrigZu 11-28-2010 07:31 PM

Also, maybe an option so only X usergroups/boards have it turned on, so instead of eliminating all the other boards/groups you can just grant permissions to one board. Anyways, <3 it.

BirdOPrey5 11-28-2010 07:48 PM

Quote:

Originally Posted by TrigZu (Post 2126836)
I'd like to see an option so [you] only works in X threads.

Quote:

Originally Posted by TrigZu (Post 2126837)
Also, maybe an option so only X usergroups/boards have it turned on, so instead of eliminating all the other boards/groups you can just grant permissions to one board. Anyways, <3 it.

I was back and forth on the issue of whether admins should specify the forums/usergroups to BLOCK or the forum/usergroups to ALLOW.

Ultimately I went with "Block" rather than "Allow" because on my own forum I have it enabled everywhere and for everyone.

It's a fairly simple edit to make in the plugins if you're so interested in changing the action from "Block" to allow...

If you go to your "Plugin Manager" in Admin CP... scroll down to the Advanced [YOU] BB Code plugins and edit EACH plugin...

At the top of each plugin is an IF statement:

PHP Code:

if ($vbulletin->options['adyoubop5_en'] == AND !in_array($post[usergroupid], explode(','$vbulletin->options['adyoubop5_users'] )) AND !in_array($thread['forumid'], explode(','$vbulletin->options['adyoubop5_forums'] )) ) 

If you remove the two exclamation points (!) (one before each "in_array") you will convert the settings from BLOCKED usergroups/forums to ALLOWED usergroups/forums.

I will investigate an option for applying this to just a single thread... Though limiting it to 1 forum like above should help.

TrigZu 11-28-2010 07:56 PM

It has helped indeed. I'm going to go ahead and change that code now.

Perhaps rather than deciding whether or not to block or allow you could use both where blocks supersede allows. By doing so it might make the options menu slightly more confusing, but infinitely more versatile. Thanks for the reply. :D

Also:
https://vborg.vbsupport.ru/external/2010/11/5.png

Brandon Sheley 11-28-2010 08:20 PM

this is nice, the old bbcode still works for us
I like the replacement for guest option "your mom"..lol

nice mod :) https://vborg.vbsupport.ru/external/2012/01/12.gif

BirdOPrey5 11-28-2010 08:29 PM

Quote:

Originally Posted by TrigZu (Post 2126846)
It has helped indeed. I'm going to go ahead and change that code now.

Perhaps rather than deciding whether or not to block or allow you could use both where blocks supersede allows. By doing so it might make the options menu slightly more confusing, but infinitely more versatile. Thanks for the reply. :D

Also:
http://content.screencast.com/users/...11-28_1703.png

I saw the link in your post on the table code, and I must say as a guest at least reading "You" instead of "Unregistered" made it make at least some sense. Lots of LOLs to be had with this... we have some lengthy and funny [you] threads too, I didn't link because they all require registration to view.

I will definitely work on the options, maybe let the admin choose whether they are allowing OR blocking by forum/usergroup. Also wondering if user's not allowed to use it should see "[YOU]" or perhaps some sort for error message when submitting a post instead so they can't even try.

@Loco.M - Thanks!

Gemma 11-28-2010 08:52 PM

Didn't work for me. Breadcrumbs and Thread title on Forum Display were showing [you] instead of my name, or Lurker which I had used as a [you] replacement for guests.

Disabled product for the time being

BirdOPrey5 11-28-2010 09:03 PM

Oh wow. Forgot about the breadcrumbs... I'll get right on that.

TrigZu 11-28-2010 09:12 PM

I think if they're not allowed to use it they should still see their username.

1
Make an option to not use the tag by user & usergroup & board & thread.
Then make an option to not see the tag by user & usergroup & board & thread.

THEN

2
use the tag by user & usergroup & board & thread.
and see the tag by user & usergroup & board & thread.

As I said before 1 supersedes 2.

sulasno 11-28-2010 09:40 PM

tagged and thanks

what's the difference with this mod ?
https://vborg.vbsupport.ru/showthread.php?t=235832

TrigZu 11-28-2010 09:51 PM

The advanced features make it much more powerful.

It's "Advanced" - There are settings in vBulletin options to enable, disable, block, and make users immune to this code.

BirdOPrey5 11-28-2010 09:54 PM

Quote:

Originally Posted by sulasno (Post 2126888)
tagged and thanks

what's the difference with this mod ?
https://vborg.vbsupport.ru/showthread.php?t=235832

That mod also does something funky with "/you" which this mod doesn't do anything with.

But more importantly that mod has no options or settings- everyone can use it in every forum... On mine you can limit who uses it, on what forums ir can be used, specify people immune to it, and specify a name/word to be shown to guests who aren't logged in.

Also I'm not sure if that mod works in User Titles or not, this one does.

One more difference- my mod doesn't work with the archive mostly because I don't think anyone cares about or uses the archive... if it's a big deal I can add it to the next version though.

BirdOPrey5 11-28-2010 09:57 PM

Quote:

Originally Posted by Gemma (Post 2126874)
Didn't work for me. Breadcrumbs and Thread title on Forum Display were showing [you] instead of my name, or Lurker which I had used as a [you] replacement for guests.

Disabled product for the time being

OK I got breadcrumbs working and will be uploading a new version shortly... the breadcrumbs are only an issue in showthread though. I don't understand what the issue is on forumdisplay- can you be more specific- usually you wouldn't see the thread title in the breadcrumbs while in forumdisplay... :confused:

Gemma 11-28-2010 10:10 PM

Hey [you] how has your day been?

Doesn't show the original posters name, doesn't show gemma, doesn't show Lurker etc - it shows [you]

BirdOPrey5 11-28-2010 10:27 PM

1 Attachment(s)
I don't know, it works for me and a couple of other sites I've tested on...

Screen Shot Attached... Is that some sort of mod separating your normal threads from your stickies? That could be a problem. Also your "latest threads" box on top I've never seen before either so I wouldn't expect this to work without some custom edits.

How many mods do you have installed? Would it be practical to give me a full list?

Dr.osamA 11-29-2010 02:05 AM

1 Attachment(s)
working in vb 4.1.0 too

thank you

installed + 5Stars + translated to Arabic

plzz add it to orignal post

BirdOPrey5 11-29-2010 02:16 AM

Quote:

Originally Posted by Dr.osamA (Post 2126979)
working in vb 4.1.0 too

thank you

installed + 5Stars + translated to Arabic

plzz add it to orignal post

Thank You! Added to first post. :up:

Dr.osamA 11-29-2010 02:53 AM

thank you bro

you are very nice

BirdOPrey5 12-07-2010 03:51 PM

Update to 0.92 - now you can use [you] in polls - both questions and as options.

COL NIL SATIS 12-07-2010 04:22 PM

tagged

Dr.osamA 12-08-2010 10:33 AM

1 Attachment(s)
thank you for update bro

plzz reupload the translated XML file agen

thank you man

BirdOPrey5 12-08-2010 12:22 PM

Quote:

Originally Posted by Dr.osamA (Post 2130803)
thank you for update bro

plzz reupload the translated XML file agen

thank you man

Updated. :up: Thanks.

fastcom 02-03-2011 02:42 PM

1 Attachment(s)
it work great, thank you. But it do not display in sidebar. I think, I muss add more plugin for mod but I do not know choose Hook Location.
please let me know how can do that.

BirdOPrey5 02-03-2011 03:09 PM

Quote:

Originally Posted by fastcom (Post 2158262)
it work great, thank you. But it do not display in sidebar. I think, I muss add more plugin for mod but I do not know choose Hook Location.
please let me know how can do that.

I don't have 4.x suite so I can't program any add-ons for the sidebars, articles, or any suite only features.

fastcom 02-05-2011 02:24 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2158269)
I don't have 4.x suite so I can't program any add-ons for the sidebars, articles, or any suite only features.

Thank for you reply. This product so great but if abuse then will bored and i want just some member can use other member can not use if do not have permission.
How can i do that?
thanks you:up:

BirdOPrey5 02-05-2011 10:28 AM

Quote:

Originally Posted by fastcom (Post 2158933)
Thank for you reply. This product so great but if abuse then will bored and i want just some member can use other member can not use if do not have permission.
How can i do that?
thanks you:up:

In the settings you can block certain usergroups from using it...

https://vborg.vbsupport.ru/attachmen...5&d=1290977671

So maybe you want to block your registered users (usergroup 2) but allow your mods and admins to use it, or f you have a "VIP" type usergroup you can let them use it too.

Alan_SP 04-01-2011 11:41 PM

One other limitation I just found out:

If you have user who has more than one usergroup, and one usergroup is immune, but other isn't, this doesn't make user immune to you tag. Is it possible to enable immunity if user has at least one immune usergroup?

Alan_SP 04-02-2011 12:20 AM

I looked in the code, I tried to use this two codes:

PHP Code:

$youname $vbulletin->userinfo['username'];
   if (
$yougroup == 1)
     {
      
$youname $vbulletin->options['adyoubop5_you'];
     }
   elseif (
in_array($yougroupexplode(','$vbulletin->options['adyoubop5_im'])))
     {
      
$youname "[YOU]";
     } 

And this:

PHP Code:

 $youname $vbulletin->userinfo['username'];
   if (
$yougroup == 1)
     {
      
$youname $vbulletin->options['adyoubop5_you'];
     }
   if (
in_array($yougroupexplode(','$vbulletin->options['adyoubop5_im'])))
     {
      
$youname "[YOU]";
     } 

But it didn't worked out. Why? Any idea?

And there's second limitation. Again with multiple usergroups. If user belongs to at least one prohibited group, he couldn't use you code. :(

BirdOPrey5 04-02-2011 02:09 AM

Quote:

Originally Posted by Alan_SP (Post 2179937)
One other limitation I just found out:

If you have user who has more than one usergroup, and one usergroup is immune, but other isn't, this doesn't make user immune to you tag. Is it possible to enable immunity if user has at least one immune usergroup?

That's not how it's programmed. It only recognizes the primary usergroup. Are you sure the account you are testing it with isn't in the "immune" usergroups? They'll always see the "[you]" code, not their username.

I just tested this on my test forum, an admin (usegroup 6) had a secondary usergroup (9) made active... In the mod options usergroup 9 was blocked from using the code. Posts made by the admin still showed the username as I expected they would.

Alan_SP 04-02-2011 03:35 AM

You are right. I set myself on my forum as (primary usergroup) registered user, and secondary as admin. I wanted to look to outsiders as regular user. Now I reversed that and when my primary usergroup is admin, I can see and write you code with no problem. Thank you, just my messed up setup of myself. :)

Everything's fine. Sorry.

BirdOPrey5 04-02-2011 01:15 PM

Not a problem. Enjoy. :up:

Boofo 04-05-2011 06:59 AM

Quote:

Also when previewing your signature in your User CP you will see the [YOU] code in the signature, however it WILL work correctly in posts with the signature attached.
This can be fixed by adding another plugin in the profile_editsignature_start hook with the following:

Code:

$previewmessage = str_ireplace("[you]", $vbulletin->userinfo[username], $previewmessage);

BirdOPrey5 04-06-2011 02:31 PM

Thanks Boofo. :up:

hugh_ 04-16-2011 05:55 AM

Is there a way of making this work with the widgets in the CMS?

BirdOPrey5 04-16-2011 10:01 PM

Probably with custom programming but since I don't have the 4.0 suite I can't help you.

hugh_ 04-16-2011 10:19 PM

Thanks for replying BoP. Anyone else want to have a go at making this work in the CMS?

BirdOPrey5 04-16-2011 11:28 PM

No problem- just a reminder I marked this as "re-usable" so I would welcome anyone who wants to pick up where I left off and keep developing this mod. :)

angeljs 05-14-2011 03:06 PM

I love little personal touches like this for my members...thank you! :)


All times are GMT. The time now is 10:32 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.01491 seconds
  • Memory Usage 1,847KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete