Verfasst: 09.06.2007 16:05
hast du dann nen Link zum Board?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Du machst kurz vorher eine Abfrage:[phpBB Debug] PHP Notice: in file /includes/functions_wwh.php on line 115: Undefined index: user_ip
Code: Alles auswählen
// bots need to get a extra handle
$sql = " SELECT u.user_type, u.user_id, u.user_lastvisit, u.user_allow_viewonline, w.id
FROM " . USERS_TABLE . " u, " . WWH_TABLE . " w
WHERE u.user_type = 2
AND u.user_id <> 1
AND u.user_lastvisit > $timestamp_cleaning";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
Die dürfte an dieser Stelle aber leer sein, daher auch die "Fehlermeldung", wenn man den Debug Modus an hat !$sql = "INSERT INTO `" . WWH_TABLE . "` (`ip`, `id`, `viewonline`, `last_page`) VALUES ('" . $row['user_ip'] . "', '" . $row['user_id'] . "', '" . $row['user_allow_viewonline'] . "', '" . $row['user_lastvisit'] . "')";
Code: Alles auswählen
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete Entry from WWH-Table: Case3', '', __LINE__, __FILE__, $sql);
}
Code: Alles auswählen
$db->sql_query($sql)
Code: Alles auswählen
WHERE u.user_type = 2
Code: Alles auswählen
WHERE u.user_type = ' . USER_IGNORE . '
Code: Alles auswählen
define('USER_NORMAL', 0);
define('USER_INACTIVE', 1);
define('USER_IGNORE', 2);
define('USER_FOUNDER', 3);
1.FixDr.Death hat geschrieben:Öhm, ich bekomme Fehlermeldungen, wenn ich die neue includes/functions_wwh.php benutze:[phpBB Debug] PHP Notice: in file /includes/functions_wwh.php on line 115: Undefined index: user_ip
Code: Alles auswählen
// bots need to get a extra handle
$sql = " SELECT u.user_type, u.user_id, u.user_lastvisit, u.user_allow_viewonline, w.id
FROM " . USERS_TABLE . " u, " . WWH_TABLE . " w
WHERE u.user_type = 2
AND u.user_id <> 1
AND u.user_lastvisit > $timestamp_cleaning";
Code: Alles auswählen
// bots need to get a extra handle
$sql = ' SELECT u.user_type, u.user_id, u.user_ip, u.user_lastvisit, u.user_allow_viewonline, w.id
FROM ' . USERS_TABLE . ' u, ' . WWH_TABLE . ' w
WHERE u.user_type = ' . USER_IGNORE . '
AND u.user_id <> 1
AND u.user_lastvisit > '.$timestamp_cleaning;
Hab ich 12mal gemachtDr.Death hat geschrieben:Mach einfach:Code: Alles auswählen
if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not delete Entry from WWH-Table: Case3', '', __LINE__, __FILE__, $sql); }
Code: Alles auswählen
$db->sql_query($sql)
hab ich jetzt auch gemacht.Dr.Death hat geschrieben:Besser wäre es wenn du die definierten Constanten ( siehe constants.php ) für den Usertyp verwenden würdest. Nicht jeder Coder weiss was usertyp 2 istCode: Alles auswählen
WHERE u.user_type = 2
Code: Alles auswählen
WHERE u.user_type = ' . USER_IGNORE . '
Absätze hab ich mal berücksichtigt Das mit "Common DBAL methods" ist aber auch so ne Sache für sich, egal... werd meinen Code mal daraufhin durcharbeiten. Genauso die ' und " Regeln...Dr.Death hat geschrieben:Dann noch folgendes:
Halte Dich etwas mehr an die Coding Guidelines, SQL .
http://area51.phpbb.com/docs/coding-guidelines.html#sql
Punkte: sql_build_array():
Code: Alles auswählen
$sql = ' SELECT u.user_type, u.user_id, u.user_ip, u.user_lastvisit, u.user_allow_viewonline, w.id
FROM ' . USERS_TABLE . ' u, ' . WWH_TABLE . ' w
WHERE u.user_type = ' . USER_IGNORE . '
AND u.user_id <> 1
AND u.user_lastvisit > ' . $timestamp_cleaning ;