TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 577
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 398
  • Total: 398

[Solved] With adding button

Started by vinduf, January 14, 2009, 07:30:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vinduf

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

G6Cad

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

vinduf

Theme is IronWoW_tp90
SMF Gallery Lite

G6Cad

Did you check what i asked ?  you have the button info for the gallery in the default core themes index.template.php file

vinduf

#4
I copied it from default theme file but this is how it looks



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>' : '';


G6Cad

Copy the calendar button from the theme and change the txt to $txt['smfgallery_menu'] and all actions to gallery

vinduf

theme meaning the default theme or IronWoW theme?
btw the IronWoW theme has no calender button

vinduf


mcardo99

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>';

Ken.

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
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

This website is proudly hosted on Crocweb Cloud Website Hosting.