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

Recent

Welcome to TinyPortal. Please login or sign up.

May 14, 2024, 07:17:28 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 83
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 76
  • Total: 76

[Discussion] Tabbed Block by Mouse Over

Started by Freddy, September 05, 2009, 05:31:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dimdom

Thank you and as for the Internet Explorer, I prefer to let it die...  ;D

Freddy

#21
 :D Hahaha, I completely understand..

dimdom

#22
As un update, I have found out what causes these errors in my IE8.

Somehow, the compatibilty mode was on.


Great disasters (more than 4 hours trying to find out what went wrong with the scripts and codes) happen with small things... :idiot2:

Ken.

[OT - rant]
IE totally Sux!!!
I hate having to continually alter, change or rewrite just so the crappy IE browser can 'see' something... just had to do about an hours work to some already existing content because IE was not able to see or use said content.. FF had no such problem of course.
[/OT -rant]
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Freddy

Yes I totally agree with you both.  IE really does suck.  It causes me more problems than anything.  What's amazing is Google gives us Chrome only a relatively short time ago and it hasn't got half the problems IE has.  If they can do that then why is MS so bad at it given all the time they have had to sort it out ?

:idiot2:

SN

Really really like this block, working fine for me.

But to be honest, i don't want any of the tabs it has there right now :p

is there any way i can edit them and put the content i want in there.

I own a football forum, so i want things like ''Next Match'' etc but im not sure how easy it is or where to start

Freddy

#26
Yes of course, in theory you can edit anything...

Like I said in the first post :

QuoteThe package installer will create a new folder in your forum directory called 'tabbed_block' - inside there is a file called mouseoverTabContent.php and this is what does all the work to create the tab contents.

So if you look at that php file and read the commentary you will see it is only limited by your imagination.  It's really just a base for further work and for people to work whatever they want into it.

One thing to note, is that this block is really designed to pull dynamic information from the forum or TP.  Because it relies on an external file it may not be practical if you want it to show constantly hand-edited information - because you would have to keep editing the file.  It's really a set-up and forget feature.  But you could do things like pull information from a certain board on the forum.  So if you posted information on the forum (in say a dedicated board) about the next match it could pull from that.

Freddy

#27
After thinking some more about this, I figured it probably is a bit more flexible than I just said...

As an example of the process, here's how to add a tab that pulls the contents of a TP HTML article.

Starting out with the initial code as supplied I did this :

Added a new function to the mousoverTabContent.php that grabs the article :

// A TP HTML article...
function mot_TPArticle($articleID)
{
global $settings, $db_prefix;

$tp_prefix = $settings['tp_prefix'];

$result = db_query("SELECT body
FROM {$tp_prefix}articles
WHERE id = $articleID
LIMIT 1",__FILE__, __LINE__);

echo '
<div class="tabsmenucontent" style="padding: 12px">';

while ($row = mysql_fetch_assoc($result))
{
echo html_entity_decode($row['body']);
}

echo '
</div>';

mysql_free_result($result);
}


I added that after the search function - just remember that the main thing is that the function comes before the configuration at the end of the file.

Then I didn't want the 'Tools' tab any more so I commented it out in the configuration area like this :

// Tab 2
//mot_TPTools();


Now I needed to call the new function so I added it at the end of all the other tabs, so it will come up in last place :

// Tab 6
mot_Member();

// Tab 7
mot_Search();

// Tab 8
mot_TPArticle(120);


So now we have a new Tab 8.  The function needs to know what article it is supposed to be grabbing so you have to set that in the brackets - so here I am using the article with the id '120'

Finally I went back to the block code in TP and made these changes :

I removed this line, because I don't want the 'Tools' tab anymore...

<li><a href="#" rel="gotsubmenu">Tools</a></li>

And at the end of the other tabs (remembering it will come last) I added a new tab :

<li><a href="#" rel="gotsubmenu">Article</a></li>

So now it looks like this :

<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
<li><a href="#" rel="gotsubmenu">Article</a></li>
</ul>
</div>


It's a bit confusing at first, but that's how you do it.  Like I said before a lot of block code could be used with this too - it's just a matter of turning them into functions.

The Demo page now shows these edits, you should now see a simple article there in the last tab. - no longer up sorry !

SN

Thanks for the reply Freddy.

But like you said i think this is best used as a set up and forget. and i would be looking for one i would be editing regularly . I think it might be easier for me to find a script and install it that way, because to be honest i'm not very good with php coding

Freddy

No problemo, yes it's a bit PHP intensive.  Good luck in finding something that will work for you.