
Quiz Hack Version 0.2.0
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
aslo das ganze ist in der posting.php und bei mir ists so:
Das der fehler beim mode=quote auftrit und die bbcode.php/tpl eigentlich io sind sollt er hier sein aber das wirkt eigentlich auch gut :-/
Code: Alles auswählen
else
{
if ( $mode == 'quote' )
{
$topic_id = $post_info['topic_id'];
}
// BEGIN Quiz Hack
$auth_answer = false;
if ( $mode == 'reply' && $userdata['session_logged_in'] && $post_info['topic_quiz'] == 1 )
{
include($phpbb_root_path . 'includes/quiz.'.$phpEx);
if ( $quiz->check_answer_auth($topic_id, $userdata) )
{
$auth_answer = true;
$post_data['quiz_answer'] = !empty($answer) ? $answer : '';
}
}
// END Quiz Hack
$post_data['first_post'] = ( $mode == 'newtopic' ) ? true : 0;
$post_data['last_post'] = false;
$post_data['has_poll'] = false;
$post_data['edit_poll'] = false;
}
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_such_post']);
}
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
//-- mod : calendar
// || (!empty($is_auth_type_cal) && !$is_auth[$is_auth_type_cal])
//-- modify
if ( !$is_auth[$is_auth_type] || (!empty($is_auth_type_cal) && !$is_auth[$is_auth_type_cal]))
//-- fin mod : calendar
{
if ( $userdata['session_logged_in'] )
{
if (!empty($is_auth_type_cal) && !$is_auth[$is_auth_type_cal])
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type_cal], $is_auth[$is_auth_type_cal . "_type"]));
}
//-- fin mod : calendar
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
$redirect .= ($post_reportid) ? '&post_reportid=$post_reportid' : '';
redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
}
//
// Set toggles for various options
//
if ( !$board_config['allow_html'] )
{
hier is meine posting.php
Code: Alles auswählen
else
{
if ( $mode == 'quote' )
{
$topic_id = $post_info['topic_id'];
}
// BEGIN Quiz Hack
$auth_answer = false;
if ( $mode == 'reply' && $userdata['session_logged_in'] && $post_info['topic_quiz'] == 1 )
{
include($phpbb_root_path . 'includes/quiz.'.$phpEx);
if ( $quiz->check_answer_auth($topic_id, $userdata) )
{
$auth_answer = true;
$post_data['quiz_answer'] = !empty($answer) ? $answer : '';
}
}
// END Quiz Hack
$post_data['first_post'] = ( $mode == 'newtopic' ) ? true : 0;
$post_data['last_post'] = false;
$post_data['has_poll'] = false;
$post_data['edit_poll'] = false;
}
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_such_post']);
}
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] || (!empty($is_auth_type_cal) && !$is_auth[$is_auth_type_cal]) )
//-- fin mod : calendar ----------------------------------------------------------------------------
{
if ( $userdata['session_logged_in'] )
{
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
if (!empty($is_auth_type_cal) && !$is_auth[$is_auth_type_cal])
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type_cal], $is_auth[$is_auth_type_cal . "_type"]));
}
//-- fin mod : calendar ----------------------------------------------------------------------------
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
$redirect .= ($post_reportid) ? '&post_reportid=$post_reportid' : '';
redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
}
//
// Set toggles for various options
//
if ( !$board_config['allow_html'] )
{
@Rainer K.: dankescjön... also das ist mir noch nie passiert... ich bekomm meistens nur fehlermeldungen und nicht gleich die problemlösungen 
@tempic: dankeschön...
@Pseiko: du benutzt eine phpbb version < 206 schau mal in der older_phpbb_versions.txt nach... du musst den ersten punkt machen...
@alle die fragenkataloge haben: schickt sie mit dann steck ich sie in die biblothek...
ah

@tempic: dankeschön...
@Pseiko: du benutzt eine phpbb version < 206 schau mal in der older_phpbb_versions.txt nach... du musst den ersten punkt machen...
@alle die fragenkataloge haben: schickt sie mit dann steck ich sie in die biblothek...
ah
Anregung
Hi,
das Intervall der Quizfragen ist ja einstellbar. Wenn nun eine neue Quizfrage gestellt wird, prügeln sich bei mir im Forum alle drum und sind natürlich genau zum Zeitpunkt der Fragestellung online.
Umdas etwas zu entschärfen, habe ich +/-10% Variation der Fragezeiten eingebaut.
In common.php ändern:
Grüße, Rainer
das Intervall der Quizfragen ist ja einstellbar. Wenn nun eine neue Quizfrage gestellt wird, prügeln sich bei mir im Forum alle drum und sind natürlich genau zum Zeitpunkt der Fragestellung online.
Umdas etwas zu entschärfen, habe ich +/-10% Variation der Fragezeiten eingebaut.
In common.php ändern:
Code: Alles auswählen
// BEGIN Quiz Hack
$sql = "SELECT config_name, config_value FROM " . QUIZ_CONFIG_TABLE . " WHERE config_name IN ('next_quiz','last_start_time','disable','next_quiz_step','next_quiz_step_mode')";
if ( !($quiz_result = $db->sql_query($sql)) )
{
if ( defined('Install_Quiz') )
{
$quiz_config['disable'] = true;
}
else
{
message_die(GENERAL_ERROR, "Could not get quiz config information", "", __LINE__, __FILE__, $sql);
}
}
while ( $quiz_row = $db->sql_fetchrow($quiz_result) )
{
$quiz_config[$quiz_row['config_name']] = $quiz_row['config_value'];
}
// Variate quiz time +/- 10%
mt_srand( (double) microtime() * 1000000 );
$next_step_secs = $quiz_config['next_quiz_step'] * 3600;
switch($quiz_config['next_quiz_step_mode'])
{
case 0:
break;
case 1:
$next_step_secs *= 24;
break;
case 2:
$next_step_secs *= (24 * 7);
break;
case 3:
$next_step_secs *= (24 * 7 * 4);
break;
case 4:
$next_step_secs *= (24 * 7 * 4 * 52);
break;
}
$random_seconds = mt_rand(0, ($next_step_secs / 5)) - ($next_step_secs / 10);
$current_time = time() + $random_seconds;
Was hab ich denn falksch gemacht wenn dieses kommt:
das kommt jetzt immer wenn ich geantwortet habe, egal wo!
Parse error: parse error, unexpected T_ELSE in /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... search.php on line 516
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... ch.php:516) in /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/posting.php on line 618
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... ch.php:516) in /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... header.php on line 647
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... ch.php:516) in /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... header.php on line 649
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... ch.php:516) in /is/htdocs/52270/www.Forum.de/phpBB2_plus_1.2/phpBB2/inc ... header.php on line 650
das kommt jetzt immer wenn ich geantwortet habe, egal wo!