Uutiset:

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

Main Menu
Advertisement:

buttons

Aloittaja trionic, kesäkuu 08, 2011, 01:58:39 AP

« edellinen - seuraava »

trionic

hey, im new to smf, i have smart portal and SMF shop installed, but when i install a new theme, the buttons disappear, buttons as in the bar with home, your account, downloads and all that, i cant seem to figure out how to get them back on, please help.

mashby

Custom themes on SMF 1.1.x require edits to index.template.php to get those menu items to appear. And each custom theme draws the menu a little differently. Have a look at the index.template.php file for the default Core theme. You should see those menu items in there. For a custom theme, it's a matter of copying an existing button in that theme and modifying it to fit the required elements to make said menu item appear. Which theme are you running?
Always be a little kinder than necessary.
- James M. Barrie

trionic


mashby

OK, so as an example, SMF Shop mod does this to index.template.php for the default theme:
Find:

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

Add after:

// Begin SMFShop code
if ($context['current_action'] == 'shop')
$current_action = 'shop';
if (in_array($context['current_action'], array('shop_general', 'shop_items_add', 'shop_items_edit', 'shop_cat', 'shop_inventory', 'shop_restock', 'shop_usergroup')))
$current_action = 'admin';
// End SMFShop code

That you can replicate to Black Rain as is. Here is the second edit to the default theme:
Find:

<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Add after:

//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END SMFShop code

Now you certainly cannot follow that verbatim, but you can alter it to match the menu pattern of black rain, so insert this:
//Begin SMFShop code
//loadLanguage("shop");
echo '<li', $current_action == 'shop' ? ' id="active"' : '', '><a href="', $scripturl, '?action=shop"><span>Shop</span></a></li>';
//END SMFShop code

That will make the Shop menu item appear for black rain. Give it a whirl and let us know how it turns out.
Always be a little kinder than necessary.
- James M. Barrie

Advertisement: