Tabs In Posts

Started by dougiefresh, June 02, 2018, 07:17:58 PM

Previous topic - Next topic

dougiefresh

Link to Mod



TABS IN POSTS v1.2
By Dougiefresh -> Link to Mod



Introduction
Ever had too much information and wished you could put it in tabs to organize it?  Well, now you can with this mod using the tabarea and tab bbcodes like this:
Code (Example) Select
[tabarea]
[tab=Tab 1]This is a test![/tab]
[tab=Tab 2]This is a test as well![/tab]
[taburl=URL]http://www.xptsp.com[/taburl]
[/tabarea]

Note that anything between [tabarea] and [tab], between closing and opening [tab] tags, and between the last [tab] and the closing [tabarea] tag is discarded.  The example below:
Code (Excluded Example) Select
[tabarea]Excluded # 1
[tab=Tab 1]This is a test![/tab]Excluded # 2
[tab=Tab 2]This is a test as well![/tab]Excluded # 3
[taburl=URL]http://www.xptsp.com[/taburl]
[/tabarea]

is the same as the first code block shown.  You can also use the [taburl] bbcode to go to a different page/site by clicking that link.

Version 1.2 allows the user to use some smileys in the title, however, anything with brackets should be avoided.  BBcodes in general cannot be used as any part of the title, but this may be change in later versions....

Using the new [wholepost bbcode changes the format of the post so that the poster information is omitted from the message display.

There is no restriction of tab areas per post or topic, as each tab area is independent of the others.

Admin Settings
There are no admin settings for this mod.  To disable the bbcode, you may go to Admin => Forum => Posts and Topics => Bulletin Board Code and uncheck the tagarea and/or tag bbcodes.

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

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2018, 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.

-Rock Lee-

Oh, it seems very good, then what it is, to see how, Very good :D


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

GigaWatt

"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Shambles

Seems to work well in 2.0.15

Getting a couple of undefined indexes in Subs.php since installation:



<?php
// This has parsed content, and a csv value which is unparsed.
elseif ($tag['type'] == 'unparsed_commas')
{
$pos2 strpos($message']'$pos1);
if ($pos2 === false)
continue;

$data explode(','substr($message$pos1$pos2 $pos1));

if (isset($tag['validate']))
$tag['validate']($tag$data$disabled);

// Fix after, for disabled code mainly.
foreach ($data as $k => $d)
=>
$tag['after'] = strtr($tag['after'], array('$' . ($k 1) => trim($d)));

$open_tags[] = $tag;

// Replace them out, $1, $2, $3, $4, etc.
=> $code $tag['before'];
foreach ($data as $k => $d)
$code strtr($code, array('$' . ($k 1) => trim($d)));
$message substr($message0$pos) . "\n" $code "\n" substr($message$pos2 1);
$pos += strlen($code) - 2;
}
?>



The tab code in the post is as follows:


[tabarea]
[tab=Profile][img]https://i.imgur.com/uMAaO4z.jpg[/img][/tab]
[tab=On Display][img]https://i.imgur.com/QAKS0dj.jpg[/img][/tab]
[/tabarea]

dougiefresh

Uploaded v1.1 - June 3rd, 2018
o Added support for SMF 2.1 Beta 3.
o Fixed a couple of undefined indexes in Sources/Subs.php.




@Shambles:  Thank you for reporting these bugs!  Those bugs been fixed for this version!

Shambles


4Kstore

Thanks for this mod, it's awesome

¡¡NEW MOD: Sparkles User Names!!!

pocttopus

This is awesome mod but how can I add bbcode for tabs?  ??? :)

dougiefresh

Uploaded v1.2 - October 14th, 2018
o Added the ability to parse the title, allowing for bbcode in the title.
o Added tab URL parameter to specify default tab in post (inspired by GitHub).
o Added tab_x URL parameter to specify default tab in a specific tabbed area.
o Fixed taburl tag to properly show title instead of URL.
o Fixed unwanted extra line issue with [wholepost] tag.
o Updated documentation to point to new website.



Quote from: pocttopus on October 13, 2018, 03:52:20 PM
This is awesome mod but how can I add bbcode for tabs?  ??? :)
I assume you mean for the tab titles, right?  I'm going to assume the answer is yes for this question, and the answer for the assumed question is that I'm looking into the issue, cause I would like to know as well.  It should be possible.

Now, if you're asking about bbcodes inside the tab area that are NOT URL links, then you need to use the tab bbcode in order to create a tabbed area for the contents of that tab.  So, it should look like this:
[tabarea]
[tab=My first tab]Blah Blah Blah Blah[/tab]
[/tabarea]


If you are asking about URL links as a title for the tab, use the taburl bbcode.  It should look like this:
[tabarea]
[taburl=My first tab]http://whereever.you.want/to/go[/taburl]
[/tabarea]


I hope this helps in understanding how this mod works.

pocttopus

@dougiefresh
Thanks for your response and I apologize if my question was not so clear. :-[
I was wondering is there any way for bbcode button. When we select this button to generate tabArea template, just like other buttons for "Insert unordered list" or "Insert code".

I hope that I am more clear with understanding of my question.  :)
Thanks!

Yorel

Hi

Does someone could show us how it looks like with a screenshoot please?.

Thanks

dougiefresh

#11
@pocttopus:  Oh, I didn't think of that.  I'll implement it in a little while....

@Yorel: Here's a link to the Mod in Action.  I'll post some screenshots later.

pocttopus

Quote from: dougiefresh on October 15, 2018, 10:32:30 AM
@pocttopus:  Oh, I didn't think of that.  I'll implement it in a little while....
Thanks!  ;) :)

dougiefresh

I just figured out that printing a page with the tabbed area on it doesn't produce the expected results.  I will fix this when I add the bbcode button stuff to the mod....

pocttopus

Hello,

Suddenly the mod has stopped to work. Didn't change anything on my forum, yesterday everything was fine, today there is an issue.
Tabs are not working. Only first tab is displayed, others are not working.

Any suggest to solve this issue?
Thanks.

StarredSkies

Lovely modification! I've been looking for something like this for awhile. <3
I would love to use this with BBCode with Style to create some lovely templates and customize the tabs in the future. If you have any way to do this currently, please share! As for now, this is just a simple suggestion.

shadav

I'm really liking this idea
I tend to post more article type posts and this will be helpful and also i'm thinking about this for my rules post.....

am I correct though that I can not use other bbc inside of the tabs (not for the titles but the tabs themselves)?

bsmither

Not sure if it matters, but the contents in the install_YYx.xml files refer to Personal Word Censor.

Marina3

Hook Challenge: function «TIP_Settings» cannot be called.
Failed to call TIP_Settings.

Steve

What version of SMF are you trying to install this on?
DO NOT pm me for support!

Advertisement: