News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Gallery

Started by SMFHacks.com Team, September 16, 2006, 07:13:02 PM

Previous topic - Next topic

Matthew Schenker

I just uninstalled this modification from my forum.  However, it's leaving a space between the "Server Settings" and "Current Theme"  options in the Configuration menu.

Can someone tell me how to fix this?

I attached a screen shot to show you what I'm talking about.

Thanks!

TrueSatan

Matthew,

In Sources/Subs.php look for:

'edit_settings' => '<a href="' . $scripturl . '?action=serversettings;sesc=' . $sc . '">' . $txt[222] . '</a>',
'edit_theme_settings' => '<a href="' . $scripturl . '?action=theme;sa=settings;th=' . $settings['theme_id'] . ';sesc=' . $sc . '">' . $txt['theme_current_settings'] . '</a>',


The above is what you should have but I expect that you have an extra </a> in there.

Matthew Schenker

TrueSatan,
Thank you for your help!  Yes, that was the trouble.

Here's what my code for that spot looked like:
'edit_settings' => '<a href="' . $scripturl . '?action=serversettings;sesc=' . $sc . '">' . $txt[222] . '</a>',
'gallery_settings' => '<a href="' . $scripturl . '?action=gallery;sa=adminset;sesc=' . $sc . '">' . $txt['smfgallery_admin'] . '</a>',

'edit_theme_settings' => '<a href="' . $scripturl . '?action=theme;sa=settings;th=' . $settings['theme_id'] . ';sesc=' . $sc . '">' . $txt['theme_current_settings'] . '</a>',


I removed those lines with the word "gallery" in them.

I'm including it here so other people can benefit, if they have the same issue.

Thank you again!

TrueSatan

It's always a pleasure Matthew...but you know that already.

aldo

I have the DilberMC theme and when i installed your mod it didnt put in a link in the navigation bar. So how can i get one in?

vbgamer45

You will need to edit the index.template.php of the custom theme to add a menu link.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

aldo

do you no how to do that? ??? because i dont

TrueSatan

@ aldo

Please read the official documentation on how to add  mods to custom themes:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531

Sonicboom

Quote from: TrueSatan on July 06, 2007, 04:27:56 PM
@ aldo

Please read the official documentation on how to add&nbsp; mods to custom themes:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531

Is there any other way? I tried with all my might to understand that but I just can't. Maybe I'm too dumb, maybe it's Friday afternoon and I need a drink but I can't wrap my brain around those instructions. I've worked with scripts before but man I'm just lost.

Sonicboom

TrueSatan

No...but if you stay patient and work through it slowly it isn't that difficult to do. Perhaps if you look carefully at what the mod has done to the SMF default theme it will be more easy for you to see what to do to a custom theme.

Sonicboom

Quote from: TrueSatan on July 06, 2007, 05:25:29 PM
No...but if you stay patient and work through it slowly it isn't that difficult to do. Perhaps if you look carefully at what the mod has done to the SMF default theme it will be more easy for you to see what to do to a custom theme.

For now I've decided just to go back to the original. So I uninstalled the image gallery mod using the package uninstall link. I think this is just over my head. I can follow instructions very well but the second my situation differs from the one in the instructions I am completely thrown off course. For example if the instructions say "search for <operation>" and I can't find it anywhere in MY file then I am lost. Because I'm not a programmer I can't use experience to figure it out so therefore I have no choice but to quit or go crazy.

Sonicboom

TrueSatan

Before you give up why not try using the SMF Package Parser by Daniel15?

http://modparser.dev.dansoftaustralia.net/

It lets you put the package you want to analyse into it and will output detailed instructions of what to do to in a, somewhat, more human-readable form than you get by just looking at the package files...that might just be enough to get you running again.

Sonicboom

#772
Quote from: TrueSatan on July 06, 2007, 05:44:14 PM
Before you give up why not try using the SMF Package Parser by Daniel15?

hxxp:modparser.dev.dansoftaustralia.net/ [nonactive]

It lets you put the package you want to analyse into it and will output detailed instructions of what to do to in a, somewhat, more human-readable form than you get by just looking at the package files...that might just be enough to get you running again.

That was a really great site and of course normally it might work. However, in my case it didn't. Any other ideas or tricks? Here is what the parser gave me:


In file Themes/[your theme]/index.template.php

