SMFHacks.com

SMF Gallery Lite => SMF Gallery Lite => Topic started by: thetraveler359 on November 17, 2006, 09:27:56 am

Title: No link to main page of gallery
Post by: thetraveler359 on November 17, 2006, 09:27:56 am
Hi,
I just installed Forum version: SMF 1.0.9.  I installed the SMF Gallery Lite 1.6.5.  I can now access the Gallery configuration under Forum configuration, but how do I access the main gallery?  There is no link/button for it in the forums.  I just have

Home            Help       Search       Admin       Edit Profile              Calendar       Logout      

thank you!  Sorry for my noobie question.  It's probably something simple and dumb.  :)
Title: Re: No link to main page of gallery
Post by: SMFHacks on November 17, 2006, 09:55:29 am
The mod only installs the link/button on the defaul theme.

For custom themes you need to create a link or button for the gallery in the index.template.php of the theme you are using.

You can access the gallery via
http://www.yoursite.com/index.php?action=gallery
Title: Re: No link to main page of gallery
Post by: thetraveler359 on November 17, 2006, 10:23:31 am
Excellent!  Thank you, I had actually forgotten that I changed the theme!  Now I just need to figure out making the button.  :D
Title: Re: No link to main page of gallery
Post by: thetraveler359 on November 17, 2006, 12:58:54 pm
Can someone tell me what I'm doing wrong?  Still trying to get the button to show in the custom theme.  Here's what I have...


// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'ban', 'gallery', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'gallery', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
   echo '
         <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
            <tr>
               <td class="maintab_' , $first , '">&nbsp;</td>';

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

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

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

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
            </td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
            </td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // Show the [gallery] button.
   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['gallery'] , '</a>
            </td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
            
   // the [member] list button
   if ($context['allow_memberlist'])
      echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
            </td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
            </td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=join">' , $txt[97] , '</a>
            </td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
            </td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // The end of tab section.
   echo '
            <td class="maintab_' , $last , '">&nbsp;</td>
         </tr>
      </table>';

}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
   global $settings, $buttons, $context, $txt, $scripturl;

   // Create the buttons...
   foreach ($button_strip as $key => $value)
   {
      if (isset($value['test']) && empty($context[$value['test']]))
      {
         unset($button_strip[$key]);
         continue;
      }
      elseif (!isset($buttons[$key]) || $force_reset)
         $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

      $button_strip[$key] = $buttons[$key];
   }

   if (empty($button_strip))
      return '<td>&nbsp;</td>';

   echo '
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}

?>
Title: Re: No link to main page of gallery
Post by: bitterwatitress on December 29, 2008, 03:23:49 pm
I finally got the button working on the orange-lt theme (1.1.7 SMF). It's a great theme for a gallery. If anyone wants the code/directions please let me know.
Title: Re: No link to main page of gallery
Post by: sandymctyre on April 26, 2009, 07:28:40 am
The mod only installs the link/button on the defaul theme.

For custom themes you need to create a link or button for the gallery in the index.template.php of the theme you are using.

You can access the gallery via
http://www.yoursite.com/index.php?action=gallery
This looks like a great package, and I will likely upgrade to Pro to get the user galleries, but I cannot even access the gallery using the direct link.  Installed via packages, everything seemingly went fine.  Is the Pro version easier, ie will it install on alternate themes.  I am using Babylon.
http://www.thehigos.com/nightbull
Any ideas?  I would be happy to grant admin access if it would help.
Thanks,
John
Title: Re: No link to main page of gallery
Post by: SMFHacks on April 26, 2009, 10:02:41 am
Is it listed under installed packages? If so it probably is a permissions issue. Make sure all the SMF files and folders are writable in order for the package manager to make changes to the files and install the gallery.
Title: Re: No link to main page of gallery
Post by: sandymctyre on April 26, 2009, 07:50:11 pm
Thanks for the reply SMFHacks,
Yes, it shows up under installed packages, it also shows up under the configuration menu on my admin page, all of the folders have read/write/delete permission.  I just can't access it using the direct link.  Should I try switching to the default theme?  Or would upgrading to PRO help?
Thanks,
Title: Re: No link to main page of gallery
Post by: SMFHacks on April 26, 2009, 08:24:12 pm
You can try the default theme. It should have also added a Gallery Configuration link in the admin section of the forum as well.
But if you say that http://www.yourforum.com/index.php?action=gallery does not then it looks like the mod did not complete the install process.
Title: Re: No link to main page of gallery
Post by: sandymctyre on April 26, 2009, 09:06:14 pm
It is under the Configuration menu on the Admin page.  I just checked packages, and checked the file list.  It looks like it installed as "mgallery" not gallery.  Will this still work the same?  Or will there be broken links looking for "gallery"?
THanks,
Title: Re: No link to main page of gallery
Post by: SMFHacks on April 26, 2009, 09:23:27 pm
Ah mgallery is for the Media Gallery which is not SMF Gallery Lite which we support at this site.
Title: Re: No link to main page of gallery
Post by: sandymctyre on April 26, 2009, 10:00:32 pm
 :-[ Oops.  Just uninstalled, and purchased PRO version...wanted the user albums anyway.
Thanks,
Title: Re: No link to main page of gallery
Post by: SMFHacks on April 26, 2009, 10:01:52 pm
Awesome let me know if you need anything.