To put it into the userbox:
In TPortalBlocks.template.php
Find:
// Tportal userbox
function TPortal_userbox()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
echo'<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo $context['user']['avatar']['image'] . '<br />';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '<span class="normaltext">
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " 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 '<br />'.$bullet.'<a href="', $scripturl, '?action=regcenter">'.$txt['tp_unapproved_members'].'<b> '. $context['unapproved_members'] . '</b></a>';
if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
}
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';
echo '<br />'.$context['user']['total_time_logged_in']['days'] . 'd ';
echo $context['user']['total_time_logged_in']['hours'] . 'h ';
echo $context['user']['total_time_logged_in']['minutes'] .'m';
}
if(isset($context['TPortal']['userbox']['time'])){
echo '<br />'.$bullet. $context['current_time'];
}
// module links - do not show if none
if($context['TPortal']['show_download']=='1')
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet5.' <a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><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')))
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpoptions.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-tools'].'</b></p>';
// can we submit an article?
if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// tpadmin checks
if (allowedTo('tp_settings'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '<br />'.$bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}
echo '</div>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />
<form action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
// module links
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet2.'<a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
}
echo '<br /></td></tr></table>';
}
and replace with:
// Tportal userbox
function TPortal_userbox()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet3 = '<img src="'.$settings['images_url'].'/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet4 = '<img src="'.$settings['images_url'].'/tpgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$bullet5 = '<img src="'.$settings['images_url'].'/tpmodule2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
echo'<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';
echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';
if (!empty($context['user']['avatar']) && isset($context['TPortal']['userbox']['avatar']))
echo $context['user']['avatar']['image'] . '<br />';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '<span class="normaltext">
<SCRIPT LANGUAGE="JavaScript">
<!--Begin
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour > 18) display = "Evening";
else if (thehour >12) display = "Afternoon";
else display = "Morning";
var greeting = ("Good " + display + "!");
document.write(greeting);
// End -->
</script> <br> <b>', $context['user']['name'], '</b></span>';
// Only tell them about their messages if they can read their messages!
if ($context['allow_pm']){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=pm">' .$txt['tp-pm'].' ', $context['user']['messages'], '</a>';
if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " 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 '<br />'.$bullet.'<a href="', $scripturl, '?action=regcenter">'.$txt['tp_unapproved_members'].'<b> '. $context['unapproved_members'] . '</b></a>';
if(isset($context['TPortal']['userbox']['unread'])){
echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=unreadreplies">'.$txt['tp-replies'].'</a>
<br />'.$bullet.'<a href="', $scripturl, '?action=profile;u='.$context['user']['id'].';sa=showPosts">'.$txt['tp-showownposts'].'</a>';
}
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br /><b>' .$bullet.$txt['tp_maintenace']. '</b>';
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']) && isset($context['TPortal']['userbox']['logged']))
{
echo '<br />'.$bullet.$txt['tp-loggedintime'] . ' ';
echo '<br />'.$context['user']['total_time_logged_in']['days'] . 'd ';
echo $context['user']['total_time_logged_in']['hours'] . 'h ';
echo $context['user']['total_time_logged_in']['minutes'] .'m';
}
if(isset($context['TPortal']['userbox']['time'])){
echo '<br />'.$bullet. $context['current_time'];
}
// module links - do not show if none
if($context['TPortal']['show_download']=='1')
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet5.' <a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><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')))
{
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpoptions.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-tools'].'</b></p>';
// can we submit an article?
if($context['TPortal']['can_submit_article']==1 && !allowedTo('tp_articles'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
// upload a file?
if(allowedTo('tp_dlupload') || allowedTo('tp_dlmanager'))
echo $bullet4.'<a href="', $scripturl, '?action=tpmod;dl=upload">' . $txt['permissionname_tp_dlupload']. '</a><br />';
// tpadmin checks
if (allowedTo('tp_settings'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=settings">' . $txt['permissionname_tp_settings'] . '</a><br />';
if (allowedTo('tp_blocks'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=blocks">' . $txt['permissionname_tp_blocks'] . '</a><br />';
if (allowedTo('tp_articles'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpadmin;sa=articles">' . $txt['permissionname_tp_articles'] . '</a><br />';
// any submissions?
if($context['TPortal']['submitcheck']['articles']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpadmin;sa=submission"><b>' . $context['TPortal']['submitcheck']['articles'] . ' ' .$txt['tp-articlessubmitted'] . '</b></a><br />';
}
if (allowedTo('tp_dlmanager'))
{
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;dl=admin">' . $txt['permissionname_tp_dlmanager'] . '</a>';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo '<br />'.$bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
}
echo '</div>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />
<form action="', $scripturl, '?action=login2" method="post" >
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
// module links
echo '<hr /><p style="margin: 4px 0 5px 0;"><img src="'.$settings['images_url'].'/tpmodule.gif" style="margin: 0;" align="absbottom" alt="" />
<b>'.$txt['tp-admin4'].'</b></p>';
if($context['TPortal']['show_download']=='1')
echo $bullet2.'<a href="'.$scripturl.'?action=tpmod;dl=0">'.$txt['tp-dldownloads'].'</a><br />';
}
echo '<br /></td></tr></table>';
}
This will add the greeting to the user box for TP (extra bonus! this also includes the birthday greeting mod so if it is a members birthday it will greet them with a special message!) Edit: was part of a modification that included edits to other files as well so i removed it from the above code