Advertisement:

Author Topic: Tabs In Posts  (Read 369 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Tabs In Posts
« on: June 02, 2018, 07:17:58 PM »
Link to Mod


TABS IN POSTS v1.1
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=Tab 3]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=Tab 3]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.

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 has been removed and can be seen at XPtsp.com.

License
Quote
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.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Rock Lee

  • SMF Hero
  • ******
  • Posts: 1,581
  • Gender: Male
  • Digitalizando un nuevo mundo :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!!!

Offline GigaWatt

  • Support Team Apprentice
  • Full Member
  • ***
  • Posts: 556
  • 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 Shambles

  • SMF Hero
  • ******
  • Posts: 4,773
  • 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,691
  • 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!
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,773
  • 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,312
  • 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!!!