View Full Version : URGENT! Major template problems - not loading modified ones, some disappearing!
X-Fan
10-12-2003, 02:09 AM
I need some urgent help here, please. I just went to check my Web site for the first time this morning...
http://www.comixfan.com/xfan/index.php?s=
...and I'm getting this error:
Database error in vbHome :
Invalid SQL:
SELECT COUNT(*) AS total
FROM thread
WHERE forumid IN( ) AND dateline>1065927913
mysql error: You have an error in your SQL syntax near ') AND dateline>1065927913
' at line 4
mysql error number: 1064
Date: Saturday 11th of October 2003 10:05:15 PM
Script: /xfan/index.php?s=
Referer:
The site was working fine around 8 hours ago, and no code has been edited/added/deleted since then but now all of a sudden it's stopped because of this error.
What could the problem be?
X-Fan
10-12-2003, 02:14 AM
Addendum: I've just discovered my site has been hacked, as the board was turned off in the admin and there was a rather rude message posted as the close reason.
The database appears to be intact, it's just that mysql error with every instance of dateline that's causing problems from what I can see.
Any help would be appreciated, thanks!
X-Fan
10-12-2003, 02:25 AM
Update 2: My templates aren't listing in my site admin. They're still in the database, but when I go to modify them nothing shows up in the list.
How do I fix that?
X-Fan
10-12-2003, 01:30 PM
Okay, I managed to get the default templateset back, however now I get a bare bones forum front page with a blank message box in the middle of the screen:
http://www.comixfan.com/xfan/forums/index.php?s=
I've tried editing the forumhome template, but for some reason the system is using only the default template and none of my modified ones.
In fact, the system isn't reading any of the stored variables, such as $hometitle, $bburl, etc. Not even $versionnumber is being read so currently my vB is null version!
I've also tried upgrading to 2.3.2, but even that causes a problem as no version number shows up for vBulletin. I re-uploaded vbulletin.style to the FTP and went to import it, but got this error:
The version of the style file does not match your version of vBulletin. Please obtain an updated version of vBulletin and/or the style file.
Your template version:
Style file template version: 2.3.2
I've checked my database, and all posts, threads, forums, users etc are still there. I've checked all the settings in the admin and the board is open, forums are visible, usergroups are established and permissions as they were before the hack attack, but just nothing is showing up on the index page.
Please, can someone help, as my site is my livelihood and every minute it's down is lost revenue for me! :(
Lesane
10-12-2003, 02:10 PM
I have no idea at this moment, but check your database if the table 'setting' contains all the settings(it will probably) and run the repair.php and upload the original global.php/functions.php/index.php again.
X-Fan
10-12-2003, 02:14 PM
Did all that, Lesane, and still no go. vBHome isn't working properly either since the hacker attack:
http://www.comixfan.com/xfan/index.php?s=
For some reason it's only reading the default templates. Any template modifications I make aren't being displayed.
X-Fan
10-12-2003, 02:21 PM
I think the root problem is that the PHP code isn't getting the variable info from the database. I think that's why it's using the master templateset to display the pages because it's not getting passed the id of the default templateset. It's also why there's no version number being displayed, or any other variables like $hometitle and the like.
What could be causing that problem, though, when the DB settings in config.php are correct?
X-Fan
10-12-2003, 11:31 PM
Someone, anyone, please, I desperately need help here! :(
Erwin
10-13-2003, 12:58 AM
Reupload all the PHP files and see if that helps.
X-Fan
10-13-2003, 01:11 AM
I have done, Erwin, twice, to no avail. :(
Thanks for helping, btw. I've been freaking out here as my site is my livelihood!
Erwin
10-13-2003, 01:30 AM
Are you sure your database has not been changed? The name? The mysql username and password?
How did the hacker hack your site?
Erwin
10-13-2003, 01:30 AM
And what version vB are you using? the latest?
X-Fan
10-13-2003, 01:37 AM
Are you sure your database has not been changed? The name? The mysql username and password?
Nope, the hacker didn't get into the database so its name/login/password are the same.
How did the hacker hack your site?
They got one of my admins accounts and got into the admin CP on site wherein they deleted the default templateset.
And what version vB are you using? the latest?
Running 2.3.0 RC, but even tried upgrading to a fresh 2.3.2 and that didn't work.
Erwin
10-13-2003, 02:12 AM
If it was just deleting a templateset, all you need to do is upload another templateset or style by overriding the default templateset with an import.
Are you sure he or she didn't do anything else? Do you have a database backup? If so, just restore you database, which will fix this.
X-Fan
10-13-2003, 02:15 AM
If it was just deleting a templateset, all you need to do is upload another templateset or style by overriding the default templateset with an import.
I've tried that, but I got an error because the system isn't recognizing what version of vB is installed, even though it's set as 2.3.0 in the database's settings table. No variables are being loaded from the database, and I don't know why.
Look at the front page of my site:
http://www.comixfan.com/xfan/index.php?s=
See how it's got "Powered by: vbHome (lite) v4.2 and vBulletin v" - no mversion number for vB.
That, and I've modified the default templates but none of the modifications are showing - the default footer template with the HTML check is still loading even though I removed that in my modified footer template.
Are you sure he or she didn't do anything else? Do you have a database backup? If so, just restore you database, which will fix this.
Most recent backup is a week old, so I'd lose all threads/posts/users since then. And being a news site that is updated daily, that's a lot of content to lose.
I did do a backup after the hack to save the latest posts/threads etc, but is there a way to combine them to get the templates back from the old update and content from the most recent?
Erwin
10-13-2003, 02:17 AM
Import ONLY the template table into your current database from your backup. You can do this. That may solve your problem.
Erwin
10-13-2003, 02:18 AM
Before you do this, backup your current database just in case.
Erwin
10-13-2003, 02:19 AM
And may I suggest, backing up your database AT LEAST DAILY. :) That's the least you can do in case your database gets corrupted or someone comes along like this and drops all your tables.
X-Fan
10-13-2003, 02:19 AM
Import ONLY the template table into your current database from your backup. You can do this. That may solve your problem.
How do I do that, Erwin? I've never actually done a database restore before, let alone restoring a single table from a backup.
Erwin
10-13-2003, 02:26 AM
Did you backup to an SQL file?
If so, you can import specific tables in SSH using the command line.
The way I do it is using phpmyadmin, and importing the whole backup database into a NEW database, the exporting the TEMPLATES table as an SQL file, then importing that into the OLD database.
X-Fan
10-13-2003, 02:27 AM
Did you backup to an SQL file?
Yes.
If so, you can import specific tables in SSH using the command line.
But how? What command(s) do I need to enter?
The way I do it is using phpmyadmin, and importing the whole backup database into a NEW database, the exporting the TEMPLATES table as an SQL file, then importing that into the OLD database.
I don't have permission to create a new database - I'll check with my site host and see if they can set me up a temp one.
Lesane
10-13-2003, 03:11 PM
Install vbulletin on your local drive:
https://vborg.vbsupport.ru/showthread.php?t=39482
Import the .sql file (also explained in above thread), then go to the admin and export the template table (see screenshot).
Also, wich 'templatesetid' has your templates? (check the content of the table 'template'). And what's the content of the table ' templateset'?
X-Fan
10-13-2003, 10:48 PM
Import the .sql file (also explained in above thread), then go to the admin and export the template table (see screenshot).
Unfortunately I can't download a 300 meg SQL file as I have a download cap with my 'net account.
Also, wich 'templatesetid' has your templates? (check the content of the table 'template').
If you mean my modified templates, currently it's 3.
And what's the content of the table ' templateset'?
templatesetid = 3
title = Default
importtemplatesetid = 0
X-Fan
10-14-2003, 12:12 AM
Did you backup to an SQL file?
If so, you can import specific tables in SSH using the command line.
The way I do it is using phpmyadmin, and importing the whole backup database into a NEW database, the exporting the TEMPLATES table as an SQL file, then importing that into the OLD database.
Erwin, what do I need to enter on the command line to import a backup of a specific table?
X-Fan
10-14-2003, 02:26 AM
It worked! My site's back up and running!
I just need to modify a few templates I'd changed since last week's backup, but it's online again with all content intact!
Thanks very much to all who helped me out! Your suggestions and advice were invaluable.
X-Fan
10-14-2003, 03:09 AM
Okay, a tad early on the celebrations there. Whilst the majority of the site appears to be working, some templates are still not loading.
For example, I've had Chen's "Change style of first post" hack installed for ages, and it was working fine until now. Take a look at this thread:
http://www.comixfan.com/xfan/forums/showthread.php?s=&threadid=22721
It's meant to be using the postbit_first template but it's not. Heck, it's not even showing the first post at all!
But on threads in forums which I didn't set for the change first post, all is mostly fine, eg:
http://www.comixfan.com/xfan/forums/showthread.php?s=&threadid=22637
Several other modified templates aren't showing either, such as forumhome, getinfo, etc.
Any ideas as to how I can fix that?
X-Fan
10-14-2003, 04:20 AM
Okay, just a quick update. Any existing templates that I've modified aren't being displayed. The master is being displayed instead.
Any new templates that I've added aren't being displayed either, unless I set their templatesetid to -1, the master set. If I do that, then the new templates are displayed.
Also odd is that some templates from hacks that were installed with templatesetid -1, such as the Warning Systems Hack and vBHome, have now reverted back to templatesetid 1.
What could be causing these things to happen?
Erwin
10-14-2003, 07:01 AM
Hacks are reverted from default to custom when you upgrade vB. Just run the installation php files for the hack to put them back to default.
X-Fan
10-14-2003, 07:22 AM
This wasn't an upgrade, though, this was a straight import of the templates table from my back-up into my current DB.
I hadn't added any new hacks since the database was backed up last week, so all templates added by hacks are still in the templates table.
What I meant, was, that after I imported the backed-up templates table, templates started disappearing after that. As I was going through the templates, I noticed some of the Warning Systems hack and Store hack templates were missing, even though they were there when I imported the backed-up templates table!
Also, what about any existing templates that I've modified not being displayed?
As I mentioned before, any new templates that I've added aren't being displayed either, unless I set their templatesetid to -1, the master set. If I do that, then the new templates are displayed.
X-Fan
10-14-2003, 08:27 AM
Huh, well there you go... I just tried importing the settings, template, and templateset tables again, but was frustrated because only the master templateset was being displayed, none of my modifications.
So I checked in the styles section, and the master templateset was coming up for header, footer etc. I went to my SQL table, looked in the style table, and noticed that the templateset there wasn't 1, so I changed it and voila, things look back to normal!
Erwin
10-14-2003, 10:40 AM
Hooray! :)
X-Fan
10-14-2003, 11:08 AM
Hooray! :)
Many thanks to you, Erwin, for taking time out to help!
Erwin
10-15-2003, 09:14 AM
You're welcome, mate! One day we really have to catch up since we're countrymen. ;)
X-Fan
10-15-2003, 09:30 AM
You're welcome, mate! One day we really have to catch up since we're countrymen. ;)
Definitely! I certainly owe you a beer after your help with this! :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.