TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 400
  • Total: 401
  • @rjen

Multi-TP Blocks

Started by akulion, December 17, 2006, 10:17:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

akulion

oh im sorry i noticed a small error

change tabcontentstyle in the code to tabcontentstyle2

Also can you give a link so I can see whats happening?

skiller

Fixed! Thanks a lot Aku. yes, the bug was with the tabcontentstyle which i changed as you asked. This made the text move on to the next line, instead of poking out into the forums area.

one hint though: when using this code, need to select "Do not use title/frame" in the code block, and this makes the extended frame disappear, so instead the background of that multiple-TP block matches with that of the forum. anyway to make the background match that of the regular TP block Aku? (just a side guess, but grateful for the fix!)

akulion

ur welcome, glad u got it working. Ill also try and refine the code a bit more later on so that it picks up images from the theme being used.

kran1um

Quote
echo'
<head>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />

<script type="text/javascript" src="tabcontent.js">

/***********************************************
* Tab Content script- Ã,© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
</head>

<ul id="maintab" class="shadetabs">
<li class="selected">
<a href="#" rel="tcontent1">User</li>
<li><a href="#" rel="tcontent2">Online</li>

</ul>

<div class="tabcontentstyle2">

<div id="tcontent1" class="tabcontent">';
TPortal_userbox();
echo'</div>

<div id="tcontent2" class="tabcontent">';
TPortal_statsbox();
echo'</div>

</div>

<script type="text/javascript">
//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.
initializetabcontent("maintab")
</script>';


Is what I used and the Tabs dont work for some reason, what did I do wrong?

skiller

did you paste the code in a phpbox? - any other and it wont work.

akulion

yup paste in a PHP box and be sure to place all the files provided in the 1st post in your forum root

Forum root is the base of the installation of SMF where you find all the folders for SMF like:
Themes
Sources
etc etc

kran1um

Awesome!! Can I do this with other things also, like shoutbox, themes??

akulion

yup u should be able to do it with all the Tiny Portal functions, here are:

TPortal_searchbox()
TPortal_themebox()
TPortal_shoutbox()

however getting multiple instances of the tabbed blocks working together is a bit tricky (explained in the install method 2)

kran1um

#18
Okay those worked but I wanted a block that I actually added, like a Teamspeak block, but dont know what the 'TP' name is ..


EDIT: Okay it actually works in FireFox, but in IE it dont.

akulion

It works fine in IE, Opera and FF for me on both my sites, the demo page and the live site.

Which code are you trying to make it work with?

You can add your own blocks any content type as long s it is formatted correctly, so depends from code to code but the basic thing is to get your block content between this:

<div id="tcontentX" class="tabcontent">
CONTENT CODE GOES HERE
</div>


Where X is the tab number

Since the original code uses a PHP function so I have used echo '';
but if it was plain html / script then no need for echo or for that matter even use of php.

This website is proudly hosted on Crocweb Cloud Website Hosting.