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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:00:46 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 143
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 92
  • Total: 92

[Upgraded to 1.0 Beta 4] Download button disappeared

Started by smartmouse, January 24, 2010, 08:51:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smartmouse

After the upgrade to TP v1.0 Beta 4 the "Download" button does not appear anymore. What could be the problem?

In index.template.php of my template (Black14K by Crip) i have this code:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];

if ($context['current_action'] == 'globalAnnouncementsAdmin')
$current_action = 'admin';

if ($context['current_action'] == 'search2')
$current_action = 'search';
if (isset($_GET['dl']))
$current_action = 'dlmanager';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 0px;">
<tr><td class="post-buttons">';
if($context['TPortal']['leftbar'])
echo '<a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 0px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
// Show the [home] button.
  echo '&nbsp;<a href="', $scripturl, '">' , $txt[103] , '</a> &nbsp; &nbsp; &nbsp;';
  if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo '<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a> &nbsp; &nbsp; &nbsp;';

// Show the [download] button.
echo '<a href="', $scripturl, '?action=tpmod;dl">'.$txt['tp-download'].'</a> &nbsp; &nbsp; &nbsp;';

// How about the [search] button?
if ($context['allow_search'])
echo '<a href="', $scripturl, '?action=search">' , $txt[182] , '</a> &nbsp; &nbsp; &nbsp;';
// Show the [help] button.
echo '<a href="', $scripturl, '?action=help">' , $txt[119] , '</a> &nbsp; &nbsp; &nbsp;';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a> &nbsp; &nbsp; &nbsp;';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a> &nbsp; &nbsp; &nbsp;';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a> &nbsp; &nbsp; &nbsp;';
// The [calendar]!
if ($context['allow_calendar'])
echo '<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a> &nbsp; &nbsp; &nbsp;';
// the [member] list button
if ($context['allow_memberlist'])
echo '<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a> &nbsp; &nbsp; &nbsp;';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<a href="', $scripturl, '?action=login">' , $txt[34] , '</a> &nbsp; &nbsp; &nbsp;';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<a href="', $scripturl, '?action=register">' , $txt[97] , '</a> &nbsp; &nbsp; &nbsp;';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a> &nbsp; &nbsp; &nbsp;';
if($context['TPortal']['rightbar'])
echo '<a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 0px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
  echo '</tr></td></table>';
}


It appears only if i go to Download section! Why?

IchBin

Probably because '.$txt['tp-download'].' does not exist unless you are in the download section. Change that part to just say downloads and see if it does.

   echo '<a href="', $scripturl, '?action=tpmod;dl">Download</a> &nbsp; &nbsp; &nbsp;';

smartmouse

It worked ;)

But what's happened? It worked with old versione, why after upgrade it stops to work?

IchBin

Because has moved the downloads manager to be a module. Which means he has moved code out of some files and into other files. So that piece of code is just not loaded on other pages anymore.