Hi.
Also, ja, ich hab den Attachment_MOD eingebaut. Was kann ich tun um trotzdem die
install_quiz_hack.php zu benutzen oder anders gefragt,
was mus ich in der DB ändern, das es läuft, wie es soll?
Hab´s von "Hand" mit phpMyadmin gemacht :
Code: Alles auswählen
CREATE TABLE phpbb_quiz (
quiz_id mediumint(8) unsigned DEFAULT '0' NOT NULL auto_increment,
question text NOT NULL,
answer varchar(100) NOT NULL,
answer2 varchar(100) NOT NULL,
answer3 varchar(100) NOT NULL,
answer4 varchar(100) NOT NULL,
quiz_points tinyint(2) DEFAULT '1' NOT NULL,
quiz_type tinyint(1) DEFAULT '0' NOT NULL,
quiz_status tinyint(1) DEFAULT '0' NOT NULL,
quiz_from_user_id mediumint(8) DEFAULT '0' NOT NULL,
quiz_topic_id mediumint(8) unsigned DEFAULT '0' NOT NULL,
quiz_bot_post_id mediumint(8) unsigned DEFAULT '0' NOT NULL,
answered_by_user_id mediumint(8) DEFAULT '0' NOT NULL,
PRIMARY KEY (quiz_id),
KEY quiz_status (quiz_status),
KEY quiz_topic_id (quiz_topic_id),
KEY user_id (quiz_from_user_id)
);
CREATE TABLE phpbb_quiz_config (
config_name varchar(255) NOT NULL,
config_value text NOT NULL,
PRIMARY KEY (config_name)
);
INSERT INTO phpbb_quiz_config VALUES ('quizbot_id', '2'),
('forum_id', '1'),
('next_quiz', '" . ( time() - 3600 ) . "'),
('next_quiz_step', '1'),
('next_quiz_step_mode', '1'),
('disable', '1'),
('subject', 'Quiz Frage #{NUM} ...'),
('message', 'Und hier die neue Quiz-Frage:\r\n{QUIZ}'),
('subject2', 'Quiz beantwortet'),
('message2', 'Die Quiz-Frage wurde von [i]{USERNAME}[/i] richtig beantwortet.\r\nDas Quiz wurde beendet.'),
('subject3', 'Fehler'),
('message3', 'Aus technischen Gründen wurde die Antwort von [i]{USERNAME}[/i] irrtümlich als richtig markiert. Wir bitten dies zu entschuldigen.\r\nDas Quiz wird nicht wiedereröffnet und bleibt beendet. \r\n'),
('next_quiz_number', '1'),
('quiz_points_disable', '0'),
('banned_users', ''),
('banned_groups', ''),
('admin_user_id', '2'),
('allow_admin_in_quiz', '0'),
('allow_mod_in_quiz', '0'),
('allow_quiz_from_user_in_quiz', '0'),
('html', '1'),
('bbcode', '1'),
('smilies', '1'),
('imported_files', ''),
('last_start_time', '0'),
('version', '0.1.0');
ALTER TABLE phpbb_users ADD quiz_points MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL;
ALTER TABLE phpbb_topics ADD topic_quiz MEDIUMINT(8) DEFAULT '0' NOT NULL;
ALTER TABLE phpbb_posts_text ADD quiz_answer VARCHAR(100) NOT NULL;
Falsch?
zur emailer.php :
Code: Alles auswählen
$Id: emailer.php,v 1.15.2.3 2002/05/20 00:21:38 psotfx 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.
*
***************************************************************************/
// BEGIN Quiz Hack
if ( defined('EMAILER_INCLUDED') )
{
return;
}
define('EMAILER_INCLUDED', true);
// END Quiz Hack
//
// The emailer class has support for attaching files, that isn't implemented
// in the 2.0 release but we can probable find some way of using it in a future
// release
//
class emailer
{
schon korrekt, oder ?
zur functions_post.php :
Code: Alles auswählen
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote $quiz_sql1) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote $quiz_sql2)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
schön, dann hab ich´s auch richtig verstanden.
was neues :
Beim Versuch eine Frage manuell zu stellen, bekomme ich folgende Meldung :
Error in posting
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax near ' 1032348077, 9, 0, 0, 0 , 1)' at line 1
INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote , topic_quiz) VALUES ('Quiz Frage #1 ...', , 1032348077, 9, 0, 0, 0 , 1)
Line : 266
File : /is/htdocs/12751/
www.offensif.de/forum/includes/functions_post.php
Die Entsprechenden Zeilen der functions_post.php :
Code: Alles auswählen
// BEGINN Quiz Hack
$quiz_sql1 = !empty($post_data['topic_quiz']) ? ', topic_quiz' : '';
$quiz_sql2 = !empty($post_data['topic_quiz']) ? ', 1' : '';
// END Quiz Hack
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote $quiz_sql1) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote $quiz_sql2)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
// ADDED $quiz_sql1 AND $quiz_sql2 BY Quiz Hack
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
if ( $mode == 'newtopic' )
{
$topic_id = $db->sql_nextid();
}
}
$edited_sql = ( $mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post'] ) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
if ( $mode != 'editpost' )
{
$post_id = $db->sql_nextid();
}
// BEGINN Quiz Hack
$quiz_sql1 = !empty($post_data['quiz_answer']) ? ', quiz_answer' : '';
$quiz_sql2 = !empty($post_data['quiz_answer']) ? ( ", '" . $post_data['quiz_answer'] . "'" ) : '';
// END Quiz Hack
$sql = ( $mode != 'editpost' ) ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text, $quiz_sql1) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message', '$quiz_sql2')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";
// ADDED $quiz_sql1 AND $quiz_sql2 BY Quiz Hack