News:

Join the Facebook Fan Page.

Main Menu

Blown modification

Started by user1234, October 28, 2015, 11:06:07 AM

Previous topic - Next topic

user1234

I thought I was going to be cool and add FreeStatCounter to my forum. Their instruction was:
"Please paste our code inside index.template.php at extreme bottom exactly above tag."

Being as ignorant to these things as I remain (yes even after all these years of use), I went into the forum themes section file of that name, and added it before what I thought was the last "tag" in that file. That was followed by a message:
_____________

Template 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.
syntax error, unexpected '<'
______________

So I went back and removed the code for FreeStatCounter that I put in there, but the error message does not go away. Now no matter what function I try, I get the same message. I can't even go back to that theme.

Is the best way for me to undo this, to delete the  themes file on my host server, and then upload it again? (My forum was fully up to date with the newest SMF version and default theme.)

If that is the best course of action, can someone provide a link or a package or something to that specific file, that I can upload to the server?

Thanks so much for your help.

Kindred

#1
well, first of all, this will demonstrate the importance of always making a backup before editing any files?

how did you edit the file?   did you use ftp and a text editor? (hint, just like backing up, that is how it should be done)
i fear that you may have used the internal admin functions that allow you to edit the template directly...  that should only be done for emergency cases when you don't have access to the hosting panel or ftp.

do you have any mods installed?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

user1234

Quote from: Kindred on October 28, 2015, 12:48:50 PM
well, first of all, this will demonstrate the importance of alwats making a backup before editing any files?

Indeed, which I learned through a number of failures to do so! :-[

Quote from: Kindred on October 28, 2015, 12:48:50 PM
how did you edit the file?   did you use ftp and a text editor? (hint, just like backing up, that is how it should be done)

I imagine it is. But I just stuffed it in there.

Quote from: Kindred on October 28, 2015, 12:48:50 PM
i fear that you may have used the internal admin functions that allow you to edit the template directly...  that should only be done for emergency cases when you don't have access to the hosting panel or ftp.

If you mean I did it through the forum admin function, rather than logging into my host and going to my public_html file, you are right - and I busted it pretty good! I couldn't even go back into that forum function or anywhere else without the error message. No more opportunity to change.

Quote from: Kindred on October 28, 2015, 12:48:50 PM

do you have any mods installed?

I try to avoid all mods and do everything default. The only mod I remember downloading is the multiple question to log in, though I think that's part of the updated version of SMF now.

Since I wrote this post I went to HostMonster, where I subscribed to CPanel backups pro, and found a version from last night!
I restored that backup, and the overlying (.htm) website was OK, but I got a message that the database could not be found, instead of seeing the forum. But it was calling it something like qdc instead of smf for the file name.
After going up a couple tech levels, the tech noticed the qdc in the settings file and changed it to smf, and it worked. So I don't know what was up with that backup.

Later I uploaded the backup of the database I made this morning, and it updated from HostMonster's backup from last night, to when I made it this morning. All seems well.

user1234

Is there a mod for FreeStatCounter that I should have looked for in the first place?

margarett

Careful with those "automagic backup utilities" ;)
You only need to restore your index.template.php and you ended up restoring a lot of things, and wrong above all :o because you had different settings between Settings.php and your database.

That being said, please attach your index.template.php and the code that FreeStatCounter gave you to add and we can do that for you ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

user1234

Quote from: margarett on October 28, 2015, 02:09:31 PM
Careful with those "automagic backup utilities" ;)
You only need to restore your index.template.php and you ended up restoring a lot of things, and wrong above all :o because you had different settings between Settings.php and your database.

That being said, please attach your index.template.php and the code that FreeStatCounter gave you to add and we can do that for you ;)

I should have considered your post regarding the HostMonster auto backup. Everything seemed fine from when I uploaded the backup, and the database tested OK on my other .com that I installed SMF on to test my main .com forum database.
Everything was fine right up until I went to install the SMF 2.0.11 on my SMF 2.0.10

I get:

"This package is already installed, and no upgrade was found!

You should uninstall the old version first to avoid problems, or ask the author to create an upgrade from your old version.

Please remember to always make regular backups of your sources and database before installing mods, especially beta versions."

Then in a pink box I get:

"Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF."

Followed by:

*   1.    Execute Modification    ./index.php    Test successful
*    2.    Execute Modification    ./Sources/Load.php    Test failed
      1.    Replace    ./Sources/Load.php    Test failed
      2.    Replace    ./Sources/Load.php    Test failed
      3.    Replace    ./Sources/Load.php    Test failed
*    3.    Execute Modification    ./Sources/LogInOut.php    Test failed
      1.    Replace    ./Sources/LogInOut.php    Test failed
      2.    Replace    ./Sources/LogInOut.php    Test failed
      3.    Replace    ./Sources/LogInOut.php    Test failed
*    4.    Execute Modification    ./Sources/ManageMembers.php    Test failed
      1.    Replace    ./Sources/ManageMembers.php    Test successful
      2.    Replace    ./Sources/ManageMembers.php    Test failed
*    5.    Execute Modification    ./Sources/Modlog.php    Test failed
      1.    Replace    ./Sources/Modlog.php    Test failed
      2.    Replace    ./Sources/Modlog.php    Test failed
*    6.    Execute Modification    ./Sources/Packages.php    Test failed
      1.    Replace    ./Sources/Packages.php    Test failed
      2.    Replace    ./Sources/Packages.php    Test failed
      3.    Replace    ./Sources/Packages.php    Test failed
      4.    Replace    ./Sources/Packages.php    Test failed
      5.    Replace    ./Sources/Packages.php    Test failed
*    7.    Execute Modification    ./Sources/Subs-Auth.php    Test failed
      1.    Replace    ./Sources/Subs-Auth.php    Test failed
      2.    Replace    ./Sources/Subs-Auth.php    Test failed
*    8.    Execute Modification    ./Sources/Subs-Editor.php    Test failed
      1.    Replace    ./Sources/Subs-Editor.php    Test failed
      2.    Replace    ./Sources/Subs-Editor.php    Test failed
*    9.    Execute Modification    ./Sources/Subs-OpenID.php    Test failed
      1.    Replace    ./Sources/Subs-OpenID.php    Test successful
      2.    Replace    ./Sources/Subs-OpenID.php    Test failed
*    10.    Execute Modification    ./Sources/Subs.php    Test failed
      1.    Replace    ./Sources/Subs.php    Test failed
      2.    Replace    ./Sources/Subs.php    Test successful
      3.    Replace    ./Sources/Subs.php    Test successful


Adjusted a little with the repair_settings.php, but it didn't change the errors in uploading the patch.

I went back to the forum in my backup site, which I realized I only visit when I upload the database to test, to see if it looks like my main site, and then on my way out go back into PHPMyAdmin and drop the database tables, until the next time I go there to test it.

I never logged in to the test site! I did today, found flagged errors that I was able to fix with repair_settings.php, and updated each successive version with patches all the way from version 2.0.5 up to 2.0.11. Everything is current and in perfect working order in the testing .com forum.

Since I do everything by default, would it just be easiest for me to overwrite the SMF files in my main site?
If so is there a thread on doing so?
Should I just try to overwrite the sources folder first?
Can anything disastrous happen?

margarett

At this point I would suggest http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
It will leave your content unchanged and SMF'c code upgraded to the latest version ;)

Then you can proceed to reinstall any MODs and themes you might need.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

user1234

Quote from: margarett on January 31, 2016, 06:36:10 PM
At this point I would suggest http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
It will leave your content unchanged and SMF'c code upgraded to the latest version ;)

Then you can proceed to reinstall any MODs and themes you might need.

No worry on mods, as pure default works fine for our needs.
It says to use the exact version. Currently my forum says .10 at the bottom
The link that I clicked on, at the link you gave me, only went up to .9
But the drop down menu showed a 2.0.10 page at this link:
http://download.simplemachines.org/index.php?archive;version=82

Do I pick
SMF 2.0.10 Upgrade
number 7027   
?

user1234

Quote from: margarett on January 31, 2016, 06:36:10 PM
At this point I would suggest http://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files
It will leave your content unchanged and SMF'c code upgraded to the latest version ;)

Then you can proceed to reinstall any MODs and themes you might need.

Thank you, thank you, thank you! I finally found the time to reacquaint myself with ole filezilla, got up the courage to go forward, and overwrote my old files with the SMF 2.0.10 fresh set. Then went into the forum and clicked on the update for 2.0.11 and it installed without a hitch! Thanks again margarett!

Advertisement: