Greetings !
So today I installed TinyPortal on my forums for the first time. It is very confusing to get used to. So I was looking around for a sort of module i wanted and default TinyPortal options didn't have it.
http://gamer.lk/index.php
If you scroll down in that site you could see a box with information and another with the latest topics being discussed in different forum sections.
Could one of you possibly know where I could find this module ? If you can please help me out !
Thanks and Best Regards,
hashend94
TP already has a built in block for that, it's called recent topics. When you create a block you can just select the recent topics type of block. If you want it to look different than what is provided with TP, then you'll need to use a custom block code which we have plenty of in our block codes board.
http://www.tinyportal.net/index.php?board=46.0
Hey guys ! So yesterday I installed Tinyportal to my forums. And i found this amazing recent topics module in a certain site which I really want and can't seem to find ( That forum uses tinyportal aswell) . In this module you can display different recent topics from different sections of the forums, they'r tabbed and when you hover over it shows the different threads from each section. I'll attach an image so you guys know how it looks like. So If you know where I can find the code for this please help me out :)
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi798.photobucket.com%2Falbums%2Fyy269%2Ftimeisticking%2FDDW.png&hash=2b9d19e43b83f136551bb5978562b06daa6ae3dc)
The site : http://gamer.lk/
Thanks and Best Regards
Bump, Anyone around ? :-\
Hello hashend94,
Welcome to the TinyPortal Support Board.
I have merged your topic from the 25th into this topic as it apparently has to do with the same question. The block code you seem to be looking for is not the Recent Topics block that you asked about in your earlier topic. That topic is a standard block for TinyPortal and Ichbin, and I, thought that was what you were looking for. Apparently not though. It appears that what you are looking for is the Tabbed block which is capable of using different TinyPortal blocks in it's structure.
It is difficult for us to just guess what you are looking for if you have not first read our Posting Guidelines (http://www.tinyportal.net/index.php?topic=581) and given us the information requested in that topic. The first thing we ask you to do is to conduct a search to see if you can find what you are looking for. If you can't find what you are looking for via a search then the information requested in that topic gives us the information that we need in order to help you.
Let's start over, shall we? Now that we know what you are looking for, Please read the Posting Guidelines (http://www.tinyportal.net/index.php?topic=581) and supply the requested information and we will try to give you the information that you seek. Here's what we need from you ...
Link to my site: http://www.yourdomain.com
SMF version: SMF ver. here
TP version: TP ver. here
Default Forum Language: Your Default Forum Language here
Theme name and version: Theme name here
Browser Name and Version: Browser name/version here
Mods installed: Mods listed here
Related Error messages: Error message here
ZarPrime
Hello!
I'm really sorry for inconvenience caused ! It's my fault for not reading the rules and guide lines and i'm really sorry for that ! So Firstly I'll prove the info :)
Link to my site: http://otakusl.mmocube.net
SMF version: SMF 2.0.1
TP version: TP ver.1.0 FINAL
Default Forum Language: English
Theme name and version: Noize (Dziner Studios)
Browser Name and Version: Chrome
Mods installed: Nothing so far
Related Error messages: No Error Messages
Okay so I tried looking everywhere in the forums but I couldn't find the solution for the problem. As you explain above I want the tabbed block. I'm still a beginner to PHP and my knowledge is somewhat limited on this matter. But I hope to learn more with your help. So Once again I am looking for a block with tabbed recent posts from different sections and if anyone of you help me, i'm really greatfull ! ( hope I don't need to post the picture again)
Hope to get a reply soon
Thanks and Best Regards,
Hashen
No problem on not following the posting guidelines since you are new here. It is only frustrating when someone has been here awhile and doesn't give us the information needed. It's sort of like us having to ask twenty questions to get the information we need and, by the time we do that, we have a huge topic spaning multiple pages. :o
Anyway, let's get started. The block code you are looking for was written by our coder Freddy and is called "Tabbed Block by Mouse Over". I have looked at the site you mentioned in your first post and that site uses the various tabs to just show recent topics, the first tab to show "All" recent topics, and the second and subsequent tabs to show recent topics from various Forum Boards on that site. If something like this is what you want to show on your site as well, it should be fairly easy to install and setup this block. It gets a little more difficult if you want to setup other tabs to do other things, especially if those other tabs use javascript, but it can be done.
Mod Package (Download for SMF 2.0) --> http://www.tinyportal.net/index.php?topic=33219
Discussion on package --> http://www.tinyportal.net/index.php?topic=30787.0
Post showing how to modify code to show something else in a tab --> http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
This Mod is designed for SMF 2.0RC2 and 2.0 RC3. Since you will be installing this on SMF 2.0.1, you will need to emulate one of those other 2 versions of SMF when installing it with the Package Manager. Read the post linked to the right for more information on that. --> http://www.tinyportal.net/index.php?topic=30787.msg279942#msg279942
I would also recommend that you backup your Forum and database before starting on this in case you make any mistakes. That way you can revert everything if you have problems. Let us know how you get along with this.
ZarPrime
Hey ZarPrime,
As you said I followed the thread used the emulation function and installed the mod. But how ever when I try to add the code in a PHP block and and display it, iParse error: syntax error, unexpected '[' in
/home/mmocuben/public_html/otakusl/Sources/Load.php(2322) : eval()'d code(127) : eval()'d code on line 2t gives me this error
Any idea why it happens ?
Thanks
Hashen
I might have to get hold of Freddy and ask him about this as he knows more about this code than anyone else. In the meantime, do the following ...
First off, let's make sure you installed the correct one. At the bottom of the Mod topic (http://www.tinyportal.net/index.php?topic=33219), there are 2 files. The top one is for SMF 1.0 and the bottom one is for SMF 2.0. You don't want the one at the top. The one you need is the bottom one for SMF 2.0. Did you install the correct one, and did you get any errors during the installation with the Package Manager?
OK, next, go to Admin --> Configuration --> Server Settings and find the setting that says "Disable evaluation of templates". Put a checkmark in that one and save and then go to the frontpage and see if the error changes. Let us know what the error says now.
Third, go to your TinyPortal blocks screen and turn off the chatbox that is right above where the error is and save. Then go back to the frontpage and see if the error changes. Let us know.
ZarPrime
Hey,
I finally got it to work ;D I've inserted a wrong code into the block :P And after I checked it worked ! Now the only problem I have is how to make different news from different board appear in different tabs. If you know any tutorial or if you could tell me how to do so. It would be really nice :)
Thanks again
Hashen
Hi mate, ZarPrime sent me a message that you needed some help. The first thing I thought was 'I bet he pasted the wrong code' ;D
I don't have a test site up and running at the moment, but as ZP mentioned there is already an entry here that explains how to make your own tabs :
Post showing how to modify code to show something else in a tab --> http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
See how you get on O0
Hey Freddy ! :D Really nice to meet you ! I gotta say I love the mod ! O0
Well I check the link, I got what is suppose to be done, I got the whole Idea but I don't know how to do it since my php ability is really low :/
I'm really sorry If I'm annoying but could be possible to explain it a little bit more, dumb it down maybe and tell how I can edit it :S
Sorry once again if I'm trouble.
Hope to get a reply from you soon :)
Thanks.
OK no problem, I agree; for someone starting out with PHP it's a little complex.
How about you tell me what you want to do in one tab and I can break it down for you and give you a step by step. If you want something like the site you linked to has it shouldn't be too difficult once you get the hang of it.
Hey Freddy !
Thanks a lot ! Okay so what I want to do in the other tabs is pretty much the same thing the site I mentioned does. I want different (Recent if possible) post from different boards of the forum to display in different tabs. Hope this isn't much. If you teach me how to do one tab I guess I could do the rest :P
Thanks,
Hashen.
Bump ! Just so the thread dont go missing
I'll look at this as well today sometime. What you want to do should not be too difficult. It's just that I've been kind of busy this week and my power was off for 36 hours during Frankenstorm Sandy. Just getting back up to speed but will try to get something for you today, if I can.
ZarPrime
Yes, sorry - I am a bit busy myself at the moment...I have not forgotten :)
So let's just clarify - you want something like that other site - each tab has topics from a particular board ?
Yeah, that's the way I read it Freddy, but maybe from a few boards. For instance One of his tabs is "Art". In the "Artists Dump1!" category, he has 10 boards, including child boards. Here is a list of them and their board numbers ...
Artistic Lounge --> 42.0
Graphic Requests --> 43.0
Render Requests --> 44.0
Misc.Case --> 45.0
Anime Renders --> 46.0
Non-Anime Renders --> 47.0
Ecchi Renders --> 48.0
Brushes --> 49.0
Tutorials --> 50.0
Competitions --> 52.0
So, he'll first have to comment out the original tabs and then add the new tabs, changing the name of the functions, and then adding the array for the boards he wants to the ssi_recenttopics function for each one, maybe something like this ...
ssi_recentTopics('5', NULL, array(42,43,44,45,46,47,48,49,50,52), 'array');
However, I don't know exactly what boards he wants to be shown in each tab.
ZarPrime
Thanks ZP. In that case I stripped down to the bare minimum.
Here is a new version of mouseoverTabContent.php :
<?php
// ===============================================================================================
// mouseoverTabContent.php - very simple version to just show recent topics from certain boards.
// 03 November 2012
//
// Code is based on the work of StormLrd and modifications by dimdom.
// This file pulls together their work and has been assembled by Freddy888.
//
// This file is designed to pull data from an SMF forum and put it in a Tiny Portal tabbed block.
// This uses a modified version of the 'Mouseover Tabs Menu' at
// http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
//
// Functions are prefixed 'mot_' meaning 'mouse over tab'.
// Basically each function equals one tab contents in your Tiny Portal block code.
// The order in which the functions are called is the order the tabs will appear in.
// You can put whatever you like in these functions or add more,
// this method just makes it easier to move stuff around.
//
// The actual 'output' from this file occurs at the end of this file.
// You can skip down to the bottom to fine tune things...
//
// Functions in this version :
// mot_NewTopics(BOARD-ID)
// ===============================================================================================
// ****************
// INITIALISATION..
// ****************
// The mouseover tabs JS code generates a $_GET we don't need at this point it seems.
// We need to empty the $_GET variable here otherwise SMF throws a 'Invalid request variable'.
// See circa line 99 in QueryString.php for more info. 888
$_GET = array();
// Going to need all the useful things in SSI.
require_once('../SSI.php');
// Initialise Tiny Portal.
TPortal_init();
// Work out where all the TP images are....
$tpimagesurl = $boardurl . '/Themes/default/images/tinyportal';
$tpimg['options'] = $tpimagesurl . '/TPoptions.gif';
$tpimg['bullet4'] = '<img src="' . $tpimagesurl . '/TPgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['tpblue'] = $tpimagesurl . '/TPblue.gif';
$tpimg['bullet1'] = '<img src="'. $tpimagesurl . '/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet2'] = '<img src="'. $tpimagesurl . '/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet3'] = '<img src="' . $tpimagesurl . '/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['article'] = $tpimagesurl . '/TParticle.gif';
// *************
// The Functions
// *************
// Grabs recent topics in a particular board...
function mot_NewTopics($boardid)
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('5', NULL, $boardid, 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle">Topic</td>
<td valign="middle">Board</td>
<td valign="middle">Writer</td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
/*
// An example function...don't forget to call it in the config at the bottom!
function mot_myFunction()
{
global $what $ever $you $need $here;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
// All your code goes here...
echo '
</div>';
}
*/
// *************************************
// And finally output & configuration...
// *************************************
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>';
// Tab 1
mot_NewTopics(1);
// Tab 2
mot_NewTopics(2);
// Tab 3
mot_NewTopics(3);
echo '
</body>
</html>
';
?>
And here is a new version of the BLOCK code :
global $boardurl;
echo '
<script type="text/javascript">
var cssNode = document.createElement("link");
cssNode.type = "text/css";
cssNode.rel = "stylesheet";
cssNode.href = "' , $boardurl , '/tabbed_block/tabbedBlockStyle.css";
cssNode.media = "screen";
cssNode.title = "dynamicLoadedSheet";
document.getElementsByTagName("head")[0].appendChild(cssNode);
</script>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) 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 this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">Tab 1</a></li>
<li><a href="#" rel="gotsubmenu">Tab 2</a></li>
<li><a href="#" rel="gotsubmenu">Tab 3</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';
========================= Now for the customisation ================================
So replace the old mouseoverTabContent.php file and edit the board id's - something like this....
// Tab 1
mot_NewTopics(42);
// Tab 2
mot_NewTopics(43);
// Tab 3
mot_NewTopics(44)
And in the BLOCK code name the tabs.
<li><a href="#" rel="gotsubmenu[selected]">Artistic Lounge</a></li>
<li><a href="#" rel="gotsubmenu">Graphic Requests</a></li>
<li><a href="#" rel="gotsubmenu">Render Requests</a></li>
Just add more tabs and functions calls till you cover all the bases...so rince and repeat.
Oh, yeah Freddy. That's some nice code there. That's why you are the Master Coder and I am just the troubleshooter. ;) That would work perfectly if he wants each tab to only contain the recent topics from one board. I was thinking that he might want multiple boards for each tab though. That's why I posted that little code snippet in my last post so that the array for the included boards would be picked up by a single tab. However, I'm still not certain exactly what he wants in each tab so your way may be the right way to do it, one board per tab. You see what I mean?
ZarPrime
Yep I see exactly what you mean and your method will fit in fine if I am reading ssi.php right...
If he wants a couple of boards in the same tab, he should simply be able to do this :
// Tab 1
mot_NewTopics(array(1,12,16));
// Tab 2
mot_NewTopics(2);
// Tab 3
mot_NewTopics(array(13,29));
And so on....we are on the same page :)
Cool !!! Yeah, that would probably work just fine. Unfortunately, I don't have time to check that out right now. Saturday is always a busy day for me. ::) I saw hashend94 on here a couple of minutes ago so maybe he'll log again in a bit and try this out and let us know what happens. If that works for him, we can split these posts out and merge them back into the block code topic as an alternative for "all tabs contain topics from specific boards" or something like that. O0
ZarPrime
Sounds good. I just tested it and it's working fine here...two boards in one tab...one board in another etc...
O0
Just dropping some images in for reference as I don't have a live demo of this anymore.
OK, excellent. 8) I figured it would work fine. I'll do some rearranging of posts here later on this evening, or maybe tomorrow. Nice job on this Freddy !!! ;)
ZarPrime
Hey guy! Sorry for the late reply, I tried and it works fine! Thankyou very much for the support :) Really appreciate it !
And also one more question. Is it possible to add the time when the thread was used (last used )
Hmmm. Well, try this code for the php file instead. It might work. If not, let us know and Freddy will have to take a look at it again, or you can let me know what happens and I'll try to troubleshoot it.
ZarPrime
Code follows below ...
<?php
// ===============================================================================================
// mouseoverTabContent.php - very simple version to just show recent topics from certain boards.
// 03 November 2012
//
// Code is based on the work of StormLrd and modifications by dimdom.
// This file pulls together their work and has been assembled by Freddy888.
//
// This file is designed to pull data from an SMF forum and put it in a Tiny Portal tabbed block.
// This uses a modified version of the 'Mouseover Tabs Menu' at
// http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
//
// Functions are prefixed 'mot_' meaning 'mouse over tab'.
// Basically each function equals one tab contents in your Tiny Portal block code.
// The order in which the functions are called is the order the tabs will appear in.
// You can put whatever you like in these functions or add more,
// this method just makes it easier to move stuff around.
//
// The actual 'output' from this file occurs at the end of this file.
// You can skip down to the bottom to fine tune things...
//
// Functions in this version :
// mot_NewTopics(BOARD-ID)
// ===============================================================================================
// ****************
// INITIALISATION..
// ****************
// The mouseover tabs JS code generates a $_GET we don't need at this point it seems.
// We need to empty the $_GET variable here otherwise SMF throws a 'Invalid request variable'.
// See circa line 99 in QueryString.php for more info. 888
$_GET = array();
// Going to need all the useful things in SSI.
require_once('../SSI.php');
// Initialise Tiny Portal.
TPortal_init();
// Work out where all the TP images are....
$tpimagesurl = $boardurl . '/Themes/default/images/tinyportal';
$tpimg['options'] = $tpimagesurl . '/TPoptions.gif';
$tpimg['bullet4'] = '<img src="' . $tpimagesurl . '/TPgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['tpblue'] = $tpimagesurl . '/TPblue.gif';
$tpimg['bullet1'] = '<img src="'. $tpimagesurl . '/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet2'] = '<img src="'. $tpimagesurl . '/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet3'] = '<img src="' . $tpimagesurl . '/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['article'] = $tpimagesurl . '/TParticle.gif';
// *************
// The Functions
// *************
// Grabs recent topics in a particular board...
function mot_NewTopics($boardid)
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('5', NULL, $boardid, 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle">Topic</td>
<td valign="middle">Board</td>
<td valign="middle">Writer</td>
<td valign="middle">Date & Time</td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time']['link'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
/*
// An example function...don't forget to call it in the config at the bottom!
function mot_myFunction()
{
global $what $ever $you $need $here;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
// All your code goes here...
echo '
</div>';
}
*/
// *************************************
// And finally output & configuration...
// *************************************
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>';
// Tab 1
mot_NewTopics(1);
// Tab 2
mot_NewTopics(2);
// Tab 3
mot_NewTopics(3);
echo '
</body>
</html>
';
?>
Hey guys, sorry for bumping this thread after a very long time. But I was just wondering does this work on other portals systems ? I know this rude :S But I just wanted to know. Sorry If I offend any of you >___<
Try it and let us know ;)
Well I tried it on adk portal, and it seems to display 'Loading Sub Menu Contents...' the sites this --> http://supremecreamscans.com/index.php
If you want help for another portal, don't you think you should post for help at that portal's support site? How would we know if something works on software that we do not use?
Quote from: IchBin™ on July 15, 2013, 07:44:21 PM
If you want help for another portal, don't you think you should post for help at that portal's support site? How would we know if something works on software that we do not use?
That is why I asked if it supports other portals in the previous post, and when Freddy told me to go ahead and try out I just simply did and posted the results I got. :-[
Yeah, but the fact that you even originally posted here. Why would you ask us about another portal? Common sense should tell you that we don't use ADK here. So you should have just asked at ADK site. Getting help for another portal here is pretty gutsy if you ask me.
I'm really sorry If I offended any of you by posting that. I meant no offense :-[ I'll make sure that won't happen again. And once again I'm really sorry. :(
Trying not to be offended here. Seems the last couple of topics have drudged up hard feelings. lol No worries. You start using TP, feel free to post here with all your questions. :)
Same as Ichbin...
My comment was meant as a little dig as we only support TP here. No offence taken. Peace.
I switched to TP finally, and dont plan on switching back to anything :P
Okay, So I have a question. I used the array function to display multiple boards in one tab, and when I use that the tab doesn't seem to display anything atall. Any Idea why this happens ?
My mouseOverrTabContent.php :
<?php
// ===============================================================================================
// mouseoverTabContent.php - very simple version to just show recent topics from certain boards.
// 03 November 2012
//
// Code is based on the work of StormLrd and modifications by dimdom.
// This file pulls together their work and has been assembled by Freddy888.
//
// This file is designed to pull data from an SMF forum and put it in a Tiny Portal tabbed block.
// This uses a modified version of the 'Mouseover Tabs Menu' at
// http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
//
// Functions are prefixed 'mot_' meaning 'mouse over tab'.
// Basically each function equals one tab contents in your Tiny Portal block code.
// The order in which the functions are called is the order the tabs will appear in.
// You can put whatever you like in these functions or add more,
// this method just makes it easier to move stuff around.
//
// The actual 'output' from this file occurs at the end of this file.
// You can skip down to the bottom to fine tune things...
//
// Functions in this version :
// mot_NewTopics(BOARD-ID)
// ===============================================================================================
// ****************
// INITIALISATION..
// ****************
// The mouseover tabs JS code generates a $_GET we don't need at this point it seems.
// We need to empty the $_GET variable here otherwise SMF throws a 'Invalid request variable'.
// See circa line 99 in QueryString.php for more info. 888
$_GET = array();
// Going to need all the useful things in SSI.
require_once('../SSI.php');
// Initialise Tiny Portal.
TPortal_init();
// Work out where all the TP images are....
$tpimagesurl = $boardurl . '/Themes/default/images/tinyportal';
$tpimg['options'] = $tpimagesurl . '/TPoptions.gif';
$tpimg['bullet4'] = '<img src="' . $tpimagesurl . '/TPgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['tpblue'] = $tpimagesurl . '/TPblue.gif';
$tpimg['bullet1'] = '<img src="'. $tpimagesurl . '/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet2'] = '<img src="'. $tpimagesurl . '/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet3'] = '<img src="' . $tpimagesurl . '/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['article'] = $tpimagesurl . '/TParticle.gif';
// *************
// The Functions
// *************
// Grabs recent topics in a particular board...
function mot_NewTopics($boardid)
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('5', NULL, $boardid, 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle">Topic</td>
<td valign="middle">Board</td>
<td valign="middle">Writer</td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
/*
// An example function...don't forget to call it in the config at the bottom!
function mot_myFunction()
{
global $what $ever $you $need $here;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
// All your code goes here...
echo '
</div>';
}
*/
// *************************************
// And finally output & configuration...
// *************************************
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>';
// Tab 1
mot_NewTopics(array(48.0,53,42,16,47,49));
// Tab 2
mot_NewTopics(array(38,40,39));
echo '
</body>
</html>
';
?>
My Block code:
global $boardurl;
echo '
<script type="text/javascript">
var cssNode = document.createElement("link");
cssNode.type = "text/css";
cssNode.rel = "stylesheet";
cssNode.href = "' , $boardurl , '/tabbed_block/tabbedBlockStyle.css";
cssNode.media = "screen";
cssNode.title = "dynamicLoadedSheet";
document.getElementsByTagName("head")[0].appendChild(cssNode);
</script>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) 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 this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="tab1[selected]">Latest forum posts here.</a></li>
<li><a href="#" rel="tab2">Recent Staff topics here.</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';
Nvm fixed it guys ! :D
Might want to post your solution so someone else will know if they run into the same problem. :)
It was a stupid mistake I made :P
<li><a href="#" rel="tab2">Recent Staff topics here.</a></li>
there for some reason I replaced it with 'gotsubmenu' with 'tab'. It's my mistake really. :)
Also I was wondering if it was possible to replace the Board with the latest poster and instead of writer replace it with the person who last posted on the thread. Sort of like in this picture.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi798.photobucket.com%2Falbums%2Fyy269%2Ftimeisticking%2FDDW.png&hash=2b9d19e43b83f136551bb5978562b06daa6ae3dc)
Also if it's possible to get that gradient bar there, that would be awesome too :)
bump?
Recent topics is not recent posts. You are probably asking for something that is not in the code. The poster for the recent post in the recent topic I do not believe is possible with the way the code is currently written. I do not have the time to rewrite it for you at the moment sorry.