Advertisement:

Author Topic: Tabs In Posts  (Read 1737 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Tabs In Posts
« on: June 02, 2018, 07:17:58 PM »
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.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 2,030
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Tabs In Posts
« Reply #1 on: June 02, 2018, 09:52:06 PM »
Oh, it seems very good, then what it is, to see how, Very good :D


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


Ayudame via PayPal

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
"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?"..."

Offline Sh@mbles

  • SMF Hero
  • ******
  • Posts: 4,965
  • Gender: Male
    • i30 Owners Club
Re: Tabs In Posts
« Reply #3 on: June 03, 2018, 11:35:21 AM »
Seems to work well in 2.0.15

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



Code: [Select]
<?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:

Code: [Select]
[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]

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Tabs In Posts
« Reply #4 on: June 03, 2018, 12:02:10 PM »
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!

Offline Sh@mbles

  • SMF Hero
  • ******
  • Posts: 4,965
  • Gender: Male
    • i30 Owners Club
Re: Tabs In Posts
« Reply #5 on: June 03, 2018, 05:40:12 PM »
Good one Herr Dougie.

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,314
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Tabs In Posts
« Reply #6 on: June 03, 2018, 07:58:05 PM »
Thanks for this mod, it's awesome
¡¡NEW MOD: Sparkles User Names!!!

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 322
    • @pocttopus on Twitter
Re: Tabs In Posts
« Reply #7 on: October 13, 2018, 03:52:20 PM »
This is awesome mod but how can I add bbcode for tabs?  ??? :)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Tabs In Posts
« Reply #8 on: October 14, 2018, 11:54:28 PM »
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.


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:
Code: [Select]
[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:
Code: [Select]
[tabarea]
[taburl=My first tab]http://whereever.you.want/to/go[/taburl]
[/tabarea]

I hope this helps in understanding how this mod works.

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 322
    • @pocttopus on Twitter
Re: Tabs In Posts
« Reply #9 on: October 15, 2018, 07:38:02 AM »
@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!

Offline Yorel

  • Semi-Newbie
  • *
  • Posts: 77
Re: Tabs In Posts
« Reply #10 on: October 15, 2018, 10:07:41 AM »
Hi

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

Thanks

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Tabs In Posts
« Reply #11 on: October 15, 2018, 10:32:30 AM »
@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.
« Last Edit: October 15, 2018, 10:42:56 AM by dougiefresh »

Offline pocttopus

  • Jr. Member
  • **
  • Posts: 322
    • @pocttopus on Twitter
Re: Tabs In Posts
« Reply #12 on: October 16, 2018, 10:35:07 AM »
@pocttopus:  Oh, I didn't think of that.  I'll implement it in a little while....
Thanks!  ;) :)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: Tabs In Posts
« Reply #13 on: October 23, 2018, 01:04:00 PM »
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....