inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 7, 2014 11:11:00 GMT -8
Condition X v1.0.1
| RELEASE CLONEABLE
|
Author: Virgil Sovereign Master Plugin: Condition X v1.0.1 Release - Downloadable from the Plugin LibraryStock Clones: Permissions: Editable Keys Used: None Dependencies: None Description: | Conditionally inserts CSS, Javascript, and HTML content into a page. The plugin allows admins to present content to specific groups of people, in specific venues, at specific times, without the need for template modifications or plugin editing.
Potential uses for the plugin include:
- presenting content to guests, groups, members, groups with exclusions, or arbitrary mixtures of the aforementioned
- adding special tools or disclaimers to profile pages, calendars, search pages, conversations, threads, editing pages, etc., etc.
- adding "messages of the day", "picture of the week", etc. to specific boards
- pre-scheduling special messages (e.g. birthdays, leave of absence notifications, etc.) to appear at specified times/dates
- adding banners or special formatting to specific threads (with or without affecting their reply, edit, or quote pages)
- presenting special content to junior members (member who haven't yet posted by a certain amount), members in different timezones, users with specific browsers, etc.
- hiding "Easter eggs" in specific threads
Customizable settings in the plugin UI are:
- header HTML, footer HTML, CSS, and Javascript content to insert
- choices for including and excluding: guests, groups, individual members
- choices for including and excluding 14 categories of pages
- choices for including and excluding specific categories, boards, and threads
- choices for displaying content on: specific weekdays, specific calendar days, start dates, end dates, and date ranges
- support for timezones
- evaluation of any custom conditions using Javascript (for advanced users)
- conditional execution of custom code (for advanced users)
- as of v1.0.1, the ability to select alternate insertion points for HTML content
- as of v1.0.1, support for special HTML tokens and date-specific content
Like all other plugins, Cond X can also be configured to run only for specific themes and/or for members of sufficient rank.
As of v1.0.1, Cond X can insert HTML content into any selectable element or group of elements rather than just headers and footers.
Cond X is cloneable in the sense that the library edition of the plugin can run alongside any or all of the "stock clone" plugins downloadable at the top of this thread. The stock clone plugins are identical to the master plugin but each retains its own settings. In this way, admins can insert multiple groups of content under multiple sets of conditions.
Presently only three clones exist (Alpha, Beta, and Charlie), hence a board may have up to four independent groups of conditional content. Additional clones will be added if the need ever arises. The plugin UI also includes optional instructions for changing the display name of Cond X (and its clones) to reflect the specific purpose of each instance.
Cond X is not an ideal plugin in all situations. Admins should consider the alternatives:
- modifying templates, if the content is reasonably permanent and either:
- the condition is related exclusively to themes
- you're comfortable working with Proboards $[] variables/conditionals in the template editor
- building your own simple plugin, if the condition is related exclusively to any combination of:
- themes
- member-only and staff-only content
- specific boards/categories
- minimum member ranks
the Global Messages plugin by Peter , if the purpose of the plugin is to display bold messages to specific groups of people the HTML Injections plugin by Wormopolis , if:
- the content is reasonably permanent
- you're comfortable with editing templates
the Bible Verse plugin by Mike, if the purpose of the plugin is daily or weekly scripture the Of the Month plugin by Robin, if the content is global and cycles on a monthly basis
|
Time-Specific Content: | In addition to inserting content at a common set of times (see Fig. 4), Cond X v1.0.1+ supports inserting date-specific HTML content by wrapping it in <on date="..."></on> tags. Content inside a tag will only be inserted if the current date satisfies the condition in the tag. In this way, the plugin can be configured to present different contents at different times.
The full list of valid date parameters is provided in the plugin UI.
Some examples of date-specific HTML are:
<on date="Jan 1"> <div class="explosion">Happy New Year!</div> </on>
<on date="sat,sun">Hi, <me/>! Come on over to the weekend shack!</on>
Today's animal is a <on date="day 1 of 2">goose</on><on date="day 2 of 2">gander</on>.
<on date="Nov 13, 6:00 PM to Nov 13, 9:30 PM"> <b>Election countdown madness!</b> <iframe src="http://countdown.wow/counter"></iframe> </on> |
HTML Tokens: | Cond X automatically translates special HTML tags and tokens into useful values that can help to personalize content. Tokens can be entered in tag format, such as <me/>, or in parameter format, such as %me%, which is useful for parameters in tag attributes.
The full list of supported tokens is provided in the plugin UI.
Some examples of HTML tokens are:
"<threadsubject/>" has been flagged as a sensitive topic. Please familiarize yourself with the forum CoC before participating.
<me/>, you have <myposts/> posts, enough to redeem them at the prize center in your <a href="/user/%myid%/">member profile</a>!
Current time: <b><thetime/></b>
Please be sure to enter your own name as <b>@<myusername/></b> when posting attack rolls in the game.
|
Advanced Users: | Cond X can evaluate any number of additional (custom) Javascript expressions as part of the insertion condition. The conditions are evaluated in order, in the global frame, immediately after all of the stock conditions specified in the 'Who', 'Where', and 'When' tabs have been evaluated and satisfied. If any condition returns a false-equivalent value, none of the subsequent conditions are evaluated. The content is inserted only if all conditions evaluate true-equivalent.
Numerous examples of custom conditions are provided in the plugin UI. Admins that have highly specialized conditions not already covered by the plugin can make requests for "code snippets" in this thread that can be pasted into the plugin settings to realize these conditions. No plugin modification or reinstallation necessary.
|
Screenshots:Fig. 1 - The WHAT tab of the plugin UI is shown. The UI is extensively documented. Fig. 2 - The WHO tab of the plugin UI is shown. Fig. 3 - The WHERE tab of the plugin UI is shown. Fig. 4 - The WHEN tab of the plugin UI is shown. Other Issues: | The Proboards plugin manager provides a range of options for conditionally targeting plugins to specific groups, themes, and venues. These conditions are evaluated at the server level and avoid sending content across the internet to users who will never see it, hence they're generally preferable to client-side plugins like Cond X.
I suspect the plugin manager may eventually reach a level of sophistication that renders Cond X totally obsolete. Until that glorious day, we'll have to make due.
|
Bugs and Feedback: | Please notify me of any plugin issues in this thread and I will do my best to resolve them promptly.
I may also consider certain feature requests if they are reasonable and won't bulk up the code too much.
Aside from that, happy X! |
Update to v1.0.1 | - Added support for alternate insertion point. - Added support for time-specific HTML content. - Added support for HTML tokens. - Minor bug fixes. |
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 8, 2014 9:40:46 GMT -8
Updated to v1.0.1.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 9, 2014 9:33:08 GMT -8
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Aug 9, 2014 9:40:36 GMT -8
The best plugins are ones that can serve the purpose of 10,000 other ones!
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 26, 2014 18:33:08 GMT -8
I can't even begin to fathom what this does. In simple terms, it lets you show whatever content you want to whoever you want, whenever you want, wherever you want. So if you want to add a sound effect and a little gremlin button to your board's menubar for all members in the "Premium Members" and "Super-Premium Members" groups (except for "suzie001", who hates gremlins), on Mondays and Wednesdays starting September 8th, when visiting the Search Page, the Calendar Page, or any non-Reply page in every thread (except the "Mourning Our Soldiers" thread, where gremlins wouldn't be appropriate, and "Suzie's Happy Thread" because... well, you know) on the "General Discussion" board and all boards in the "Fun and Games Category", but only for members using light-coloured themes and whose browser windows are at least 1000 pixels wide (because otherwise the gremlin would be an imposition)... then this plugin will do that for you.
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 29, 2014 4:30:26 GMT -8
Is it of any use for putting code in several theme profile templates at once? You can, but it's overkill unless the content you want to insert is conditional in some way. If the content is relatively static, you should try a plugin called "HTML Injections" by Wormopolis.
|
|
inherit
212350
0
May 17, 2018 6:57:55 GMT -8
Bladehawk
35
August 2014
bladehawk
|
Post by Bladehawk on Aug 30, 2014 16:33:08 GMT -8
Wee. I'm wondering if I could use this to insert a sortable HTML table into a specific post. I've got a very basic test table and the Javascript to make it sortable, so I just need to put it in a specific post.
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 30, 2014 18:48:47 GMT -8
Bladehawk: You can use the plugin to insert content into specific threads easily enough. You can get it to insert content into specific posts too (in a somewhat off-beat way) as follows: - Include the code
[font face="Sorted Table"][/font] in your post in the location where you want the table to appear.
- In the Cond X plugin, for the "Alternate Insertion Point" field in the "What" tab, insert the code
font[face="Sorted Table"]
- Place the HTML code for the table in the "Header" field in the "What" tab.
- Place the code
$(function() { ... table formatting code here .... }); into the "Javascript" field in the "What" tab.
The plugin will then automatically convert your placeholder tag into the necessary table, and format it. Obviously you can use an identifier other than Sorted Table if you want, too. Just make sure it's unique and consistent.
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 30, 2014 18:52:38 GMT -8
The HTML Injections apparently doesn't work for putting a code for likes in profile template. Ah. If you give me an idea of specifically what you're trying to do, maybe I can help. Are you trying to put the total number of likes a poster has somewhere on their profile page?
|
|
inherit
212350
0
May 17, 2018 6:57:55 GMT -8
Bladehawk
35
August 2014
bladehawk
|
Post by Bladehawk on Aug 30, 2014 19:06:00 GMT -8
Excellent, Virgil! Thank you so much.
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Aug 31, 2014 7:35:47 GMT -8
TinMachine: Ah. No. Proboards doesn't make "likes" data available to scripts. For profile pages, no script variables are defined regarding the account being viewed, hence scripts are limited to scrounging information off what is already displayed on the page. A plugin can't help you here. You'll have to bite the bullet and make the template modifications. One thing Cond X would be useful for is if you want the ability to easily turn "Likes" in profiles on or off, or have it only display for certain users, etc. But setting these up would require template modification.
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Dec 28, 2016 9:14:05 GMT -8
Oh my gosh, how have I never given this a thorough look-through? Possibly the coolest, most useful plugin I've ever seen. Holy crap, so many possibilities, this is just endless and I'm equally overwhelmed and ecstatic at once! I can't wait to get started on figuring out the ways I want to utilize this. Thank you so much for making this <3
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Dec 20, 2017 1:12:54 GMT -8
Virgil SovereignI am looking to add something to the posting page that certain membergroups see, which if they check the box or select something from a dropdown (either option would work) then it generates something specific on that post. If an example helps, the chekbox will say "did you apply an item to this post?" and they can select yes/no from a dropdown or just click a checkbox, whatever, and if they did apply an item to the post then it'll put an image at the top corner of it. I can't tell if this plugin is capable of that or not because this kinda coding goes completely over my head. I'd love your thoughts since you obviously know this plugin best hahah
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Dec 23, 2017 6:26:06 GMT -8
Virgil Sovereign I am looking to add something to the posting page that certain membergroups see, which if they check the box or select something from a dropdown (either option would work) then it generates something specific on that post. If an example helps, the chekbox will say "did you apply an item to this post?" and they can select yes/no from a dropdown or just click a checkbox, whatever, and if they did apply an item to the post then it'll put an image at the top corner of it. I can't tell if this plugin is capable of that or not because this kinda coding goes completely over my head. I'd love your thoughts since you obviously know this plugin best hahah This plugin will take care of the conditional aspects of the construction, but you'd still need to put in the markup and event handlers on your own. Frankly, it would be easier to do as a standalone plugin. The v6 alpha just came out and it appears to radically redesign the editor. I recommend you wait a month or two for the official v6 launch, after which you should put in a specific plugin request. It won't need to be redesigned in two months that way.
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Apr 16, 2018 7:19:49 GMT -8
Virgil Sovereign, is there a way to set up different conditional content that has different who/where conditions? Meaning if I set up content in the "What" tab can I make separate conditions in the "Who" page for membergroups, such as Content A shows up for Membergroup A and Content B shows up for Membergroup B, or is it that whatever content I enter is going to be globally set as Membergroup A can see it and I can't split them? Let me know if that makes 0 sense lol
|
|