Seite 3 von 13

Verfasst: 05.10.2003 16:34
von saerdnaer
@kaisun: find in includes/quiz.php:

Code: Alles auswählen

prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
replace with

Code: Alles auswählen

$topic_desc = '';
$news_category = '';
$msg_icon = 0;

prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length, $topic_desc);
find

Code: Alles auswählen

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("'", "''", $username), str_replace("'", "''", $subject), str_replace("'", "''", $message), $poll_title, $poll_options, $poll_length);
replace with

Code: Alles auswählen

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("'", "''", $username), str_replace("'", "''", $subject), str_replace("'", "''", $message), $poll_title, $poll_options, $poll_length, $news_category, $msg_icon);

Verfasst: 06.10.2003 12:44
von kaisuny
Thanks a lot for your patch code but after patching these code, it goes to another error message page, though the quiz still workable.

1)While in ACP, ask a question maually , the following errormessage page appears:

Code: Alles auswählen

Warning: Missing argument 23 for submit_post() in /home/gstudy/public_html/pstudy/portal/includes/functions_post.php on line 316


?? 
The selected question was asked successfully.

Click here to return to the quiz administration.

Click Here to return to the Admin Index 

2) When submitting an answer to a quiz on the forum, the following error page appears:

Code: Alles auswählen

XML ???AQ1N Pg Nd\CQ?0 U?t?? 'http://pstudy.net/portal/posting.php' |vu/??0 ,{ 2 L? MOn 2 
 

<b>Warning</b>:  Missing argument 23 for submit_post() in <b>/home/gstudy/public_html/pstudy/portal/includes/functions_post.php</b> on line <b>316</b><br />
Here is the line 316 of /include/function_post.php for your kind reference.

Code: Alles auswählen

// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length, &$topic_desc, &$news_category, &$msg_icon, $forcetime='')

Verfasst: 06.10.2003 20:05
von Mofi
Ich hab auch nochmal ne Frage.

Das Quiz läuft bei mir super und ohne Probleme. Hab aber mal ne Frage:

Kann man das evtl irgendwie so regeln das eine Frage z.B. 5 Stunden dort steht und alle Leute einen Tipp abgegeben können. Nach 5 Stunden macht der Quizbot dir Frage zu und alle die die richtige Antwort gegeben haben bekommen die Punkte!

Geht dat irgendwie?

Verfasst: 06.10.2003 20:21
von saerdnaer
@kaisuny:
oh i forgot the $topic_desc var... please replace this

Code: Alles auswählen

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("'", "''", $username), str_replace("'", "''", $subject), str_replace("'", "''", $message), $poll_title, $poll_options, $poll_length, $news_category, $msg_icon);
with this

Code: Alles auswählen

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("'", "''", $username), str_replace("'", "''", $subject), str_replace("'", "''", $message), $poll_title, $poll_options, $poll_length, $topic_desc, $news_category, $msg_icon);
@mofi: wird in einer der nächsen versionen möglich sein...

ah

Verfasst: 06.10.2003 23:54
von kaisuny
All works perfectly. Thanks :cookie:

Verfasst: 12.10.2003 09:28
von mondi
Hallo,
zunächst erstmal Respekt an Saerdnaer. Ich habe das Quiz in der Version 0.2.1 eingebaut. Ich muss schon sagen, wirklich großartig. Das sieht nach viel Arbeit aus. Die Sachen funktionieren soweit tadellos. Die Fragen werden automatisch nachgestellt. Allein: Ich habe dieses Punkte System MOD eingebaut. Wie funktioniert es, dass jemand, der eine Frage korrekt beantwortet hat, zugleich einen Punkt ausgezahlt bekommt. Da passiert im Moment noch nix.

Grüße
Mondi

Verfasst: 12.10.2003 11:27
von saerdnaer
suche in der includes/quiz.php nach folgendem:

Code: Alles auswählen

		$sql = "UPDATE " . USERS_TABLE . "
			SET quiz_points = quiz_points + " . ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] ) . "
			WHERE user_id = $user_id";
erseten durch

Code: Alles auswählen

		$quiz_points = ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] );
		$user_points = $quiz_points * 3; 
		$sql = "UPDATE " . USERS_TABLE . "
			SET quiz_points = quiz_points + $quiz_points, user_points = user_points + $user_points
			WHERE user_id = $user_id";
suche:

Code: Alles auswählen

		$sql = "UPDATE " . USERS_TABLE . "
			SET quiz_points = quiz_points - " . ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] ) . "
			WHERE user_id = '$user_id'";
ersetzen durch

Code: Alles auswählen

		$quiz_points = ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] );
		$user_points = $quiz_points * 3; 
		$sql = "UPDATE " . USERS_TABLE . "
			SET quiz_points = quiz_points - $quiz_points, user_points = user_points - $user_points
			WHERE user_id = $user_id";
mit diesem code bekommt man 3 user punkte wenn man einen quiz punkt bekommt... kann man aber auch ändern... dürfte ja klar sein wo. der erste teil ist für die punktevergabe der 2. für das abziehen der punkte wenn der quizbot einen fehler gemacht hat. wenn man die eine 3 ändert sollte man auch die andere ändern....

ah

Verfasst: 12.10.2003 11:52
von mondi
Hallo,
danke für die schnelle Antwort. Ich habe das eingebaut und es funktioniert; allerdings werden dem User nun drei Punkte von seinem Gesamtpunktestand abgezogen und nicht addiert. Oder habe ich was übersehen?

Grüße
Mondi

Verfasst: 12.10.2003 12:04
von saerdnaer
du musst beim einbauen genau auf die plus und minus zeichen nach quiz_points = quiz_points aufpassen

ah

Verfasst: 12.10.2003 12:20
von mondi
Hallo,
ich habe es natürlich erstmal so eingebaut, wie es oben steht. Da es mir da offenbar Punkte subtrahiert, habe ich nun folgenden Code geändert:

Code: Alles auswählen

$quiz_points = ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] ); 
      $user_points = $quiz_points * 3; 
      $sql = "UPDATE " . USERS_TABLE . " 
         SET quiz_points = quiz_points + $quiz_points, user_points = user_points + $user_points 
         WHERE user_id = $user_id";
Leider ist das Ergebnis wieder ein Reinfall; noch immer werden 3 Punkte abgezogen im Gesamtpunktestand.

Grüße
Mondi