Mahlzeit,
also ich habe das bei mir so drin in der forums.php und es funzt bei mir.
Öffnet Eure forums.php und suche das:
Code:
//---- Get poster thanks
$resa = mysql_query("SELECT * FROM postthanks WHERE topicid = $topicid") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($resa) > 0) {
while ($arra = mysql_fetch_array($resa)) {
$ptuserid = $arra["userid"];
$ptpostid = $arra["postid"];
$resb = mysql_query("SELECT id, username, class FROM users WHERE id = $ptuserid") or print(mysql_error());
while($arrb = mysql_fetch_assoc($resb)) {
if ($thanks) $thanks .= ",\n";
$thanks .= "<a href=userdetails.php?id=" . $arrb["id"] . "><font class=".get_class_color($arrb["class"])."><b>" . $arrb["username"] . "</b></font></a>";
}
}
}
$thanksbutton = ("<form method=\"post\" action=\"forums.php?action=thanks&topicid=$topicid&postid=$postid&userid=$userid\" style=\"display:inline\"><input type=\"submit\" value=\"Bedanken\"></form>");
und ersetze das mit dem:
Code:
//---- Get poster thanks
$is_thx = false;
$resa = mysql_query("SELECT * FROM postthanks WHERE topicid = $topicid") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($resa) > 0) {
while ($arra = mysql_fetch_array($resa)) {
$ptuserid = $arra["userid"];
$ptpostid = $arra["postid"];
if ($CURUSER["id"] == $ptuserid && $ptpostid == $postid) $is_thx = true;
$resb = mysql_query("SELECT id, username, class FROM users WHERE id = $ptuserid") or print(mysql_error());
while($arrb = mysql_fetch_assoc($resb)) {
if ($thanks) $thanks .= ",\n";
$thanks .= "<a href=userdetails.php?id=" . $arrb["id"] . "><font class=".get_class_color($arrb["class"])."><b>" . $arrb["username"] . "</b></font></a>";
}
}
}
$thanksbutton = ("<form method=\"post\" action=\"forums.php?action=thanks&topicid=$topicid&postid=$postid&userid=$userid\" style=\"display:inline\"><input type=\"submit\" value=\"Bedanken\"></form>");
dann suche weiter nach dem:
Code:
if ($bedanko == "2" && $ptuserid != $CURUSER[id]) {
$body1 .= "<br>$thanksbutton<br>";
}
if ($thanks && $ptpostid == $postid) {
$body1 .= "<br>Bedankt für diesen Beitrag haben sich:";
$body1 .= "<br>$thanks<br>";
}
und ersetze das mit dem:
Code:
if ($bedanko == "2" && !$is_thx) {
$body1 .= "<br>$thanksbutton<br>";
}
if ($thanks && $ptpostid == $postid) {
$body1 .= "<br>Bedankt für diesen Beitrag haben sich:";
$body1 .= "<br>$thanks<br>";
}
suche weiter nach dem:
Code:
//-------- Action: Thanks
if ($action == "thanks") {
$userid = $_GET["userid"];
$topicid = $_GET["topicid"];
$postid = $_GET["postid"];
if (!is_valid_id($topicid))
stderr("Forum Fehler", "<b><p>Falsche Beitrags ID $postid.</p></b>");
mysql_query("INSERT INTO postthanks (id,topicid,postid,userid) VALUES (id,$topicid,$postid,$userid)") or sqlerr(__FILE__, __LINE__);
header("Location: $BASEURL/forums.php?action=viewtopic&topicid=$topicid");
die;
}
und ersetze es mit dem:
Code:
//-------- Action: Thanks
if ($action == "thanks") {
$userid = $CURUSER["id"]; // Nicht die $_GET["userid"], das kann jeder Faken!
$topicid = $_GET["topicid"];
$postid = $_GET["postid"];
$query_check = mysql_query("SELECT * FROM postthanks WHERE topicid = $topicid AND postid= $postid AND userid= $userid") or sqlerr(__FILE__, __LINE__);
$row_check = mysql_num_rows($query_check);
if (!is_valid_id($topicid))
stderr("Forum Fehler", "<b><p>Falsche Beitrags ID $postid.</p></b>");
elseif($row_check > 0)
stderr("Forum Fehler", "<b><p>Du hast dich bereits bedankt !</p></b>");
mysql_query("INSERT INTO postthanks (id,topicid,postid,userid) VALUES (id,$topicid,$postid,$userid)") or sqlerr(__FILE__, __LINE__);
header("Location: $BASEURL/forums.php?action=viewtopic&topicid=$topicid");
die;
}
Ich hoffe ich konnte helfen und habe jetzt nix vergessen.
MFG