Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43261
Total Topics: 7519
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 2
Guests: 283
Total: 285

Author Topic: help with Gallery link in custom theme  (Read 20901 times)

0 Members and 1 Guest are viewing this topic.

Offline jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
help with Gallery link in custom theme
« on: May 20, 2007, 11:09:35 am »
I have installed Gallery Lite for my SMF driven forum and I now need to modify the index.php to provide a button/link for Gallery on the main forum menu of the English Steel custom theme I use.

The help with "Custom Themes" section did not detail how to do this. I am not sure I am capable of editing the index.php properly and I don't want to mess anything else up. There must be an imbedded script that did put a Gallery button on the standard SMF theme (it was there on my forum when switching to the standard theme). Would it be possible to have such a script that provided for changing the index.php on a custom theme? That is something I might be able to handle.

I look forward to solving this so that I can evaluate the Gallery mod and then purchase Gallery Pro.

Regards,  Jeff Wexler

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #1 on: May 20, 2007, 07:23:50 pm »
Attach the index.template.php of the theme you are using.
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 jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #2 on: May 20, 2007, 09:30:53 pm »
attached is the index.php for English Steel theme I am using

-  JW

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #3 on: May 20, 2007, 10:09:35 pm »
Here is the index.template.php code for the menu function replace with this code  to add the gallery button
Code: [Select]
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', '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('gallery','search', 'admin', 'calendar', '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>' : '';


// the [SMF 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['smfgallery_menu']  , '</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>';

}
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 jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #4 on: May 20, 2007, 10:41:40 pm »
thank you for posting the code to use to replace the code in the index.template.php but I cannot figure out how to cut and paste this (and I m sure I am not supposed to transcribe all of this manually).

please advise

-  JW

Offline jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #5 on: May 20, 2007, 10:43:56 pm »
wouldn't it be possible for you to just email me the proper index.template.php file and then I could replace the existing file?

-  JW


Offline jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #6 on: May 21, 2007, 03:51:56 pm »
I am still trying to sort this out and while looking at the regular SMF support forums several other people are having the same problem: installed Gallery Lite (or Pro) and cannot get it to work with any theme other than the standard SMF theme. It would be nice if the install (which went perfectly) would support putting the menu button link into ANY theme. I am not able to edit the index.template.php myself so I guess I am out of luck. Too bad because I have heard good things about Gallery Lite and Gallery Pro and I was looking forward to incorporating this into my forum.

I will include the index.template.php again here in the hopes that someone could edit/modify it and re-post it so that I could just replace the old index with the new, hopefully creating the link which makes using Gallery possible.

-  Jeff Wexler

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #7 on: May 21, 2007, 06:38:39 pm »
I included the code in the previous post. Mods only install on the default theme that might be changed in SMF 2.0
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 jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #8 on: May 22, 2007, 06:34:42 pm »
I included the code in the previous post. Mods only install on the default theme that might be changed in SMF 2.0

I understand that the Gallery mod only installs for the default theme. I don't want to wait for SMF 2.0. I appreciate you posting the edited code for index.template.php but I still do not know how to USE the code. It appears in its own window on this forum in html with a gray background and seems to be impossible to cut and paste into a text editor to make use of it. Could you just attach the edited index.template.php file itself then I could use it (or email it directly to me:  <jwsound@gmail.com>  or <jw@jwsound.net>

Thanks.

-  JW
« Last Edit: May 22, 2007, 08:40:38 pm by jwsound »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #9 on: May 22, 2007, 10:49:51 pm »
File uploaded to
http://www.smfhacks.com/index.template.zip

Unzip the file upload it to your custom theme's folder.
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 jwsound

  • Member
  • *
  • Posts: 7
    • View Profile
Re: help with Gallery link in custom theme
« Reply #10 on: May 23, 2007, 10:44:08 am »
File uploaded to
http://www.smfhacks.com/index.template.zip
Unzip the file upload it to your custom theme's folder.

Thank you, thank you, thank you !!! This worked PERFECTLY. I really appreciate your help. There is now a Gallery link button sitting perfectly in the main menu and we can all start using Gallery in my forum.

Regards,  Jeff Wexler

Offline j3cubcapt

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: help with Gallery link in custom theme
« Reply #11 on: September 27, 2007, 09:33:54 am »
May I please ask for help with the code on my Slickpro theme? I have a number of mods including "Custom Fields" and "SMFAds" and I don't want to mess up anything.

Thanks
Will
« Last Edit: September 27, 2007, 09:35:42 am by j3cubcapt »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #12 on: September 27, 2007, 11:05:48 am »
File attached
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 j3cubcapt

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: help with Gallery link in custom theme
« Reply #13 on: September 27, 2007, 11:21:52 am »
SMFHacks, Thanks so much for your fast response. What file needs to be updated to show the link in the profile shown in a posting? May I please ask for help with that too?

Will
Dallas
« Last Edit: September 27, 2007, 11:25:15 am by j3cubcapt »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: help with Gallery link in custom theme
« Reply #14 on: September 27, 2007, 11:53:45 am »
If you mean under this it would be in Display.template.php
"
j3cubcapt
SMF Gallery Pro Customer
Newbie
*****
Online Online

Posts: 12"
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/

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
7085 Views
Last post September 14, 2006, 01:20:31 pm
by SMFHacks
1 Replies
4129 Views
Last post February 24, 2007, 08:28:22 pm
by SMFHacks
3 Replies
5610 Views
Last post June 28, 2007, 09:36:48 pm
by SMFHacks
1 Replies
3329 Views
Last post July 05, 2007, 08:14:49 am
by SMFHacks
5 Replies
8346 Views
Last post January 19, 2008, 09:35:38 am
by madeupmedia

+- Recent Topics

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
Today at 08:27:36 am

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Powered by EzPortal