Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

December 08, 2021, 06:00:14 AM

Login with username, password and session length
Members
  • Total Members: 3831
  • Latest: pulgoki
Stats
  • Total Posts: 192617
  • Total Topics: 21020
  • Online Today: 152
  • Online Ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 61
Total: 61

Author Topic: [Discussion] Tabbed Block by Mouse Over  (Read 61942 times)

0 Members and 1 Guest are viewing this topic.

dimdom

  • Guest
Re: [Block] Mouse over tabbed block.
« Reply #20 on: September 06, 2009, 10:32:15 AM »
Thank you and as for the Internet Explorer, I prefer to let it die...  ;D

Offline Freddy

  • Moderator
  • *
  • Posts: 1615
    • AiDreams
Re: [Block] Mouse over tabbed block.
« Reply #21 on: September 06, 2009, 10:33:41 AM »
 :D Hahaha, I completely understand..
« Last Edit: September 06, 2009, 10:37:03 AM by freddy888 »

dimdom

  • Guest
Re: [Block] Mouse over tabbed block.
« Reply #22 on: September 06, 2009, 11:02:28 AM »
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:
« Last Edit: September 06, 2009, 12:02:09 PM by dimdom »

Offline Ken.

  • Support Team
  • *
  • Posts: 4361
    • Our FamilyForum
Re: [Block] Mouse over tabbed block.
« Reply #23 on: September 06, 2009, 11:06:25 AM »
[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.

Offline Freddy

  • Moderator
  • *
  • Posts: 1615
    • AiDreams
Re: [Block] Mouse over tabbed block.
« Reply #24 on: September 06, 2009, 11:39:31 AM »
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:

Offline SN

  • Full Member
  • ***
  • Posts: 137
    • SpursNetwork - Tottenham Hotspur Fansite
Re: [Block] Mouse over tabbed block.
« Reply #25 on: September 26, 2009, 07:05:56 AM »
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

Offline Freddy

  • Moderator
  • *
  • Posts: 1615
    • AiDreams
Re: [Block] Mouse over tabbed block.
« Reply #26 on: September 26, 2009, 07:53:17 AM »
Yes of course, in theory you can edit anything...

Like I said in the first post :

Quote
The 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.
« Last Edit: September 26, 2009, 08:19:38 AM by freddy888 »

Offline Freddy

  • Moderator
  • *
  • Posts: 1615
    • AiDreams
Re: [Block] Mouse over tabbed block.
« Reply #27 on: September 26, 2009, 10:41:36 AM »
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 :

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

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

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

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

Code: [Select]
<li><a href="#" rel="gotsubmenu">Article</a></li>
So now it looks like this :

Code: [Select]
<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 !
« Last Edit: October 30, 2012, 05:50:56 AM by Freddy »

Offline SN

  • Full Member
  • ***
  • Posts: 137
    • SpursNetwork - Tottenham Hotspur Fansite
Re: [Block] Mouse over tabbed block.
« Reply #28 on: September 26, 2009, 11:07:05 AM »
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

Offline Freddy

  • Moderator
  • *
  • Posts: 1615
    • AiDreams
Re: [Block] Mouse over tabbed block.
« Reply #29 on: September 26, 2009, 11:47:58 AM »
No problemo, yes it's a bit PHP intensive.  Good luck in finding something that will work for you.