Seite 77 von 111
Verfasst: 09.06.2003 15:49
von Toddo
Login: Test
Passwort: test01
Frage erstelle ich dir gleich auch mal eine.
Richtige Antwort ist dann: test
Thanks for help!
Verfasst: 09.06.2003 16:01
von saerdnaer
deine includes/quiz.php bitte
achja und stelle bei deinen fragen die bereits beantwortet wurde manuel per phpmyadmin topic_quiz auf 2 um...
ah
Verfasst: 09.06.2003 16:07
von Toddo
Hier schon mal die
quiz.php.
Ich bin dann mal bei phpmyadmin
Hat´s dir denn sonst bei mir im Forum gefallen? Da gibt´s wenigstens mal was fürs Auge
...sorry, jetzt ist die Datei oben.
Verfasst: 09.06.2003 16:15
von Toddo
Ok, wenn ich die Tabellen auf "2" umstelle, wird alles richtig dargestellt.
Nur warum konnte ich mit dem anderen Benutzername das Antwortfeld nicht sehen? Das hängt doch nicht mit der Überprüfung der sessions.php zusammen, oder?
Verfasst: 09.06.2003 16:24
von saerdnaer
könntet ihr mir mal sagen warum ihr immer irgendwas am code ändert und die probleme die dadurch entstehen auf den hack schiebt?
bei dir sieht der teil so aus:
Code: Alles auswählen
$points = $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'];
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + $points, user_points = user_points + $points
WHERE user_id = $userid";
if ( !$db->sql_query($sql) )
{
$this->notify_admin("Could not update topic quiz status", __LINE__, __FILE__, $sql);
return false;
}
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + " . ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] ) . "
WHERE user_id = $userid";
if ( !$db->sql_query($sql) )
{
$this->notify_admin("Could not update user quiz points", __LINE__, __FILE__, $sql);
return false;
}
bei mir so:
Code: Alles auswählen
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_quiz = 2
WHERE topic_id = '$topic_id'";
if ( !$db->sql_query($sql) )
{
$this->notify_admin('Could not update topic quiz status', __LINE__, __FILE__, $sql);
return false;
}
$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";
if ( !$db->sql_query($sql) )
{
$this->notify_admin('Could not update user quiz points', __LINE__, __FILE__, $sql);
return false;
}
und fällt dir was auf? warum hast du das eigendlich geändert?
Verfasst: 09.06.2003 16:45
von Toddo
Also ich schiebe wirklich nichts auf deinen Hack! Finde ihn klasse, sonst hätte ich ihn nicht eingebaut.
UND ICH FREU MICH AUCH SCHON, WIE VIELE ANDERE AUF DAS UPDATE!
Die Datei hab ich wirklich geändert und zwar anhand dieser Anleitung hier:
http://www.phpbb.de/viewtopic.php?p=109 ... uiz#109339 ...die ist doch von dir, oder?
Die Punkte wurden ja auch addiert, so wie es sein sollte... War da sonst noch was falsch?
Ich brauch das so, weil ich auf meinem Board ein monatliches Gewinnspiel laufen habe. Wer die meisten Punkte aus geschriebenen Beiträgen und Quizfragen gesammelt hat, gewinnt am Ende des Monats. Es hat die Attraktivität des Forums auf alle Fälle merklich erhöht und die Idee kann nur weiterempfohlen werden.
Verfasst: 09.06.2003 16:55
von saerdnaer
dann solltest du auch genau suchen.... schließlich hat du nich folgendes:
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";
sondern folgendes:
Code: Alles auswählen
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_quiz = 2
WHERE topic_id = '$topic_id'";
geändert....
im klartext musst du jetzt folgendes machen:
suche:
Code: Alles auswählen
$points = $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'];
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + $points, user_points = user_points + $points
WHERE user_id = $userid";
if ( !$db->sql_query($sql) )
{
$this->notify_admin("Could not update topic quiz status", __LINE__, __FILE__, $sql);
return false;
}
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + " . ( $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'] ) . "
WHERE user_id = $userid";
if ( !$db->sql_query($sql) )
{
$this->notify_admin("Could not update user quiz points", __LINE__, __FILE__, $sql);
return false;
}
ersetzen durch
Code: Alles auswählen
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_quiz = 2
WHERE topic_id = '$topic_id'";
if ( !$db->sql_query($sql) )
{
$this->notify_admin('Could not update topic quiz status', __LINE__, __FILE__, $sql);
return false;
}
$points = $this->config['quiz_points_disable'] ? 1 : $this->quiz_data['quiz_points'];
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + $points, user_points = user_points + $points
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
$this->notify_admin('Could not update user quiz points', __LINE__, __FILE__, $sql);
return false;
}
durch deinen fehler haben alle user die so eine fehlerhafte quizfrage beantwortet haben die doppelte punktzahl bei den quizpunkten bekommen...
ah
Verfasst: 09.06.2003 16:57
von Toddo
durch deinen fehler haben alle user die so eine fehlerhafte quizfrage beantwortet haben die doppelte punktzahl bei den quizpunkten bekommen...
Sag das ja nicht weiter! Dann hab ich den Wettbewerb ja total geschoben
Ok, hab die Änderungen eingebaut und ein Problem ist damit behoben.
Das Quiz wird jetzt wieder korrekt beendet, aber die Punkte werden leider nicht mehr addiert. Folgende Fehlermeldung:
Could not update user quiz points
SQL Error : 1064 You have an error in your SQL syntax near '' at line 3
UPDATE phpbb_users
SET quiz_points = quiz_points + 5, user_points = user_points + 5
WHERE user_id =
Line : 411
File : /usr/local/httpd/htdocs/1755/1759/board/includes/quiz.php
Hab die phpbb_users noch mal überprüft. Die Tabellen quiz_points und user_points sind vorhanden.
Verfasst: 10.06.2003 14:04
von Toddo
@ saerdnaer
Kannst Du mir bitte noch mal helfen wegen dem Update der Punkte? Das gleiche Problem ist weiter oben schon mal aufgetaucht und wurde dort leider auch noch nicht gelöst.
siehe:
http://www.phpbb.de/viewtopic.php?p=133 ... nts#133319
deine Antwort:
http://www.phpbb.de/viewtopic.php?p=133 ... ern#133904
Der Rest funktioniert wieder...Danke im Vorraus!
Verfasst: 11.06.2003 16:18
von saerdnaer
ähm ja... das lag an mir... ich hab dir einen zu aktuellen code gepostet...
suche:
Code: Alles auswählen
$sql = "UPDATE " . USERS_TABLE . "
SET quiz_points = quiz_points + $points, user_points = user_points + $points
WHERE user_id = $user_id";
und darin das
$user_id durch
$userid ersetzen...