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

Recent

Welcome to TinyPortal. Please login or sign up.

July 24, 2024, 09:46:29 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,347
  • Total Topics: 21,237
  • Online today: 80
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 76
  • Total: 77
  • @rjen

Issues after SMF upgrade from 2.0.19 to 2.1.4 / TP 1 to TP 3 lots if index error

Started by GhostRider2110, June 17, 2024, 01:48:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GhostRider2110

Is it enough to disable all blocks in a panel?  Or will I have delete all the blocks?  I think most that are left active are just linking to pages or articles.  I will keep looking. 

Thanks
Mitch 
Mitchell Baker

GhostRider2110

I believe I found it.  Stats and info block I had, must be old code:

global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.png" style="margin-right: 5px; margin-left: 5px" />';

echo'
<div class="tp_userblock">';


// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<h4>', $txt['hello_member'], ' ', $context['user']['name'], '</h4>
';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members']  . '</a>';

if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />
';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'];
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '
' , $bullet , $txt['tp-loggedintime'] , $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays']. $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours']. $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
echo '
' , $bullet , $context['current_time'] , '<br />';

// admin parts etc.
         if(!isset($context['TPortal']['can_submit_article']))
            $context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
             if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a>';
             if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a>';
}
// upload a file?
            if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
              echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a>';

// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a>';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a>';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a>';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a>';
}

}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a>';
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
<div>', $txt['hi_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="302400">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" />
</form>
<span class="smalltext">', $txt['quick_login_dec'], '</span>
<br />';
}
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';

echo '
</div>';


// STATS....

echo'
<div class="tp_statsblock">';

if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<h5 class="mlist"><a href="'.$scripturl.'?action=mlist">'.$txt['members'].'</a></h5>

' , $bullet , $txt['total_members'].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
' , $bullet , $txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><strong>', $modSettings['latestRealName'], '</strong></a>
';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>

' , $bullet , $txt['total_posts'].': '.$modSettings['totalMessages']. '
' , $bullet , $txt['total_topics'].': '.$modSettings['totalTopics']. '
' , $bullet , $txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
' , $bullet , $txt['tp-mostonline'].': '.$modSettings['mostOnline'].'
('.timeformat($modSettings['mostDate']).')';

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt['online_users'].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' ';
}
echo '
</div></div>';
}
echo '
</div>';
Mitchell Baker

@rjen

Just curious: all these custom php blocks you have: did you set these up yourself?

If so, it should not be a surprise that with SMF and TP developing, these blocks require maintenance/ updating.

If not, this may be a more general warning message: since the software is getting updated over time, custom php code must follow... so when you have custom php code blocks or php articles, these must always be checked when upgrading!
Running Latest TP on SMF2.1 at: www.fjr-club.nl

GhostRider2110

I'm sure I grabbed them from people on this site many years ago.  Seems between TP 1x to 3, the php 5 to 7/8 and Mariadb/Mysql move to 10 changed enough to keep them working on the old site and break things on the new site.  I can't even find exactly which version of TP I am running on the old site. Package Manager is so messed up. The Changelog_TP.txt has 1.090 beta 5 as the newest version, some of the file say version 2 some say version 1 LOL.. So, like I said it's a mess.. and I have ignored it for several years except to update some content occasionally.   

But good news, I think I have all the rogue TP blocks eliminated.  That block I found by just turning off all the panels, then back on one at a time, testing to see of got errors, no errors from any of the blocks in that panel, turned it off, and turned on next.. kept that up until errors started up. Then did same thing with the blocks until I found all the through errors into the error log.  

I might make an attempt to fix the block as my rusty php coding comes back.  Not sure.  Some of the functionality is probably built in now. I have to look and see. 

My next steps are to get some of the other mods which have been update for SMF 2.1 installed and see what I can break then.  

Thanks
Mitch
Mitchell Baker

@rjen

I can have at look at the block codes if you post them here... maybe we can post the corrected codes back onto the forum
Running Latest TP on SMF2.1 at: www.fjr-club.nl

GhostRider2110

#25
Not sure what one I posted below. Ah yes the Stats and Info block: DOES NOT WORK WITH TP3

global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';

echo'
<div class="tp_userblock">';


// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<h4>', $txt['hello_member'], ' ', $context['user']['name'], '</h4>
';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members']  . '</a>';

if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />
';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'];
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '
' , $bullet , $txt['tp-loggedintime'] , $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays']. $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours']. $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
echo '
' , $bullet , $context['current_time'] , '<br />';

// admin parts etc.
         if(!isset($context['TPortal']['can_submit_article']))
            $context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
              if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a>';
              if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a>';
}
// upload a file?
            if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
              echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a>';

// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a>';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a>';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a>';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a>';
}

}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a>';
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
<div>', $txt['hi_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="302400">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" />
</form>
<span class="smalltext">', $txt['quick_login_dec'], '</span>
<br />';
}
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';

