TinyPortal

Development => Support => Installation => Topic started by: Ken. on September 14, 2006, 09:54:54 PM

Title: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 14, 2006, 09:54:54 PM
SMF 1.1 RC3

I've been reading through several threads for the last few days here on TP & on the SMF site and so far don't find a problem like this one in any of the posts, hopefully someone can point me in the right direction.  :)
Maybe I'm just missing where ever the info is?

When trying to install TP 0.9.5 the Apply Mod screen shows the error;
Quote"10. Execute Modification ./Themes/default/index.template.php Test failed".
All of the others test successful.

So should I run the SMF repair_settings.php to fix this problem, or is something else wrong?

Thanks for any help... Ken

Installed mods:
  Mod Name Version 
1. TinyPortal 0.95 ... not applied yet
2. Gallery 2 Integration 1.0beta2   
3. Users Online Today Mod 1.3.1 
4. URL Popup 1.0 ... not applied yet
5. Award Mod 1.1   
6. Who Voted What? 1.1 
7. SMF Arcade 1.3.0-MOD-E1.3
8. Googlebot & Spiders Mod 2.0.0 
9. Karma Buttons 1.02   
10. Karma Description Mod 1.9.7-2   
11. LogModAccountEdits 1.6 
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: akulion on September 14, 2006, 10:26:13 PM
u need to do a manual modification to the smf files in that particular file (index.template.php) for your correct TP / SMF version

Please refer to Documentation On TP Modifications (http://www.tinyportal.net/smf/index.php?board=131.0)

**PS: please do not confuse index.php with index.template.php - they are completely different files.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: pheasant_plucker on September 14, 2006, 10:27:43 PM
Just install it, it will work! I have had this error everytime I have installed it (several seperate forum installs)but it works perfectly everytime.

Gerry
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: IchBin on September 14, 2006, 10:29:40 PM
Yes but it won't work on the default theme if it fails.

To further explain what is happening: TP is looking for certain pieces of code to alter in each of those files. If you have other mods that have altered the code TP is looking for, your install test will fail on those files. So you must do as Akulion has posted. Manual modification...
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 14, 2006, 10:37:38 PM
OK, so this is the section you are talking about??? "$themedir/index.template.php"

And... doing all of the changes is the section??? All the way down untill you reach " $boarddir/Themes/babylon/index.template.php"

Sorry for sounding kind of thick, but I've only been doing this for a few weeks and don't want to trash my forum.  :P

Thanks for the help... Ken
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: akulion on September 14, 2006, 10:55:03 PM
Yes that is the section.

It is better you get used to file modifications

when I started out with SMF I was very uncomfortable with changing files around.

But once you are used to it, its not that bad.

Just remember the golden rule: Make a backup!

when you download your index.template.php file put a copy of it in a folder called backup - and if things get bad, no problem, you can upload the old one and you are back where you started.

So dont worry and just get used to it - because in smf you will encounter a lot of file modifications as you add more and more mods etc - especially since a heavily modded board has a high probablity of having code conflicts when installing
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 14, 2006, 11:02:19 PM
Quote from: akulion on September 14, 2006, 10:55:03 PM
Yes that is the section.

It is better you get used to file modifications

when I started out with SMF I was very uncomfortable with changing files around.

But once you are used to it, its not that bad.

Just remember the golden rule: Make a backup!

when you download your index.template.php file put a copy of it in a folder called backup - and if things get bad, no problem, you can upload the old one and you are back where you started.

So dont worry and just get used to it - because in smf you will encounter a lot of file modifications as you add more and more mods etc

Been there on the backup thing... still go there sometimes. ;)
I've made a backup copy & a working copy and there’s the live one on the site of course, always handy to have at least three copies so that you have to try really hard to screw things upâ€Ã,¦ but I still manage now and then.

Thanks... Ken
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: akulion on September 14, 2006, 11:05:05 PM
ur welcome

i always try and keep a copy of all the theme files on my PC

that way when i install a new mod I simply have to modify the files on my PC and upload one by one until they are all updated

its handy to have many backups lol
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 15, 2006, 12:38:32 AM
Well that was fun! :)

Something is missing, because it throws an error page as below:
QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

And, it displays this code:

Edit: I fixed the code in this box so that it looks the same as that which was displayed on the error page...ken

Parse error: parse error, unexpected T_ECHO in .../Themes/default/index.template.php on line 360


351: </table>';
352:
353: ';
354: // TinyPortal
355:        }
356: //  end
357: echo '
358:
359:
360: echo '
361: <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
362: <tr>';
363:
364: // Show a random news item? (or you could pick one from news_lines...)
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: akulion on September 15, 2006, 12:43:48 AM
try removing

echo '361:
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 15, 2006, 12:57:14 AM
I just copied the code below strait from the file, I'm not exactly sure what you want me to remove, everything on line 360 & 361???. (lines 353-364 showing below)

