MyBB Community Forums

Full Version: Settings deleted
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am sorry if this doesn't go here.

My inc/settings.php was deleted (on accident by a youngin) and for some reason my recycle bin on the host that I use won't allow me to retreive it. It's gone.

I tried to upload it anew, but that didn't work at all. Now, I am getting errors whenever anyone clicks on anything. It will load the index.php but nothing else.

When I click on the forum name I get
Quote:Warning: Division by zero in /home/rkphuntc/public_html/forum/inc/functions.php on line 340
mySQL error: 1064
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: SELECT t.*, (t.totalratings/t.numratings) AS averagerating, i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM mybb_threads t LEFT JOIN mybb_icons i ON (i.iid = t.icon) LEFT JOIN mybb_users u ON (u.uid = t.uid) WHERE t.fid='2' AND (t.visible='1' OR t.visible='0') ORDER BY t.sticky DESC, t.lastpost DESC LIMIT 0,

When I click on last post I get
Quote:Warning: Division by zero in /home/rkphuntc/public_html/forum/showthread.php on line 362

Warning: Division by zero in /home/rkphuntc/public_html/forum/showthread.php on line 375

Warning: Division by zero in /home/rkphuntc/public_html/forum/inc/functions.php on line 340
mySQL error: 1064
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: SELECT pid FROM mybb_posts WHERE tid='499' AND (visible='0' OR visible='1') ORDER BY dateline LIMIT 0,

I can't enter my admin area or anything else. The only page that loads is the index.php. I am not a very php/mysql savvy person and I am completely at odds of what to do.

Someone said that I should dump mysql database and then just totally reinstall the forum. I've never done that before, and have no idea what I would be doing there. I don't want to lose everything that I have posted on the forum. Thank you for any help in advance.
You should be able to log into your Admin-CP. Upload an empty settings.php into the inc directory and set the permissions (CHMOD) so that it is writable.

After that upload the attached file into the forums directory and open it in your browser. It will write the settings into the file again.
Thank you very much, but now I am getting a different error.

Quote:Parse error: parse error, unexpected T_VARIABLE, expecting '(' in /home/rkphuntc/public_html/forum/inc/settings.php on line 7

It's the same error for everything.
Can you please attach your settings.php?
Here ya go. Thank you for taking the time to help me.
Please try the attached one.
Thank you, everything works now. I really appreciate your help.
I'm having more issues with this now. Whenever I try to change anything in my Admin CP setting I get:

Quote:Warning: fopen(./inc/settings.php): failed to open stream: Permission denied in /home/rkphuntc/public_html/forum/admin/settings.php on line 55

Warning: fwrite(): supplied argument is not a valid stream resource in /home/rkphuntc/public_html/forum/admin/settings.php on line 56

Warning: fclose(): supplied argument is not a valid stream resource
in /home/rkphuntc/public_html/forum/admin/settings.php on line 57
My apologizes. I figured out the problem. Forgot to change the Chmod.