Seite 1 von 1

Brauche Hilfe beim Quiz Hack Add-On

Verfasst: 20.01.2006 14:47
von mixmax
Brauche Hilfe beim Quiz Hack Add-On

Code: Alles auswählen

## MOD Title: Quiz Hack Add-On 
## MOD Author: Christian Steger < christian.steger@arcor.de > 
## Based on Quiz Hack 0.2.1 from saerdnaer 
## MOD Version: 1.1.5 (based on Quiz Hack Ver. 0.2.1 )
Ich habe die 5 Teile in mein Board eingebaut

Code: Alles auswählen

## 1) Who Viewed Hack --- Nötig, wenn nicht eingebaut     (Mod Part 1)
## 2) Quiz Hack - Add On - SQL Anweisung --- Nötig        (Mod Part 2)
## 3) Quiz Hack - Add On - Ändern der Dateien --- Nötig   (Mod Part 3)
## 4) Quiz Hack - Add On - Topic Sortierung --- Optional  (Mod Part 4)
## 5) Quiz Hack - Add On - Ersetzen der Dateien --- Nötig (Mod Part 5)
Folgendes Problem habe ich jetzt
Wen jemand eine Quizfrage beantworten möchte,setzt er den Punkt vor der richtigen Antwort und klickt auf los.
Danach erscheint das
[ externes Bild ]

Da Fehlt jetzt die antwort auswahl,und wen man einfach auf Absenden klickt erscheint"Du musst zu deinem Beitrag einen Text eingeben"

Hier mal meine
functions_post.txt
posting.txt
quiz.txt

Bitte Helft mir weiter,damit das Quiz wider leuft
ICQ = 314759256

Verfasst: 21.01.2006 11:37
von mixmax
Help :)

Verfasst: 22.01.2006 09:15
von mixmax
Wo sind die Profis ...............die mir helfen können.
Wäre doch schade um den schönen mod. :D

Verfasst: 23.01.2006 15:19
von mixmax
Ist der mod so unbeliebt weil so viele drannnnn verzweifeln. :grin:

Verfasst: 01.03.2006 19:35
von mixmax
Versuche nochmal mein Glück :D
Da der Mod immer noch nicht leuft :cry:

Ich habe mal meine alte posting.php hochgeladen,
und bei der kommt über "BBCode in diesem Beitrag deaktivieren"
die angeklinkte Antwort.

[ externes Bild ]

Hier mal meine posting.php
http://kinderspiele.ki.funpic.de/posting.txt

Und hier der Code

Code: Alles auswählen

posting.php

#
#-----[ FIND ]------------------------------------------
#

			$quiz->insert_answer_request($topic_id, $userdata['user_id']);

