Which file should I be looking at to mod the User block? I'm using an older Joomla theme (RocketTheme "Versatility" modified by Bloc for SMF) so I already have the "Welcome XXXX", number of PMs, unread posts, etc at the top. All I want displayed in the user block on the left hand side is the user permissions for submitting atricles and uploading files. Any help on where to start would be greatly appreciated. Thanks.
Bruce
TPortalBlocks.template.php file in the default themes folder is where the user block is. If you search for TPortal_user you should find the block easily.
Thanks IchBin!
Before you go and do that, why don't you see if this code will do what you want. Put it in a php block
$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
'<p>';
// 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_linkmanager','tp_teampage','tp_gallery')))
{
echo '<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><br />';
// any submissions?
if($context['TPortal']['submitcheck']['uploads']>0)
echo $bullet4.$bullet3.'<a href="' . $scripturl . '?action=tpmod;dl=adminsubmission"><b>' . $context['TPortal']['submitcheck']['uploads'] . ' ' .$txt['tp-dluploaded'] . '</b></a><br />';
}
/*
if (allowedTo('tp_gallery'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;show=admin">' . $txt['permissionname_tp_gallery'] . '</a><br />';
if (allowedTo('tp_teampage'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;team=admin">' . $txt['permissionname_tp_teampage'] . '</a><br />';
if (allowedTo('tp_linkmanager'))
echo $bullet4.'<a href="' . $scripturl . '?action=tpmod;link=admin">' . $txt['permissionname_tp_linkmanager'] . '</a><br />';
*/
}
ZarPrime
You guys are outstanding. It looks like I can revert back to original TPblocks.template.php file. Thanks for the help. I might have even learned something... :uglystupid2:
Bruce
Fantastic. It's always good news when somebody learns something. ;D :up:
ZarPrime
I added a couple of lines so the "Submit HTML Article" and "Submit BBC Article" would show up:
if(allowedTo('tp_submithtml'))
echo $bullet.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle">' . $txt['tp-submitarticle']. '</a><br />';
if(allowedTo('tp_submitbbc'))
echo $bullet.'<a href="', $scripturl, '?action=tpmod;sa=submitarticle;bbc">' . $txt['tp-submitarticlebbc']. '</a><br />';
Thanks again for the help.
The other thing you can do if you want, is copy the file to your custom theme and edit it. This way, the default theme and the default install of TP is untouched as well. Just another way of doing it.