Seite 1 von 7

problem mit "last visit mod"

Verfasst: 27.01.2004 08:18
von [119] M3tr0!d
moin

ich hab den "last visit mod" eingebaut (http://www.phpbbhacks.com/viewhack.php?id=237) - naja. zumindest so halbwegs...

nun kommt folgender fehler:

Code: Alles auswählen

phpBB : Kritischer Fehler 

Error updating last visit time

DEBUG MODE

SQL Error : 1054 Unknown column 'user_lastlogon' in 'field list'

UPDATE phpbb_users SET user_session_time = 1075187421, user_session_page = 0, user_lastvisit = 1075150909, user_lastlogon = 1075187421, user_totallogon=user_totallogon+1 WHERE user_id = 2

Line : 165
File : /home/mtrid/public_html/phpBB2-2.0.6G/includes/sessions.php 
meine vermutung ist das die db nicht geupdatet wurde (keine ahnung wieso. ausgeführt hab ich das update und die berechtigungen waren auch gut bei chmod)

frage 1: kann mir einer sagen wie ich das wieder hinkrieg ???
frage 2: kennt sich einer mit dem mod aus ? was sollte der wo in der db updaten (ist mir ein rätsel wenn ich die beiliegende php-datei für das update anschaue!) ???

mfg [119] M3tr0!d


p.s.: hier der code der "last_visit_db_update.php"

Code: Alles auswählen

<?
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rød
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.8
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login, 
## but that is a minor cosmetic isue, that will correct it self next time the use  logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE '.USERS_TABLE.' ADD user_lastlogon INT (11) DEFAULT "0" not null',
'UPDATE '.USERS_TABLE.' SET user_lastlogon=user_lastvisit WHERE user_lastlogon="0"',
'INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("hidde_last_logon", "0")',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totaltime INT (11) DEFAULT "0"',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totallogon INT (11) DEFAULT "0"',
'ALTER TABLE ' . USERS_TABLE .' ADD user_totalpages INT (11) DEFAULT "0"',
'UPDATE '. USERS_TABLE .' SET user_totaltime=(user_session_time-user_lastlogon) WHERE user_totaltime="0" AND user_lastlogon>0',
'UPDATE '. USERS_TABLE .' SET user_totallogon=1 WHERE user_totallogon="0" AND user_session_time<>"0"'
);


$mods = array ( 
'Last Visit PART 1 Mod','Last Visit PART 1 Mod','Last Visit PART 2 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod','Last Visit PART 4 Mod'
);

############################################### Do not change anything below this line #######################################

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if ($userdata['user_level']!=ADMIN)
      message_die(GENERAL_ERROR, "You are not Authorised to do this"); 
$n=0;
$message="<b>This list is a result of the SQL queries needed for MOD</b><br/><br/>";
while($sql[$n])
{
	$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
	if(!$result = $db->sql_query($sql[$n])) 
	$message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
	else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
	$n++;
}
 message_die(GENERAL_MESSAGE, $message); 
?>

Verfasst: 27.01.2004 09:42
von itst
Die Änderungen wurden jedenfalls anscheinend nicht übernommen. Schau mal per phpMyAdmin o. ä. in die DB.

Im Zweifel führe die Änderungen händisch durch, dann siehst Du auch ungefiltert alle dabei event. auftretenden Fehlermeldungen.

Verfasst: 27.01.2004 11:20
von [119] M3tr0!d
kannst du mir auch sagen wo ich was reinschreiben muss ?
die db hab ich mir schon angesehen und da steht nichts drin
ich blick wie gesagt bei dem script nicht durch......

Verfasst: 27.01.2004 14:07
von phpbbaby
hi,

geh in deine db und klicke dann sql

dann erscheint so ein feld....da gibst die sql daten aus der einbauanleitung ein und dann auf OK

beachte aber den präfix wenn du nicht phpbb_ hast, dass musst sonst in den zeilen ändern bevor du auf OK klickst

Verfasst: 27.01.2004 17:20
von [119] M3tr0!d
danke für die info - ich habs mal manuell eingetragen soweit ich gekommen bin. der fehler ist weg *extremfreu !!*


weiss einer noch wie ich diesen teil eingeben kann ? da krieg ich immer sql-errors egal wie ichs drehe und wende:

UPDATE '.USERS_TABLE.' SET user_lastlogon=user_lastvisit WHERE user_lastlogon="0",
INSERT INTO '.CONFIG_TABLE.' (config_name, config_value) VALUES ("hidde_last_logon", "0"),
UPDATE '. USERS_TABLE .' SET user_totaltime=(user_session_time-user_lastlogon) WHERE user_totaltime="0" AND user_lastlogon>0,
UPDATE '. USERS_TABLE .' SET user_totallogon=1 WHERE user_totallogon="0" AND user_session_time<>"0"


p.s.: ein riesen danke an itst und phpbbaby !!!

Verfasst: 10.03.2005 22:27
von sebbik
Ich hatte die selbe Fehlermeldung wie oben, hab es auch manuell eingetragen, bekomme jetzt aber
phpBB : Kritischer Fehler

Could not connect to the database
zu sehen, wenn ich mein Forum öffnen will....

Verfasst: 10.03.2005 22:32
von sebbik
Kommando zurück - geht wieder ;-)

Verfasst: 24.04.2005 02:45
von Tasso
Ich habe das gleiche Prob, nur in umgekehrter Reigenfolge. Ich hatte den MOD verbaut und bekam die gleiche Fehlermeldung. Daraufhin habe ich ihn wieder ausgebaut. Wenn ich jetzt in mein Forum will, kommt immer noch

Code: Alles auswählen

phpBB : Kritischer Fehler 

Error updating last visit time

DEBUG MODE

SQL 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 'WHERE user_id = 2' at line 3

UPDATE phpbb_users SET user_session_time = 1114303726, user_session_page = 0, user_lastvisit = 1114298498, WHERE user_id = 2

Line : 171
File : sessions.php 
Wie bekomme ich das denn wieder hin? Es wurde ja nichts in die DB eingetragen, soweit ich das sehen kann. Wäre super, wenn mir da jemand helfen könnte.

Verfasst: 24.04.2005 03:41
von easygo
Entferne das Komma vor WHERE @ Tasso :roll:

Verfasst: 24.04.2005 03:49
von Tasso
Sorry, dass sich meine Fragen vllt. dumm anhören. Aber ich bin absoluter Frischling, was php anbelangt. Wo soll ich das Komma wegmachen? Im Script ist kein Komma vor "Where".