echo '
</div>';


// STATS....

echo'
<div class="tp_statsblock">';

if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<h5 class="mlist"><a href="'.$scripturl.'?action=mlist">'.$txt['members'].'</a></h5>

' , $bullet , $txt['total_members'].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
' , $bullet , $txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><strong>', $modSettings['latestRealName'], '</strong></a>
';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>

' , $bullet , $txt['total_posts'].': '.$modSettings['totalMessages']. '
' , $bullet , $txt['total_topics'].': '.$modSettings['totalTopics']. '
' , $bullet , $txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
' , $bullet , $txt['tp-mostonline'].': '.$modSettings['mostOnline'].'
('.timeformat($modSettings['mostDate']).')';

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt['online_users'].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' ';
}
echo '
</div></div>';
}
echo '
</div>';

Attached is a screen shot of what it produced.

Mitchell Baker

GhostRider2110

#26
Old News block, each news item fades out into the next:  DOES NOT WORK WITH TP3

global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Show the news fader?  (assuming there are things to show...)
// if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div style="height: 107px">';
// <div style="height: 85px; background: url('.$settings['images_url'].'/machine.jpg) repeat-x;">';

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="text-align: center; width: 90%; padding: 2px;"><b>', $context['news_lines']
, '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 155, "g": 185, "b": 255}, smfFadeTo = {"r": 0, "g": 0, "b": 0};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";
var foreColor, backEl, backColor;
if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;
backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;
backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}
// List all the lines of the news for display.
var smfFadeContent = new Array(
"', implode('",
"', $context['fader_news_lines']), '"
);
// ]]></script><script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script></div>';
}
Mitchell Baker

@rjen

Quote from: GhostRider2110 on June 20, 2024, 08:05:02 PMNot sure what one I posted below. Ah yes the Stats and Info block: DOES NOT WORK WITH TP3

global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.gif" style="margin-right: 5px; margin-left: 5px" />';

echo'
<div class="tp_userblock">';


// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<h4>', $txt['hello_member'], ' ', $context['user']['name'], '</h4>
';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members']  . '</a>';

if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br />
';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'];
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '
' , $bullet , $txt['tp-loggedintime'] , $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays']. $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours']. $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
echo '
' , $bullet , $context['current_time'] , '<br />';

// admin parts etc.
         if(!isset($context['TPortal']['can_submit_article']))
            $context['TPortal']['can_submit_article']=0;
// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc')))
{
// can we submit an article?
if(!allowedTo('tp_articles'))
{
              if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a>';
              if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a>';
}
// upload a file?
            if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
              echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a>';

// tpadmin checks
if (allowedTo('tp_settings'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a>';
if (allowedTo('tp_blocks'))
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a>';
if (allowedTo('tp_articles'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a>';
}
if (allowedTo('tp_dlmanager'))
{
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a>';
}

}
// add adminhooks
if(sizeof($context['TPortal']['tpmodules']['adminhook'])>0)
{
foreach($context['TPortal']['tpmodules']['adminhook'] as $link)
echo $bullet , '<a href="' . $scripturl . '?'.$link['action'].'">' . $link['title']. '</a>';
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else{
echo '
<div>', $txt['hi_guest'], '</div>
<div class="smalltext">', $context['current_time'], '</div>
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" /><br />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="302400">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" />
</form>
<span class="smalltext">', $txt['quick_login_dec'], '</span>
<br />';
}
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';

echo '
</div>';


// STATS....

echo'
<div class="tp_statsblock">';

if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<h5 class="mlist"><a href="'.$scripturl.'?action=mlist">'.$txt['members'].'</a></h5>

' , $bullet , $txt['total_members'].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
' , $bullet , $txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><strong>', $modSettings['latestRealName'], '</strong></a>
';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>

' , $bullet , $txt['total_posts'].': '.$modSettings['totalMessages']. '
' , $bullet , $txt['total_topics'].': '.$modSettings['totalTopics']. '
' , $bullet , $txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
' , $bullet , $txt['tp-mostonline'].': '.$modSettings['mostOnline'].'
('.timeformat($modSettings['mostDate']).')';

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt['online_users'].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' ';
}
echo '
</div></div>';
}
echo '
</div>';

Attached is a screen shot of what it produced.

I believe this is better

global $context, $settings, $options, $scripturl, $txt, $modSettings;

$bullet = '<img src="Themes/default/images/tinyportal/TPdivider.png" style="margin-right: 5px; margin-left: 5px" />';

echo'
<div class="tp_userblock">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged']) {
echo '
<h4>', $txt['hello_member'], ' ', $context['user']['name'], '</h4>
';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '
' , $bullet , '<a href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">'.$txt['tp_unapproved_members'].' '. $context['unapproved_members']  . '</a>';

if(isset($context['TPortal']['userbox']['unread']))
echo '
' , $bullet , '<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=showcomments">'.$txt['tp-showcomments'].'</a><br>
';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
' , $bullet , $txt['tp_maintenace'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged'])) {
echo '
' , $bullet , $txt['tp-loggedintime'] , $context['user']['total_time_logged_in']['days'] . $txt['tp-acronymdays']. $context['user']['total_time_logged_in']['hours'] . $txt['tp-acronymhours']. $context['user']['total_time_logged_in']['minutes'] .$txt['tp-acronymminutes'];
}
echo '
' , $bullet , $context['current_time'] , '<br>';

// admin parts etc.
if(!isset($context['TPortal']['can_submit_article']))
$context['TPortal']['can_submit_article']=0;

// do not show if none is availalable
if($context['TPortal']['can_submit_article']==1 || allowedTo(array('tp_dlupload','tp_dlmanager','tp_settings','tp_articles','tp_blocks','tp_submithtml','tp_submitbbc'))) {
// can we submit an article?
if(!allowedTo('tp_articles')) {
if(allowedTo('tp_submithtml'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a>';
if(allowedTo('tp_submitbbc'))
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a>';
}
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager')) {
echo '
' , $bullet , '<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a>';
}

// tpadmin checks
if (allowedTo('tp_settings')) {
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a>';
}
if (allowedTo('tp_blocks')) {
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a>';
}
if (allowedTo('tp_articles')) {
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a>';

// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a>';
}
if (allowedTo('tp_dlmanager')) {
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';

// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '
' , $bullet , '<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a>';
}
}
}
// Otherwise they're a guest - so politely ask them to register or login.
else {
echo '
<div style="line-height: 1.4em;">', sprintf($txt[$context['can_register'] ? 'tp-welcome_guest_register' : 'tp-welcome_guest'], $context['forum_name_html_safe'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=signup'), '<br><br>', $context['current_time'], '</div>';
echo '
<form style="margin-top: 5px;" action="', $scripturl, '?action=login2" method="post" >
<input type="text" class="input_text" name="user" size="10" style="max-width: 45%!important;"/> <input type="password" class="input_password" name="passwrd" size="10" style="max-width: 45%!important;"/><br>
<select name="cookielength" style="max-width: 45%!important;">
<option value="-1" selected="selected">', $txt['forever'], '</option>
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="302400">', $txt['one_month'], '</option>
</select>
<input type="submit" class="button_submit" value="', $txt['login'], '" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">';
echo '
</form>
<div style="line-height: 1.4em;" class="middletext">', $txt['tp-quick_login_dec'], '</div><br>';
}
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo '<p>' , $context['user']['avatar']['image'] , '</p>';

echo '
</div>';


// STATS....

echo'
<div class="tp_statsblock">';

if(isset($context['TPortal']['userbox']['stats']))
// members stats
echo '
<h5 class="mlist"><a href="'.$scripturl.'?action=mlist">'.$txt['members'].'</a></h5>

' , $bullet , $txt['total_members'].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '
' , $bullet , $txt['tp-latest']. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><strong>', $modSettings['latestRealName'], '</strong></a>
';
if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>

' , $bullet , $txt['total_posts'].': '.$modSettings['totalMessages']. '
' , $bullet , $txt['total_topics'].': '.$modSettings['totalTopics']. '
' , $bullet , $txt['tp-mostonline-today'].': '.$modSettings['mostOnlineToday'].'
' , $bullet , $txt['tp-mostonline'].': '.$modSettings['mostOnline'].'
('.timeformat($modSettings['mostDate']).')';

if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt['online_users'].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $bullet , $txt['tp-users'].': '.$online['num_users']. '
' , $bullet , $txt['tp-guests'].': '.$online['guests'].'
' , $bullet , $txt['tp-total'].': '.$online['total_users'].'
<div style="max-height: 23em; overflow: auto;">';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' ';
}
echo '
</div></div>';
}
echo '
</div>';
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

Quote from: GhostRider2110 on June 20, 2024, 08:07:15 PMOld News block, each news item fades out into the next:  DOES NOT WORK WITH TP3

global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Show the news fader?  (assuming there are things to show...)
// if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<div style="height: 107px">';
// <div style="height: 85px; background: url('.$settings['images_url'].'/machine.jpg) repeat-x;">';

// Prepare all the javascript settings.
echo '
<div id="smfFadeScroller" style="text-align: center; width: 90%; padding: 2px;"><b>', $context['news_lines']
, '</b></div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 155, "g": 185, "b": 255}, smfFadeTo = {"r": 0, "g": 0, "b": 0};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";
var foreColor, backEl, backColor;
if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;
backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};
backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;
backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}
// List all the lines of the news for display.
var smfFadeContent = new Array(
"', implode('",
"', $context['fader_news_lines']), '"
);
// ]]></script><script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script></div>';
}


this code is calling a script that does not exist in SMF2.1

sorry: it's not TP3.0 that is the issue, it's SMF2.1...
Running Latest TP on SMF2.1 at: www.fjr-club.nl