Ps: The code here looks a little different from what the error page code shows... it looks the same on the page, but not in the code box when posted here. EDIT:fixed the code in the other box one page 1

';
// TinyPortal
       }
//  end
echo '


echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';

// Show a random news item? (or you could pick one from news_lines...)
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 15, 2006, 01:03:32 AM
The original error page is still up in my browser, don't know if it will load up for you but here is the url.

http://www.mykimbrell.com/FamilyForum/index.php?theme=1
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: akulion on September 15, 2006, 01:08:40 AM
i dont see an error message

but basically what u have to remove is the extra echo' statement



//  end
echo '


echo ' <---this one


Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 15, 2006, 01:15:59 AM
New error this time.
I thought that I was being very careful to get this code right when altering the file, but looks like not carefull enough.

Parse error: parse error, unexpected T_STRING in .../Themes/default/index.template.php on line 360

351: </table>';
352:
353: ';
354: // TinyPortal
355:        }
356: //  end
357: echo '
358:
359:
360: <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">361: <tr>';
362:
363: // Show a random news item? (or you could pick one from news_lines...)
364: if (!empty($settings['enable_news']))
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: IchBin on September 15, 2006, 03:22:13 AM
line 353 remove the ';
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 11:14:06 AM
OK, thanks...
Did that one and got an error on line 614 this time.
...is it talking about the 'echo' at the start of the code on line 614?

Parse error: parse error, unexpected T_ECHO in .../Themes/default/index.template.php on line 614

605: <td class="maintab_' , $first , '"> </td>';
606:
607: // Show the [home] button.
608: echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
609: <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
610: <a href="', $scripturl, '">' , $txt[103] , '</a>
611: </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
612: f($settings['TPortal_front_type']!='boardindex')
613: // Show the [forum] button.
614: echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '615: <td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
616: <a href="', $scripturl, '?action=forum">FORUM</a>
617: </td>' , $current_action=='forum' ? '<td class="maintab_active_last"> </td>' : '';
618:
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 11:52:28 AM
In the code below take a look at "f($settings['TPortal_front_type']!='boardindex')"
It appears on line 612:
Should there be an 'i' before the 'f' to make it say 'if'?

EDIT: OK, so the 'i' was added in and the forum was changed over to this modified index.template file... then after doing a refresh all seem to be OK with everything working as expected.
The only difference I've found so far is that there is now a Home button & a Forum button. Both buttons take you to the front of the forum itself. When trying to install TP the same error message still comes up... "10. Execute Modification ./Themes/default/index.template.php Test failed"


// 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>' : '';
f($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">FORUM</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last"> </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>' : '';
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: alan s on September 16, 2006, 11:57:30 AM
yes it should be

if($settings['TPortal_front_type']!='boardindex')

because as far as i know the "f" command doest exist in php lol.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 12:08:16 PM

Quote from: Alan S on September 16, 2006, 11:57:30 AM
yes it should be

if($settings['TPortal_front_type']!='boardindex')

because as far as i know the "f" command doest exist in php lol.

Thanks Alan, thats what I thought! :)
See the edit to my post above for details on whats happening now.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 12:20:01 PM
Could any of the other mods that are installed be in conflict with the TP install process???

Mod Name Version 
1. Users Online Today Mod 1.3.1
2. Who Voted What? 1.1
3. SMF Arcade 1.3.0-MOD-E1.3
4. Googlebot & Spiders Mod 2.0.0
5. Karma Description Mod 1.9.7-2
6. Karma Buttons 1.02
7. LogModAccountEdits 1.6
8. Gallery 2 Integration 1.0beta2
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: alan s on September 16, 2006, 12:28:16 PM
The arcade and gallery could have something to do with it since they edit the index.template.php to add buttons just try replacing the home and forum code with the one below.


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

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 12:41:02 PM
Thanks Alan, that took care of the extra button issue, but the same test failed error shows when the TP install is started.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: alan s on September 16, 2006, 12:44:47 PM
Well if it really causes you that much concern you should uninstall all your mods then install tinyportal again and see if you get the same error.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 01:04:36 PM
My concern is mostly due to my lack of experience and the short time that I’ve been doing the forum software, as has been mentioned elsewhere my â€ËÅ"regular’ site has been up for several years and my abilities there with HTML and the like is OK, but I’ve only been doing .php for a few weeks.
Some folks have said that I should just go ahead with the install in spite of the error message, but others (in this thread) have said that is the wrong thing to do.
Me, well I just don’t want to trash my forum because it’s off to a good start with membership numbers and starting over would not be a good thing. :)
I have considered uninstalling the mods,maybe that would be the way to go.

Edit: One thought that I've had for a while now:
There are plenty of MySQL databases available to me, so if I build a brand new forum from scratch, install TinyPortal and then Gallery2 and bridge it all together can all the data from the 'live' forum be imported into the new one so that it can then replace the current one?
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: IchBin on September 16, 2006, 01:20:10 PM
If you know how to make a backup of your SMF database you can always restore it. Make sure you're using the same version of SMF when you do something like this.

It is not recommended that you continue with the TinyPortal installation when you have failures. You can always try it, but before doing anything make sure you BACKUP your files and database.

Yes, the mods are what is causing the issue. You can either uninstall those mods, or you can manually code in the changes to the index.template.php file by reading the modification how-to in the Documentation board.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 16, 2006, 03:47:18 PM
Thanks IchBin
I'm doing the backups all the while so that hopefully a recovery can be made if the forum goes down from all this.

The index.template file modification has already been done but maybe I need to start over on that and go completly through it again.

I'm going to start out by unstalling the mods one at a time and then if the test failure problem is still there on the TP install I'll do a new index.template file.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 18, 2006, 02:17:14 AM
OK, I started over with the index.template code mod and went through it three times trying to make sure it was right, but when it is set to be active in the forum/themes/default folder and the forum page is refreshed the following error is displayed:

QuoteParse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 360
And, it shows this code:

351:             </table>
352:     ';
353:     // TinyPortal
354:         }
355:     //  end
356:     echo '
357:
358:     echo '
359:     
360:           <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
361:               <tr>';
362:
363:    // Show a random news item? (or you could pick one from news_lines...)
364:    if (!empty($settings['enable_news']))

I’ve tried to figure out how to fix it by adding the ',' or ';' into the code, but it’s not coming together, so my â€ËÅ"guesses’ just don’t get it done.  ???

Could someone help me once again???
Thanks, Ken
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: IchBin on September 18, 2006, 02:50:11 AM
line 356 take out the echo '
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 18, 2006, 03:15:48 AM
Quote from: IchBinÃ,â,,¢ on September 18, 2006, 02:50:11 AM
line 356 take out the echo '

Thanks IchBin, I'll do that... but I will have to stop for now, several of my members keep signing in, voting has just started on a couple of polls on a contest we ran for the grandkids and it looks like it will be a busy night. It looks like sometime tomorrow afternoon will be the next try.

Thanks... Ken
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 18, 2006, 11:15:12 AM
OK, did that one, now it throws this error:

Parse error: parse error, unexpected '<' in .../Themes/default/index.template.php on line 359


350: </tr>
351: </table>
352: ';
353:     // TinyPortal
354:        }
355:     //  end
356:
357: echo '
358: ';
359: <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
360: <tr>';
361:
362: // Show a random news item? (or you could pick one from news_lines...)
363: if (!empty($settings['enable_news']))
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: G6Cad on September 18, 2006, 12:35:56 PM
On line 358 remove the ';
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 18, 2006, 02:09:47 PM
Quote from: Mrs G6 on September 18, 2006, 12:35:56 PM
On line 358 remove the ';

Thanks Mrs G6
That gets the page(s) to load using the 'mod'ed' index.template.php.
So far I am finding an extra button on the nav bar, 'Forum'... both the Home & Forum buttons lead to the forum index page.
And the following error messages at the bottom of each page:
Quote
class="smalltext"> Powered by SMF 1.1 RC3 | SMF ÂÃ,© 2001-2006, Lewis Media
... the 'class="smalltext">' appears next to the SMF copyright as shown, the copyright itself look normal.


Fatal error: Call to undefined function: tportal_version() in /homepages/46/d100556969/htdocs/mykimbrell/FamilyForum/Sources/Load.php(1703) : eval()'d code on line 452

This is the code that is in the file, starting at line #435
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;"> class="smalltext">
', theme_copyright(), ' <br />', tportal_version() , '

</td>

<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Ken. on September 18, 2006, 02:14:07 PM
I fixed the "class="smalltext"> Powered by SMF 1.1 RC3 | SMF ÂÃ,© 2001-2006, Lewis Media" error, found text size command on the next line above (251) and closed the command by adding the missing '<'.

Slowly but surely I'm learning a little.  :o

[edit]on the line 452 error that is displayed at the bottom of each page, is it wanting to see the TP install now??? if so it's not yet installed.[/edit]
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: Xarcell on September 19, 2006, 06:41:11 AM
the "theme" will give an error if you have the TP copyright in it, but TP not installed.
Title: Re: Run SMF "repair_settings.php" to fix my problem?
Post by: redone on December 10, 2006, 06:34:38 PM
I would personally uninstall your mods and TP for that matter and start again! Start from a clean copy of SMF with no mods and then install TP, then begin installing your mods.

Remember though the more mods you install the higher the chances of you breaking what you have so make sure you really want or need these mods before you install them.