![]() |
|
Off-Topic Hier ist die allgemeine Plauder-Ecke. Alles, was sonst nirgends reinpasst kommt hier rein |
|
Themen-Optionen | Ansicht |
![]() |
#23 | |||||||||||
Erfahrener Benutzer
Registriert seit: 20.11.2010
Ort: Deutschland
Beitr?ge: 256
Abgegebene Danke: 235
Erhielt 0 Danke für 0 Beiträge
Downloads: 47
Uploads: 0 Nachrichten: 12 Renommee-Modifikator:
272 ![]() |
![]()
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>"); 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>"); 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>"; } 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>"; } 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; } 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; } MFG |
|||||||||||
![]() |
![]() ![]() ![]() |
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, G?ste: 1) | |
|
|