--> DELETE (OR COMMENT THE LINE [Two Slashes in the Beginning of the Line)

#
#-----[ FIND ]------------------------------------------
#

// BEGIN Quiz Hack
if ( $auth_answer )
{
	list($answer_field, $js) = $quiz->generate_answer_box($topic_id, $userdata['user_id'], $answer);
	$template->assign_block_vars('switch_quiz_answer', array(
		'L_ANSWER' => $lang['Answer'],
		'ANSWER' => $answer_field)
	);
	$template->assign_block_vars('switch_quiz_answer_js', array(
		'JS' => $js)
	);
}
// END Quiz Hack

#
#-----[ REPLACE WITH ]------------------------------------------
#

// BEGIN Quiz Hack
if ( $auth_answer )
{
    $sql = "SELECT * FROM " . QUIZ_CONFIG_TABLE;
    if ( $result = $db->sql_query($sql) )
    {
        while ( $row = $db->sql_fetchrow($result) )
        {
            $quiz_config[$row['config_name']] = $row['config_value'];
        }
    }
    else
    {
        message_die(GENERAL_ERROR, 'Could not query quiz_config information', '', __LINE__, __FILE__, $sql);;
    }

	//
	// Is the User allowed to view the Quiz Answer Box?
	//
	$sql = "SELECT  *
		FROM " . TOPIC_VIEW_TABLE . "
		WHERE " . $userdata['user_id'] ." = user_id AND topic_id = '$topic_id'";
	if(!$result = $db->sql_query($sql))
	{
		message_die(CRITICAL_ERROR, "Could not query config information in topic_view12", "", __LINE__, __FILE__, $sql);
	}
	else
	{
		while( $row = $db->sql_fetchrow($result) ) {
			$is_ok = $row['is_ok'];
			$topic_view_time = $row['view_time'];
		}
	}

	if((!$is_ok) && ( time() < ($topic_view_time + $quiz_config['var_secs'] + 10)) )
	{
	 $_needed_time = time() - $topic_view_time;
      list($answer_field, $js) = $quiz->generate_answer_box($topic_id, $userdata['user_id'], $answer);
      $template->assign_block_vars('switch_quiz_answer', array(
        'L_ANSWER' => $lang['Answer'],
        'ANSWER' => $answer_field)
      );
      $template->assign_block_vars('switch_quiz_answer_js', array(
        'JS' => $js)
      );
  }
	else
	{
        $sql = "SELECT topic_title
            FROM " . TOPICS_TABLE . "
            WHERE topic_id = '$topic_id'";
        if(!$result = $db->sql_query($sql))
        {
            message_die(CRITICAL_ERROR, "Could not query topic title from topic table", "", __LINE__, __FILE__, $sql);
        }
        else
        {
            while( $row = $db->sql_fetchrow($result) ) {
				preg_match("/#([0-9]*)/i",$row['topic_title'],$_matches);
				$_quiz_id = $_matches[1];
            }

        }
		//
		// Getting the Admin-ID
		//
		$sql = "SELECT user_id
				FROM ". USERS_TABLE ."
				WHERE `user_level` = 1 ORDER BY 'user_ id' LIMIT 1";
        if(!$result = $db->sql_query($sql))
        {
            message_die(CRITICAL_ERROR, "Could not query user information for error", "", __LINE__, __FILE__, $sql);
        }
		else
		{
			while( $row = $db->sql_fetchrow($result) )
				$_admin_id = $row['user_id'];
		}


		$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
                VALUES (0, '" . str_replace("\'", "''", "Quiz #".$_quiz_id." - Ein User versucht zu betrügen ") ."', " . $userdata['user_id'] . ", $_admin_id, ".time().", '$user_ip', 0, 1, 1, 0)";
        if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
        {
            message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
        }

        $privmsg_sent_id = $db->sql_nextid();

		$_needed_time = time() - $topic_view_time;
		$_schummelei = ($is_ok) ? "versucht über den Zurück-Button zu betrügen" : "$_needed_time Sek. benötigt um auf den OK-Button zu drücken";
        $_message = "Bei der Quizfrage: <a href=\"viewtopic.php?t=".$topic_id."\">#".$_quiz_id."</a> hat der User ".$userdata['username']." ".$_schummelei;

        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
            VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $_message) . "')";

        if ( !$db->sql_query($sql, END_TRANSACTION) )
        {
            message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql);
        }
    }
	//
	// Insert into DB, that User cannot click two times on OK-Button
	//
	$sql = "UPDATE " . TOPIC_VIEW_TABLE . " SET is_ok = 1
		WHERE " . $userdata['user_id'] ." = user_id AND topic_id = '$topic_id'";
	if(!$result = $db->sql_query($sql))
	{
		message_die(CRITICAL_ERROR, "Could not update topic view table", "", __LINE__, __FILE__, $sql);
	}
}
// END Quiz Hack
Hoffe immer noch auf Hilfe von einem Profi :wink:

Verfasst: 04.03.2006 15:48
von mixmax
:roll: :roll: :roll: :o :lol: :wink: