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

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 11:32:50 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 92
  • Total: 92

[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.

shuban

#140
Can someone tell me how to get rid of "TinyPortal 1.0 RC1 | © 2005-2010 BlocWeb" on this block. I don't think it's fair to have this copyright embedded everywhere on the website. :(

Also, I'm finding that every time I post, the content within each tab disappears :( Why is this happening. In other words, I post, and after the page has loaded or returns to the thread, the stuff inside are gone!

agent47

#141
Here's the thing guys. I've been using the code snippet that's below but it's funny how when you look at your website everyday, you just have this need to improve the interface and that's why I'm here. If you look at my Tabbed Block on the homepage, it doesn't look perfect.
<?php
// ===============================================================================================
// mouseoverTabContent.php
// 23rd September 2010
//
// 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
// mot_TPTools
// mot_NewArticles
// mot_NewFiles1
// mot_NewFiles2
// mot_Statistics
// mot_Member
// mot_Search
// ===============================================================================================



// ****************
// INITIALISATION..
// ****************

// In the block code you can set the categories for the 'New Articles' tab, so you don't have to edit this code.
// This should make it easier to work with this function.
if (isset($_GET['categories']))
// Were some categories sent ?
$categories explode("," $_GET['categories']);
else
// if not just do a guess...
$categories = array(1,2,3,4,5,6);

// 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...
function mot_NewTopics()
{
global $scripturl$settings$context$txt;
   
$what ssi_recentTopics('15',NULL,'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics1()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics2()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics3()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics4()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics5()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics6()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;

// Call each function in the order you want them to appear in the tabs.
// This should correspond with what you have in your TP block code too.
// So make sure your tabs are in the same order as these functions.

// mot_NewArticles configuration :
// $mode :
//  1= order by date
// 2= order by comments
// 3= order by views
// 4= order by rating
// 6= order randomly
//
// $limit = number of items
// $cats = categories to include [changed to use the passed GET variable from the TP block 888]
//  Others are obvious..

// All boards
mot_NewTopics();
// Comics Discussion
mot_NewTopics1();
// TV, Movies & Music
mot_NewTopics2();
        
// DC Discussion
        
mot_NewTopics3();
        
// DC Movies
        
mot_NewTopics4();
        
// DC Movies
        
mot_NewTopics5();
        
// DC Movies
        
mot_NewTopics6();
?>


Will someone please help me make it look just the way it looks on that site. The titlebg on my code snippet too had to be manually done via TP block because I didn't know how to append it via php. Help will be more than appreciate fellas. I know that's some messed up looking code and there's an easier way through all of that. Also since I'm working on a v2.0 of my site I'd like to get all fixes ready for Superhero Alliance v2.0.

Thanks in advance.

Freddy

I can't help with this at the moment guys, I am too busy working on my own site after a hack, so I will be brief.

Shuban, the extra columns you want are probably in the results returned by SSI - try dumping the result of the array it returns to see what you can use.  You can use :

echo '<pre>';
print_r($whateverArrayName);
echo '</pre>';


You could use that in a temporary PHP article for example, just to see what data it returns, obviously you would need to fill the array first like you do in your code.

Also, about the missing stuff - look in your error log for clues if there are any.

agent47, they look pretty similar to me.  You just need to adjust css (or use inline styles) to change the colour of the links, text sizes and put some padding around the title bit.  And remove or add some style to the cell background in your tables.  Pretty basic stuff, you should be able to handle it with a little research.

IchBin

Shuban, TinyPortal adds it's copyright by modifying the output buffer of SMF. Doing this makes it added to a page where SSI is used. If I figure a way to do this, I'll let you know. For now I don't have the time to work on that. I'll put it in the bugtracker so I won't forget about it though. :D

shuban

Thank you,

Now I finally got this to work for me, but my only problems are the disappear tables inside each tab.

For instance, if I post a new topic or add a new reply, after the page returns to the thread, the tables are gone :(

Can someone tell me if this happens to them as well?

<?php
// ===============================================================================================
// mouseoverTabContent.php
// 23rd September 2010
//
// 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
// mot_TPTools
// mot_NewArticles
// mot_NewFiles1
// mot_NewFiles2
// mot_Statistics
// mot_Member
// mot_Search
// ===============================================================================================



// ****************
// INITIALISATION..
// ****************

// In the block code you can set the categories for the 'New Articles' tab, so you don't have to edit this code.
// This should make it easier to work with this function.
if (isset($_GET['categories']))
// Were some categories sent ?
$categories explode("," $_GET['categories']);
else
// if not just do a guess...
$categories = array(1,2,3,4,5,6);

// 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...
function mot_NewTopics()
{
global $scripturl$settings$context$txt;
   
$what ssi_unansweredTopics('5'$exclude_boards = array(2151617212229), 'array');

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>'
;

foreach ($what as $topic) {
$cnt++;
    
$class = ($cnt 2) ? 'windowbg' 'windowbg2';

{
echo '
<tr>
<td class="'
$class'">'$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="'
$class'"><center>'$topic['board']['link'], '</center></td>
<td class="'
$class'"><center>'$topic['poster']['link'], '</center></td>
<td class="'
$class'" style="text-align:right;">'$topic['time'], '</td>
<td class="'
$class'" style="text-align:center;">';

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"/></a>';
} }

echo 
'
</td>
</tr>
</table>
</div>'
;
}
// Grabs recent topics 1...
function mot_NewTopics1()
{
global $scripturl$settings$context$txt;
   
$what ssi_unansweredTopics('5'$exclude_boards = array(3456789101133343512131424252321222915161720), 'array'); 

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>'
;

foreach ($what as $topic) {
$cnt++;
    
$class = ($cnt 2) ? 'windowbg' 'windowbg2';

{
echo '
<tr>
<td class="'
$class'">'$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="'
$class'"><center>'$topic['board']['link'], '</center></td>
<td class="'
$class'"><center>'$topic['poster']['link'], '</center></td>
<td class="'
$class'" style="text-align:right;">'$topic['time'], '</td>
<td class="'
$class'" style="text-align:center;">';

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"/></a>';
} }

echo 
'
</td>
</tr>
</table>
</div>'
;
}
// Grabs recent topics 2...
function mot_NewTopics2()
{
global $scripturl$settings$context$txt;
   
$what ssi_recentTopics('5'NULL'array'); 

echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>'
;

foreach ($what as $topic) {
$cnt++;
    
$class = ($cnt 2) ? 'windowbg' 'windowbg2';

{
echo '
<tr>
<td class="'
$class'">'$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="'
$class'"><center>'$topic['board']['link'], '</center></td>
<td class="'
$class'"><center>'$topic['poster']['link'], '</center></td>
<td class="'
$class'" style="text-align:right;">'$topic['time'], '</td>
<td class="'
$class'" style="text-align:center;">';

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"/></a>';
} }

echo 
'
</td>
</tr>
</table>
</div>'
;
}

function 
mot_NewTopics3()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics4()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics5()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;
}

function 
mot_NewTopics6()
{
global $scripturl$settings$context$txt;

$what ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'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"></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['poster']['link'], '</td>
<td class="windowbg2" valign="middle">'
$topic['time'], '</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>'
;

// Call each function in the order you want them to appear in the tabs.
// This should correspond with what you have in your TP block code too.
// So make sure your tabs are in the same order as these functions.

// mot_NewArticles configuration :
// $mode :
//  1= order by date
// 2= order by comments
// 3= order by views
// 4= order by rating
// 6= order randomly
//
// $limit = number of items
// $cats = categories to include [changed to use the passed GET variable from the TP block 888]
//  Others are obvious..

// All boards
mot_NewTopics();
// Comics Discussion
mot_NewTopics1();
// TV, Movies & Music
mot_NewTopics2();
        
// DC Discussion
        
mot_NewTopics3();
        
// DC Movies
        
mot_NewTopics4();
        
// DC Movies
        
mot_NewTopics5();
        
// DC Movies
        
mot_NewTopics6();
?>

Dylert

I have tried to install this mod, but get the error: The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

I use SMF 2.0.2 and TP 1.105. I have emulated SMF 2.0 and 2.0.1, with no luck.

Any suggestion anyone?? :)

ZarPrime

Quote from: Dylert on October 06, 2012, 11:29:11 PM
Any suggestion anyone?? :)

Dylert,

Perhaps.  The package-info.xml file for this mod doesn't specify either SMF 2.0, 2.0.1, not 2.02.  The code is below ...

<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<name>TP Tabbed Block</name>
<id>Various:TPTabbedBlock</id>
<version>1.0.0</version>
<type>modification</type>
<install for="2.0 RC2">
<readme type="file" parsebbc="true">readme.txt</readme>
<require-dir name="tabbed_block" destination="$boarddir" />
<code>chmod.php</code>
</install>
<uninstall for="2.0 RC2">
<remove-dir name="tabbed_block" destination="$boarddir" />
</uninstall>
<install for="2.0 RC3">
<readme type="file" parsebbc="true">readme.txt</readme>
<require-dir name="tabbed_block" destination="$boarddir" />
<code>chmod.php</code>
</install>
<uninstall for="2.0 RC3">
<remove-dir name="tabbed_block" destination="$boarddir" />
</uninstall>
</package-info>


As you can see, only 2.0 RC2 and 2.0 RC3 are specified for the install.  I can't guarantee that this mod will work for newer versions of SMF than those two but try emulating "SMF 2.0 RC3" and let us know if it works.

ZarPrime