Code: Alles auswählen
http://www.contenido.de/front_dev/upload/Kommentarmodul_v093.txt
hat jemand ein beispiel auf der eigenen seite?
Code: Alles auswählen
http://www.contenido.de/front_dev/upload/Kommentarmodul_v093.txt
Code: Alles auswählen
MODUL - KOMMENTAR LESEN
input:
echo "'Kommentare lesen' gesetzt.";
output:
$kommentarcount = MYSQL_QUERY( "SELECT LfdNr FROM kommentare WHERE ID = '$idside'");
while ($kommcount = mysql_fetch_row($kommentarcount)){
$kommanzahl = $kommcount[0];
}
IF ($kommanzahl > 0) {
echo("<HR><P>Zu diesem Artikel wurden folgende Kommentare geschrieben:<BR><BR>");
$sql = "select * from kommentare where ID = $idside order by LfdNr";
$query = mysql_query($sql);
$r = mysql_fetch_array($query);
do {
IF ($r[KommentarMail] != ""){
echo ("Kommentar von <B><a
href=\"mailto:$r[KommentarMail]\">$r[KommentarVon]</a></B><BR>"); }
Else {
echo ("Kommentar von <B>$r[KommentarVon]</B><BR>");
}
echo("<B>>> " . $r[Kommentar] . "</B>");
echo("<BR><BR>");
} while ($r = mysql_fetch_array($query));
}
MODUL - KOMMENTAR SCHREIBEN
input:
echo "'Kommentare schreiben' gesetzt.";
output:
echo ("<br><br><HR><P>Bitte kommentieren Sie diesen Artikel mit folgendem Formular:<BR><BR>");
echo ("<form name=\"bew\" method=\"post\" action=\"$PHP_SELF\">");
echo ("<table cellpadding=\"0\" cellspacing=\"0\">");
echo ("<tr>");
echo ("<td width=\"120\"><P>Ihr Name:</td>");
echo ("<td><input type=\"text\" name=\"name\" size=\"30\" value=\"Anonymous\"></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td><P>Ihre E-Mail Adresse:</td>");
echo ("<td><input type=\"text\" name=\"email\" size=\"30\" value=\"name@it.add.gknplc.com\"></td>");
echo ("</tr>");
echo ("</table><BR>");
echo ("<input type=text size=\"60\" name=\"kommentar\" value=\"Ihr Text\">");
echo ("<input type=\"hidden\" name=\"idside\" value=\"$idside\">");
echo ("<input type=\"hidden\" name=\"idcat\" value=\"$idcat\">");
echo ("<input type=\"hidden\" name=\"lang\" value=\"$lang\">");
echo ("<input type=\"hidden\" name=\"contenido\" value=\"$contenido\">");
echo ("<input type=\"hidden\" name=\"komt\" value=\"do\">");
echo (" <input type=\"submit\" name=\"submit\" value=\"Absenden\">");
echo ("</form>");
if ($kommentar != "")
{
$kommentarcount = MYSQL_QUERY( "SELECT LfdNr FROM kommentare WHERE ID = '$idside'");
while ($kommcount = mysql_fetch_row($kommentarcount)){
$kommanzahl = $kommcount[0];
}
$kommentar = strip_tags($kommentar);
IF ($kommanzahl == "0" or $kommanzahl == "") {
$rezlfdnr = 1;
MYSQL_QUERY( "INSERT INTO kommentare set ID = $idside, LfdNr = $rezlfdnr,
Kommentar = '$kommentar', KommentarVon = '$name', KommentarMail = '$email'");
} else {
$rezlfdnr = $kommanzahl + 1;
MYSQL_QUERY( "INSERT INTO kommentare set ID = $idside, LfdNr = $rezlfdnr,
Kommentar = '$kommentar', KommentarVon = '$name', KommentarMail = '$email'");
}
}
bevor ihr die modul verwenden könnt, müsst ihr natürlich folgende tabelle in der datenbank anlegen...
CREATE TABLE kommentare (
ID int(3) unsigned NOT NULL DEFAULT '0' ,
LfdNr int(10) unsigned ,
Kommentar text ,
KommentarVon text ,
KommentarMail text ,
TIMESTAMP timestamp(14)
);
Code: Alles auswählen
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\home\webpages\cms\test\front_single\front_content.php(128) : eval()'d code on line 127