Seite 1 von 2

kritischer fehler bei useronline mod

Verfasst: 02.12.2004 16:30
von Meditationsmeister
diese fehler meldung kommt
phpBB : Kritischer Fehler

Error updating sessions table

DEBUG MODE

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

UPDATE phpbb_knuddelssessions SET session_time = 1102001234, session_page = 5, session_topic = '0' WHERE session_id = '35f34cccd89d623144e03b1019ddf466'

Line : 280
File : /var/www/virtual/net-hoster.de/htdocs/foren/knuddels/includes/sessions.php
kann mir vll jemand sagen was ich falsch gemacht habe??

Re: kritischer fehler bei useronline mod

Verfasst: 02.12.2004 16:34
von FSKiller / Phoenix
Meditationsmeister hat geschrieben:diese fehler meldung kommt
phpBB : Kritischer Fehler

Error updating sessions table

DEBUG MODE

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

UPDATE phpbb_knuddelssessions SET session_time = 1102001234, session_page = 5, session_topic = '0' WHERE session_id = '35f34cccd89d623144e03b1019ddf466'

Line : 280
File : /var/www/virtual/net-hoster.de/htdocs/foren/knuddels/includes/sessions.php
kann mir vll jemand sagen was ich falsch gemacht habe??
Wenn Du uns sagst was du eingebaut hast? So würde ich sagen das die sessions.php ne kleinen Fehler hat ;P ,ernsthaft Lade die sessions.php nochmal hoch und Logge dich mal aus und wieder ein.

Verfasst: 02.12.2004 16:36
von Meditationsmeister
wie kann ich die denn erneut hochladen??? habe sie ja net mehr
ich habe versucht topic_in_whoisonline_1.2.9em einzubauen und habe alles so gemacht wie es dort stand!

Verfasst: 02.12.2004 16:49
von FSKiller / Phoenix
Meditationsmeister hat geschrieben:wie kann ich die denn erneut hochladen??? habe sie ja net mehr
ich habe versucht topic_in_whoisonline_1.2.9em einzubauen und habe alles so gemacht wie es dort stand!
kannste mir auch verraten wo ich den mod herbekomme ;)

schaue dir nochmal den sessions.php Bereich an vermute das du da ein Fehler gemacht hast! War da zufällig auch ein SQL-Update mit dabei wenn ja schaue nochmal nach ob du das eingetragen hast :)

