Fehlerbehebung bei AFK Manager

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

Fehlerbehebung bei AFK Manager

Beitrag von Secretly »

Hallo,

ich habe mal die Debug-Funktion angeschaltet und da hagelte es bei mir einige Fehlermeldungen, welche ich gern beheben würde, aber leider nicht so "eingearbeitet" bin, dass ich wüsste wo ich anfangen müsste:
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 164: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 164: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 170: Undefined variable: start
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 179: Undefined index: num_afkstatus
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4837: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3872)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4839: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3872)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4840: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3872)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4841: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3872)
Ich habe den AFK-Manager eingebaut mit ein paar kleinen Änderungen. Ich weiß, ich muss limit, staart und num_afkstatus definieren, aber wie weiß ich leider nicht.

Mein Einbau in der index.php ist:

Code: Alles auswählen

// AFK Manager 
if (isset($config['afkmanager_afk_autoafk']))
{
	global $cache;
	$cache->purge();
	if ($config['afkmanager_afk_autoafk'])
	{
		$check_time = (int) gmdate('mdY',time() + (3600 * ($config['board_timezone'] + $config['board_dst'])));
		if ( $config['afkmanager_afk_autoafk_check'] != $check_time)
		{
			if (!function_exists('afkmanager_autoafk_users'))
			{
				include($phpbb_root_path . 'includes/functions_afkmanager.' . $phpEx);
			}
			afkmanager_autoafk_users();
			set_config('afkmanager_afk_autoafk_check', $check_time);
		}
	}
}	
				$sql = 'SELECT username, user_afkstatus, user_id
						FROM ' . $table_prefix . 'users
						WHERE user_afkstatus = 1
						ORDER BY username ASC';
				//$result = $db->sql_query($sql);
				$result = $db->sql_query_limit($sql, $limit, $start);


				//echo $config['afkmanager_afk_posting_enable'];

				//while ($row = $db->sql_fetchrow($result))
				while($row = $db->sql_fetchrow($result, $limit, $start))
				{
					$template->assign_block_vars('afkers', array( 
						'AFKER_ID'					=> $row['user_id'],
						'AFKER_LINK'				=> append_sid('memberlist.php?mode=viewprofile&u=' . $row['user_id']),
						'AFKER_NAME'				=> $row['username'],
						'AFKER_STATUS'				=> $row['user_afkstatus'],
					));
				}
$total_afkstatus	= $config['num_afkstatus'];
// AFK Manager 
Daher hoffe ich mal, dass jemand mir helfen kann, so dass ich mir beim nächsten Mal hoffentlich selbst helfen kann.
Benutzeravatar
darkonia
Mitglied
Beiträge: 900
Registriert: 15.11.2008 15:24
Wohnort: München
Kontaktdaten:

Re: Fehlerbehebung bei AFK Manager

Beitrag von darkonia »

der mod ist schon seit ewigen zeiten [ABD] ... irwie klar das er nicht richtig geht mit phpbb 3.0.10
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven
Secretly
Mitglied
Beiträge: 358
Registriert: 14.07.2011 16:59
Kontaktdaten:

Re: Fehlerbehebung bei AFK Manager

Beitrag von Secretly »

Der Mod funktioniert, wie man auch hier sieht (unten sind die abwesenden User aufgelistet und im Profil steht wie lange sie abwesend sind) ;) Ich möchte lediglich die Fehler die durch meine "Änderungen" entstanden sind beheben.
Benutzeravatar
BNa
Valued Contributor
Beiträge: 3169
Registriert: 12.04.2010 23:51
Kontaktdaten:

Re: Fehlerbehebung bei AFK Manager

Beitrag von BNa »

Zu 1
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 164: Undefined variable: limit
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 164: Undefined variable: start
Kommt daher:

Code: Alles auswählen

$result = $db->sql_query_limit($sql, $limit, $start);
Erklärung: $limit und $start sind nicht definiert. Logo, tauchen ja nirgendwo auf, bzw. wurden vorher nicht definiert.
Solange Du keine Pagination benutzt oder Dich damit nicht auskennst, halte das Script so einfach wie möglich, also schreibe (erstmal):

Code: Alles auswählen

$result = $db->sql_query($sql);
Zu 2
[phpBB Debug] PHP Notice: in file [ROOT]/index.php on line 179: Undefined index: num_afkstatus
Kommt daher:

Code: Alles auswählen

$config['num_afkstatus'] 
Erklärung: Der DB Eintrag in der CONFIG_TABLE namens num_afkstatus fehlt. Ist also undefiniert. Erzeuge den Eintrag via set_config('num_afkstatus','dein_string'); als string() oder set_config('num_afkstatus',3); als int() oder whatever (einfach in die index.php einfügen und die Datei ein zweimal F5'en, dann wieder entfernen) und sieh zu, das der Wert zukünftig bedient wird (woher er auch immer kommt, bzw, normalerweise befüllt wird).
Secretly
Mitglied
Beiträge: 358
Registriert: 14.07.2011 16:59
Kontaktdaten:

Re: Fehlerbehebung bei AFK Manager

Beitrag von Secretly »

Danke :) Ich habe tatsächlich gar keine Fehlermeldung mehr.

Code: Alles auswählen

while($row = $db->sql_fetchrow($result, $limit, $start))
habe ich noch gegen:

Code: Alles auswählen

//while ($row = $db->sql_fetchrow($result))
ausgetauscht

und

Code: Alles auswählen

$total_afkstatus   = $config['num_afkstatus'];
Habe ich ganz weggenommen und jetzt geht es :) Danke BNa
Benutzeravatar
BNa
Valued Contributor
Beiträge: 3169
Registriert: 12.04.2010 23:51
Kontaktdaten:

Re: Fehlerbehebung bei AFK Manager

Beitrag von BNa »

Kein Problem. Das hier hatte ich garnicht gesehen
Secretly hat geschrieben:

Code: Alles auswählen

while($row = $db->sql_fetchrow($result, $limit, $start))
und war natürlich Quark an der Stelle bzw. doppelt gemoppelt.
Antworten

Zurück zu „[3.0.x] Mod Support“