PDA

View Full Version : ok i really need help...


Brad
05-30-2002, 03:06 AM
well seeing how jelsoft cant suport me due to hacks im asking here


my views are broke, its the database itself thats messed up, it was just not counting views until a day or so ago when our php got upgraded, now when you view a topic then go to anthor page 1/3 of the time it will give this error


Database error in vBulletin 2.2.5:

Invalid SQL: UPDATE LOW_PRIORITY user SET views=views+1 WHERE userid='88'
mysql error: Unknown column 'views' in 'field list'

mysql error number: 1054

Date: Thursday 30th of May 2002 05:05:02 AM
Script: http://www.kousetsu.net/forums/forums/showthread.php?postid=9503#post9503
Referer: http://www.kousetsu.net/forums/index.php?

and under the error box it says

HTTP/1.1 200 OK Date: Thu, 30 May 2002 05:05:09 GMT Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_perl/1.24_01 PHP/4.1.2 FrontPage/5.0.2 mod_ssl/2.8.1 OpenSSL/0.9.6 X-Powered-By: PHP/4.1.2 Content-Length: 71267 Keep-Alive: timeout=15, max=98 Connection: Keep-Alive Content-Type: text/html


i really need help on this one, is there a query i can run or soemthing to repair the database?, i dont have telnet acess but i do have phpmyadmin

url to forums: http://www.kousetsu.net/forums

FWC
05-30-2002, 05:48 AM
You don't have a views column in your user table, which is normal. That query must be from some kind of hack. The normal showthread query updates the thread table.if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}

Brad
05-30-2002, 06:08 AM
welll thanks for the reply, i cleared some things up for me, however im still not sure about how to go about fixing it, can you give me some more info or can i send you my files so you can look into it for me?

FWC
05-30-2002, 06:11 AM
You can't send me your files. That's not allowed. I posted the correct queries. I don't know how that other one got in your showthread.php. Did you install some hack that tracks users views of threads or something?

Brad
05-30-2002, 06:18 AM
sorry i thought i saw someone do that before, my forum is heavly hacked, ill have to look into it, i do have that querie. lemme search that file

Brad
05-30-2002, 06:20 AM
is all i can file while searching views

if ((!isset($pagenumber) or $pagenumber==0) and $pagenumber!="lastpage") {
$pagenumber=1;
}
if ($bbuserinfo['userid']!=0) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET views=views+1 WHERE userid='$bbuserinfo[userid]'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET views=views+1 WHERE userid='$bbuserinfo[userid]'";
}
}
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}

Brad
05-30-2002, 06:23 AM
if it helps i also get this when applying the "fix" for views found here

http://www.vbulletin.com/forum/showthread.php?s=&threadid=35488&highlight=view+counts

and the error i get after applying that fix when trying to view a topic

Database error in vBulletin 2.2.5:

Invalid SQL: UPDATE user SET views=views+1 WHERE userid='88'
mysql error: Unknown column 'views' in 'field list'

mysql error number: 1054

Date: Saturday 18th of May 2002 09:49:07 AM
Script: http://www.kousetsu.net/forums/foru...hp?threadid=322
Referer:

FWC
05-30-2002, 06:27 AM
This code has to be part of a hack:if ($bbuserinfo['userid']!=0) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET views=views+1 WHERE userid='$bbuserinfo[userid]'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET views=views+1 WHERE userid='$bbuserinfo[userid]'";
}
}If you want to run that you need to add a views column to your user table. The alternative is to delete it or comment it out. The code above and below it is normal and will work.

Brad
05-30-2002, 06:32 AM
ok! ^_^ thanks, time to kill that code and see witch hack it was from

Brad
05-30-2002, 06:35 AM
ahh i see it was from that views hack for members i decided not to install, guess i forgot to whipe the scripts ^_^

Brad
05-30-2002, 06:41 AM
all errors with the views not updating and the database errors are gone, dake you! :D

FWC
05-31-2002, 04:58 AM
Originally posted by Anime-loo
all errors with the views not updating and the database errors are gone, dake you! :D You're welcome. :)