habe den Last Visit Mod eingebaut und bin total unzufrieden damit.. Habe jetzt alles rückgängig gemacht, jedoch weiß ich nicht wie ich die Datenbank von den Last Visit Mod Tabellen säubere...
Das ist die last_visit_update.php
Code: Alles auswählen
<?php
#########################################################
## SQL commands to phpBB2
## Author: Paul Norman
## Nickname: acoolwelshbloke
## Email: acoolwelshbloke@tec2spec.co.uk
##
## Ver 1.0.9
##
## phpBB2 database update script for mods.
## This file is intended for use with phpBB2, when installing the Last Visit mod.
## After you run this file you may delete it, but remember only admin can use so it really doesen't matter.
## The script will look for whatever prefix you are using, and it will use the existing DB defined by congig.php
## The execution of these/this script(s) including the SQL commands are harmless, so you can run it as meny times you like.
## Please note, though the users last visit will be set back to his/her last login,
## however this is a minor cosmetic isue, and it will correct itself next time the user logs in.
##
#########################################################
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['session_logged_in'])
{
header('Location: ' . append_sid("login.$phpEx?redirect=last_visit_db_update.$phpEx", true));
}
if ($userdata['user_level'] != ADMIN)
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
$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);
?>
Danke