TinyPortal

Development => Support => Topic started by: vinduf on January 14, 2009, 07:30:10 AM

Title: [Solved] With adding button
Post by: vinduf on January 14, 2009, 07:30:10 AM
I have searched..and tried a lot of things still no success so im begging for someone to help me  :-\

I want to replace the and help and search buttons with gallery and downloads respectively but only the links are changing  the name of the button stays the same as Help and Search

Here is my code for both buttons :
Quote
   if (in_array($context['current_action'], array('download', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'gallery', 'pm', 'forum', 'tpadmin')))
      $current_action = $context['current_action'];

   // Show the [gallery] button.
   echo '
         <td class="mainnav"><a href="', $scripturl, '?action=gallery">' , $txt[119] , '</a></td>';

   // How about the [download] button?
   if ($context['allow_search'])
      echo '
            <td class="mainnav"><a href="', $scripturl, '?action=tpmod;dl">' , $txt[182] , '</a></td>';

Please help im a noob with php  :(
Thanks a lot!! in return
Title: Re: [Help] With adding button
Post by: G6Cad on January 14, 2009, 07:37:26 AM
What theme ?
What gallery ?
Did you search your default themes gallery button to see what txt it holds ?
Downloads doesent hold a txt called downloads so remove this part ' , $txt[182] , ' abd typ Downloads there instead
Title: Re: [Help] With adding button
Post by: vinduf on January 14, 2009, 07:40:01 AM
Theme is IronWoW_tp90
SMF Gallery Lite
Title: Re: [Help] With adding button
Post by: G6Cad on January 14, 2009, 07:42:57 AM
Did you check what i asked ?  you have the button info for the gallery in the default core themes index.template.php file
Title: Re: [Help] With adding button
Post by: vinduf on January 14, 2009, 07:58:32 AM
I copied it from default theme file but this is how it looks

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fsldotaportal.co.cc%2Fbutton.jpg&hash=ad624dd012824a62fb20ee7b6c739f928a9570ed)

Code:
Quote
   // the [SMF Gallery] button
   if ($context['allow_smfgallery_view'])
      echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="mainnav_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="mainnav_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu']  , '</a>
            </td>' , $current_action == 'gallery' ? '<td class="mainnav_active_' . $last . '">&nbsp;</td>' : '';

Title: Re: [Help] With adding button
Post by: G6Cad on January 14, 2009, 08:03:53 AM
Copy the calendar button from the theme and change the txt to $txt['smfgallery_menu'] and all actions to gallery
Title: Re: [Help] With adding button
Post by: vinduf on January 14, 2009, 08:07:21 AM
theme meaning the default theme or IronWoW theme?
btw the IronWoW theme has no calender button
Title: Re: [Help] With adding button
Post by: vinduf on January 14, 2009, 08:29:31 AM
Thanks got it fixed!! Yipee  :D :D :D ;D ;D
Title: Re: [Solved] With adding button
Post by: mcardo99 on April 22, 2009, 10:45:42 PM
This post shows a great lack of dialog and communiction. One person asks a question, the next one replies with a suggestion and the original poster keeps posting with no answer to the second person's suggestions... seems like this post was not of help for him or he decided not to post how he got it to work.

The button does not work for me after copying the calendar line and replacing all actions to "gallery", the [allow_smfgallery_view] and the $txt to "gallery_menu"

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

......


// The [gallery]!
      if ($context['allow_smfgallery_view'])
      echo '<li><a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu'] , '</a></li>';
Title: Re: [Solved] With adding button
Post by: Ken. on April 22, 2009, 11:24:54 PM
mcardo99, the best way to get help with your issue is to start your own topic.  :)

Be sure to follow the posting guidelines so that we may know how to help.
Please read the Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581)
Title: Re: [Solved] With adding button
Post by: G6Cad on April 23, 2009, 07:44:09 AM
Strange way to get free support on a site... First wave the bat on the people giving support, then hijack a topic that really old, and then ask for help !!

Good luck with that.
I will just ask you to use the search and read the replies you find, there are several of them with the correct answers. You can "waste" your own time on your question just because you came with a non wanted attitude..... and because you didnt follow our posting guide we have