Gallery Button Code For DARKBREAK

Started by themekings, September 23, 2008, 10:57:19 PM

Previous topic - Next topic

themekings

What an awesome theme. (Darkbreak) I've add the SMF Gallery Lite mod to this theme and looking to add the gallery button code. I'm presently using this code:

// Show the [gallery] button.
                  echo '    <li><a href="', $scripturl, '?action=gallery">' , $txt[smfgallery_menu] , '</a></li>
               <li class="mainnavDivider"><!-- /--></li>';[/s]


Although the link appears in the menu, on "roll over" a portion of the button disappears. Any better thoughts on a better code for this theme.

This is located at: http://custom.simplemachines.org/themes/index.php?lemma=486

FYI, I browsed support under the theme comments, but nothing in regard to the correct button for a gallery.

Thx in advance!

cme1st2302

See if this one works:

// How about the [gallery] button?
echo '<li><a' , $current_action=='gallery' ? ' class="current"' : '' , ' href="', $scripturl, '?action=gallery"><span>' , "Gallery" , '</span></a></li>';


then find this above the buttons

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];


and add gallery to the array like this

if (in_array($context['current_action'], array('gallery', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];


Let me know if this works for ya.

Chris
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

themekings

You da man! Thx Chris! It worked perfectly. I'll copy and paste your responce in the DARKBREAK area for others to read too. I'm sure other will use it. Thx again!

cme1st2302

Glad it worked!!  When trying to make a button for a theme it is important to keep the code similar to the other buttons.  That way you can compare. 

On another note, if you wanted that to be viewable only to people logged in just add this before the echo.

if ($context['user']['is_logged'])

so it would look like this

// How about the [gallery] button?
            if ($context['user']['is_logged'])
                  echo '<li><a' , $current_action=='gallery' ? ' class="current"' : '' , ' href="', $scripturl, '?action=gallery"><span>' , "Gallery" , '</span></a></li>';


SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

themekings

Thx buddy!

I copied the "Search" button lines of code on the index.template.php and paste it below that an changed the Search info with the gallery info as well as including the gallery link in the link tree but that didnt work so I copied an entirely different code from another one of my forums and it gave me the button, with that one flaw.

Your code however worked perfectly. I appreciate you taking the time to help me. TY!

cme1st2302

Not a problem, buttons are sort of my specialty ;D
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

themekings

Would it be that simple to place a link back to my main site from the forum also in the link tree?

Say name the button "Home" and use demosite.com as the main site home/index page

cme1st2302

Sure do it like this

// How about the [home] button?
               echo '<li><a href="site link"><span>' , "Home" , '</span></a></li>';


The theme has a home button now so just change the wording where it says $txt[103] to "Forum" (with quotes) like below

// Show the [home] button.
echo '<li><a' , $current_action=='home' ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , "Forum" , '</span></a></li>';
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

themekings

EXCELLENT!

Works perfect. You have been a great help. Do you have a site I can place in my affilates links area of my site to show my appreciation?

www.themekings.com

cme1st2302

Sure do and thanks, I have two:

www.sjaaaa.com
www.eastcoastastro.com
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

themekings


Advertisement: