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: 0
  • Guests: 460
  • Total: 460

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.

Wish

Quote from: Aku on January 08, 2007, 08:24:47 AM
yes for it to show up on all pages it is a MUST that you declare these 2 bits in the index.template.php file of the themes instead of in the blocks:

This part inside the <head> of the doc:

Quote
<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>

and this part just before the </body> ends

<script type="text/javascript">
initializetabcontent("maintab", "maintab1")
</script>


important to note here is that ("maintab", "maintab1") are initilization strings for the tabs to work and must be named the same as your tab blocks.

For example in my code I had declared for tab block 1
<ul id="maintab1" class="shadetabs">

and for tab block 2
<ul id="maintab2" class="shadetabs">

If u look at the codes u will see these are named in the actual tabbed content block as shown below:

echo'
<ul id="maintab1" class="shadetabs"> <<---this is where the name occurs
<li class="selected">
<a href="#" rel="tcontent8">User</a></li>
<li><a href="#" rel="tcontent9">Stats</a></li>
</ul>
<div class="tabcontentstyle2"><div id="tcontent8" class="tabcontent">';
TPortal_userbox();
echo'</div><div id="tcontent9" class="tabcontent">';
TPortal_statsbox();
echo'</div></div>';


I dont understand where to put the code in my index.template.php

akulion

search for the tags mentioned

the 1st part goes just before the </head> tag

and then the second pardy goes just before the </body> tag

do a search in the file for those terms and ul find them

jpark

Quote from: jpark on January 21, 2007, 04:57:18 AM
Thank you for this snippet :)  I'm trying to use this on my left side column for a "Main Menu" and "User Menu"  I can't seem to figure out how to get the "User Menu" to only show up for registered members.  I tried to stick an "if (!$user_info['is_guest']) { ...User Menu here...}" declaration before and after the div for the "User Menu" but I'm getting errors.  Is there a way to do this?


sorry to ask again but i was wondering if anyone knows how to do this?  i'd really appreciate it!

akulion

u will have to prepare 2 FULL codes for the tabs and set them up like so:

   global $user_info;

    if ($user_info['is_guest'])

echo'
the entire code for the tabs block all of them
';

   else
echo'
a repeat of the above code but with the changes in place for the menu etc
';

hope that helps

jpark

wow.. yes, that helped a lot!  Thanks so much!  so the guest menu shows only one tab ("Main Menu") while the member menu shows two ("Main Menu" and "User Menu") and this works swimmingly with your code but there's one problem...  The statsbox that I put in the member menu comes up (outside of the div) in the guest menu..    :-\ would you have any suggestions?  This is the full code I was using:
global $user_info;
if ($user_info['is_guest'])
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">Main Menu</a></li>
</ul>

<div class="tabcontentstyle">

<div id="tcontent1" class="tabcontent">
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?page=15">Item 1</a><br />
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?page=18">Item 2</a><br />
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?cat=3">Item 3</a><br />
</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>';


else
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">Main Menu</a></li>
<li><a href="#" rel="tcontent2">User Menu</a></li>
</ul>

<div class="tabcontentstyle">

<div id="tcontent1" class="tabcontent">
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?page=15">Item 1</a><br />
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?page=18">Item 2</a><br />
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?cat=3">Item 3</a><br />
</div>

<div id="tcontent2" class="tabcontent">
<img src="/Themes/TP_pnpn11/images/TPdivider2.gif"> <a href="/index.php?page=17">Photo Gallery</a><br />

<center><b><a href="/index.php?action=stats">Stats</a></b></center>
';
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>';

brianjw

I need help because the backgrounds aren't showing up correctly.

Here is my site where it shows it the incorrect way: http://www.brianjwilson.com/index.php

I have attached all the files I am using, these are located in the "tabs" directory in my forum root (I have modified urls inside code as well)

Tommy

#66
Mhpf...the .js file is not loaded:

"topic,49144.msg484676/tabcontent.js"  :(

//Edit: I changed the code to this:

<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/tabcontent.css" />
<script type="text/javascript" src="', $settings['default_theme_url'], '/tabcontent.js">


and copied the files to the default theme...now it's working  :D


tribalost

nned help :( 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">Menu</a></li>
<li><a href="#" rel="tcontent2">User</a></li>
<li><a href="#" rel="tcontent3">Online</a></li>

</ul>

<div class="tabcontentstyle2">


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

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

<div id="tcontent3" 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>';


cant get menu box to work :(

IchBin

It would help if you could tell us what is not working. Do you get an error? What happens? Please help us to help you by giving us as much info as possible....

tribalost

#69
hmm ok here's what happened...
I added <div id="tcontent1" class="tabcontent">';
TPortal_menubox();
echo'</div>

as the first tab and assigned the userbox to tcontent2 and the statusbox to 3...

but I can't get it to work :\ Im confused :(
my target is to also have the menu on a tab so that it wont consume much space..

This website is proudly hosted on Crocweb Cloud Website Hosting.