Page 2 of 4

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 19:53
by Tim
Hey 4seven, ich habe leider mit dem neuen Code jetzt wieder eine Fehlermeldung bekommen.
Diese Fehlermeldung gibt er aber nur im Debugmodus aus, den ich bis eben aktiv hatte.

Den Fehler, dass manchmal dort steht
Beantwortet Thema "" in ForumX
habe ich schon bemerkt,
aber erst durch den Debugmodus erscheint dabei auch eine Fehlermeldung, dadurch wurde mir erst klar,
dass es ein richtiger Fehler ist.
Der Fehler, der ausgegeben wird, ist dieser:
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 366: Undefined offset: 1
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 366: Undefined index:
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 366: Undefined index:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4820: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4822: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4823: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4824: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)


Hier der Screenshot dazu: http://img5.fotos-hochladen.net/uploads ... jao3r7.png
Die Zeile 366 in der viewonline.php ist diese:
Code: Select all
                                    $location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$topic_post_ids[$on_page[1]]]); 

und gehört zu dem Codeblock der Topic in who is online:
Code: Select all
// BEGIN: Topic in "Who is online"
                                
if ($auth->acl_get('a_')){
                                
preg_match('#t=([0-9]+)#'$row['session_page'], $on_page);
                                
preg_match('#p=([0-9]+)#'$row['session_page'], $on_page_p);
                                if (
sizeof($on_page) && isset($topic_titles[$on_page[1]]))
                                {
                                    
$location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$on_page[1]]);
                                    
$location_url append_sid("{$phpbb_root_path}viewtopic.$phpEx"'f=' $forum_id '&t=' $on_page[1]);
                                }
                                else if (
sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]))
                                {
                                    
$location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$topic_post_ids[$on_page[1]]]);
                                    
$location_url append_sid("{$phpbb_root_path}viewtopic.$phpEx"'f=' $forum_id '&p=' $on_page_p[1]);
                                }
                                else
                                {
                                    
$location sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]['forum_name']);
                                }
                                }
                                else{
                                
$location sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]['forum_name']);
                                }
                                
// END: Topic in "Who is online" 

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 21:46
by 4seven
Das ist aber kein Fehler meines Mods, den 'vergangenen' Fehler habe ich nämlich sicher ausgeschlossen.
Es ist ein Fehler im Topic in "Who is online" Mod, der zwar selten auftritt aber bekannt ist ;)

Code: Select all
// BEGIN: Topic in "Who is online"
// code code code
// END: Topic in "Who is online"          

Ich such mal nach der Lösung, ich hatte das nämlich im Original Topic des Autors schon damals gelöst.

Hier isse schon:

Finde

Code: Select all
$location = sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$topic_post_ids[$on_page[1]]]);

Ersetze mit

Code: Select all
$location = sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], isset($forum_data[$forum_id]['forum_name']) ? $forum_data[$forum_id]['forum_name'] : false, isset($topic_titles[$topic_post_ids[$on_page[1]]]) ? $topic_titles[$topic_post_ids[$on_page[1]]] : false);

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:01
by Tim
Ah ja, da hatte ich die Mods durcheinander gebracht, sorry. :roll:
Vielen Dank für die super Hilfe, echt top! :!:

Edit:
Das gibt leider eine neue Fehlermeldung aus.

Code: Select all
[phpBB DebugPHP Noticein file [ROOT]/viewonline.php on line 361Undefined index621
[phpBB DebugPHP Warningin file [ROOT]/includes/functions.php on line 4820Cannot modify header information headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[
phpBB DebugPHP Warningin file [ROOT]/includes/functions.php on line 4822Cannot modify header information headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[
phpBB DebugPHP Warningin file [ROOT]/includes/functions.php on line 4823Cannot modify header information headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[
phpBB DebugPHP Warningin file [ROOT]/includes/functions.php on line 4824Cannot modify header information headers already sent by (output started at [ROOT]/includes/functions.php:3848

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:12
by 4seven
Dann mal bitte die Zeile 361 posten

Code: Select all
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 361:

Ich wusste das da noch was war. Gab wohl damals auch Folgefehler, da der Mod nicht ganz durchdacht ist.

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:13
by Tim
361 ist diese:
Code: Select all
                                    $location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], isset($forum_data[$forum_id]['forum_name']) ? $forum_data[$forum_id]['forum_name'] : false, isset($topic_titles[$topic_post_ids[$on_page[1]]]) ? $topic_titles[$topic_post_ids[$on_page[1]]] : false); 

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:16
by 4seven
Versuch mal

Code: Select all
$location = sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], isset($forum_data[$forum_id]) ? $forum_data[$forum_id]['forum_name'] : false, isset($topic_titles[$topic_post_ids[$on_page[1]]]) ? $topic_titles[$topic_post_ids[$on_page[1]]] : false);

oder

Code: Select all
$location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], isset($forum_data[$forum_id]['forum_name']) ? $forum_data[$forum_id]['forum_name'] : false, isset($topic_titles[$topic_post_ids]) ? $topic_titles[$topic_post_ids[$on_page[1]]] : false);  

statt

Code: Select all
$location sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], isset($forum_data[$forum_id]['forum_name']) ? $forum_data[$forum_id]['forum_name'] : false, isset($topic_titles[$topic_post_ids[$on_page[1]]]) ? $topic_titles[$topic_post_ids[$on_page[1]]] : false);  

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:23
by Tim
Mit dem ersten Code habe ich, zumindest im Moment, keine Fehlermeldung, ich beobachte das mal weiter, danke dir. :)

Edit:
Es kam doch wieder eine Fehlermeldung, jetzt probiere ich den zweiten. ;)

Edit2:
Der ergibt diese Fehlermeldung:
[phpBB Debug] PHP Warning: in file [ROOT]/viewonline.php on line 361: Illegal offset type in isset or empty
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4820: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4822: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4823: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4824: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)


Wahrscheinlich lass ich den Code am besten im Original und ignoriere diesen Fehler, wenn er im nicht-Debugmodus nicht angezeigt wird. ^^

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:35
by 4seven
Hmm, nochmal alles zurück und dann

Finde

Code: Select all
                                else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]))
                                {

Ersetze mit

Code: Select all
                                else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]) && isset($forum_data[$forum_id]['forum_name']))
                                {

Wie gesagt, der Code ist etwas crappy

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:41
by Tim
Da kommt dann diese Fehlermeldung:
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 361: Undefined index: 621
[phpBB Debug] PHP Notice: in file [ROOT]/viewonline.php on line 361: Undefined index:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4820: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4822: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4823: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4824: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3848)


Schade, dass die MOD so fehlerhaft ist.

Re: Fehlermeldung in der viewonline.php

PostPosted: 30 Jan 2013, 22:58
by 4seven
Letzte Chance(n)

Finde

Code: Select all
                                else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]))
                                {

Ersetze mit

Code: Select all
                                else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]) && ($forum_data[$forum_id]['forum_name'] !== NULL))
                                {

Falls das nich klappt, hab ich noch einen