Find: $current_action = 'admin';
if (in_array($context['current_action'], array(

Add after:
'gallery',


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


Add after:

// 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']&nbsp; , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Then here is my index.template.php:

Ok I can't post it here for some reason. I tried to insert the file using the code tags but it just doesn't work and I don't know why. Sorry

Sonicboom

TrueSatan

The only other thing that could make it any easier for you would be to choose a good editor so that the searching is just a matter of putting in a line of what you want, letting it search for that and making sure that the rest of the block of code is correct before making the edit...that aside there's not much more I can offer save to, again, suggest patience and a refusal to quit.

Good editors you might consider would include http://www.context.cx/ or http://www.mpsoftware.dk/downloads.php

RiderRaghav

I'm getting the following error while installing :( ......
What should I do ??? .....
Any help would be greatly appreciated :) .....



QuoteInstalling this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Themes/default/languages/Modifications.english.php Test failed
2.    Execute Modification    ./Themes/default/languages/Who.english.php    Test successful
3.    Execute Modification    ./index.php    Test successful
4.    Execute Modification    ./Themes/default/index.template.php    Test successful
5.    Execute Modification    ./Sources/Subs.php    Test successful
6.    Execute Modification    ./Sources/ManagePermissions.php    Test successful
7.    Extract File    ./Sources/Gallery.php    
8.    Extract File    ./Themes/default/Gallery.template.php    
9.    Extract Tree    ./gallery    
10.    Extract File    ./Themes/default/languages/Gallery.english.php    
11.    Extract File    ./Themes/default/languages/Gallery.english-utf8.php    
12.    Execute Code    galleryinstall.php    

TrueSatan

Your report just shows that one of the other mods you have installed has edited the file that reports a fail and thus the file isn't now as this mod would expect to find it...you need to do a manual install.

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531

In the postings on this mod and many others you will see similar reports being handled...please read the topic.

Sonicboom

#776
Hi! it's me again. I have really tried to get this going but I'm not having any luck. It's not even for anything that important (my WoW guild site) but it's the principal of the thing. I want to learn how to do this but I can't seem to figure it out. The template I'm using is one I downloaded from here called wowdk11_d. I've tried the online Mod Parser and using TextPad 5.2 I edited the index.template.php file according to the instructions. I also tried the "Manual Installation of Mods" instructions by editing the Display.template.php file. I still cannot see a Tab at the top with a link to the Gallery. I also cannot see a link in the Admin page for the Gallery Configuration. However, if I use the default theme it shows up fine. I've included the code the parser told me to change. Is there anything else I'm forgetting that may be specific to this theme? Sorry to be a pest but I really want to learn this. Any help is greatly appreciated!

** I don't know if this matters but I am running SMF 1.1.2 (updated from 1.1.1) and the Theme says it is for 1.1.2 as well. **

Installation instructions for SMF versions: 1.1 - 1.1.99, 1.1 RC3, 1.1 RC2
Note: If a file does not exist in your theme, it doesn't matter (as the file from the Default theme will be used).

In file Themes/[your theme]/index.template.php
Find: $current_action = 'admin';
if (in_array($context['current_action'], array(

Add after:
'gallery',


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


Add after:

// 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']&nbsp; , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

TrueSatan

@ Sonicboom

Would you please put the following files from the theme you are trying to edit into a zip archive and post them here as an attachment? Leave whatever editing you have done in the files in place so I can see how far you have got.

Modifications.english.php (in the language directory of your custom theme)

Who.english.php (also in the language directory of your custom theme)

index.template.php (in the root directory of your custom theme...N.B. not the forum root)

I suspect that in index.template.php you may have failed to do this edit:

Find:

$current_action = 'admin';
if (in_array($context['current_action'], array(




Add after:

'gallery',

...but given the trouble you've been having I'd like to check the other files to see that they are also OK.

This mod does not edit, or need to edit, the Display.template.php file so I don't know why you've edited that.

My preferred choice of editor is phpDesigner2007 but a lot of people use Context...you might consider trying these products.

Sonicboom

Quote from: TrueSatan on July 09, 2007, 12:27:10 PM
@ Sonicboom

Would you please put the following files from the theme you are trying to edit into a zip archive and post them here as an attachment? Leave whatever editing you have done in the files in place so I can see how far you have got.

Modifications.english.php (in the language directory of your custom theme)

Who.english.php (also in the language directory of your custom theme)

index.template.php (in the root directory of your custom theme...N.B. not the forum root)

Ok I have zipped those files up. I double checked the index.template.php file and it looked right to me. I think the issue is with the other two since I didn't edit them. When I used the online parser it failed to mention anything about editing those files. Anyway here they are and thank you so much for your help!

Sonicboom


TrueSatan

I've fixed your files as promised...sorry for the delay.

As regards use of the Package Parser had you set it to show All Edits not just the theme ones it would have spat out the language directory ones as well. I'll have a word with Daniel15 as he might be able to alter the code a little so that language directory ones are included in the theme request. The language directory is part of the theme you see.

Your editing of index.template.php lacked some spacing as you'll be able to tell from my fixed version...it's not a big problem but it does help with any future work that might be needed on the file as readability is improved by it.

I hope these work for you.

Advertisement: