Author Topic: Visible, Invisible and NoQuote Tags v3.2  (Read 1707 times)

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 245
Visible, Invisible and NoQuote Tags v3.2
« on: May 16, 2015, 11:23:28 AM »

VISIBLE, INVISIBLE AND NOQUOTE TAGS v3.2
By Dougiefresh -> Link to Mod


Introduction
This modification adds bbcodes that will make content visible or invisible based on criteria in the parameters of the bbcode, and a bbcode to prevent someone from easily quoting text within a post.

The new visible and invisible BBCodes take any of the following parameters:
Code: [Select]
[b]u={user ID}[,{user_ID}....][/b] => User ID(s) seperated by commas
[b]g={group ID}[,{group_ID}....][/b] => Membegroup ID(s) seperated by commas
[b]min_posts={number of posts}[/b] => Filter by minimum number of posts; valid: positive integer value
[b]max_posts={number of posts}[/b] => Filter by maximum number of posts; valid: positive integer value
[b]guests={answer}[/b] => Filters by guest status; valid: [b]1[/b], [b]0[/b], [b]true[/b], [b]false[/b], [b]y[/b], [b]yes[/b], [b]n[/b], or [b]no[/b].
[b]members={answer}[/b] => Filters by member status; valid: [b]1[/b], [b]0[/b], [b]true[/b], [b]false[/b], [b]y[/b], [b]yes[/b], [b]n[/b], or [b]no[/b].
[b]banned={answer}[/b] => Filters by ban status; valid: [b]1[/b], [b]0[/b], [b]true[/b], [b]false[/b], [b]y[/b], [b]yes[/b], [b]n[/b], or [b]no[/b].
[b]karma={minimum karma required}[/b] = Filters by amount of karma received; valid: integer value.
[b]replied={topic ID}[/b] = Filter by whether member has replied to given topic or current topic if value is 0; valid: topic ID or 0.
[b]warning={warning level}[/b] = Filter by whether member has maximum warning level; valid: integer value.

These parameters are also accepted, but the data supplied must be QUOTED and is treated as a partial regex search value.  For example, username="Doug" would match dougiefresh, freshdoug, weird_doug and doug...
Code: [Select]
[b]username={username}[,{username}...][/b] => Username(s) seperated by commas
[b]user={display name}[,{display name}...][/b] => Display name(s) seperated by commas
[b]group={membergroup}[,{membergroup}...][/b] => Membergroup name(s) seperated by commas
[b]lang={language}[,{language}...][/b] => Language(s) seperated by commas

For example, if you wanted to make the portion invisible to user # 1 and membergroup ID # 2, you would use this:
Code: [Select]
[invisible u=1 g=2]Whatever goes here[/invisible]If you wanted to make it invisible to just guests, you would use this:
Code: [Select]
[invisible guests=y]Whatever goes here[/invisible]Likewise, making things visible to only certain groups or people is equally easy.  Just replace invisible with visible!

In order to keep people from easily quoting part (or all) of your post, just surround the unquotable part like this:
Code: [Select]
[noquote]Whatever goes here[/noquote]
VERSION 2.1 adds the [else] bbcode for the [visible] and [invisible] tags.  When present and the conditions are false, the part after [else] will be displayed instead of nothing.

To-Do List
o [DONE] Add support for custom fields.... (?)
o Add support for search values as whole strings instead of partial strings.... :p

Admin Settings
There is a whole new admin area with three parts: Admin => Configuration => VIVNQ Settings!  The first part is the Shortcuts UI, where you can modify existing shortcuts.

The second area is the Create New Tags, where you can create new shortcuts for use within the forum.

The third area is the permission page, where you can set all the permissions of the mod easily in one spot (as opposed to going to the permissions area and setting it up per membergroup!)

There are 7 new permissions that one can assign the membergroups:
o Allow use of the "visible" tag"
o Quote the contents of "visible" tag
o Allow use of the "invisible" tag"
o Quote the contents of "invisible" tag
o Allow use of the "noquote" tag"
o Quote the contents of "noquote" tag
o Toggle filtering of "visible" & "invisible" tag

Other Notes
If you upgrade from v1.x of this mod to v2.0, this mod will not remove any "visible" or "invisible" tags that already exists within the messages table.  When a user doesn't have permission to use those tags, the tag is removed from the message before committing the message to the database.

Related Discussions
o Code to keep someone from quoting something in [noquote] tags....

Compatibility Notes
This mod was tested on SMF 2.0.10, but should work on SMF 2.1 Beta 3, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2015 - 2017, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: Jan 09, 2016, 10:27:27 AM by dougiefresh »

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 245
Re: Visible, Invisible and NoQuote Tags v2.0
« Reply #1 on: May 16, 2015, 11:24:18 AM »

Download Mod


FileName: Visible_Invisible_NoQuote_Tags_v3.2.zip
Size: 17 kb (17,356 bytes)
MD5: 17708de14e822ae036e37f0c9ff3882c
Built: Aug 31, 2017, 10:44:32 PM
Downloaded 4 times

Changelog

Uploaded v3.2 - August 31st, 2017
o Fixed invalid index error in Subs-VIVNQ.php.

Uploaded v3.1 - August 26th, 2017
o Fixed missing global variable in Subs-VIVNQ_Admin.php.

Uploaded v3.0 - August 19th, 2017
o Added admin area: Admin -> Configuration -> VIVNQ Settings.
o Fixed visible and invisible bbcode validation functions.

Uploaded v2.1 - August 10th, 2017
o Removed support for SMF 2.1 Beta 1 and 2.
o Added support for SMF 2.1 Beta 3.
o Moved language strings to their own language file.
o Added hook for 3rd parties to add their own parsing conditions.
o Added [else] bbcode for alternate text within visible/invisible tags.

Uploaded v2.0 - September 6th, 2015
o Added "warning" parameter, based on the warning level the user is at.
o Performance increase due to modification of parse_bbc function to deal with memory issue found.
o Added "visible" and "invisible" tags without parameters to the mix.
o Poster, Admin and Moderators can now quote messages without the visible/invisible tags being removed.
o Poster, Admin and Moderators now have a button on Post Display page to turn filtering on/off.
o Poster, Admin and Moderators can now see "visible to you" messages with green background with filtering on.
o Poster, Admin and Moderators can now see "invisible to you" messages with red background with filtering on.
o Permissions added to control who can use the "visible", "invisible" and "noquote" tags.
o Permissions added to control who can quote the "visible", "invisible" and "noquote" tags.
o Permission added to control who can see through the "visible" and "invisible" tag filters.
o Added permissions not available to Guest membergroup, mostly for security reasons....

Uploaded v1.0.1 - July 6th, 2015
o Added "karma" parameter, based on whether user has minimum amount of karma.
o Added "replied" parameter, based on whether user has replied to specified topic ID or current topic ID.

Uploaded v1.0 - May 16th, 2015
o Initial Release of the Mod

« Last Edit: Oct 29, 2016, 08:17:19 PM by dougiefresh »