Verfasst: 02.12.2004 16:51
von Meditationsmeister
<?php
/***************************************************************************
* sessions.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: sessions.php,v 1.58.2.11 2004/07/11 16:46:19 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

//
// Adds/updates a new session to the database for the given userid.
// Returns the new session ID on success.
//
function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0)
{
global $db, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

$cookiename = $board_config['cookie_name'];
$cookiepath = $board_config['cookie_path'];
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];

if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
$sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
$sessionmethod = SESSION_METHOD_COOKIE;
}
else
{
$sessiondata = array();
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
$sessionmethod = SESSION_METHOD_GET;
}

//
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}

$last_visit = 0;
$current_time = time();
$expiry_time = $current_time - $board_config['session_length'];

//
// Try and pull the last time stored in a cookie, if it exists
//
$sql = "SELECT *
FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql);
}

$userdata = $db->sql_fetchrow($result);

if ( $user_id != ANONYMOUS )
{
$auto_login_key = $userdata['user_password'];

if ( $auto_create )
{
if ( isset($sessiondata['autologinid']) && $userdata['user_active'] )
{
// We have to login automagically
if( $sessiondata['autologinid'] == $auto_login_key )
{
// autologinid matches password
$login = 1;
$enable_autologin = 1;
}
else
{
// No match; don't login, set as anonymous user
$login = 0;
$enable_autologin = 0;
$user_id = $userdata['user_id'] = ANONYMOUS;
}
}
else
{
// Autologin is not set. Don't login, set as anonymous user
$login = 0;
$enable_autologin = 0;
$user_id = $userdata['user_id'] = ANONYMOUS;
}
}
else
{
$login = 1;
}
}
else
{
$login = 0;
$enable_autologin = 0;
}

//
// Initial ban check against user id, IP and email address
//
preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts);

$sql = "SELECT ban_ip, ban_userid, ban_email
FROM " . BANLIST_TABLE . "
WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
OR ban_userid = $user_id";
if ( $user_id != ANONYMOUS )
{
$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "'
OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}

if ( $ban_info = $db->sql_fetchrow($result) )
{
if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )
{
message_die(CRITICAL_MESSAGE, 'You_been_banned');
}
}

//
// Create or update the session
//
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
{
$session_id = md5(uniqid($user_ip));

$sql = "INSERT INTO " . SESSIONS_TABLE . "
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);
}
}

if ( $user_id != ANONYMOUS )
{// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : (
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;

$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
}

$userdata['user_lastvisit'] = $last_visit;

$sessiondata['autologinid'] = ( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '';
$sessiondata['userid'] = $user_id;
}

$userdata['session_id'] = $session_id;
$userdata['session_ip'] = $user_ip;
$userdata['session_user_id'] = $user_id;
$userdata['session_logged_in'] = $login;
$userdata['session_page'] = $page_id;
$userdata['session_start'] = $current_time;
$userdata['session_time'] = $current_time;

setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);

$SID = 'sid=' . $session_id;

return $userdata;
}

//
// Checks for a given user session, tidies session table and updates user
// sessions at each page refresh
//
function session_pagestart($user_ip, $thispage_id, $thistopic_id=PAGE_INDEX)
{
global $db, $lang, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

$cookiename = $board_config['cookie_name'];
$cookiepath = $board_config['cookie_path'];
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];

$current_time = time();
unset($userdata);

if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
{
$sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
$sessionmethod = SESSION_METHOD_COOKIE;
}
else
{
$sessiondata = array();
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
$sessionmethod = SESSION_METHOD_GET;
}

//
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}

//
// Does a session exist?
//
if ( !empty($session_id) )
{
//
// session_id exists so go ahead and attempt to grab all
// data in preparation
//
$sql = "SELECT u.*, s.*
FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}

$userdata = $db->sql_fetchrow($result);

//
// Did the session exist in the DB?
//
if ( isset($userdata['user_id']) )
{
//
// Do not check IP assuming equivalence, if IPv4 we'll check only first 24
// bits ... I've been told (by vHiker) this should alleviate problems with
// load balanced et al proxies while retaining some reliance on IP security.
//
$ip_check_s = substr($userdata['session_ip'], 0, 6);
$ip_check_u = substr($user_ip, 0, 6);

if ($ip_check_s == $ip_check_u)
{
$SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';

//
// Only update session DB a minute or so after last update
//
if ( $current_time - $userdata['session_time'] > 60 || ((( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_topic']:$userdata['session_topic']) != $thispage_topic) || (( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_page']:$userdata['session_page']) != $thispage_id
)
{
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_page = $thispage_id, session_topic = $thistopic_id
WHERE session_id = '" . $userdata['session_id'] . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}

if ( $userdata['user_id'] != ANONYMOUS )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id, user_session_topic= $thistopic_id
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
}

//
// Delete expired sessions
//
$expiry_time = $current_time - $board_config['session_length'];
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_time < $expiry_time
AND session_id <> '$session_id'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
}

setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
}

return $userdata;
}
}
}

//
// If we reach here then no (valid) session exists. So we'll create a new one,
// using the cookie user_id if available to pull basic user prefs.
//
$user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;

if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
{
message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);
}

return $userdata;

}

//
// session_end closes out a session
// deleting the corresponding entry
// in the sessions table
//
function session_end($session_id, $user_id)
{
global $db, $lang, $board_config;
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;

$cookiename = $board_config['cookie_name'];
$cookiepath = $board_config['cookie_path'];
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];

$current_time = time();

//
// Pull cookiedata or grab the URI propagated sid
//
if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) )
{
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
$sessionmethod = SESSION_METHOD_COOKIE;
}
else
{
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
$sessionmethod = SESSION_METHOD_GET;
}

if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
return;
}

//
// Delete existing session
//
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_id = '$session_id'
AND session_user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql);
}

setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);

return true;
}

//
// Append $SID to a url. Borrowed from phplib and modified. This is an
// extra routine utilised by the session code above and acts as a wrapper
// around every single URL and form action. If you replace the session
// code you must include this routine, even if it's empty.
//
function append_sid($url, $non_html_amp = false)
{
global $SID;

if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
das ist die session.php
#
#-----[ OPEN ]------------------------------------------------
#
viewonline.php

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT u.user_id, u.username

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, s.session_page

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, s.session_topic

#
#-----[ FIND ]------------------------------------------------
#
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
$location = $forum_data[$row['session_page']];

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Topic in Who is online MOD
if ($row['session_topic'])
{
//
// Topic info
//
$sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id=" . $row['session_topic'];
if ( $result2 = $db->sql_query($sql) )
{
$topic_title = $db->sql_fetchrow($result2);
}
else
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}
$location_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $row['session_topic']);
$location = $forum_data[$row['session_page']] .' -> '.$topic_title['topic_title'];
} else
{
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
$location = $forum_data[$row['session_page']];
}
// End replacement - Topic in Who is online MOD

#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------------
#
$forum_id = intval($forum_topic_data['forum_id']);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Topic in Who is online MOD
$topic_id = intval($forum_topic_data['topic_id']);
// End add - Topic in Who is online MOD

#
#-----[ FIND ]------------------------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);

#
#-----[ IN-LINE FIND ]----------------------------------------
#
)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $topic_id

#
#-----[ FIND ]------------------------------------------------
#
// Output page header
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Topic in Who is online MOD
define('SHOW_ONLINE', true);
// End add - Topic in Who is online MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Topic in Who is online MOD
$user_forum_sql = ( !empty($topic_id) ) ? "AND s.session_topic = " . intval($topic_id) :(( !empty($forum_id) ) ? "AND s.session_page = ".intval($forum_id) : '');
// End replacement - Topic in Who is online MOD

#
#-----[ FIND ]------------------------------------------------
#
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Topic in Who is online MOD
$online_userlist = $lang['Registered_users'].' ' . $online_userlist;
// End replacement - Topic in Who is online MOD

#
#-----[ FIND ]------------------------------------------------
#
if ( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}

#
#-----[ REPLACE WITH ]----------------------------------------
#

// Start replacement - Topic in Who is online MOD
if ( $total_online_users == 0 )
{
$l_t_user_s = ( ( isset($topic_id) ) ? $lang['Browsing_topic'] : ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Online_users_zero_total'] ) );
}
else
{
$l_t_user_s = ( ( isset($topic_id) ) ? $lang['Browsing_topic'] : ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Online_users_total'] ) );
}
// End replacement - Topic in Who is online MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------------
#
function session_pagestart($user_ip, $thispage_id)

#
#-----[ IN-LINE FIND ]----------------------------------------
#
)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $thistopic_id=PAGE_INDEX

#
#-----[ FIND ]------------------------------------------------
#
if ( $current_time - $userdata['session_time'] > 60 )

#
#-----[ IN-LINE FIND ]----------------------------------------
#
)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
|| ((( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_topic']:$userdata['session_topic']) != $thispage_topic) || (( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_page']:$userdata['session_page']) != $thispage_id

#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . SESSIONS_TABLE . "
SET
WHERE

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, session_topic = '".$thistopic_id ."'

#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET
WHERE

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_session_topic='" . $thistopic_id . "'

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Topic in Who is online MOD
$lang['Browsing_topic'] = 'Users browsing this topic:';
// End add - Topic in Who is online MOD

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
{LOGGED_IN_USER_LIST}</b></span></td>

#
#-----[ IN-LINE FIND ]----------------------------------------
#
{LOGGED_IN_USER_LIST}

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
{TOTAL_USERS_ONLINE}<br/>

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Topic in Who is online MOD -->
<span class="gensmall"><b><br/>{TOTAL_USERS_ONLINE}<br/>{LOGGED_IN_USER_LIST}</b></span></td>
<!-- End add - Topic in Who is online MOD -->

#
#-----[ FIND ]------------------------------------------------
#
<span class="gensmall"><b>{PAGINATION}</b><br />
&nbsp; </span></td>
</tr>

#
#-----[ REPLACE WITH ]----------------------------------------
#

<!-- Start replacement - Topic in Who is online MOD -->
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
</tr>
<!-- End replacement - Topic in Who is online MOD -->

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
das ist die anleitung
kannst du mir sagen was falsch ist?

Re: ...

Verfasst: 02.12.2004 17:12
von Lodda
Die Datei ist in der .rar Datei enthalten ;)
##############################################################
## MOD Title: Topic in Who is online
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: This mod will make it possible to view
## exactly witch topic a user is looking
## at. The information is applyed in the
## Who-is-online list.
## MOD Version: 1.2.9
## MOD Compatibility: 2.0.6
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 7
## viewonline.php
## viewtopic.php
## includes/page_header.php
## includes/sessions.php
## language/lang_english/lang_main.php
## template/subSilver/viewforum_body.tpl
## template/subSilver/viewtopic_body.tpl
##
## Included Files: 1
## topic_in_wio_db_update.php
##
##############################################################

Verfasst: 02.12.2004 17:15
von Meditationsmeister
ja die dateien habe ich ja alle, oder net? also ich habe alle dateien die im paket sein sollen! aber da tritt ein doofer fehler auf

Re: ...

Verfasst: 02.12.2004 17:18
von Lodda
Entweder bin ich blind oder Du hast die Änderungen in der session.php nicht gemacht ne ;)

[edit]
ich bin wohl blind
//edit]

Verfasst: 02.12.2004 17:19
von Meditationsmeister
klar habe ich die gemacht, das aber weiter unten die update die die meinen
hier is der teil
{
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_page = $thispage_id, session_topic = $thistopic_id
WHERE session_id = '" . $userdata['session_id'] . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}

if ( $userdata['user_id'] != ANONYMOUS )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id, user_session_topic= $thistopic_id
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
}

Re: ...

Verfasst: 02.12.2004 17:26
von Lodda
Ich würde an Deiner Stelle alles wieder rückgängig machen bzw. die Backupdateien wieder hochladen und von vorne beginnen.

Mit diesem Codeschnipsel kann ich nix anfangen, in welchem Zusammenhang steht dieser?