RageNo1
Erfahrenes Mitglied
Hallo,
ich versuche grad dieses Tutorial (http://www.tutorials.de/tutorials63349.html) in meine Kommentarfunktion einzutragen.
Soweit scheint auch die Sache mit dem Generieren zu klappen: http://www.eblogx.de/index.php?&comments=1471
Nun habe ich aber noch ein Problem und zwar wo ich die Überprüfung einbaue.
Sprich diesen Code:
Hier der Teil in dem Script wo die Kommantare gespeichert werden:
Ich hatte es bereits an mehreren Stellen eingebunden aber igrgendwie wird es total ignoriert. Ich hoffe mir kann jemand dabei helfen.
Mfg Ragey
ich versuche grad dieses Tutorial (http://www.tutorials.de/tutorials63349.html) in meine Kommentarfunktion einzutragen.
Soweit scheint auch die Sache mit dem Generieren zu klappen: http://www.eblogx.de/index.php?&comments=1471
Nun habe ich aber noch ein Problem und zwar wo ich die Überprüfung einbaue.
Sprich diesen Code:
PHP:
if($_GET['action'] == 'do') {
session_name('tutorials');
session_start();
if($_SESSION['image'] == $_POST['code']) {
echo "Der eingegebene Code war richtig. Ihre Anmeldung wurde registriert.";
}
else {
echo "Der eingegebene Code ist falsch";
}
}
Hier der Teil in dem Script wo die Kommantare gespeichert werden:
PHP:
// Hier werden die Kommentare gespeichert
if (!function_exists("postComment")) {
function postComment() {
global $extension,
$news_id,
$options,
$success,
$failure,
$REMOTE_ADDR;
// hier definiere die zu blockenden wörter
$badwords = array("fly2.cc", "payday", "loans", "mortage", "cash-services", "refinance", "credit", "online-casinos-matrix", "online-casinos", "epraha", "slot-machines", "roulette", "hbsnwa", "gambling", "blackjack", "free-slots", "itp4kids", "casinos", "online-gambling", "mothershope", "texas-holdem", "texas-hold-em", "online-casinos-research", "best-777-online-casinos", "best-online-casinos-tips", "racepointfunding", "casino7-online", "perfect-online-casinos", "diamond-online-casinos", "teriandersonandassoc.com", "online-casinos-know-how", "sure-online-casinos", "access-online-casinos", "best-9-online-casinos.com", "casinos-jp", "texas", "poker", "casino", "teriandersonandassoc", "easy-online-casinos.com", "easy-online-casinos", "online-casinos-comparation.com", "online-casinos-comparation", "online-casinos-pro-choice.com", "online-casinos-pro-choice", "casinos-in-linea-it.udcorp.com", "casinos-in-linea-it");
$getvars = array();
$postvars = array('author' ,'email' ,'title' ,'comment');
foreach ($getvars as $key=>$elem) { if(isset($_GET[$elem])) { $$elem = $_GET[$elem]; } else { $$elem = ""; } }
foreach ($postvars as $key=>$elem) { if(isset($_POST[$elem])) { $$elem = $_POST[$elem]; } if(!isset($$elem)) { $$elem = ""; } }
require("config.inc".$extension);
require("corebb".$extension);
$dbconn = new Coresql($db_server, $db_database, $db_account, $db_password);
$result = $dbconn->fetchArray("SELECT * FROM $newstable WHERE id = $news_id");
if ($result['id'] != "") {
$ipcheck = $dbconn->fetchArray("SELECT * FROM $commentstable WHERE ip = '$REMOTE_ADDR' ORDER BY time DESC");
if (($ipcheck['time'] + $options['flood_control']) <= time()) {
if (($author != "") && (($options['force_email'] == 0 || ($email != "") && ($options['force_email'] == 1))) && ($comment != "")) {
$author = str_replace("'", "\"", htmlspecialchars($author));
$email = str_replace("'", "\"", htmlspecialchars($email));
$title = str_replace("'", "\"", htmlspecialchars($title));
// methode 1: nur checken ob verbotenes wort enthalten, wenn ja => nicht speichern und beenden
if($x = badwords($comment, $badwords)) {
echo "<span id=main><b>der spamfilter hat deinen kommentar geblockt! <br>folgende wörter sind auf der schwarzen liste:</b><br />";
foreach($x["matches"] as $word) echo "$word ";
echo "<br><br></span>";
return false;
}
switch ($options['html_bb_allow']) {
case 0: $comment2 = htmlspecialchars($comment); break;
case 1: $comment2 = corebb(htmlspecialchars($comment), "toHTM"); break;
case 2: $comment2 = $comment; break;
case 3: $comment2 = corebb($comment, "toHTM"); break;
}
$comment2 = str_replace("\r\n", "<br />", $comment2);
$comment2 = stripslashes($comment2);
$comment2 = str_replace("'", "\"", $comment2);
$time = time();
$dbconn = new Coresql($db_server, $db_database, $db_account, $db_password);
$query = $dbconn->execQuery("INSERT INTO $commentstable (news_id, author, email, title, comment, time, ip) VALUES ($news_id, '$author', '$email', '$title', '$comment2', '$time', '$REMOTE_ADDR')");
if ($query) {
$success = "<span id=main>kommentar eingetragen!</span>";
} else {
$failure = "<span id=main>kommentar konnte nicht eingetragen werden!</span>";
}
} elseif ((isset($author)) && ($author == "")) { $failure = "<span id=main>kein name eingegeben!</span>";
} elseif ((isset($email)) && ($email == "") && ($options['force_email'] == 1)) { $failure = "Bitte gib deine E-Mail ein!";
} elseif ((isset($title)) && ($title == "")) { $failure = "Bitte gib einen Titel für den Kommentar ein!";
} elseif ((isset($comment)) && ($comment == "")) { $failure = "<span id=main>kein kommentar eingegeben!</span>";
}
} else {
if ($options['flood_control'] <= 60) {
$wait = $options['flood_control']." sekunden";
} else {
$wait = (($options['flood_control'] - ($options['flood_control'] % 60)) / 60)." Minuten";
}
$failure = "<span id=main>du musst $wait warten, bis du einen neuen kommentar posten kannst!</span>";
}
$close = $dbconn->close();
}
}}
Ich hatte es bereits an mehreren Stellen eingebunden aber igrgendwie wird es total ignoriert. Ich hoffe mir kann jemand dabei helfen.
Mfg Ragey