Last_Visit_Mod - DB update?!

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Benutzeravatar
McLane
Mitglied
Beiträge: 53
Registriert: 05.07.2005 17:22
Kontaktdaten:

Last_Visit_Mod - DB update?!

Beitrag von McLane »

hallo leute! hab den oben genannten mod eingebaut nur irgendwie will der klene wicht den sql eintrag nicht.

das spuckt der mir aus:

Code: Alles auswählen

phpBB : Kritischer Fehler

Error updating sessions table

DEBUG MODE

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

UPDATE rswforum_users SET user_session_time = 1127773908, user_session_page = 0, user_totalpages = user_totalpages+1, user_totaltime = user_totaltime+(1127773908-1127773686) WHERE user_id = 2

Line : 282
File : *******/forum/includes/sessions.php
weis da einer weiter? bzw. kann mir einer sagen wie ich das vielleicht au manuell eingetragen bekomm?!

hier die update datei:

Code: Alles auswählen

<?php
#########################################################
## 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); 
?>
LiNUX - It's Time For A Better Future!
___ ___ __ _ _
Signaturen dürfen maximal 3 Zeilen lang sein
Benutzeravatar
McLane
Mitglied
Beiträge: 53
Registriert: 05.07.2005 17:22
Kontaktdaten:

Beitrag von McLane »

kleine ergänzung: oberen "code" zeigt der jetzt beim laden der seite an...is also was andres kaputt?!

EDIT: ich hab grad erst begriffen, dass ich was übersehen hab: 1146 bezeichnet fehlende einträge in der sqldb! sprich jmd. müsst mir ma eben sagen, wie ich aus der update.php (2. code) die sachen herausnehmen muss, damit ich das ganze manuell machen kann!

danke im vorraus!

PS: sorry, es is scho spät un mir sitzt ne shize klausur in den knochen *lol*
LiNUX - It's Time For A Better Future!
___ ___ __ _ _
Signaturen dürfen maximal 3 Zeilen lang sein
Benutzeravatar
HansiHansemann
Mitglied
Beiträge: 10
Registriert: 26.09.2005 17:13
Wohnort: Landshut

Beitrag von HansiHansemann »

Hi,

hab ihn gestern auch eingebaut und hatte die selben Probs.
Habs aber so hinbekommen.... :-)

Hab dann aber danach noch ein bißchen im Forum gestöbert und nen Beitrag gefunden, dass man die DB mit

ALTER TABLE `phpbbtest2_users` ADD `user_reminded` TINYINT(4) DEFAULT '0' NOT NULL;

zuerst updaten muss. Dann sollt's eigentlich funktionieren!
Benutzeravatar
McLane
Mitglied
Beiträge: 53
Registriert: 05.07.2005 17:22
Kontaktdaten:

Beitrag von McLane »

danke!
also das war jetzt seeeeeeeeeeeehr viel arbeit, da ich alle befehle umschreiben musst un sie manuell eingeben, aber ich habs geschafft un alles geht!
LiNUX - It's Time For A Better Future!
___ ___ __ _ _
Signaturen dürfen maximal 3 Zeilen lang sein
Antworten

Zurück zu „phpBB 2.0: Mod Support“