Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4215
Latest: Proxitane
New This Month: 6
New This Week: 1
New Today: 1
Stats
Total Posts: 42796
Total Topics: 7456
Most Online Today: 34
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 45
Total: 45

Author Topic: Theme Author's How to Support SMFHacks.com Mods  (Read 11910 times)

0 Members and 1 Guest are viewing this topic.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16235
    • View Profile
Theme Author's How to Support SMFHacks.com Mods
« on: December 27, 2006, 02:55:28 pm »
Examples for SMF 1.1.1 themes using tabs

Using these codes will allow your theme to support my major mods and save yourself and users some trouble from editing themes.

First find
Code: [Select]
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
Replace with
Code: [Select]
if (in_array($context['current_action'], array('gallery','links','articles','staff', 'tag', 'contact', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))

Add these codes to your themes menu function you might have to adjust the code a little to work with your theme.
Code: [Select]
// the [SMF Gallery] button
if (isset($txt['smfgallery_menu']))
{
if ($context['allow_smfgallery_view'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu']  , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}

// the [Articles] button
if (isset($txt['smfarticles_menu']))
{
if ($context['allow_view_smfarticles'])
echo ($current_action == 'articles' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'articles' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=articles">' , $txt['smfarticles_menu']  , '</a>
</td>' , $current_action == 'articles' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}

// the [tags] button
if (isset($txt['smftags_menu']))
{
echo ($current_action == 'tags' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tags' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tags">' , $txt['smftags_menu']  , '</a>
</td>' , $current_action == 'tags' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}

// the [links] button
if (isset($txt['smflinks_menu']))
{
if ($context['allow_view_smflinks'])
echo ($current_action == 'links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'links' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=links">' , $txt['smflinks_menu']  , '</a>
</td>' , $current_action == 'links' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}


// the [staff list] button
if (isset($txt['smfstaff_stafflist']))
{
if ($context['allow_view_stafflist'])
echo ($current_action == 'staff' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'staff' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=staff">' , $txt['smfstaff_stafflist']  , '</a>
</td>' , $current_action == 'staff' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}

// the [contact] button
if (isset($txt['smfcontact_contact']))
{
if ($context['allow_view_contact'])
echo ($current_action == 'contact' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'contact' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=contact">' , $txt['smfcontact_contact']  , '</a>
</td>' , $current_action == 'contact' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
}
« Last Edit: December 27, 2006, 03:00:34 pm by SMFHacks »
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline ©RebelRose

  • Member
  • *
  • Posts: 18
    • View Profile
    • RebelRose Networks
Re: Theme Author's How to Support SMFHacks.com Mods
« Reply #1 on: March 04, 2007, 12:30:44 am »
I have been adding this to my themes, I would like to point out to new designers or people who are going to modify themes, to recheck the code for the menu links, not all themes use the same images, you may need to tweak it a bit.  ;)

Offline Bec

  • Member
  • *
  • Posts: 30
    • View Profile
Re: Theme Author's How to Support SMFHacks.com Mods
« Reply #2 on: January 27, 2008, 02:46:14 pm »
"you might have to adjust the code a little to work with your theme. "

How do i go about doing this???

Brides United - Online Wedding Planning
http://www.bu-community.com/

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
5520 Views
Last post April 19, 2007, 01:06:10 am
by Nigerdream
0 Replies
3507 Views
Last post March 12, 2012, 07:57:21 pm
by HostFat
5 Replies
5225 Views
Last post November 25, 2016, 09:44:10 pm
by Ogletree
3 Replies
2415 Views
Last post June 23, 2017, 09:16:48 am
by Vincent Volmer
1 Replies
290 Views
Last post October 18, 2022, 01:36:35 pm
by SMFHacks

+- Recent Topics

Using SMF's Built-in Search Algorithm by shuban
March 27, 2023, 09:15:10 am

Permissions query by davejo
March 26, 2023, 04:43:48 am

prettyurls - TroubleShooting.wiki by SMFHacks
March 25, 2023, 01:49:35 pm

Download Gallery Option by SMFHacks
March 23, 2023, 09:34:02 am

Lost attachments by pete
March 22, 2023, 10:24:17 am

Additional Permissions by mickjav
March 18, 2023, 05:21:23 am

[Mod]Discord Web Hooks by SMFHacks
March 17, 2023, 08:48:30 am

Site upgrade to 2.1 by SMFHacks
March 12, 2023, 08:51:19 am

Theme/CSS design wanted by mickjav
March 11, 2023, 12:10:11 pm

Category Images by Anmer
March 10, 2023, 06:20:04 am

Powered by EzPortal