MyBB Community Forums

Full Version: How to restore a part of the template codes?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have messed up the codes in the header of a customized template. I don't remember the codes and I can't restore it manually typing them out...

I want it to go back the way it was. Is there an easy way to roll back just like that? Something like "undo"? lol... Or do I have to restore it from the backup?

I have made a full site backup just yesterday by using the backup wizard in Cpanel of Hostgator (my host), which should contain everything including entire MyBB.

Sorry I am still a newbie. If I have to restore the header codes from backup, where to find the codes in my backup files? I can't seem to find the codes for the forum header. Or is there any other way to restore just the header? Please give me some advice! Thanks!

Come on people, could anyone please help a newbie? I know my questions might be dumb, but since it's a dumb question so it should be easy for all you experts, right? Big Grin

I really need to restore the header as soon as possible. Please help!
you can revert the template to original but it can not be like a backup of previous version.
you can get the header from backup of database. if the database file is not huge then you can open it
in a text editor (eg. notepad++) and find the header template of your active theme. or you have to take
help of someone experienced.
Thank you for the reply!

I can't just revert it to the original, because the header (before messed up) was far from the original.

Where do I find the database files?

I have full backup of my site, and I have just downloaded it from my host. All the data seem to be in a folder called "homedir" because it's the only one looks big with tons of files in there.

I can go as far as
homedir --> public_html ---> forum

There are tons of note pad type of files in the forum folder, but none of which is header and I don't see any codes of the template anywhere.

Where is the header file in it?
your forum's database backup should have sql or sql.gz extension. if it is not a huge file
then it can be opened in a text editor like notepad++ and header code can be searched in it.
but better method is to make a copy of your forum in your computer using a local server (eg. XAMPP, WAMPP)
and use backed-up database and find required codes.
I couldn't find anything called sql under "forum" in homedir, but I found something outside homedir called "mysql", and in there I see a file called (myusername_mybb1), it is over 12MB. I opened it with notepad and it doesn't look like the same codes I saw in the header.

example of the stuff I found in there
" -- MySQL dump 10.13 Distrib 5.5.23, for Linux (x86_64)
--
-- Host: localhost Database: myusername_mybb1
"

Perhaps I should do it a different way...

Which file under "forums" should I replace by using Core FTP? I just want to change the header back, nothing else.
first open themes page on your forum's admin panel and hover mouse pointer on the active theme (in which you need header code)
look at the statusbar of your browser - you should see theme id like this --> module=style-themes&action=edit&tid=x
keep a note of the tid number

in the sql backup file or the mysql dump, search for VALUES ('x','header','
here x is theme id number. the code available after above code part belongs to header
most probably <navigation>\r\n is the end of header code.
you have to remove \r\n and \ s in that code.