News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PDX-DK

Started by padexx, July 18, 2006, 06:59:04 PM

Previous topic - Next topic

PLAYBOY

I added many custom tabs the way you said but it doesnt work well because the little arrow on top of the tab which shows your current page doesnt follow the custom tabs.

For example i created a custom tab for portal and gallery but when i am in the gallery the tab arrow shows that i am still in the forum.

How can i make the arrow to follow the custom tabs?

1.1.12

PLAYBOY

Is there any pdx expert out there to help us with our simple questions? because i dont think the coder of the mod supports the help requests anymore.

padexx

Hi PLAYBOY,

not sure what you've done so far but here is what you need to do to get a "current tab" using mods:
look at the (install) xml of the mod to see what needs to be added to the index.template.php menu. There should be two things: the tab and the "work out where we currently are" code.

As this theme differs from the default theme you need to add this code by hand.

First find the "work out where we currently are" code and see what needs to be added to the template. In the index.template.php this code is below
// Work out where we currently are.
Most of the times you just need to add the "mod" to one of the lines. Some mods require you to add another if condition.

Secondly you need to add the tab. Use the Help tab code as base and change its txt and its action and current-action parameters (to the one you added above)

That's it

PLAYBOY

Thank you. can you also look at this one? This is a major issue for me.

QuoteI have 11 tabs total on top of the page for a regular member and 13 tabs for admin. Its not able to show all the tabs on iphone and other small screens. Is there a solution for this?

padexx

I am currently not able to test this, sorry
Quote from: PLAYBOY on December 23, 2010, 10:12:54 AM
Thank you. can you also look at this one? This is a major issue for me.

QuoteI have 11 tabs total on top of the page for a regular member and 13 tabs for admin. Its not able to show all the tabs on iphone and other small screens. Is there a solution for this?

I am currently not able to test this, sorry

PLAYBOY

#185
I have edited and added the gallery mod tab as below to index.template.php but it still doesnt show the little arrow on the top when i view the gallery

// Aeva Media
// Recalculate number of unseen items
global $user_info;

if (!empty($user_info['aeva_unseen']) && $user_info['aeva_unseen'] == -1)
{
global $sourcedir;
require_once($sourcedir . '/Aeva-Subs.php');
aeva_loadSettings();
}

$aeva_unseen = !allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? 0 : $user_info['aeva_unseen'];

if (allowedTo('aeva_access'))
echo ($current_action == 'media' || $context['browser']['is_ie4']) ? '<div class="maintab_active_' . $first . '">&nbsp;</div>' : '', '
<div valign="top" class="maintab_', $current_action == 'media' ? 'active_back' : 'back', '">
<a href="', $scripturl, '?action=media">', isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media', $aeva_unseen ? '</a> <a href="' . $scripturl . '?action=media;sa=unseen">[<b>' . $aeva_unseen . '</b>]' : '', '</a>
</div>', $current_action == 'media' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


It shows the arrow on search button. It doesnt show any arrow on any of the tabs when i go to chess section.




Problem 2-

i cant see the tiled background images behind the moderation (and new album) tabs in my gallery
It shows as broken image link. When i switch to default theme and look at the page source. its trying to load "maintab_active_back.gif" and other maintab images. So i copy that image into my themes images directory but it doesnt load it. Because it tried to load /themes/pdx-dx/images/ folder not the file. Its wierd.

padexx

Regarding the tab:

You've still forgot to alter the code below
// Work out where we currently are.

I don't want to be rude but I just went to the download page of the mod and there is a Manual Install Instructions for SMF!
It is all there. Select your smf version, go to the index.template.php part of the instructions and look what needs to be done.
To be sure everything else went fine during install you could also check the rest of the code given (especially if there are other theme files which need to be taken care of).

PLAYBOY

Problem 1-

I have been working on it the last like 5 hours.
I donno what am i doing wrong here but here is the entire  code of tab section.

// 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')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Begin SMFChess code
if ($context['current_action'] == 'chess')
$current_action = 'chess';
// End SMFChess code

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Start of the tab section.
echo ' <div class="seperator"><!--no content--></div>';
// Show the [home] button.
if (!empty($settings['pdx_forum_button']))
echo '
<div class="maintab_back">
<a href="', $settings['pdx_forum_button'], '">' , $txt[103] , '</a>
</div>
<div class="seperator"><!--no content--></div>';

if (!empty($settings['pdx_forum_button']))
{

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">Portal</a>
</div>' , $current_action == 'home' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';
}
else
{

// Show the [forum] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</div>' , $current_action == 'home' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

}

// Custom Pano Button
echo '
      <div class="maintab_back">
      <a href="http://www.site.com/folder/index.php">an external link</a>
      </div>
   <div class="seperator"><!--no content--></div>';

// Custom Forum Button
echo '
      <div class="maintab_back">
      <a href="http://www.site.com/forum/index.php?action=forum">Forum</a>
      </div>
   <div class="seperator"><!--no content--></div>';

// Aeva Media
// Recalculate number of unseen items
global $user_info;

if (!empty($user_info['aeva_unseen']) && $user_info['aeva_unseen'] == -1)
{
global $sourcedir;
require_once($sourcedir . '/Aeva-Subs.php');
aeva_loadSettings();
}

$aeva_unseen = !allowedTo('aeva_access_unseen') || empty($user_info['aeva_unseen']) || $user_info['aeva_unseen'] == -1 ? 0 : $user_info['aeva_unseen'];

if (allowedTo('aeva_access'))
echo '
<div class="maintab_back">
      <a href="', $scripturl, '?action=media">', isset($txt['aeva_gallery']) ? $txt['aeva_gallery'] : 'Media', $aeva_unseen ? '</a> <a href="' . $scripturl . '?action=media;sa=unseen">[<b>' . $aeva_unseen . '</b>]' : '', '</a>
      </div>
   <div class="seperator"><!--no content--></div>';


// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</div>' , $current_action == 'search' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</div>' , $current_action == 'admin' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</div>' , $current_action == 'profile' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</div>' , $current_action == 'pm' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</div>' , $current_action == 'calendar' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Chess [Chess]
echo '
<div class="maintab_back">
<a href="http://www.site.com/forum/index.php?action=chess">Chess</a>
</div>
<div class="seperator"><!--no content--></div>';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</div>' , $current_action == 'mlist' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


// If the user is a guest, show [login] button.

// Invite MOD.
if (allowedTo('invite'))
echo '
<div class="maintab_back">
<a href="http://www.site.com/forum/index.php?action=invite">Invite</a>
</div>
<div class="seperator"><!--no content--></div>';


if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</div>' , $current_action == 'login' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</div>' , $current_action == 'register' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</div>' , $current_action == 'help' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</div>' , $current_action == 'logout' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';

// The end of tab section.


All i want is to have those little arrows on each tab when you enter that tab.
I added the gallery as you said but its still the same.
I got the same problem with chess and portal tabs also.




Problem 2-

i cant see the tiled background images behind the moderation (and new album) tabs in my gallery
It shows as broken image link. When i switch to default theme and look at the page source. its trying to load "maintab_active_back.gif" and other maintab images. So i copy that image into my themes images directory but it doesnt load it. Because it tried to load /themes/pdx-dx/images/ folder not the file. Its wierd.




Problem 3-
I have 11 tabs total on top of the page for a regular member and 13 tabs for admin. Its not able to show all the tabs on iphone and other small screens. Is there a solution for this?




Can anybody help me about these problems please?
I am having a lot of trouble.

PLAYBOY

How can i change UP and DOWN writings with /theme/images/go_down.gif and go_up.gif buttons?

PLAYBOY

Will there be a version for 2.0?

ukhalik2

problems with 2.0 RC5 :(
Links wont come like home, profile, etc

Advertisement: